gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
'''Utility functions and classes used internally by Skype4Py.
'''
import sys
import weakref
import threading
from new import instancemethod
def chop(s, n=1, d=None):
'''Chops initial words from a string and returns a list of them and the rest of the string.
@param s: String to chop from.
@type s: str or... | |
# -*- 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 model 'CandidateList'
db.create_table('polyorg_candidatelist', (
('id', self.gf('django... | |
import pytest
from awx.main.access import (
WorkflowJobTemplateAccess,
WorkflowJobTemplateNodeAccess,
WorkflowJobAccess,
# WorkflowJobNodeAccess
)
from awx.main.models import InventorySource, JobLaunchConfig
@pytest.fixture
def wfjt(workflow_job_template_factory, organization):
objects = workflo... | |
# The MIT License (MIT)
#
# Copyright (c) 2015 addfor s.r.l.
#
# 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, m... | |
"""
This is a module that contains the tool for python to interact with our JFrog
artifactory API.
"""
import hashlib
import json
import os
import requests
class JFrogArtifactory(object):
"""
This is a class that holds the interacting method for JFrog Artifactory
"""
def __init__(self, user_cred,
... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# std
import logging
import simplejson as json
from os import path
# 3p
from requests.packages.urllib3.exceptions import TimeoutError
# project
from utils.checkfiles import get_check_class, get_auto_conf, get_au... | |
#!/usr/bin/env python
# zwave_power_meter_socket.py
# Copyright (C) ContinuumBridge Limited, 2014 - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Peter Claydon
#
ModuleName = "aeotec_heavy_switch"
INTERVAL = 60 # How o... | |
#!/usr/bin/env python
"""
@package ion.services.sa.tcaa.test.test_2caa
@file ion/services/sa/tcaa/test/test_2caa.py
@author Edward Hunter
@brief Test cases combined 2CAA endpoints.
"""
__author__ = 'Edward Hunter'
# Pyon log and config objects.
from pyon.public import log
from pyon.public import CFG
# Standard impo... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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/... | |
"""Copyright 2009 Chris Davis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | |
from django.contrib.auth.models import User
from django.urls import reverse
from django.conf import settings
from django.core import mail
from django.test import TestCase
from lfs.catalog.models import Product
from lfs.cart.models import Cart
from lfs.cart.models import CartItem
from lfs.core.models import Country
fro... | |
# Copyright 2015 Red Hat, 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 ... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
from toontown.minigame.DistributedMinigameAI import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
import TravelGameGlobals
from toontown.toonbase import ToontownGlobals
class DistributedTravelGameAI(DistributedMinigameAI):
notify = directNotify.newCategory('DistributedTravelGameAI')
... | |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | |
"""
Chapter 4 : Object Oriented Programming
@author: Alvin Wan
@site: alvinwan.com
"""
def hailstone_chicken(i):
"""Return a function hailstone(start) that prints the hailstone sequence for
a given start. For every ith number n of the hailstone sequence,
print a string with 'chicken' repeated n times inst... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | |
r"""
Wigner, Clebsch-Gordan, Racah, and Gaunt coefficients
Collection of functions for calculating Wigner 3j, 6j, 9j,
Clebsch-Gordan, Racah as well as Gaunt coefficients exactly, all
evaluating to a rational number times the square root of a rational
number [Rasch03]_.
Please see the description of the individual fun... | |
import abc
import logging
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn as nn
import rlkit.torch.pytorch_util as ptu
from rlkit.policies.base import ExplorationPolicy
from rlkit.torch.core import torch_ify, elem_or_tuple_to_numpy
from rlkit.torch.distributions import (
Delta... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | |
import collections
from flask import Flask, request, render_template, redirect
from google.appengine.ext import deferred
import json
import pytz
import datetime
import random
import time
import logging
import models
import consolidate
import alertfunctions
app = Flask(__name__)
app.config['DEBUG'] = True
@app.rou... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify 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 law... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# Copyright 2017 The Sonnet 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 applicable l... | |
import unittest
import numpy
import six
from chainer import cuda
from chainer import gradient_check
from chainer.testing import attr
from chainer.testing import condition
if cuda.available:
cuda.init()
def _uniform(*shape):
return numpy.random.uniform(-1, 1, shape).astype(numpy.float32)
def _full_like(x... | |
from __future__ import division
import os
import sys
import shutil
import itertools
from jinja2 import Environment, FileSystemLoader
import cluster
class View:
def __init__(self, name, pdiff, ftypes, gopts):
self.name = name
self.data = { 'type':self.name, 'title':'gDelta '+ self.name }
... | |
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
# Copyright (C) 2018 NTT DATA, 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 require... | |
#!/usr/bin/env python
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a co... | |
#!/usr/bin/env python
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import (
assertGreaterEqual,
get_params,
gettestcases,
expect_info_dict,
try_rm,
report_warning,
)
import hashl... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""EventMan(ager)
Your friendly manager of attendees at an event.
Copyright 2015-2017 Davide Alberani <da@erlug.linux.it>
RaspiBO <info@raspibo.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in ... | |
#!/usr/bin/env python
'''
Description
If using files, (call by command line or from python):
all the inputs are raw float32 vectors files that are reshaped by the number
of f0 values in ff0.
There are three safe patches that were not described in the publication[1]:
(These are not critical, they might re... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel... | |
import sys
import inspect
import weakref
from contextlib import contextmanager
from collections import OrderedDict
import numpy as np
from scipy.spatial import cKDTree
_SHAPE_ASSERTIONS = True
def assert_shape(arr, shape, label='array'):
'''
Raises a ValueError if `arr` does not have the specified shape
... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, Context, loader
from django.core.urlresolvers import r... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind with different proxy configuration.
Test plan:
- Start bitcoind's with different proxy c... | |
import pygame, random
from pygame.locals import *
CONST_WIDTH = 640 #* 2
CONST_HEIGHT = 480 #* 2
CONST_BOX_WIDTH = 8
CONST_BOX_HEIGHT = 8
#Colors
BackgroundBarva = (0,0,0,0)
BARVE = []
Bela = (255,255,255,255)
BARVE.append(Bela)
Crna = (0,0,0,255)
BARVE.append(Crna)
Rdeca = (255,0,0,255)
BARVE.append(Rdeca)
Modra =... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
from .imports import *
class CCD(Talker):
'''
CCD object handles every related to an individual CCD exposure.
You can think of this as a simulated CCD on which our dear
mosasaurus can play back any image.
'''
def __init__(self, obs, exposureprefix=0, imageType=None, calib=None, **kwargs):
... | |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.db import transaction
from django.utils import timezone
from django.conf import settings
import django
import os
import logging
import sys
from datetime import datetime, timedelta
from compat import atom... | |
from dbt.graph import (
cli,
SelectionUnion,
SelectionIntersection,
SelectionDifference,
SelectionCriteria,
)
from dbt.graph.selector_methods import MethodName
import textwrap
import yaml
from dbt.contracts.selection import SelectorFile
def parse_file(txt: str) -> SelectorFile:
txt = textwrap... | |
from __future__ import print_function, division
import serial
import json
import logging
log = logging.getLogger("rfm_ecomanager_logger")
import select
import time
import sys
class NanodeError(Exception):
"""Base class for errors from the Nanode."""
class NanodeRestart(NanodeError):
"""Nanode has restarted."... | |
import itertools
from tornado import web
import nbformat
from ..nbxmanager import NBXContentsManager
from .notebook_gisthub import parse_tags
class GistNotebookManager(NBXContentsManager):
"""
"""
def __init__(self, *args, **kwargs):
self.gisthub = kwargs.pop('gisthub')
super(GistNoteboo... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Metaswitch Networks
# 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... | |
# -*- 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
#... | |
# -- coding: utf-8 --
from __future__ import absolute_import
import logging
from os import mkdir, remove
from os.path import join, split, exists, isdir, sep
from git import Repo
from git.cmd import GitCommandError
import yaml
import re
import json
import random
from . import edit_functions, google_api_functions
from . ... | |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Twitter client
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# Lorenzo Rubio <lrnzcig@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for the :module:`twitterclient` mod... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# (C) 2014 Arulalan.T <arulalant@gmail.com> #
# #
# Author : Arulalan.T <arulalant@gma... | |
#
# Support for graphs
#
# Developer(s): Grigori Fursin, https://fursin.net
#
from . import config
from . import comm
from . import obj
import ck.kernel as ck
import json
import os
import copy
meta_template={
"meta": {
"scenario": "universal",
"scenario_uid": "3bf7371412455a8f",
"viz_engine": ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# PYTHON_ARGCOMPLETE_OK
"""
tc.py <command> [<args>]
Where command is the type of build you with to invoke:
linux Neo4j Linux
power8 Neo4j Power8
windows Neo4j Windows
har HA Robustness
"""
# StdLib imports first
from __future__ i... | |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.coghq.DistributedCashbotBossCrane
from panda3d.physics import ActorNode, PhysicalNode, PhysicsCollisionHandler, PhysicsObject
from panda3d.direct import SmoothMover
from panda3d.core import BitMask32, CollideMask, CollisionHandler, CollisionHandlerEven... | |
import matplotlib
matplotlib.use("Agg")
from astropy.io import fits as pyfits
import numpy as np
from numpy import median,sqrt,array,exp
import scipy
from scipy import signal,special,optimize,interpolate
import scipy.special as sp
import copy
import glob
import os
from pylab import *
import sys
base = '../'
sys.path.a... | |
from . import *
from colour import Color
import collections
class Item(object):
def __init__(self, name, name_zh):
self.name = name
self.name_zh = name_zh
attr_string = '%ss' % (self.__class__.__name__)
if not hasattr(self.__class__, attr_string):
setattr(self.__class_... | |
from __future__ import division, absolute_import, print_function
import numpy as np
import scipy
import scipy.stats
import scipy.fftpack
import scipy.optimize
from stingray.lightcurve import Lightcurve
from stingray.utils import rebin_data, simon, rebin_data_log
from stingray.exceptions import StingrayError
from stin... | |
"""
Tests for the dashboard views
"""
from datetime import timedelta
from unittest.mock import (
MagicMock,
patch,
call
)
from urllib.parse import urljoin
import ddt
from django.urls import reverse
from django.test import override_settings
from requests.exceptions import HTTPError
from rest_framework impor... | |
#
# Copyright 2014 Grupo de Sistemas Inteligentes (GSI) DIT, UPM
#
# 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
#
# Unles... | |
"""
VIS Data Reduction and Processing
=================================
This simple script can be used to reduce (simulated) VIS data.
The script was initially written for reducing a single CCD data.
However, since the version 0.5 the script tries to guess if the
input is a single quadrant then reduce correctly.
The... | |
# coding: utf-8
"""Utilities for installing Javascript extensions for the notebook"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import shutil
import sys
import tarfile
import zipfile
from os.path import basenam... | |
# Copyright (c) 2012 - 2014 EMC Corporation, 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
#
# ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Base class for FHIR resources.
# 2014, SMART Health IT.
from . import fhirabstractbase
class FHIRAbstractResource(fhirabstractbase.FHIRAbstractBase):
""" Extends the FHIRAbstractBase with server talking capabilities.
"""
resource_type = 'FHIRAbstractRes... | |
#!/usr/bin/env python
# ======================================================================
# This software is distributed under the MIT license reproduced below:
#
# Copyright (C) 2009-2014 Giampaolo Rodola' <g.rodola@gmail.com>
#
# Permission to use, copy, modify, and distribute this software and
# its docum... | |
# coding=utf-8
"""
The MIT License
Copyright (c) 2007 Leah Culver
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, modify... | |
#!/usr/bin/env python
# -----------------------------------------------------------
# Filename : S2D.py
# Created By : Joe Pistone
# Date Created : 16-Mar-2016 18:16
# Date Modified :
#------------------------------------------------------------
# License : Development
#
# Description : Network Discove... | |
"""Engine-Level Classes and Utilities.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon.
@license: Licensed under the MIT license.
"""
import codecs
import threading
import traceback
import sys
import os
import os.path
import time
import ... | |
#!/usr/bin/env python3
#
# Sniffles2
# A fast structural variant caller for long-read sequencing data
#
# Created: 09.09.2021
# Author: Moritz Smolka
# Contact: moritz.g.smolka@gmail.com
#
from dataclasses import dataclass
import collections
from sniffles import util
@dataclass
class Group:
"""
A sequence t... | |
import copy
import Config
from core.expression import Equal, Plus, Times, Minus, Transpose, Inverse, \
Symbol, PatternDot, PatternStar, NList, Predicate
from core.functional import Constraint, Replacement, RewriteRule, match, replace
import core.properties as properties
from core.InferenceO... | |
# media_bundler/templatetags/bundler_tags.py
"""
Template tags for the django media bundler.
"""
from django import template
from django.template import Variable
from media_bundler import bundler
from media_bundler.conf import bundler_settings
register = template.Library()
def context_set_default(context, key, de... | |
#!/usr/bin/env python
'''
GAEUnit: Google App Engine Unit Test Framework
Usage:
1. Put gaeunit.py into your application directory. Modify 'app.yaml' by
adding the following mapping below the 'handlers:' section:
- url: /test.*
script: gaeunit.py
2. Write your own test cases by extending unittest.TestCas... | |
# -*- coding: utf-8 -*-
# This software is released under the MIT License.
#
# Copyright (c) 2014 Cloudwatt
#
# 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 w... | |
import os
import json
import pickle
import logging
from collections import deque
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import MinMaxScaler
import mmm
import vicon
from ..util import check_feature_array
MOTION_TYPE_EXTENSIONS = {'mmm': '.xml', 'mmm-nlopt': '.xml', 'vicon... | |
#!/usr/bin/env python
# Copyright (c) 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/LICE... | |
from SimPEG import Mesh, Regularization, Maps, Utils, EM
from SimPEG.EM.Static import DC
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import copy
#import pandas as pd
#from scipy.sparse import csr_matrix, spdiags, dia_matrix,diags
#from scipy.sparse.linalg import spsolve
from scipy.stats imp... | |
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology. All rights reserved
"""
import pyximport;
pyximport.install()
import os
import numpy as np
import matplotlib.pyplot as plt
import ConfigParser
import matplotlib.dates as mdates
from matplotlib import cm
import pickle
from cStringIO... | |
"""Test Z-Wave node entity."""
import asyncio
import unittest
from unittest.mock import patch, MagicMock
import tests.mock.zwave as mock_zwave
import pytest
from homeassistant.components.zwave import node_entity, const
from homeassistant.const import ATTR_ENTITY_ID
@asyncio.coroutine
def test_maybe_schedule_update(ha... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import logging
import time
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
... | |
# -*- coding: utf-8 -*-
__author__ = 'Jeremy Robin'
__email__ = 'jeremy.robin@gmail.com'
__version__ = '0.1.1'
import numpy as np
class FeatureVectorMatrix(object):
""" A class to abstract away the differences in internal representation between dictionaries and lists that can matter
for very large datasets ... | |
# Copyright 2013 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... | |
"""This test unit checks node attributes that are persistent (AttributeSet)."""
import datetime
import sys
import warnings
from packaging.version import Version
import numpy as np
import tables as tb
from tables.tests import common
class Record(tb.IsDescription):
var1 = tb.StringCol(itemsize=4) # 4-character ... | |
# Copyright (c) 2013 Scality
#
# 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... | |
from som.compiler.ast.method_generation_context import MethodGenerationContext
from som.compiler.parse_error import ParseError
from som.compiler.parser import ParserBase
from som.compiler.symbol import Symbol
from som.interpreter.ast.nodes.block_node import BlockNode, BlockNodeWithContext
from som.interpreter.ast.node... | |
from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from toontown.battle.BattleBase import *
from toontown.battle import DistributedBattle
from direct.directnotify import DirectNotifyGlobal
from toontown.toon import TTEmote
from otp.avatar import Emote
from toontown.batt... | |
# $Id: io.py 8129 2017-06-27 14:55:22Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
exist for a variety of input/output mechanisms.
"""
__docformat__ = 'reStructur... | |
# -*- coding: utf-8 -*-
import os # noqa
import datetime
import logging
import requests
from bs4 import BeautifulSoup
from flask import request, make_response
from framework.flask import redirect
from framework.exceptions import HTTPError
from framework.utils import secure_filename
from framework.auth.utils import p... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
'''
Url Request
===========
.. versionadded:: 1.0.8
You can use the :class:`UrlRequest` to make asynchronous requests on the
web and get the result when the request is completed. The spirit is the
same as the XHR object in Javascript.
The content is also decoded if the Content-Type is
application/json and the result... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
from pyro.distributions.torch_distribution import TorchDistributionMixin
from pyro.distributions.util import broadcast_shape, sum_rightmost
from pyro.ops.special import log_binomial
from . import constra... | |
# Copyright (C) 2014 Yahoo! Inc. All Rights Reserved.
# 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
#
... | |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
"""
Settings and configuration for Django.
Read values from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global_settings.py
for a list of all possible variables.
"""
import importlib
import os
import time
import traceback
import warnings
f... | |
#!/usr/bin/env python2
"""Command line utility for querying the Logitech Harmony."""
import argparse
import logging
import json
import sys
from harmony import auth
from harmony import client as harmony_client
LOGGER = logging.getLogger(__name__)
def login_to_logitech(args):
"""Logs in to the Logitech service.
... | |
"""
Start a complete analysis with the MACKE toolchain on a given bitcode file
"""
import argparse
import sys
from datetime import datetime
from os import path
from .config import check_config
from .cgroups import initialize_cgroups, validate_cgroups
from .Macke import Macke
from .Logger import Logger
def str2bool(v... | |
# /**
# * 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
# * "... | |
# Copyright 2013 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 required by applicab... | |
# coding=utf-8
"""
Killable threads
"""
import os
import sys
import threading
import weakref
import ctypes
from collections import OrderedDict
from .shcommon import M_64, _SYS_STDOUT, python_capi
_STATE_STR_TEMPLATE = """enclosed_cwd: {}
aliases: {}
sys.stidin: {}
sys.stdout: {}
sys.stderr: {}
temporary_environ: {}
e... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
A bridge to publish and subscribe to EventAdmin events over the network using
MQTT
:author: Thomas Calmant
:copyright: Copyright 2016, Thomas Calmant
:license: Apache License 2.0
:version: 0.6.4
..
Copyright 2016 Thomas Calmant
Licensed under the Apa... | |
#!/usr/bin/env python
# pysw_1d_2L.py
#
# Solve the 1D, 2-LayerRotating Shallow Water (SW) Model
# FJP: make multi-layer
# FJP: make 2D
#
# Fields:
# u : zonal velocity
# v : meridional velocity
# h : depth of each layer
# e : free-surface deformations
#
# Evolution Eqns:
# u_t = - v*u_y + f*v
# v_t = - v*v_y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.