gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import shutil
import sys
import tempfile
import unittest
from openmdao.main.component import Component
from openmdao.main.datatypes.api import Float
from openmdao.main.factorymanager import get_signature
from openmdao.main.project import Project, project_from_archive, PROJ_FILE_EXT, \
_filter_macro, Proj... | |
#!/usr/bin/env python3
import unittest
from test import support
from test.test_urllib2 import sanepathname2url
import os
import socket
import urllib.error
import urllib.request
import sys
try:
import ssl
except ImportError:
ssl = None
TIMEOUT = 60 # seconds
def _retry_thrice(func, exc, *args, **kwargs):
... | |
import sys, os
#get path of script
_script_path = os.path.realpath(__file__)
_script_dir = os.path.dirname(_script_path)
pyWolfPath = _script_dir
if sys.platform == "linux" or sys.platform == "linux2":
print "Linux not tested yet"
elif sys.platform == "darwin":
print "OS X not tested yet"
elif sys.platform ==... | |
"""Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD Style.
import numpy as np
from scipy import linalg
from ..utils.arpack import eigsh
from ..base import BaseEstimator, TransformerMixin
from ..preprocessing import KernelCenterer
from ..metrics.pairwise import p... | |
"""The tests for the Yandex SpeechKit speech platform."""
import asyncio
from http import HTTPStatus
import os
import shutil
from homeassistant.components.media_player.const import (
DOMAIN as DOMAIN_MP,
SERVICE_PLAY_MEDIA,
)
import homeassistant.components.tts as tts
from homeassistant.config import async_pro... | |
#!/usr/bin/env python
##############################################################################
#
# bitstruct.py
#
# TODO:
# - refactor implementation into bitsruct class, and keep functions as a
# convenience interface
# - optimize string spec parsing
#
##################################################... | |
from __future__ import absolute_import
import socket
import warnings
from kombu import Connection
from kombu import pidbox
from kombu.exceptions import ContentDisallowed, InconsistencyError
from kombu.utils import uuid
from .case import Case, Mock, patch
class test_Mailbox(Case):
def _handler(self, state):
... | |
"""
2008 added for asynchronous DNS query by Hans Roh
"""
from rs4 import asyncore
from ... import lifetime
import time
import random
from .pydns import Base, Type, Class, Lib, Opcode
import threading
from .clients import UDPClient, TCPClient
defaults = Base.defaults
class RequestHandler:
def __init__(s... | |
"""The tests for the Canary sensor platform."""
from datetime import timedelta
from unittest.mock import patch
from homeassistant.components.canary.const import DOMAIN, MANUFACTURER
from homeassistant.components.canary.sensor import (
ATTR_AIR_QUALITY,
STATE_AIR_QUALITY_ABNORMAL,
STATE_AIR_QUALITY_NORMAL,
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apach... | |
# cpennello 2014-08-21
'''Tests for validation system.'''
import unittest
from . import validate, types
# It's easier to test error messages by looking at them.
show_errors = False
class SingleDictTest(unittest.TestCase):
# expects class attributes type and data
def failtest(self, k, v):
data = self.data.... | |
from math import inf
import unittest
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.stream import HStream
from hwtLib.abstract.frame_utils.alignment_utils import FrameAlignmentUtils
from hwtLib.abstract.frame_utils.join.fsm import input_B_dst_to_fsm
from hwtLib.abstract.frame_utils.join.state_trans_item import... | |
# 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 logging
import time
import urlparse
from telemetry.internal.actions.drag import DragAction
from telemetry.internal.actions.javascript_click import Cl... | |
#!/usr/bin/env python
# Copyright (c) 2014, Paessler AG <support@paessler.com>
# 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 not... | |
#!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays. NumPy is built ... | |
# This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'TrialEntity.clinical_trials_page_intro'
db.delete_colum... | |
#!/usr/bin/python
#
# OSPatching extension
#
# Copyright 2014 Microsoft 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
#
# Unle... | |
#!/usr/bin/env python
"""igcollect - Highwinds CDN
Copyright (c) 2018 InnoGames GmbH
"""
import sys
import json
import grequests
from time import gmtime, strftime, time
from argparse import ArgumentParser
try:
from urllib.request import Request, urlopen
from urllib.parse import urlencode
except ImportError:... | |
#
# MultiDim.py -- Multidimensional plugin for Ginga reference viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time
import re
from distutils import spawn
from contextlib import contextmanager
from ginga import AstroImage
from ginga.gw import... | |
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
import time
import requests
import requests.utils
class PyBingException(Exception):
pass
class PyBingSearch(object):
"""
Shell class for the individual searches
"""
def __init__(self, api_key, query, query_base, safe=False):
self.api_key = api_key
self.safe = safe
self.... | |
# -*- coding: utf-8 -*-
from settings.core import *
import dj_database_url
from django.utils.translation import ugettext_lazy as _
from themes import secrets
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATICFILES_... | |
# Generated by Django 1.11.24 on 2019-10-16 22:48
from typing import Any, Set, Union
import orjson
from django.conf import settings
from django.contrib.auth.hashers import check_password, make_password
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.d... | |
# -*- coding: utf-8 -*-
import os
import time
from datetime import datetime
import click
import pythoncom
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.w... | |
import sys
from io import BytesIO
from pyredis.exceptions import ProtocolError, ReplyError
SYM_CRLF = b'\r\n'
SYM_EMPTY = b''
TYPE_SIMPLE = b'+'
TYPE_ERROR = b'-'
TYPE_INT = b':'
TYPE_BULK = b'$'
TYPE_ARRAY = b'*'
__all__ = [
'to_bytes',
'Reader',
'writer'
]
def is_exception(inst, classinfo):
try:
... | |
#
# Copyright 2015 The AMP HTML 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 applic... | |
#
# 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
# ... | |
"""
Django settings for amy project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 09 16:00:27 2012
Author: Josef Perktold
"""
from __future__ import print_function
from statsmodels.compat.python import iterkeys, cPickle, BytesIO
import warnings
import numpy as np
from numpy.testing import assert_, assert_equal
import pandas as pd
import statsmodels... | |
#!/usr/bin/env python3
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This module provides functionality to generate dart:html event classes."""
impor... | |
#!/usr/bin/env python
import xml.etree.ElementTree as ET
class ietf_netconf_notifications(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def netconf_config_change_changed_by_server_or_user_server_server(self, **kwargs):... | |
# -*- coding: utf-8 -*-
import base64
import distutils.version
import functools
import logging
import random
import re
import string
import urllib
import flask
import requests
import rsa
from docker_registry.core import compat
json = compat.json
from . import storage
from .lib import config
logger = logging.getLo... | |
# 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... | |
from collections import defaultdict
import copy
import logging
import datetime
logger = logging.getLogger(__name__)
def aggregate_up(lesser_dicts, aggregate_key, lesser_key=None, skip_keys=(), copy_keys=None,
count_inner_keys=(), sum_inner_keys=(), enumerate_keys=()):
""" Sums values of aggregat... | |
# encoding: utf-8
# Written for Python 3.6
import os
import io
import math
from cage.utils import unit_vector
from cage.core import Cage, OccupiedCage
from cage.study import Study
from cage.landscape import Landscape
import numpy as np
import pymatgen as pmg
import pymatgen.io.nwchem as nwchem
"""
Scripts to set up... | |
#!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
import ctypes as ct
from unittest import main, skipUnless, TestCase
import os
import sys
import socket
import struct
from contextlib import contextmanager
import distutils.version
... | |
#!/usr/bin/env python
import rospy
import tf
import numpy as np
import cv2
import collections
import threading
from aruco_ros.msg import Center
from geometry_msgs.msg import PointStamped, TwistStamped
from sensor_msgs.msg import CameraInfo
from switch_vis_exp.msg import Output
from std_msgs.msg import Empty
qMult = t... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
import ipaddress
import os
import re
from urllib.parse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_v... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# Copyright 2022 The Flax 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 wri... | |
# -*- coding: utf-8 -*-
import datetime
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.http import Http404
from vanilla import UpdateView, DetailView, ListView, FormView, TemplateView
from braces.views import LoginRequiredMixin, StaffuserRequiredMixin
from .form... | |
import copy
import json
import logging
import aiohttp
from mfr.server import settings
from mfr.version import __version__
from waterbutler.core.utils import async_retry
logger = logging.getLogger(__name__)
async def log_analytics(request, metrics, is_error=False):
"""Send events to Keen describing the action ... | |
"""
Tests outwardly observable behaviour of fields
This test suite attempts to cover the interactions between several
orthogonal attributes that affect the behaviour of xblock fields.
1) Whether the field is mutable or immutable
2) Whether the field is in one of 3 different states
a) The field has no stored value... | |
###########################################################################
#
# 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/l... | |
# Copyright 2014 The Oppia 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 ... | |
from flask import render_template, redirect, url_for, abort, flash, request,\
current_app, make_response
from flask_login import login_required, current_user
from . import main
from .forms import EditProfileForm, EditProfileAdminForm, PostForm,\
CommentForm
from .. import db
from ..models import Permission, Rol... | |
# Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0, 1.0 ) )... | |
#!/usr/bin/env python
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
"""
Some classes to help optimisation problems formulated with thetis_adjoint.
In particular this module contains some OptimisationCallbacks that can be used
as callbacks of a :class:`ReducedFunctional` called at various stages during the optimisation
process:
- eval_cb_pre(controls) and eval_cb_post(functional, contr... | |
# 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 annotations
import os
import shutil
import procrunner
import pytest
from dxtbx.serialize import load
@pytest.mark.parametrize("use_beam", ["True", "False"])
@pytest.mark.parametrize("use_gonio", ["True", "False"])
@pytest.mark.parametrize("use_detector", ["True", "False"])
def test_reference... | |
#!/usr/bin/env ipython
from pylab import *
import numpy as np
from scipy.io.netcdf import netcdf_file
import os, sys
import matplotlib.patches as patches
import matplotlib.transforms as transforms
from numpy import array
from matplotlib.gridspec import GridSpec
import matplotlib.pyplot as plt
from os.path import isdir,... | |
"""
analysis.py
===========
Written by Scott Thomas 2012-02-01
Made available online 2015-02
See `LICENSE` for terms of re-use
Simple Python script used to test mixing along a microfluidic channel.
Inputs
------
Uses line profiles input from ImageJ. An option is also included to use data
from PMCapture, which is so... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
Very simple script to replace a template with another one.
It also converts the old MediaWiki boilerplate format to the new format.
Syntax: python template.py [-remove] [xml[:filename]] oldTemplate [newTemplate]
Specify the template on the command line. The program will... | |
import numpy as np
import pytest
from pandas.errors import UnsupportedFunctionCall
from pandas import (
DataFrame,
DatetimeIndex,
Index,
MultiIndex,
Series,
isna,
notna,
)
import pandas._testing as tm
from pandas.core.window import Expanding
def test_doc_string():
df = DataFrame({"B... | |
# (c) 2015, Kevin Carter <kevin.carter@rackspace.com>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any lat... | |
# 3rd party
import memcache
# project
from checks import AgentCheck
# Ref: http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt
# Name Type Meaning
# ----------------------------------
# pid 32u Process id of this server process
# uptime 32u Number o... | |
"""Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... | |
#
# 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
# ... | |
# -*- coding: utf-8 -*-
import os.path
import codecs
from xml.etree import ElementTree
from behave.reporter.base import Reporter
from behave.model import Scenario, ScenarioOutline, Step
from behave.formatter import ansi_escapes
from behave.model_describe import ModelDescriptor
from behave.textutil import indent, make_... | |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train a Fast R-CNN network."""
import caffe
from fast_rcnn.config i... | |
__author__ = 'francois'
from string import Template
import sqlite3
import numpy as np
import pandas as pd
import os
def getLockFile(db):
return os.path.join(os.path.dirname(os.path.realpath(__file__)), ".%s.db_lock"%db)
class Storage(object):
def get_data(self):
pass
class ProcessedStorage(Storage):
... | |
import sys
import os
from . import io
from . import root_paths
from abc import *
def ninja_esc_path(path):
return path.replace('$','$$').replace(' ','$ ').replace(':', '$:')
def xlat_path(project, path):
"""Translate common prefix to variable reference."""
if path.startswith(project.projectDir):
... | |
import logging
import math
from datetime import datetime, timedelta
from random import uniform,choice
from django.utils import timezone
from django.db.models import Max, Min
from autotrader.controllers import *
from autotrader.models import *
LOG=logging.getLogger(__name__)
class StrategyInterface(object):
def... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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... | |
#!/usr/bin/env python -u
"""
RPYC-based daemon that allows for remote execution
of pycryptoki commands.
Start via ``./rpyc_pycryptoki.py -i <ip> -p <port>``
or ``python rpyc_pycryptoki.py -i <ip> -p <port>``
All methods starting are useable via ``rpyc_conn.root.<method>``
All methods ending with ``_ex`` will automat... | |
from __future__ import division
import sys
import numpy
import six
try:
from cupy import core
except ImportError:
# core is a c-extension module.
# When a user cannot import core, it represents that CuPy is not correctly
# built.
msg = ('CuPy is not correctly installed. Please check your environme... | |
# coding=utf-8
# Copyright 2019 The SEED 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 agre... | |
import base64
import binascii
import io
import logging
import os
import random
import re
import secrets
import shutil
import unicodedata
import urllib
from datetime import timedelta
from mimetypes import guess_extension, guess_type
from typing import IO, Any, Callable, Optional, Tuple
import boto3
import botocore
from... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import logging
from dateutil.tz import tz
from c7n.exceptions import PolicyValidationError
from c7n.policy import execution, ServerlessExecutionMode, PullMode
from c7n.utils import local_session, type_schema
from c7n_gcp import mu
DEFAUL... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 10:26:39 2013
Author: Josef Perktold
"""
from __future__ import print_function
from statsmodels.compat.python import BytesIO, asbytes, StringIO
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
ss = '''\
43.9 1 1
39.0 1 2
4... | |
# -*- coding: utf-8 -*-
# Copyright 2013 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 requir... | |
"""
PynamoDB attributes
"""
import six
import json
from base64 import b64encode, b64decode
from delorean import Delorean, parse
from pynamodb.constants import (
STRING, NUMBER, BINARY, UTC, DATETIME_FORMAT, BINARY_SET, STRING_SET, NUMBER_SET,
DEFAULT_ENCODING
)
class Attribute(object):
"""
An attribut... | |
import numpy as np
import sys
import random
import pygame
import flappy_bird_utils
import pygame.surfarray as surfarray
from pygame.locals import *
from itertools import cycle
FPS = 30
SCREENWIDTH = 288
SCREENHEIGHT = 512
pygame.init()
FPSCLOCK = pygame.time.Clock()
SCREEN = pygame.display.set_mode((SCREENWIDTH, SCR... | |
# 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 a... | |
#!/usr/bin/env python
"""This plugin renders the client search page."""
import urllib
from grr.gui import renderers
from grr.gui.plugins import forms
from grr.gui.plugins import semantic
from grr.lib import aff4
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import utils
class NotificationCount(... | |
# 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.
# --------------------------------------------------------------------... | |
"""The tests for the manual_mqtt Alarm Control Panel component."""
from datetime import timedelta
import unittest
from unittest.mock import patch, Mock
from homeassistant.setup import setup_component
from homeassistant.const import (
STATE_ALARM_DISARMED,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY,
... | |
# -*- coding: utf-8 -*-
"""
Volume Purchase Programme Support
TODO:
- Not all error conditions are unit tested.
- Only the license cursor has been tested.
- The license assignment method remains untested.
"""
import requests
from typing import List, Optional, Iterator, Tuple, Dict, Text, Any
import json
i... | |
# Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# 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 b... | |
# Copyright 2011 OpenStack Foundation.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | |
"""
For simplest use of the module, these function works as an alternative frontend
to the ``mconvert`` script.
+--------------------------------+-----------------------------------------+
| Function | Description |
+================================+==================... | |
#!/usr/bin/env python
"""
Copyright 2018-present Open Networking Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... | |
"""Update a task in maniphest.
you can use the 'task id' output from the 'arcyon task-create' command as input
to this command.
usage examples:
update task '99' with a new title, only show id:
$ arcyon task-update 99 -t 'title' --format-id
99
"""
# ========================================================... | |
#!/usr/bin/env python3
#
# Copyright (c) 2019, 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
# ... | |
def RM_Normal_From_Tumor(path):
for k1 in os.listdir(path):
if k1.split('.')[-1]=='bed' and 'Tumor' in k1:
if os.path.isfile(path+k1.replace('Tumor','Normal')):
os.system(r'''Extract.Normal.From.Tumor.py --normal %s --tumor %s --output %s'''%(path+k1.replace('Tumor','Normal'),path+k1,path+k1.replace('Tumor','... | |
import json
from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
import commonware.log
from rest_framework import response, serializers
from django.utils.translation import ungettext as ngettext
import mkt
from mkt.api.fields import (ESTranslationSerializerField, ... | |
"""
Django settings for healthchecks project.
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def envbool(s, default):
v = os.getenv(s, default=default)
if v not in (... | |
# Copyright 2018 The Oppia 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 ... | |
import os
import sys
import io
import subprocess
import signal
XCPATH = subprocess.check_output(['xcode-select', '--print-path']).strip()
FWPATH = os.path.join(XCPATH, '../SharedFrameworks/LLDB.framework/Resources/Python')
sys.path.insert(0, FWPATH)
import lldb
debugger = None
class CoverageData:
def __init__(se... | |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import os
import mimetypes
import six
from tweepy.binder import bind_api
from tweepy.error import TweepError
from tweepy.parsers import ModelParser, Parser
from tweepy.utils import list_to_csv
class AP... | |
# Generated from sdoc/antlr/sdoc1Lexer.g4 by ANTLR 4.9
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2*")
buf.write("\u013d\b\1\b\1\b\1\4\2\t\2\4\3\t\3... | |
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import itertools
import json
import math
import os
import shutil
import tempfile
import time
import unittest
# Find the best implementation available
try:
from cStringIO import StringIO
except ImportError:
... | |
#
# 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... | |
import xml.etree.ElementTree as etree
from collections import namedtuple
from twisted.internet import defer
from . import client, utils, error, pagination
from .client import ns
__all__ = ['Service', 'Bucket', 'Object']
def simpleOperation(action='', method='GET'):
def func(self):
return self._request... | |
# scp.py
# Copyright (C) 2008 James Bardin <j.bardin@gmail.com>
"""
Utilities for sending files over ssh using the scp1 protocol.
"""
__version__ = '0.10.2'
import locale
import os
import re
from socket import timeout as SocketTimeout
# this is quote from the shlex module, added in py3.3
_find_unsafe = re.compile(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.