gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Bitbucket API wrapper. Written to be somewhat like py-github:
https://github.com/dustin/py-github
"""
try:
from urllib.request import Request, urlopen
except ImportError:
from urllib2 import Request, urlopen
try:
from urllib.parse import urlencode
except... | |
# flake8: noqa I201
from Child import Child
from Node import Node
DECL_NODES = [
# type-assignment -> '=' type
Node('TypeInitializerClause', kind='Syntax',
children=[
Child('Equal', kind='EqualToken'),
Child('Value', kind='Type'),
]),
# typealias-declaration ->... | |
# -*- coding: utf-8 -*-
import copy
import os
import unittest
import tempfile
import gridfs
import six
from nose.plugins.skip import SkipTest
from mongoengine import *
from mongoengine.connection import get_db
from mongoengine.python_support import StringIO
try:
from PIL import Image
HAS_PIL = True
except Im... | |
# -*- coding: utf-8 -*-
"""
/*
* Copyright 2012-2014 NAVER Corp.
*
* 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... | |
import gc
from clang.cindex import CursorKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from nose.tools import raises
from .util import get_cursor
from .util import get_tu
kInput = """\
typedef int I;
struct teststruct {
int a;
I b;
long c;
unsigned long d;
signed long e;
... | |
# 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... | |
# -*- 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... | |
# coding: utf-8
#
# Copyright 2020 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 requi... | |
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | |
#!/usr/bin/env python
#encode=utf-8
#vim: tabstop=4 shiftwidth=4 softtabstop=4
#Created on 2013-8-17
#Copyright 2013 nuoqingyun xuqifeng
import logging
import logging.handlers
import os
import sys
import stat
import inspect
from oslo.config import cfg
log_opts = [
cfg.BoolOpt('use_syslog',
d... | |
#!/usr/bin/env python
"""System cron flows tests."""
from grr.endtoend_tests import base
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import flow
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.flows.cron import sys... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserInfo.trust_changed'
db.add_column('canvas_userinfo', 'trust_changed', self.gf('canvas.... | |
#!/usr/bin/env python2.7
# to use gimport: use wget or curl to download the gimport.py file locally
#ie. os.system('wget -q https://github.com/scottidler/gimport/raw/master/gimport.py -O gimport.py')
import os
import re
import imp
import sys
import contextlib
from subprocess import Popen, PIPE
sys.dont_write_byteco... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from jmbo import USE_GIS
class Migration(SchemaMigration):
depends_on = (
("jmbo", "0004_auto__add_field_modelbase_location"),
("foundry", "0038_auto__chg_field_count... | |
"""
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class BaseSpatialOperations(object):
"""
This module holds t... | |
# -*- coding: utf-8 -*-
# File: nvml.py
from ctypes import (byref, c_uint, c_ulonglong,
CDLL, POINTER, Structure)
import threading
__all__ = ['NVMLContext']
NVML_ERROR_FUNCTION_NOT_FOUND = 13
NvmlErrorCodes = {"0": "NVML_SUCCESS",
"1": "NVML_ERROR_UNINITIALIZED",
... | |
# Author: mozman <mozman@gmx.at>
# Purpose: xfcell -- cell with convenient xf function
# Created: 04.12.2010
# Copyright (C) 2010, Manfred Moitzi
# License: BSD-style licence
"""
The XFCell() object contains the data for one cell.
WARNING: You don't call this class yourself. You access Cell objects
via methods of th... | |
#!/usr/bin/env python
import sys
import memcache
import textwrap
import os.path
import time
from nagiosplugin import *
"""
Nagios plugin for checking memcached instances. Returns detailed memcached
statistics for use by perfdata visualisation tools.
Requirements
=============
This script requires the following pytho... | |
# Copyright (c) 2018-2021 Manfred Moitzi
# License: MIT License
from array import array
from typing import Iterable, MutableSequence, Sequence, Iterator
from .types import DXFTag
from .const import DXFTypeError, DXFIndexError, DXFValueError
from .tags import Tags
from ezdxf.tools.indexing import Index
from ezdxf.lldxf... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python.dataio import Reader, ReaderWithLimit, ReaderWithTimeLimit
from caffe2.python.dataset import Dataset
from caffe2.python.pipeline import pipe
from caffe... | |
#!/usr/bin/env python
"""Python helper for virt-install(1)"""
import os
import platform
import re
import string
import random
import include_funcs
import yaml
__author__ = 'Jason Callaway'
__email__ = 'jason@jasoncallaway.com'
__license__ = 'Apache License Version 2.0'
__version__ = '0.1'
__status__ = 'alpha'
class... | |
"""
Parser for VT100 input stream.
"""
from __future__ import unicode_literals
import os
import re
import six
import termios
import tty
from ..keys import Keys
from ..key_binding.input_processor import KeyPress
__all__ = (
'InputStream',
'raw_mode',
'cooked_mode',
)
_DEBUG_RENDERER_INPUT = False
_DEBUG_... | |
#!/usr/bin/env python
# Copyright (c) 2013-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.
#
# SMB Relay Server
#
# Authors:
# Alberto Solino (@agsolino)
# Dirk-jan Mollema... | |
# 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 use ... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Page object models for the info widget of the object"""
from lib import base
from lib.constants import locator
from lib.element import widget_info
class Widget(base.Widget):
"""Abstract class for al... | |
# 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.
from telemetry import benchmark
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.platform import tracing_category_fi... | |
from library_rami4pilps import *
#from foo1 import *
from RAMI4PILPS_reference_values import *
from invertJulesRT_new import *
from copy import copy
from array import array
from pylab import *
from runJulesRTStruct import runJulesRTStruct
import numpy as np
import matplotlib.pyplot as plt
controlData=[]
# Sparse c... | |
"""Support for Huawei LTE routers."""
from collections import defaultdict
from datetime import timedelta
from functools import partial
import ipaddress
import logging
from typing import Any, Callable, Dict, List, Set, Tuple
from urllib.parse import urlparse
import attr
from getmac import get_mac_address
from huawei_l... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import os
import datetime
import heapq
import itertools
import collections
import gevent
import requests
from gevent.event import AsyncResult, Event
from gevent.queue import Queue, Empty
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import sqlalchemy.exc
import yaml
try:
import xml.... | |
"""Integrating sklearn in our clumsy framework, the clumsy way.
How to add a new model:
- Identify SKLearn class
- Add it to the Scikit2Short dictionary
- Create a shortName_default_params() and a shortName_nonid_params() method
To instantiate:
sk_factory(skclass) or sk_factory(shortName)
"""
#TODO GLMnet
#TOD... | |
import functools
import itertools
import operator
from nflgame import OrderedDict
from nflgame import statmap
_BUILTIN_PREDS = {
'__lt': operator.lt,
'__le': operator.le,
'__ne': operator.ne,
'__ge': operator.ge,
'__gt': operator.gt,
}
"""
A dictionary of suffixes to predicates that can be used in... | |
from collections import OrderedDict
import pytest
from django.test import TestCase
from mongoengine import Document, EmbeddedDocument, fields
from rest_framework import fields as drf_fields
from rest_framework.serializers import Field, Serializer
from rest_framework_mongoengine.fields import DocumentField
from rest_f... | |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... | |
""" This file contains view functions for Flask-User forms.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
from datetime import datetime
from flask import current_app, flash, redirect, render_template, reque... | |
#!/usr/bin/env python
"""
================================LICENSE======================================
Copyright (c) 2015 Chirag Mello & Mario Tambos
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 Softwa... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicabl... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | |
#!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... | |
from collections import MutableSet
from math import hypot
def _build_variant(cls, opname):
fn = getattr(cls, opname)
if hasattr(fn, 'im_func'):
fn = fn.im_func
def method(self, other, fn=fn):
if not isinstance(other, MutableSet):
other = self._from_iterable(other)
return... | |
import warnings
from contextlib import contextmanager
from copy import deepcopy
from lxml import etree
import json
import sys
from jnpr.junos.factory.viewfields import ViewFields
from jnpr.junos.factory.to_json import TableViewJSONEncoder
class View(object):
"""
View is the base-class that makes extracting ... | |
##########################################################################
#
# Copyright (c) 2010-2011, Image Engine Design 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:
#
# * Redis... | |
# Copyright 2016 PLUMgrid, 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 ... | |
#!/usr/bin/env python
"""Utilities for common tasks needed to use lime framework.
"""
import optparse
import subprocess
import logging
import sys
import os.path
import zipfile
import re
import shutil
import fileinput
import mimetypes
from os.path import join, splitext, split, exists
from shutil import copyfile
from d... | |
# 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... | |
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString']
# For bootstrapping reasons, the collection ABCs are defined in _abcoll.py.
# They should however be considered an integral part of collections.py.
from _abcoll import *
import _abcoll
__all__ += _abcoll.__all__
from _co... | |
#!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
import srwl_bl
import srwlib
import srwlpy
import srwl_uti_smp
def set_optics(v=None):
el = []
pp = []
names = ['S0', 'S0_HFM', 'HFM', 'HFM_S1', 'S1', 'S1_DCM_C1', 'DCM_C1', 'DCM_C2', 'DCM_C2_At_BPM... | |
# Copyright 2019 Aerospike, 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 to in writing, ... | |
from __future__ import print_function
import unittest
import discretize
from SimPEG import (
utils,
maps,
data_misfit,
regularization,
optimization,
inversion,
inverse_problem,
tests,
)
import numpy as np
from SimPEG.electromagnetics import spectral_induced_polarization as sip
try:
... | |
# 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 agr... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.hazmat.primitives import... | |
"""
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from django.core.exceptions import EmptyResultSet
from django.utils import tree
from django.utils.functional import cached_property
# Connection types
AND = 'AND'
OR = 'OR'
class WhereNode(tree.Node):
"""
An SQL WHERE clause.
... | |
"""
Support for Envisalink devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/envisalink/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from... | |
import os, sys
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, "%s/libs" % BASE_DIR)
import time
import json
from datetime import datetime, timedelta
import httplib2
import logging.config
from config import Config
from apiclient.discovery import build
from apiclient.errors import HttpError... | |
import os
import re
import subprocess
import tempfile
from .. import vcs
from ..vcs import git, hg
def get_unique_name(existing, initial):
"""Get a name either equal to initial or of the form initial_N, for some
integer N, that is not in the set existing.
:param existing: Set of names that must not be ... | |
import numpy as np
from gym.spaces import Box
from scipy.spatial.transform import Rotation
from metaworld.envs import reward_utils
from metaworld.envs.asset_path_utils import full_v2_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerPushBackEnvV2(Sawye... | |
"""Manages the spawning of mpi processes to send to the various solvers.
"""
import os
import functools
import numpy as np
from .slepc_linalg import (
eigs_slepc, svds_slepc, mfn_multiply_slepc, ssolve_slepc,
)
from ..core import _NUM_THREAD_WORKERS
# Work out if already running as mpi
if ('OMPI_COMM_WORLD_SIZE... | |
import numpy as np
import pyspawn.complexgaussian as cg
######################################################
# adiabatic Hamiltonian
######################################################
# build Heff for the first half of the time step in the adibatic rep
# (with NPI)
def build_Heff_first_half(self):
self.get_... | |
import unittest
import sys
sys.path.insert(0, '..')
from lib.item import Item, Elem
from lib.organizem import Organizem, Conf
from lib.orgm_controller_base import ActionArg
TEST_DATA_FILE = "orgm_test.dat"
TEST_BAK_FILE = "orgm_test_bak.dat"
IS_UNIT_TESTING = True
Organizem(TEST_DATA_FILE, IS_UNIT_TESTING).setconf(C... | |
#
# Copyright 2015 Nexenta 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 r... | |
"""
(C) 2014-2018 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import sys
import json
import subprocess
import webbrowser
from threading import Event, Semaphore
import Foundation
import AppKit
import WebKit
from PyObjCTools import AppHelper
from objc import nil, su... | |
# -*- coding: utf-8 -*-
#
# Let's Encrypt documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 23 20:35:21 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | |
# Copyright 2016 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 argparse
import codecs
import datetime
import fnmatch
import glob
import os
import plistlib
import shutil
import subprocess
import sys
import tempfile... | |
from __future__ import unicode_literals
import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
F, BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, Func,
IntegerField, Sum, Value,
)
from django.test import Tes... | |
#!/usr/bin/env python
"""These are standard aff4 objects."""
import hashlib
import StringIO
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import utils
class VFSDirectory(aff4.AFF4Volume):
"""This represents a directory from the client."... | |
'''
Copyright 2014-2016 PTIN
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 wr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... | |
"""
To run this test, type this in command line <kolibri manage test -- kolibri.content>
"""
import datetime
import uuid
from collections import namedtuple
import mock
import requests
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils impor... | |
#!/usr/bin/env python3
#
# Copyright (c) 2013,Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (... | |
#|##############################################################################
#|Copyright (c) 2009, The Green-Span Project. All rights reserved. This code is
#|Open Source Free Software - redistribution and use in source and binary forms,
#|with or without modification, are permitted under the Two Clause BSD Licens... | |
# Copyright 2013-2021 Aerospike, 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 to in writ... | |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import argparse
from sphinxarg.parser import parse_parser, parser_navigate
import six
def test_parse_options():
parser = argparse.ArgumentParser()
parser.add_argument('--foo', action='store_true', default=False, help='foo help')
parser.add_argument('--bar', action='store_true', default=False)
data = ... | |
"""
Example: scikits.statsmodels.WLS
example is extended to look at the meaning of rsquared in WLS,
at outliers, compares with RLM and a short bootstrap
"""
import numpy as np
import scikits.statsmodels as sm
import matplotlib.pyplot as plt
data = sm.datasets.ccard.load()
data.exog = sm.add_constant(data.exog)
ols_f... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import six
import re, copy, os
import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields, default_fields
from frappe.model.... | |
"""
3D ConvNet layers using Theano, Pylearn and Numpy
ConvLayer: convolutions, filter bank
NormLayer: normalization (LCN, GCN, local mean subtraction)
PoolLayer: pooling, subsampling
RectLayer: rectification (absolute value)
"""
from conv3d2d import conv3d
from maxpool3d import max_pool_3d
from activations import r... | |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
RC = {"organisation_type.name" : "Red Cross / Red Crescent"}
# ============================================================================... | |
#!/usr/bin/env python
#
# Copyright 2015, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import base64
import unittest
from vtproto import topodata_pb2
from vtdb import vtgate_client
import environment
import tablet
import utils... | |
# pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
__all__ = [
"to_cds",
"output_notebook",
"output_file",
"ColumnDataSource",
"create_layout",
"show_layout",
]... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# 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 (t... | |
ATTACK_PATTERN = {
'response': {
"id": "attack-pattern--01a5a209-b94c-450b-b7f9-946497d91055",
"name": "ATTACK_PATTERN 1",
"type": "attack-pattern",
"modified": "2020-05-13T22:50:51.258Z",
"created": "2017-05-31T21:30:44.329Z",
"description": "Adversaries may abuse Wi... | |
# 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 compliance with the License. You may obtain
# a ... | |
import sys
from typing import Any, Dict, List, Optional, Type, TypeVar
import json
from .utils import parse_yaml, dump_json
from .cache import Cacheable
R = TypeVar('R', bound='Resource')
class Resource (Cacheable):
"""
A resource that's part of the overall Ambassador configuration world. This is
the... | |
#!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from... | |
# Copyright (c) 2020 PaddlePaddle 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 app... | |
from student.apps.courses.models import Course
import json
from django.forms.models import model_to_dict
from core.apps.tools.common import render_json, dump_and_render_json, error_form_serialization
data = {
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
... | |
##############################################################################
# Copyright 2010 North Carolina State University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# ... | |
"""
Utilities for working with APK packages in Alpine images
"""
import enum
import copy
class ComparisonResult(enum.IntEnum):
less_than = -1
equal_to = 0
greater_than = 1
class TokenType(enum.IntEnum):
INVALID = -1,
DIGIT_OR_ZERO = 0,
DIGIT = 1,
LETTER = 2,
SUFFIX = 3,
SUFFIX_N... | |
"""
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
*General purpose*:
The class GalaxySpectrumFIREFLY is dedicated to handling spectra to be fed to FIREFLY for fitting its stellar population
*Imports*::
import numpy as np
import astropy.io.fits as pyfits
import glob
from firefly_dust import ge... | |
"""Compute Linearly constrained minimum variance (LCMV) beamformer."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Roman Goj <roman.goj@gmail.com>
# Britta Westner <britta.wstnr@gmail.com>
#
# License: BSD-3-Clause
import numpy as np
from ..rank import compute_rank
from ..io.meas_i... | |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .theplatform import ThePlatformIE
from ..utils import (
find_xpath_attr,
lowercase_escape,
smuggle_url,
unescapeHTML,
)
class NBCIE(InfoExtractor):
_VALID_URL = r'https?://www\.nbc\.com/(?:[^/]+/)+(?P<id>n?\... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2020, henry232323
#
# 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... | |
#
# 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... | |
"""Support for IKEA Tradfri lights."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
from pytradfri.group import Group
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,... | |
"""Tests related to the ``devhub.addons.owner`` view."""
from nose.tools import eq_
from pyquery import PyQuery as pq
import waffle
import amo
import amo.tests
from amo.tests import formset
from addons.models import Addon, AddonUser
from devhub.forms import LicenseForm
from devhub.models import ActivityLog
from versio... | |
#!/usr/bin/env python
import argparse
import calendar
import json
import re
import time
import os
import sys
from datetime import datetime
from time import mktime
DODO_FILE = os.path.join(os.getcwd(), 'DODO')
VERSION = "0.99"
class TerminalColors(object):
"""
Color class for listing out dodos
"""
HE... | |
"""
Sample Mayavi customization file.
This code is not to be executed as `mayavi2 -x user_mayavi.py` or
`python user_mayavi.py`.
Put this file in ~/.mayavi2/user_mayavi.py and rerun mayavi2 to see what
it does -- the worker view may not show up by default so you will have
to go to View->Other and in the Show View dia... | |
def foo1():
<weak_warning descr="Local variable 'aaa' value is not used">aaa</weak_warning> = 1 #fail
<weak_warning descr="Local variable 'aaa' value is not used">aaa</weak_warning> = 2 #fail
bbb = 1 #pass
return bbb
def bar(<weak_warning descr="Parameter 'self' value is not used">self</weak_warning>): #fail
... | |
# -*- coding: utf-8 -*-
import datetime as dt
import logging
from flask import flash, redirect
from flask_login import current_user
from scout.build.panel import build_panel
from scout.parse.panel import parse_genes
LOG = logging.getLogger(__name__)
INHERITANCE_MODELS = ["ar", "ad", "mt", "xr", "xd", "x", "y"]
de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.