gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-22 18:21
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import utilities.fields
class Migration(migrations.Migration):
initial = True
dependencies ... | |
# This Python file uses the following encoding: utf-8
#
# 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/licen... | |
# 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 ... | |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import int2oct, oct2int, ints2octs, null, str2octs
from ... | |
#!/usr/bin/python3
"""
.. moduleauthor:: Albert Heinle<albert.heinle@gmail.com>
"""
#import threading
import multiprocessing
import constants
from nltk.tokenize import word_tokenize
import os
import logging
class Matcher(multiprocessing.Process):
"""
This is one of an army of in parallel running Threads.
... | |
#!/usr/bin/env python
#
# 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, merge, publish, distribute, subl... | |
#!/usr/bin/env python
#######################
'''
suppressreflections.py regiondir image1 image2 image3...
Given the locations of reflection rings around stars, this module removes and masks reflections and rings.
Each image needs a weight and flag file.
Star reflections are marked by ds9 circle regions. Stars are ... | |
"""Support for sensors through the SmartThings cloud API."""
from collections import namedtuple
from typing import Optional, Sequence
from pysmartthings import Attribute, Capability
from homeassistant.const import (
DEVICE_CLASS_BATTERY, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATUR... | |
# 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.
"""URL endpoint to add new graph data to the datastore."""
import datetime
import json
import logging
from google.appengine.api import datastore_errors
fro... | |
#---------------------------------------------------------------------------
# Copyright 2013 The Open Source Electronic Health Record Agent
#
# 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
#
... | |
# -*- coding: utf-8 -*-
import rs.sqldb as sqldb
import csv
import slughifi
import simplejson as json
import os
from os.path import join as osjoin
import shutil
import re
with open( 'trans.json', 'rb' ) as trans_file:
content = trans_file.read()
translation = json.loads( content )
def trans( key ):
if k... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import os
import uuid
from osipkd.tools import row2dict, xls_reader
from datetime import datetime
from sqlalchemy import not_, func
from sqlalchemy.sql.expression import and_
from ziggurat_foundations.models import groupfinder
from pyramid.view import (
view_config,
)
from pyramid.httpexceptions import (
HT... | |
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/re... | |
"""Code shared between the API classes."""
class Remote(object):
"""Base class for Nvim objects(buffer/window/tabpage).
Each type of object has it's own specialized class with API wrappers around
the msgpack-rpc session. This implements equality which takes the remote
object handle into consideratio... | |
# --------------------------------------------------------
# Scene Graph Generation by Iterative Message Passing
# Licensed under The MIT License [see LICENSE for details]
# Written by Danfei Xu
# --------------------------------------------------------
import tensorflow as tf
from networks.network import Network
imp... | |
#
# frontend.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it wi... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# name: test_handler_list.py
# author: Harold Bradley III
# email: harold@bradleystudio.net
# created on: 02/19/2016
#
"""
Unittests for nwid.event.handler_list module.
"""
from __future__ import absolute_import
from nwid.event im... | |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | |
import sys
import os
import unittest
sys.path.append(os.path.abspath('../'))
from menu import Node
class NodeTests(unittest.TestCase):
def setUp(self):
"""Before each test case"""
def tearDown(self):
"""After each test case"""
def test_Path(self):
"""Node.Path() should return all of the Node's anc... | |
import os
from django.conf import settings
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.decorators import (api_view, authentication_classes,
permission_classes)
f... | |
"""Support for KNX/IP lights."""
from __future__ import annotations
from typing import Any, cast
from xknx import XKNX
from xknx.devices.light import Light as XknxLight, XYYColor
from homeassistant import config_entries
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_H... | |
# Copyright (c) 2013-2015 by California Institute of Technology
# 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,... | |
# 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 2009-2015 MongoDB, Inc.
# Modifications copyright (C) 2018 Gabriel Leopoldino
#
# 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
#
# Un... | |
"""Makes figure with gradient-weighted class-activation maps (Grad-CAM)."""
import os
import pickle
import argparse
import numpy
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot
from PIL import Image
from gewittergefahr.gg_utils import general_utils
from gewittergefahr.gg_utils import radar_utils
... | |
"""
Types for objects parsed from the configuration.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import os
from collections import namedtuple
import six
from compose.config.config import V1
from compose.config.errors import ConfigurationError
from compose.const import IS_WINDOW... | |
# Copyright 2013 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 ag... | |
"""Xbox Media Source Implementation."""
from __future__ import annotations
from contextlib import suppress
from dataclasses import dataclass
from pydantic.error_wrappers import ValidationError # pylint: disable=no-name-in-module
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.api.provider.catalog.... | |
# Copyright (C) 2015 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... | |
# -*- coding: utf-8 -*-
"""
Fields for Discontinous Galerkin method
"""
import numpy as nm
import six
from numpy.lib.stride_tricks import as_strided
from six.moves import range
from sfepy.base.base import (output, assert_, Struct)
from sfepy.discrete import Integral, PolySpace
from sfepy.discrete.common.fields import ... | |
#
# Copyright (c) 2009, Novartis Institutes for BioMedical Research 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 copyrigh... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from pyecs import *
from pyecs.components import *
from collections import defaultdict
from testing import *
class TestEntity():
def test__reset_global(self):
Entity.__uid__ = "foo"
Entity.__tags__ = "bar"
assert hasattr(Entity, "__uid__")
... | |
import os
import subprocess
import sys
from collections import defaultdict
from typing import Any, ClassVar, Dict, Type
from urllib.parse import urljoin
from .wptmanifest.parser import atoms
atom_reset = atoms["Reset"]
enabled_tests = {"testharness", "reftest", "wdspec", "crashtest", "print-reftest"}
class Result(o... | |
# 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
# distributed under t... | |
# coding=utf-8
#
# Copyright 2012 Guokai (benben.cc)
# Do have a faith in what you're doing.
# Make your life a story worth telling.
import re
do_dict = {
"where": "__condition",
"table": "__table_name",
"limit": "__limit",
"order": "__order",
"field": "__field",
"data": "__data",
"group"... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from collections import MutableSet
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.plugins.internal.... | |
"""
Operator to convert lazyflow slots into pylearn2 datasets.
"""
from functools import wraps
import logging
import numpy as np
from lazyflow.operator import Operator, InputSlot, OutputSlot
from lazyflow.rtype import SubRegion
from pylearn2.datasets import Dataset
from pylearn2.space import CompositeSpace
from pyl... | |
"""SECCOMP policy.
This policy is based on the default Docker SECCOMP policy profile. It
allows several syscalls, which are most commonly used. We make one major
change regarding the network-related ``socket`` syscall in that we only
allow AF_INET/AF_INET6 SOCK_DGRAM/SOCK_STREAM sockets for TCP and UDP
protocols.
"""
... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | |
import logging
import functools
import operator
l = logging.getLogger("claripy.backends.backend_vsa")
from . import Backend, BackendError
from ..vsa import RegionAnnotation
def arg_filter(f):
@functools.wraps(f)
def filter(*args): #pylint:disable=redefined-builtin
if type(args[0]) in {int, long}: #py... | |
import logging
import re
import netfilter.parser
"""
rule.py Author: Zach Bricker
A set of classes to allow the creation of rules to be used with IPTables
"""
re_extension_opt = re.compile(r'^--(.*)$')
class Extension:
def __init__(self, na... | |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
import logging
import time
from sys import version_info
from functools import wraps
from threading import Event
from types import MethodType
from enum import IntEnum
from ..watchmen import watch
def action_valid_decorator_factory(state, protocol):
"""
This decorator factory is used to generate decorators w... | |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import numpy as np
from copy import deepcopy
from ..surface import (... | |
"""
pymel ipython configuration
Current Features
----------------
tab completion of depend nodes, dag nodes, and attributes
automatic import of pymel
Future Features
---------------
- tab completion of PyNode attributes
- color coding of tab complete options
- to differentiate between methods and attributes
... | |
# -*- coding: utf-8 -*-
# based on http://djangosnippets.org/snippets/1792/ by monokrome
from __future__ import absolute_import
from __future__ import unicode_literals
from django.http import HttpResponse, Http404
from django.conf import settings
from django.core import serializers
from django.db.models import Model
fr... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for ``flocker.node.agents.ebs`` using an EC2 cluster.
"""
import time
from uuid import uuid4
from bitmath import Byte
from boto.ec2.volume import (
Volume as EbsVolume, AttachmentSet
)
from boto.exception import EC2ResponseError
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script to automate creating builds of projects."""
from __future__ import print_function
import argparse
import logging
import os
import subprocess
import sys
from l2tdevtools import build_helper
from l2tdevtools import dependencies
from l2tdevtools import download_helper
... | |
'''
Text Markup
===========
.. versionadded:: 1.1.0
.. versionchanged:: 1.10.1
Added `font_context`, `font_features` and `text_language` (Pango only)
We provide a simple text-markup for inline text styling. The syntax look the
same as the `BBCode <http://en.wikipedia.org/wiki/BBCode>`_.
A tag is defined as ``[... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import logging
from datetime import datetime
from .. import base
logger = logging.getLogger(__name__)
# Module API
def extract_sourc... | |
# Copyright (c) 2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Authors: Alberto Solino (@agsolino)
# Kacper Nowak (@kacpern)
#
# Description:
# RFC 4511 Minim... | |
"""
===========================
Formaldehyde mm-line fitter
===========================
This is a formaldehyde 3_03-2_02 / 3_22-221 and 3_03-2_02/3_21-2_20 fitter.
It is based entirely on RADEX models.
Module API
^^^^^^^^^^
"""
from __future__ import print_function
import numpy as np
from . import hyperfine
from . im... | |
import time as real_time
import unittest
import jwt as jwt_lib
from mock import patch
from twilio.jwt import Jwt, JwtDecodeError
class DummyJwt(Jwt):
"""Jwt implementation that allows setting arbitrary payload and headers for testing."""
ALGORITHM = 'HS256'
def __init__(self, secret_key, issuer, subje... | |
###############################################################################
#
# Copyright 2012 Pants Developers (see AUTHORS.txt)
#
# 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
#
# h... | |
# 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... | |
import json
import pytest
from bson.objectid import ObjectId
from tests import clear_db
from . import jrequest, get_jwt_auth_header
unauthorized_scenarios = [
['GET', '/api/users', 'Authorization Required', 401],
]
@pytest.mark.parametrize(
'method, url, error, status_code ', unauthorized_scenarios)
def te... | |
"""Negative tests for the parametrization."""
import logging
import re
import pytest
from dvc.parsing import ResolveError
from dvc.parsing.context import Context
from dvc.parsing.interpolate import embrace
from dvc.utils.humanize import join
from . import make_entry_definition, make_foreach_def
def escape_ansi(l... | |
from pyramid.view import view_config
from confluent_kafka import Producer
from copy import deepcopy
import os
import urllib.request
import requests
import json
import sys
import clincoded.messaging.templates.gci_to_dx, clincoded.messaging.templates.vci_to_dx
affiliation_data = []
saved_affiliation = []
def includeme(... | |
import socket
import random
from pprint import pformat
from errno import EAGAIN, EWOULDBLOCK
from Queue import Queue
from Queue import Empty as QueueEmpty
class UnknownBrokerResponseError(Exception):
"""An unexpected response was received from the broker."""
class BrokerErrorResponse(Exception):
"""Received... | |
#!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013 winlin
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, mo... | |
# coding: utf-8
import json
import logging
from json.decoder import JSONDecodeError
from typing import Optional, Generator, List, Union, Any
from django.utils.module_loading import import_string
from modernrpc.conf import settings
from modernrpc.core import Protocol, RPCRequestContext
from modernrpc.exceptions import... | |
# standard imports
import sys
import logging
import importlib
from pathlib import Path
# toolbox imports
from .busy import BusyObservable, busy
# logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Metaclass(type):
"""A metaclass for the :py:class:`Resource` class. It assigns a un... | |
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from . import managers
from spectator.core.fields import NaturalSortField
from spectator.core.models import (
BaseRole,
SluggedModelMixin,
ThumbnailModelMixin,
... | |
#!/usr/bin/env python
import unittest
from test import support
from test.test_urllib2 import sanepathname2url
import os
import socket
import sys
import urllib.error
import urllib.request
def _retry_thrice(func, exc, *args, **kwargs):
for i in range(3):
try:
return func(*args, **kwargs)
... | |
## Automatically adapted for numpy.oldnumeric May 17, 2011 by -c
import numpy.oldnumeric as Numeric
def dot(array1, array2):
try: return array1.dot(array2)
except AttributeError:
try: return array2.dot(array1)
except AttributeError:
return Numeric.dot(array1, array2)
def sum(array... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2015 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 copy
import re
from enum import Enum
from random import randint, choice
from typing import Union, Optional, List, Any, Dict, Tuple
from netaddr import IPAddress, IPNetwork
from pyASA import address
from pyASA.address import BaseAddress, Address, AnyAddress
from pyASA.aliases import Aliases
from pyASA.baseconfi... | |
# Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 wit... | |
import json
import os
import tempfile
from zstacklib.utils import shell
# from kvmagent.plugins.bmv2_gateway_agent import exception
class Base(object):
""" Construct obj from req body
"""
k_v_mapping = {}
def __init__(self):
for v in self.k_v_mapping.values():
setattr(self, v, ... | |
# Webhooks for external integrations.
import re
import string
from functools import partial
from inspect import signature
from typing import Any, Dict, List, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import log_unsupported_webhook_event, webhook_view
from zerver.lib.exceptions i... | |
""" PyPTV_BATCH is the script for the 3D-PTV (http://ptv.origo.ethz.ch) written in
Python/Enthought Traits GUI/Numpy/Chaco
Example:
>> python pyptv_batch.py experiments/exp1 10001 10022
where 10001 is the first file in sequence and 10022 is the last one
the present "active" parameters are kept intact except the sequ... | |
import sys, os, shutil
from datetime import datetime
#from git import Repo, GitCommandError
join = os.path.join
import_path = os.path.abspath('..')
sys.path.append(import_path)
from dkrz_forms import form_handler, utils
#from dkrz_forms.config.settings import INSTALL_DIRECTORY, SUBMISSION_REPO, NOTEBOOK_DIRECTORY,F... | |
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Monotonic addition of entities."""
from google.appengine.api import datastore_errors
from google.appengine.ext import ndb
from google.appengin... | |
"""
Copyright (c) 2014, Samsung Electronics Co.,Ltd.
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 and... | |
import socket
import asyncore
import codecs
from time import time
from random import randint
from common import BLANK, BUFFERSIZE
from httpscopeinterface import connections_waiting, scope_messages, scope
from utils import pretty_print_XML, pretty_print
def encode_varuint(value):
if value == 0:
return "\0"
... | |
#!/usr/bin/env python
import rospy
from threading import Thread
from sensor_msgs.msg import JointState
from brics_actuator.msg import JointVelocities, JointValue
from rospy.exceptions import ROSException
from robotnik_msgs.msg import State
from std_srvs.srv import Empty
from cob_srvs.srv import Trigger
import time
... | |
"""Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from math import sqrt
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorMixin
from ..utils imp... | |
import os
from vigra import readImage
import h5py
from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
FileTransferSpeed, FormatLabel, Percentage, \
ProgressBar, ReverseBar, RotatingMarker, \
SimpleProgress, Timer
from colorama import Fore, Back, Style
import os.path
#from termcolor ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
from gevent.pywsgi import WSGIServer
import re
from urllib import unquote
static_setting = {
'templates': r'templates'
}
from HTTPerror import HTTP404Error, HTTP403Error, HTTP502Error
class RouteError(Exception):
... | |
#!/usr/bin/env python
"""
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... | |
#!/usr/bin/python -u
'''
simulate.py - simulation script for the 2012 UCC Programming Competition
NOTE: This is not the manager program for a stratego game
It merely calls the manager program as appropriate, and records results
Plays exactly ONE round, but does not overwrite previously played rounds
eg: run once ... | |
# 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... | |
from pycket.values import W_Symbol
from pycket.prims.expose import define_nyi, prim_env, expose
DEBUG = False
def make_primitive_table(ls_str):
table = [None] * len(ls_str)
for i, exposed_id in enumerate(ls_str):
table[i] = W_Symbol.make(exposed_id)
return table
place_str = ["place-break", "plac... | |
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... | |
"""DXR's concept of version control systems
The main entry points are `tree_to_repos`, which produces a mapping of roots
to VCS objects for each version control root discovered under the provided
tree, and `path_to_vcs`, which returns a VCS object for the version control
system that tracks the given path. Currently su... | |
# coding: utf-8
import json
import mimetypes
import os
import re
import urllib
import urlparse
import xml.sax.saxutils
from htmlentitydefs import name2codepoint
def urlsplit(*args):
"""
.. function:: urlsplit(text1, [text2,...]) -> multiset
Breaks a given URL into multiple fields. The returned table sche... | |
#!/usr/bin/env python
#
# Copyright (C) 2014 Narf Industries <info@narfindustries.com>
#
# 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
# th... | |
"""Support for NuHeat thermostats."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
HVAC_MODE_AUTO, HVAC_MODE_HEAT, HVAC_MODE_OFF, SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPER... | |
"""
Use lldb Python API to test dynamic values in C++
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class DynamicValueTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def ... | |
# Copyright 2013 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 agre... | |
"""Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import timedelta
from flask import request
from wtforms.ext.sqlalchemy.fields import QueryS... | |
extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker']
master_doc = "index"
link_files = {
'../CHANGES.rst': dict(
using=dict(
BB='https://bitbucket.org',
GH='https://github.com',
),
replace=[
dict(
pattern=r'(?<!\w)... | |
import cPickle
import Cookie
import hmac
import os
import random
import time
from datetime import datetime, timedelta
try:
from hashlib import md5
except ImportError:
from md5 import md5
try:
# Use PyCrypto (if available)
from Crypto.Hash import HMAC, SHA as SHA1
except ImportError:
# PyCrypto not ... | |
#!/usr/bin/env python3
# Copyright (c) 2018-2021 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 the wallet balance RPC methods."""
from decimal import Decimal
import struct
from test_framework.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.