content string |
|---|
from msrest.serialization import Model
class VirtualMachineStatusCodeCount(Model):
"""The status code and count of the virtual machine scale set instance view
status summary.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar code: The instance view sta... |
# from spyre import server
from spyre import server
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from numpy import pi
class TestApp(server.App):
colors = [
{"label": "Green", "value": 'g'},
{"label": "Red", "value": 'r'},
{"label": "Blue", "value": 'b'},
... |
"""
Table property for providing information about table.
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import os
from contextlib import contextmanager
from inspect import isclass
import numpy as np
from astropy.utils.data_info import DataInfo
__all__ = ['table_info', 'TableInfo', 'se... |
import os
import logging
import shutil
import tempfile
import time
from cerbero.build import build, source
from cerbero.build.filesprovider import FilesProvider
from cerbero.config import Platform
from cerbero.errors import FatalError
from cerbero.ide.vs.genlib import GenLib
from cerbero.tools.osxuniversalgenerator im... |
def check(module, name, state, service_key, api_key, incident_key=None):
url = "https://%s.pagerduty.com/api/v1/incidents" % name
headers = {
"Content-type": "application/json",
"Authorization": "Token token=%s" % api_key
}
data = {
"service_key": service_key,
"incident_... |
# -*- coding: utf-8 -*-
"""The arguments helper interface."""
class ArgumentsHelper(object):
"""The CLI arguments helper class."""
NAME = u'baseline'
# Category further divides the registered helpers down after function,
# this can be something like: analysis, output, storage, etc.
CATEGORY = u''
DESCRIP... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 3 of the Lic... |
#!/usr/bin/env python
import argparse
import logging
import sys
import boto
def main():
p = argparse.ArgumentParser()
p.add_argument('cluster_name')
p.add_argument('--dry-run', action='store_true')
a = p.parse_args()
conn = boto.connect_ec2()
active = [instance for res in conn.get_all_instan... |
from oslo_policy import policy
from nova.policies import base
POLICY_ROOT = 'os_compute_api:os-certificates:%s'
certificates_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'discoverable',
check_str=base.RULE_ANY),
base.create_rule_default(
POLICY_ROOT % 'create',
base.R... |
"""This example gets all custom fields that apply to line items.
To create custom fields, run create_custom_fields.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authen... |
'''
Copyright (c) <2012> Tarek Galal <<EMAIL>>
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,... |
import re
# Prefix for the branch portion of a locator URL
BRANCH_PREFIX = "/branch/"
# Prefix for the block portion of a locator URL
BLOCK_PREFIX = "/block/"
# Prefix for the version portion of a locator URL, when it is preceded by a course ID
VERSION_PREFIX = "/version/"
# Prefix for version when it begins the URL (... |
import re
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backend import G... |
from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils... |
# -*- coding: utf-8 -*-
import hashlib
import pycurl
from ..internal.MultiHoster import MultiHoster
from ..internal.misc import json, seconds_to_midnight
class LinkifierCom(MultiHoster):
__name__ = "AlldebridCom"
__type__ = "hoster"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r'^u... |
import builder
import os
import sys
# Each configurator must export this function
def create_builder(args):
usage = """\
Usage:
main.py cfg_msvc [-h|--help] [-t|--target TARGET] [cfg_site]
Arguments:
cfg_site: site configuration module. If not specified, "cfg_site"
is implie... |
"""
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... |
import time
from bot import project_info
from bot.action.core.action import Action
from bot.action.core.update import Update
from bot.action.standard.about import VersionAction
from bot.action.standard.admin.config_status import ConfigStatus
from bot.action.util.textformat import FormattedText
from bot.api.api import ... |
import time
from openerp.report import report_sxw
class pos_payment_report_user(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(pos_payment_report_user, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': t... |
import os
import importlib
import logging
l = logging.getLogger('angr.misc.autoimport')
def auto_import_packages(base_module, base_path, ignore_dirs=(), ignore_files=(), scan_modules=True):
for lib_module_name in os.listdir(base_path):
if lib_module_name in ignore_dirs:
continue
lib_p... |
"""Wraps the upstream safebrowsing_test_server.py to run in Chrome tests."""
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(BASE_DIR, '..', '..', '..', 'net',
'tools', 'testserver'))
import testserver_base
class ServerRunner(test... |
from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input import cached
try:
from flexget.plugins.api_rottentomatoes import lists
except ImportError:
raise... |
from sahara.service.edp.oozie.workflow_creator import base_workflow
from sahara.utils import xmlutils as x
class HiveWorkflowCreator(base_workflow.OozieWorkflowCreator):
def __init__(self):
super(HiveWorkflowCreator, self).__init__('hive')
hive_elem = self.doc.getElementsByTagName('hive')[0]
... |
import click
from jinja2 import Environment, FileSystemLoader
from model import *
session = setup_sqlalchemy()()
env = Environment(loader=FileSystemLoader("."))
template = env.get_template("results.html.j2")
sql = """
select
r.author,
r.title,
h.branch_name,
h.collection_name,
h.call_class,
count(*) as... |
import sys
import types
import gevent
import signal
import functools
class cleanup:
def __init__(self, *args, **keys):
self.cleanup_funcs = args
self.keys = keys
def __enter__(self):
pass
def __exit__(self, exc_type, value, traceback):
if self.cleanup_funcs:
... |
import errno
import logging
import os
import os.path
import subprocess
import sys
class GTKDoc(object):
"""Class that controls a gtkdoc run.
Each instance of this class represents one gtkdoc configuration
and set of documentation. The gtkdoc package is a series of tools
run consecutively which conve... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from actstream.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Action.data'
db.add_column('actstream_action', 'dat... |
"""
Helpers for student roles
"""
from openedx.core.djangoapps.django_comment_common.models import (
FORUM_ROLE_ADMINISTRATOR,
FORUM_ROLE_COMMUNITY_TA,
FORUM_ROLE_GROUP_MODERATOR,
FORUM_ROLE_MODERATOR,
Role
)
from common.djangoapps.student.roles import (
CourseBetaTesterRole,
CourseInstruc... |
from contextlib import (contextmanager)
import argparse
import sys
import pylibmc
def parse_args(args=None):
p = argparse.ArgumentParser()
p.add_argument('--protocol', '-p', default='text',
help="choose protocol type. One of text or bin")
p.add_argument('--remote', '-r', default='127.0... |
"""Parser driver.
This provides a high-level interface to parse a file into a syntax tree.
"""
__author__ = "Guido van Rossum <<EMAIL>>"
__all__ = ["Driver", "load_grammar"]
# Python imports
import codecs
import os
import logging
import StringIO
import sys
# Pgen imports
from . import grammar, parse, token, token... |
#!/usr/bin/env python
'''Test that a font distributed with the application can be displayed.
Four lines of text should be displayed, each in a different variant
(bold/italic/regular) of Action Man at 24pt. The Action Man fonts are
included in the test directory (tests/font) as action_man*.ttf.
Press ESC to end the ... |
class Timer(object):
"""Abstraction of a GUI-toolkit implemented timer."""
def __init__(self, ival_sec, expire_cb, data=None, tkcanvas=None):
"""Create a timer set to expire after `ival_sec` and which will
call the callable `expire_cb` when it expires.
"""
self.ival_sec = ival_s... |
"""Unit test for utils.py"""
import utils
import unittest
class APDUCase1Tests(unittest.TestCase):
def setUp(self):
self.a4 = utils.C_APDU("\x00\xa4\x00\x00")
def tearDown(self):
del self.a4
def testCreation(self):
self.assertEqual(0, self.a4.CLA)
self.assert... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from units.compat.mock import patch
from units.modules.utils import set_module_args
from ansible.modules.network.slxos import slxos_interface
from .slxos_module import TestSlxosModule, load_fixture
class TestSlxosInter... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tempfile
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.lite.experimental.examples.lstm.tflite_lstm import TFLiteLSTMCell
from tenso... |
"""Support for the Nissan Leaf Carwings/Nissan Connect API."""
import asyncio
from datetime import datetime, timedelta
import logging
import sys
from pycarwings2 import CarwingsError, Session
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_USERNAME, HTTP_OK
from homeassistant... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j. F Y G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.... |
import re
from .ordereddict import OrderedDict
from .misc import to_unicode
__all__ = ['ValuesDict', 'Value', 'ValueBackendPassword', 'ValueInt', 'ValueFloat', 'ValueBool']
class ValuesDict(OrderedDict):
"""
Ordered dictionarry which can take values in constructor.
>>> ValuesDict(Value('a', label='Test... |
from __future__ import unicode_literals
import warnings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.shortcuts import get_current_site
from django.db.utils import IntegrityError, OperationalError, ProgrammingError
from djan... |
# coding: utf8
{
'!langcode!': 'zh-tw',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s s... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
'''
Compat module for Python2.7's unittest module
'''
import sys
# Python 2.6
if sys.version_info < (2, 7):
try:
# Need unittest2 on python2.6
from unittest2 import *
except ImportError:
print('You... |
# Code imported from https://github.com/taskcluster/taskcluster/blob/32629c562f8d6f5a6b608a3141a8ee2e0984619f/services/treeherder/src/util/route_parser.js
# A Taskcluster routing key will be in the form:
# treeherder.<version>.<user/project>|<project>.<revision>.<pushLogId/pullRequestId>
# [0] Routing key prefix used... |
from __future__ import division
import re
from ... import gloo
class Compiler(object):
"""
Compiler is used to convert Function and Variable instances into
ready-to-use GLSL code. This class handles name mangling to ensure that
there are no name collisions amongst global objects. The final name of
... |
# encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
from guardian.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GroupObjectPermission.object_pk'
db.add_column('guardian_groupobjectpermission', 'object_pk', se... |
import mock
from solum.deployer.handlers import noop as noop_handler
from solum.openstack.common.gettextutils import _
from solum.tests import base
from solum.tests import fakes
from solum.tests import utils
class HandlerTest(base.BaseTestCase):
def setUp(self):
super(HandlerTest, self).setUp()
s... |
"""
Generates IDL file for the OneClick ActiveX control from the passed-in IDL
template. The input template is a complete IDL file in all but one respect;
It has one replaceable entry for the CLSID for GoopdateOneClickControl.
We generate a GUID using UUIDGEN.EXE, and write out an IDL with a new CLSID.
"""
import sys... |
import datetime
import unittest
from unittest import mock
from urllib.parse import quote_plus
from django.test import SimpleTestCase
from django.utils.encoding import (
DjangoUnicodeDecodeError, escape_uri_path, filepath_to_uri, force_bytes,
force_text, get_system_encoding, iri_to_uri, smart_bytes, smart_text,... |
class OperandType:
""" Types of possible operands in an opcode.
Refer to the diStorm's documentation or diStorm's instructions.h
for more explanation about every one of them. """
(NONE,
IMM8,
IMM16,
IMM_FULL,
IMM32,
SEIMM8,
IMM16_1, # NEW
IMM8_1, # NEW
IMM8_2, # NEW
REG8,
REG16,
REG_FULL,
... |
# -*- coding: utf-8 -*-
#old way
from distutils.core import setup
#new way
#from setuptools import setup, find_packages
setup(name='mimeparse',
version='0.1.3',
description='A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges.',
long_desc... |
# File name: comicwidgets.py
import kivy
kivy.require('1.9.0')
from kivy.uix.scatter import Scatter
from kivy.graphics import Line
class DraggableWidget(Scatter):
def __init__(self, **kwargs):
self.selected = None
self.touched = False
super(DraggableWidget, self).__init__(**kwargs)
de... |
"""
Module for Image annotations using annotator.
"""
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
from xmodule.annotator_mixin import get_instructions, html_to_text
from xmodule.... |
#!/usr/bin/python
######################################################################
# Autor: Andrés Herrera Poyatos
# Universidad de Granada, March, 2015
# Single-Linkage Clustering Algorithm
#######################################################################
# This program read the values asociated to the v... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'local_dialog_base.ui'
#
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf... |
import numpy as np
from unittest.mock import patch
from sm.engine.ms_txt_converter import MsTxtConverter
from sm.engine.util import SMConfig
from sm.engine.tests.util import sm_config, ds_config
@patch('sm.engine.ms_txt_converter.MsTxtConverter._parser_factory')
def test_convert(MockImzMLParser, sm_config):
mock... |
"""
Unit tests for course import and export
"""
import os
import shutil
import tarfile
import tempfile
import copy
from uuid import uuid4
from pymongo import MongoClient
from .utils import CourseTestCase
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.conf impor... |
"""Helped functions to concatenate subset of noisy images to batch."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
from tensorflow.compat.v2 import summary
IMG_SUMMARY_PREFIX = '_img_'
def format_tensors(*dicts):
"... |
"""
Container page in Studio
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise, EmptyPromise
from . import BASE_URL
from utils import click_css, confirm_prompt
class ContainerPage(PageObject):
"""
Container page in Studio
"""
NAME_SELECTOR = '.page-header-title'
... |
import warnings
from contextlib import contextmanager
from copy import copy
from django.utils.deprecation import RemovedInDjango110Warning
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
_current_app_undefined = object()
class Con... |
import logging
from pytest import raises, skip
from hscommon.testutil import eq_
try:
from ..cache import Cache, colors_to_string, string_to_colors
except ImportError:
skip("Can't import the cache module, probably hasn't been compiled.")
class TestCasecolors_to_string:
def test_no_color(self):
eq... |
import copy
import gdb
"""GDB commands for working with type-printers."""
class InfoTypePrinter(gdb.Command):
"""GDB command to list all registered type-printers.
Usage: info type-printers
"""
def __init__ (self):
super(InfoTypePrinter, self).__init__("info type-printers",
... |
from importlib import import_module
from optparse import make_option
import os
from django.apps import apps
from django.conf import settings
from django.core.management.base import CommandError
from django.db.models.fields import NOT_PROVIDED, TimeField, DateField
from django.db.models.fields.related import ForeignKey... |
"""Provides an API for generating Event protocol buffers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
import warnings
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import summary_pb2
from t... |
"""This module defines the core structure of the classification rules.
This module does NOT specify how the rules filter the data: this responsibility
is of to the concrete classifiers, which have to override the Rule class herein
defined and know how to do the math.
This module, instead, defines the format of the ru... |
import argparse
import os
import re
from ansible.plugins.test import core, files, mathstuff
TESTS = list(core.TestModule().tests().keys()) + list(files.TestModule().tests().keys()) + list(mathstuff.TestModule().tests().keys())
TEST_MAP = {
'version_compare': 'version',
'is_dir': 'directory',
'is_file':... |
"""Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... |
"""
Statistical Functions
=====================
This module contains a large number of probability distributions as
well as a growing library of statistical functions.
Each included distribution is an instance of the class rv_continous.
For each given name the following methods are available. See docstring
for rv_co... |
from numpy.linalg import norm
from numpy.testing import assert_, run_module_suite
from qutip.random_objects import rand_dm, rand_unitary, rand_kraus_map
from qutip.subsystem_apply import subsystem_apply
from qutip.superop_reps import kraus_to_super
from qutip.superoperator import mat2vec, vec2mat
from qutip.tensor imp... |
"""This file allows the bots to be easily configure and run the tests."""
import argparse
import os
import tempfile
from environment import Environment
import tests
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Password Manager automated tests runner help.")
parser.add_argument(... |
"""Tests for predictor.saved_model_predictor."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.predictor import saved_model_predictor
from tensorflow.core.framework import tensor_shape_pb2
from tensorflow.core.f... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from collections import defaultdict
from ansible.compat.six import iteritems
from ansible.compat.six.moves import builtins
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import MagicMock, mock_open, patch... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.datastructures import MultiValueDictKeyError
from django.shortcuts import render, redirect
from django.http import HttpResponse, Http404
from django.views import View
from random import shuffle, randint
from django.contrib.auth import aut... |
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import empty, memoize, LazyObject
from django.utils.importl... |
#!/usr/bin/env python
import datetime
import os
import django
from django.utils.translation import ugettext_lazy as _
# Which settings are we using?
# Useful for debugging.
SETTINGS = 'base'
# Base paths
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = os.path.dirname(os.path.dirname(os.... |
class Event(object):
"""
Class representing a NAV Event
"""
UP = 'UP'
DOWN = 'DOWN'
boxState = 'boxState'
serviceState = 'serviceState'
def __init__(self, serviceid, netboxid, deviceid,
eventtype, source, status, info='', version=''):
self.serviceid = serviceid
... |
from unittest import TestCase
from bricklayer.doctor.config import Configurator
import uuid
import os
import shutil
import tempfile
import ConfigParser
class ConfiguratorTest(TestCase):
def setUp(self):
self.random_dir = tempfile.gettempdir() + '/.' + uuid.uuid4().hex
os.makedirs(self.random_dir)... |
# ------------------------------------------------------------------------------------------------
# Split Wordpress XML (using LXML)
# ------------------------------------------------------------------------------------------------
import sys, os, re, pprint, codecs, datetime, subprocess
# sys.path.append('/usr/local... |
from PIL._binary import o8
##
# File handler for Teragon-style palette files.
class PaletteFile(object):
rawmode = "RGB"
def __init__(self, fp):
self.palette = [(i, i, i) for i in range(256)]
while True:
s = fp.readline()
if not s:
break
... |
#! /usr/bin/env python
from numpy.testing import TestCase, assert_equal, assert_almost_equal
from aubio import fvec, source
from numpy import array
from utils import list_all_sounds
list_of_sounds = list_all_sounds('sounds')
path = None
class aubio_source_test_case(TestCase):
def setUp(self):
if not len... |
# -*- coding: utf-8 -*-
from openerp.tests import common
class TestFloatExport(common.TransactionCase):
def setUp(self):
super(TestFloatExport, self).setUp()
self.Model = self.registry('decimal.precision.test')
def get_converter(self, name):
converter = self.registry('ir.qweb.field.flo... |
from sockets.stream_socket import StreamSocket
from transfer.request import Request
from transfer.notification import Notification
import settings
from groundstation.utils import path2id
import groundstation.logger
log = groundstation.logger.getLogger(__name__)
class StreamClient(StreamSocket):
def __init__(sel... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 3 of the License, or
(at your option) any later version.
T... |
# -*- coding: utf-8 -*-
#
# Maximum Temperature Renderer for Dreambox/Enigma-2
# Coded by Vali (c)2010-2011
#
#######################################################################
from Components.VariableText import VariableText
from enigma import eLabel
from Renderer import Renderer
class valioPosition(Rende... |
"""Tests for tensorflow_models.skip_thoughts.skip_thoughts_model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from skip_thoughts import configuration
from skip_thoughts import skip_thoughts_model
class S... |
"""
This file contains a function used to retrieve the token for the annotation backend
without having to create a view, but just returning a string instead.
It can be called from other files by using the following:
from xmodule.annotator_token import retrieve_token
"""
import datetime
from firebase_token_generator im... |
data = (
'Zui ', # 0x00
'Can ', # 0x01
'Xu ', # 0x02
'Hui ', # 0x03
'Yin ', # 0x04
'Qie ', # 0x05
'Fen ', # 0x06
'Pi ', # 0x07
'Yue ', # 0x08
'You ', # 0x09
'Ruan ', # 0x0a
'Peng ', # 0x0b
'Ban ', # 0x0c
'Fu ', # 0x0d
'Ling ', # 0x0e
'Fei ', # 0x0f
'Qu ', # 0x10
'[?] '... |
try:
import shade
HAS_SHADE = True
except ImportError:
HAS_SHADE = False
def _needs_update(module, port, cloud):
"""Check for differences in the updatable values.
NOTE: We don't currently allow name updates.
"""
compare_simple = ['admin_state_up',
'mac_address',
... |
"""Contains the data classes of the Dublin Core Metadata Initiative (DCMI) Extension"""
__author__ = '<EMAIL> (Jeff Scudder)'
import atom.core
DC_TEMPLATE = '{http://purl.org/dc/terms/}%s'
class Creator(atom.core.XmlElement):
"""Entity primarily responsible for making the resource."""
_qname = DC_TEMPLATE %... |
import markdown
from markdown.extensions.fenced_code import FencedCodeExtension, FencedBlockPreprocessor
class StandaloneFencedCodeExtension(FencedCodeExtension):
def __init__(self, **kwargs):
self.config = {
"linenums": [False, "Use lines numbers. True=yes, False=no, None=auto"],
... |
import sys
import os
import fileinput
import datetime
import time
import datetime
from matplotlib import dates
import matplotlib
matplotlib.use('Agg')
from matplotlib import pylab
import Image
OUTPUT_FILE = '../../www/images/svn-dav-securityspace-survey.png'
OUTPUT_IMAGE_WIDTH = 800
STATS = [
('1/1/2003', 70),
('... |
__source__ = 'https://leetcode.com/problems/find-eventual-safe-states/'
# Time: O(N + E)
# Space: O(N)
#
# Description: Leetcode # 802. Find Eventual Safe States
#
# In a directed graph, we start at some node and every turn,
# walk along a directed edge of the graph.
# If we reach a node that is terminal (that is, it ... |
"""Utilities and helper functions."""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import contextlib
import json
import os
import shutil
import tempfile
import yaml
from oslo_config import cfg
from oslo_log import log as logging
import six
LOG = logging... |
from lib.cuckoo.common.abstracts import Signature
class WineDetectFunc(Signature):
name = "antiemu_wine_func"
description = "通过功能名检测是否存在Wine模拟器"
severity = 3
categories = ["anti-emulation"]
authors = ["Accuvant"]
minimum = "1.0"
evented = True
filter_apinames = set(["LdrGetProcedureAdd... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
MessageBarProgress.py
---------------------
Date : April 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*********************... |
from pycket import values
from pycket import values_parameter
from pycket.argument_parser import ArgParser, EndOfInput
from pycket.arity import Arity
from pycket.base import W_Object
from pycket.error import SchemeException
from pycket.prims.expose impor... |
"""IP Utils test class."""
import unittest
import json
import os
import pandas as pd
from msticpy.sectools.ip_utils import get_whois_info, get_whois_df, get_ip_type
_test_data_folders = [
d for d, _, _ in os.walk(os.getcwd()) if d.endswith("/tests/testdata")
]
if len(_test_data_folders) == 1:
_TEST_DATA = _... |
# pylint: disable=E1101,E1103,W0232
""" manage legacy pickle tests """
import nose
import os
from distutils.version import LooseVersion
import pandas as pd
from pandas import Index
from pandas.compat import u, is_platform_little_endian
import pandas
import pandas.util.testing as tm
from pandas.tseries.offsets impor... |
# pylint: disable=missing-docstring
from django.core.cache import cache
from django.test.utils import override_settings
from lang_pref import LANGUAGE_KEY
from xmodule.modulestore.tests.factories import (check_mongo_calls, CourseFactory)
from student.models import anonymous_id_for_user
from student.models import UserP... |
import sys
import unittest2 as unittest
from optparse import make_option
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.tool.multicommandtool import MultiCommandTool, Command, TryAgain
class TrivialCommand(Command):
name = "trivial"
show_in_main_help = True
help_text = "hel... |
from spack import *
class Pathfinder(MakefilePackage):
"""Proxy Application. Signature search."""
homepage = "https://mantevo.org/packages/"
url = "http://mantevo.org/downloads/releaseTarballs/miniapps/PathFinder/PathFinder_1.0.0.tgz"
tags = ['proxy-app']
version('1.0.0', '374269e8d42c305e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.