code stringlengths 1 199k |
|---|
"""Plugins that are not OS-specific"""
from rekall.plugins.common import address_resolver
from rekall.plugins.common import api
from rekall.plugins.common import bovine
from rekall.plugins.common import efilter_plugins
from rekall.plugins.common import inspection
from rekall.plugins.common import memmap
from rekall.plu... |
from __future__ import print_function
import json
import socket
import sys
import threading
try:
# Python 3
import socketserver
except ImportError:
# Python 2
import SocketServer as socketserver
thesocket = None
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
... |
import nest
import nest.raster_plot
import numpy as np
import pylab
Dt = 1.
nsteps = 100
w_0 = 100.
nest.ResetKernel()
nrn_pre = nest.Create('parrot_neuron')
nrn_post1 = nest.Create('iaf_psc_delta')
nrn_post2 = nest.Create('pp_psc_delta')
nest.Connect(nrn_pre, nrn_post1 + nrn_post2,
syn_spec={'model': 'std... |
import re
import time
import datetime
from Parser import Parser
from Repository import Commit, Action, Person
from utils import printout, printdbg
class GitParser(Parser):
class GitCommit:
def __init__(self, commit, parents):
self.commit = commit
self.parents = parents
se... |
from hermes2d import (Mesh, MeshView, H1Shapeset, PrecalcShapeset, H1Space,
LinSystem, Solution, ScalarView, WeakForm, DummySolver)
from hermes2d.examples.c04 import set_bc
from hermes2d.examples import get_example_mesh
from hermes2d.forms import set_forms
INIT_REF_NUM = 2 # number of initial uniform me... |
"""Editor window that can serve as an output file.
"""
import re
from tkinter import messagebox
from idlelib.editor import EditorWindow
file_line_pats = [
# order of patterns matters
r'file "([^"]*)", line (\d+)',
r'([^\s]+)\((\d+)\)',
r'^(\s*\S.*?):\s*(\d+):', # Win filename, maybe starting with space... |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
import decimal
import re
__EXPR = re.compile(r"ORDER BY\s(\w+\.(?P<column_1>\w+)(\s+\w+)?)"
r"(,\s+\w+\.(?P<column_2>\w+)(\s+\w+)?)?"
r"(,\s+\w+\.(?P<column_3>\w+)(\s+\w+)?)?"
r"(,\s+\w+\.(?P<column_4>\w+)(\s+\w+)?)?"
r"(,\s+\w+\.(?P<column... |
"""Parsing API Discovery document."""
import mock_api_types
from gcutil_lib import mock_api_types
class Parser(object):
"""Discovery document parser.
Parses discovery document types, resources and methods. Result of parsing is a
dictionary method_id -> method.
"""
__slots__ = ('_discovery_document', '_parsed_... |
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.0'
}
DOCUMENTATION = '''
---
module: bigip_iapp_service
short_description: Manages TCL iApp services on a BIG-IP.
description:
- Manages TCL iApp services on a BIG-IP.
version_added: "2.4"
options:
name:
... |
import pygame
from pygame import gfxdraw
from .rangable import Rangable
import random
class Pizza(Rangable):
"""docstring for Pizza"""
def __init__(self, context):
Rangable.__init__(self)
self.context = context
self.pizza = self.context.plain_pizza
self.trashed = False
se... |
import sys
file = sys.argv[1]
f = open(file)
print '''
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">
'''
try:
... |
"""Contain utils for ROOT command line tools"""
from contextlib import contextmanager
import os
import sys
def fileno(file_or_fd):
"""
Look for 'fileno' attribute.
"""
fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)()
if not isinstance(fd, int):
raise ValueError("Expected a file (`.fi... |
"""Parsing and conversion of NTP dates contained in datagrams."""
import datetime
import struct
import time
IMMEDIATELY = struct.pack('>q', 1)
_SYSTEM_EPOCH = datetime.date(*time.gmtime(0)[0:3])
_NTP_EPOCH = datetime.date(1900, 1, 1)
_NTP_DELTA = (_SYSTEM_EPOCH - _NTP_EPOCH).days * 24 * 3600
class NtpError(Exception):
... |
"""Keras estimator API."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.tf_export import tf_export
try:
import tensorflow.python.estimator.keras as keras_lib # pylint: disable=g-import-not-at-top
model_to_estimator = tf_exp... |
"""
Copyright 2014 The Trustees of Princeton University
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 ... |
DJANGO_APPS = ['filebrowser']
NICE_NAME = "File Browser"
REQUIRES_HADOOP = False
ICON = "/filebrowser/static/art/icon_filebrowser_24.png"
MENU_INDEX = 20 |
"""Test configs for relu."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
... |
import random
import string
import subprocess
import sys
import re
from cli_test_parameters import CLITestParameters
class CLITest:
def __init__(self):
pass
@staticmethod
def check_description(test_case, cli):
parameters = CLITestParameters()
test_case.assertEqual(parameters.get_valu... |
"""
Defines some base class related to managing green threads.
"""
from __future__ import absolute_import
import abc
from collections import OrderedDict
import logging
import socket
import time
import traceback
import weakref
import netaddr
import six
from ryu.lib import hub
from ryu.lib import sockopt
from ryu.lib i... |
"""Providers sub-commands"""
import re
from airflow.cli.simple_table import AirflowConsole
from airflow.providers_manager import ProvidersManager
from airflow.utils.cli import suppress_logs_and_warning
def _remove_rst_syntax(value: str) -> str:
return re.sub("[`_<>]", "", value.strip(" \n."))
@suppress_logs_and_war... |
import m5.objects
import inspect
import sys
from textwrap import TextWrapper
_mem_classes = {}
_mem_aliases_all = [
("simple_mem", "SimpleMemory"),
("ddr3_1600_x64", "DDR3_1600_x64"),
("lpddr2_s4_1066_x32", "LPDDR2_S4_1066_x32"),
("lpddr3_1600_x32", "LPDDR3_1600_x32"),
("wio_200_x128", "WideIO_200_... |
from . import errordocument
from . import recursive
from . import static |
import subprocess
import sys
import os
import shutil
import gzip
os_suffix = '.exe'
build_dir = os.path.join('build', 'Debug_x64')
def run_deqp(deqp_exe):
subprocess.call([deqp_exe, '--deqp-runmode=txt-caselist', '--deqp-gl-context-type=null'])
script_dir = os.path.dirname(sys.argv[0])
path_to_deqp_exe = os.path.jo... |
"""
sentry.templatetags.sentry_activity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from django import template
from django.utils.html import escape,... |
from mock import Mock
from django.test import TestCase
from opbeat.events import Message
class MessageTest(TestCase):
def test_to_string(self):
unformatted_message = 'My message from %s about %s'
client = Mock()
message = Message(client)
message.logger = Mock()
data = {
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DefinedGeography'
db.create_table('seak_definedgeography', (
('id', self.gf('django.db.models.fields.AutoFi... |
"""Constraints definition for minimize."""
from __future__ import division, print_function, absolute_import
import numpy as np
from ._hessian_update_strategy import BFGS
from ._differentiable_functions import (
VectorFunction, LinearVectorFunction, IdentityVectorFunction)
from .optimize import OptimizeWarning
from ... |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.fields
import olympia.amo.models
import olympia.amo.validators
import olympia.users.models
class Migration(migrations.Migration):
i... |
"""Generated client library for fusiontables version v1."""
from apitools.base.py import base_api
from samples.fusiontables_sample.fusiontables_v1 import fusiontables_v1_messages as messages
class FusiontablesV1(base_api.BaseApiClient):
"""Generated client library for service fusiontables version v1."""
MESSAGES_MO... |
import sys
from mock import patch
from pip import pep425tags
class TestPEP425Tags(object):
def mock_get_config_var(self, **kwd):
"""
Patch sysconfig.get_config_var for arbitrary keys.
"""
import pip.pep425tags
get_config_var = pip.pep425tags.sysconfig.get_config_var
d... |
import string
import numpy
import six
import cupy
from cupy import carray
from cupy import cuda
from cupy import util
six_range = six.moves.range
six_zip = six.moves.zip
def _get_simple_elementwise_kernel(
params, operation, name, preamble,
loop_prep='', after_loop='', options=()):
module_code = str... |
"""Contains routines for printing protocol messages in text format."""
import cStringIO
import re
from collections import deque
from google.net.proto2.python.internal import type_checkers
from google.net.proto2.python.public import descriptor
__all__ = [ 'MessageToString', 'PrintMessage', 'PrintField',
'Pri... |
from __future__ import print_function
import sys
print('preprocess_trace.py:', sys.argv)
cppind = []
bsvind = []
for filename in sys.argv[2:]:
data = open(filename).readlines()
hasdisplay = False
hasdispind = False
for line in data:
if line.find('$display') >= 0:
hasdisplay = True
... |
connect('@WL_USR@','@WL_PWD@','t3://@WL_HOST@:@WL_PORT@')
edit()
startEdit()
delete('@DS_NAME@','JDBCSystemResource')
delete('@NON_JTA_DS_NAME@','JDBCSystemResource')
save()
activate()
exit() |
import GemRB
from GUIDefines import *
import CommonTables
ClassWindow = 0
TextAreaControl = 0
DoneButton = 0
BackButton = 0
ClassCount = 0
HasSubClass = 0
ClassID = 0
def AdjustTextArea():
global HasSubClass, ClassID
Class = GemRB.GetVar("Class")-1
TextAreaControl.SetText(CommonTables.Classes.GetValue(Class,1) )
Cl... |
"""Test the LD_X_decr opcode.
"""
import base_test
from registers import Reg, SREG
class LD_X_decr_TestFail(base_test.TestFail): pass
class base_LD_X_decr(base_test.opcode_test):
"""Generic test case for testing LD_X_decr opcode.
LD_X_decr - Load Indirect from data space to Register using index X and
pre decrement X... |
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure to have them installed when using this script.
Th... |
from ipaclient.frontend import MethodOverride
from ipalib import errors
from ipalib import Flag
from ipalib import util
from ipalib.plugable import Registry
from ipalib import _
from ipalib import x509
register = Registry()
@register(override=True, no_fail=True)
class user_del(MethodOverride):
def get_options(self)... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: firewalld
short_description: Manage arbitrary ports/services w... |
import datetime
import hashlib
from scrapy_proj.helpers import *
class SanatatePipelineExtraMeta(object):
def process_item(self, item, spider):
item['institution'] = spider.name
act_type = LegalHelper.get_type_from_title(item['title'])
if act_type == None:
raise scrapy.exceptions... |
""" Tests for commerce views. """
from common.djangoapps.student.tests.factories import UserFactory
class UserMixin:
""" Mixin for tests involving users. """
def setUp(self):
super().setUp()
self.user = UserFactory()
def _login(self):
""" Log into LMS. """
self.client.login(u... |
from odoo import api, fields, models
class HrPlanWizard(models.TransientModel):
_name = 'hr.plan.wizard'
_description = 'Plan Wizard'
plan_id = fields.Many2one('hr.plan', default=lambda self: self.env['hr.plan'].search([], limit=1))
employee_id = fields.Many2one(
'hr.employee', string='Employee'... |
test_records = [
[{
"doctype": "Price List",
"price_list_name": "_Test Price List",
"currency": "INR",
"valid_for_all_countries": 1
}]
] |
from spack import *
class PyNbformat(PythonPackage):
"""The Jupyter Notebook format"""
homepage = "https://github.com/jupyter/nbformat"
url = "https://github.com/jupyter/nbformat/archive/4.1.0.tar.gz"
version('4.1.0', '826b4fc4ec42553b20144f53b57b4e7b')
version('4.0.1', 'ab7172e517c9d561c0c01ee... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unsmuggle_url,
)
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
class SenateISVPIE(InfoExtractor):
_COMM_MAP = [
['ag', '76440', 'http://ag-f.akamaihd.net'],
... |
"""Test LRUCache by running different input batch sizes on same network."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python... |
"""SynologyChat platform for notify component."""
from http import HTTPStatus
import json
import logging
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SS... |
"""
A registry module for registering alert methods.
"""
from django.db import models
from method_base import AlertMethodBase
class MethodRegistry(dict):
"""
Dict with methods for handling method registration.
"""
def unregister(self, name):
method = self[name]
del self[name]
def reg... |
"""
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 this ... |
import mock
from oslo.config import cfg
from neutron.common import exceptions
from neutron.openstack.common import uuidutils
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.api_client import version as version_module
from neutron.plugins.vmware.common import exceptions as ... |
"""For seeding individual ops based on a graph-level seed.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
_DEFAULT_GRAPH_SEED = 87654321
def get_seed(op_seed):
"""Returns the local seeds an operation should u... |
import mock
import six
from heat.common import exception
from heat.common import template_format
from heat.engine.clients.os import sahara
from heat.engine.resources.openstack.sahara import job_binary
from heat.engine import scheduler
from heat.tests import common
from heat.tests import utils
job_binary_template = """
... |
"""A template to define composite ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from absl import app
from tensorflow.compiler.mlir.tfr.python.composite import Composite
from tensorflow.compiler.mlir.tfr.python.op_reg_gen import ... |
"""
The I{2nd generation} service proxy provides access to web services.
See I{README.txt}
"""
import suds
import suds.metrics as metrics
from cookielib import CookieJar
from suds import *
from suds.reader import DefinitionsReader
from suds.transport import TransportError, Request
from suds.transport.https import HttpA... |
import sqlalchemy as sa
from solum.objects import infrastructure_stack as abstract
from solum.objects.sqlalchemy import models as sql
class InfrastructureStack(sql.Base, abstract.InfrastructureStack):
"""Represent an infrastructure_stack in sqlalchemy."""
__tablename__ = 'infrastructure_stack'
__resource__ ... |
import unittest
import GafferUI
import GafferUITest
class ProgressBarTest( GafferUITest.TestCase ) :
def testConstructor( self ) :
b = GafferUI.ProgressBar()
self.assertEqual( b.getRange(), ( 0, 100 ) )
self.assertEqual( b.getProgress(), 0 )
self.assertEqual( b.getText(), "%p%" )
b = GafferUI.ProgressBar( 10... |
from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.ba... |
import base64
import copy
import logging
import re
import shlex
import sys
import time
import os
from webkitpy.common.system import path
from webkitpy.common.system.profiler import ProfilerFactory
_log = logging.getLogger(__name__)
DRIVER_START_TIMEOUT_SECS = 30
class DriverInput(object):
def __init__(self, test_na... |
import numpy as np
from .mixin import TransformerMixin
from .. import pick_types
from ..filter import (low_pass_filter, high_pass_filter, band_pass_filter,
band_stop_filter)
from ..time_frequency import multitaper_psd
from ..externals import six
from ..utils import _check_type_picks, deprecated
cl... |
"""Command for listing Cloud CDN cache invalidations."""
import sys
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute import constants
from googlecloudsdk.api_lib.compute import request_helper
from googlecloudsdk.api_lib.compute import utils
from googlecloudsdk.calliope import ... |
import os
import glob
from automation.utilities.const import COMMAND_MODULE_PREFIX, EXTENSIONS_MOD_PREFIX
def get_repo_root():
"""Returns the path to the source code root directory"""
current_dir = os.path.dirname(os.path.abspath(__file__))
while not os.path.exists(os.path.join(current_dir, 'CONTRIBUTING.rs... |
import attr
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.widget import View, Select
from widgetastic_manageiq import (
Accordion, BaseEntitiesView, BootstrapSelect, BreadCrumb, ItemsToolBarViewSelector,
ManageIQTree, SummaryTable, Text, TextInput)
from widgetastic_patternfly imp... |
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
**************... |
"""Api serving config collection service implementation.
Contains the implementation for BackendService as defined in api_backend.py.
"""
try:
import json
except ImportError:
import simplejson as json
import logging
from endpoints import api_backend
from endpoints import api_config
from endpoints import api_excepti... |
from pootle_app.models.suggestion import Suggestion
from pootle_app.models.directory import Directory
from pootle_app.models.permissions import PermissionSet
__all__ = ["Suggestion", "Directory", "PermissionSet"] |
import re
import urlparse
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class Keep2ShareCc(SimpleHoster):
__name__ = "Keep2ShareCc"
__type__ = "hoster"
__version__ = "0.25"
__status__ = "testing"
__pattern_... |
"""
This script checks HighGUI's cvGetCaptureProperty functionality for correct return
of the frame width and height of an .avi file containing uncompressed 32bit Bitmap frames.
"""
TESTNAME = "size_bmp32"
REQUIRED = []
import sys
import works
import size_test
if not works.check_files(REQUIRED,TESTNAME):
sys.exit(77)
... |
'''Test cases for QLayout handling of child widgets references'''
import unittest
from sys import getrefcount
from PySide.QtGui import QHBoxLayout, QVBoxLayout, QGridLayout, QWidget
from PySide.QtGui import QStackedLayout, QFormLayout
from PySide.QtGui import QApplication, QPushButton, QLabel
from helper import UsesQAp... |
from __future__ import print_function, division
import random
from itertools import permutations
import numpy as np
from scipy.stats.distributions import vonmises
import pickle
import tempfile
from sklearn.pipeline import Pipeline
from msmbuilder.example_datasets import AlanineDipeptide
from msmbuilder.featurizer impor... |
import unittest
from org.o3project.odenos.core.component.network.topology.port import Port
class PortTest(unittest.TestCase):
def setUp(self):
self.target = Port('Port', '1', 'PortId', 'NodeId', 'OutLink',
'InLink', {'Key': 'Val'})
def tearDown(self):
pass
def test... |
"""Tests for the private `_AutoShardDataset` transformation."""
import os
from absl.testing import parameterized
from tensorflow.core.example import example_pb2
from tensorflow.core.example import feature_pb2
from tensorflow.python.data.experimental.ops import cardinality
from tensorflow.python.data.experimental.ops im... |
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
class EndpointsClient(rest_client.RestClient):
api_version = "v2.0"
def create_endpoint(self, service_id, region_id, **kwargs):
"""Create an endpoint for service."""
post_body = {
'service_id'... |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
import six
from cassandra.cqlengine.operators import EqualsOperator
from cassandra.cqlengine.statements import StatementException, WhereClause
class TestWhereClause(unittest.TestCase):
def test_operator_check(self):
""" te... |
"""Vizio SmartCast Device support."""
from datetime import timedelta
import logging
from typing import Any, Callable, Dict, List, Optional, Union
from pyvizio import VizioAsync
from pyvizio.api.apps import find_app_name
from pyvizio.const import APP_HOME, INPUT_APPS, NO_APP_RUNNING, UNKNOWN_APP
from homeassistant.compo... |
from socket import *
FILE = 'unix-socket'
s = socket(AF_UNIX, SOCK_STREAM)
s.connect(FILE)
s.send('Hello, world')
data = s.recv(1024)
s.close()
print 'Received', repr(data) |
class Solution:
# @param prices, a list of integer
# @return an integer
def maxProfit(self, prices):
if not prices:
return 0
n = len(prices)
m1 = [0] * n
m2 = [0] * n
max_profit1 = 0
min_price1 = prices[0]
max_profit2 = 0
max_price2... |
from flask import Blueprint, render_template, jsonify
from flask_website.utils import request_wants_json
from flask_website.listings.projects import projects
mod = Blueprint('community', __name__, url_prefix='/community')
@mod.route('/')
def index():
return render_template('community/index.html')
@mod.route('/irc/'... |
import pingo
'''
In order to use this set of cases, it is necessary to set
the following attributes on your TestCase setUp:
self.analog_input_pin_number = 0
self.expected_analog_input = 1004
self.expected_analog_ratio = 0.98
'''
class AnalogReadBasics(object):
'''
Wire a 10K Ohm resistence from ... |
f = open("pixels.dat", "r")
pixs = f.readline()
f.close()
print len(pixs)
from PIL import Image
import numpy as np
img = Image.new('RGB', (160, 210), "black") # create a new black image
pixels = img.load() # create the pixel map
from grayscale import getGrayscaleArray
colMat = getGrayscaleArray()
for i in range(len(p... |
"""
Tests for support views.
"""
import itertools
import json
import re
from datetime import datetime, timedelta
import ddt
import pytest
from django.contrib.auth.models import User
from django.urls import reverse
from django.db.models import signals
from nose.plugins.attrib import attr
from pytz import UTC
from common... |
"""
:class:`~xblock.field_data.FieldData` subclasses used by the LMS
"""
from xblock.field_data import ReadOnlyFieldData, SplitFieldData
from xblock.fields import Scope
def lms_field_data(authored_data, student_data):
"""
Returns a new :class:`~xblock.field_data.FieldData` that
reads all UserScope.ONE and U... |
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import uuid
from sockjs.tornado import SockJS... |
"""
Test if global editor and global reader role has the permission to access
the workflow objects, owned by Admin.
"""
from ggrc_workflows.models import Workflow
from ggrc_workflows.models import WorkflowPerson
from ggrc_workflows.models import TaskGroup
from ggrc_workflows.models import TaskGroupObject
from ggrc_work... |
"""
Shared code between AMQP based openstack.common.rpc implementations.
The code in this module is shared between the rpc implemenations based on AMQP.
Specifically, this includes impl_kombu and impl_qpid. impl_carrot also uses
AMQP, but is deprecated and predates this code.
"""
import collections
import inspect
impo... |
from test import test_support
import unittest
import sys
import difflib
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
def arigo_example():
x = 1
del x
while 0:
pass
x = 1
arigo_example.events = [(0, 'call'),
... |
import threading
from ggrc import db
from ggrc.app import app
from ggrc.models import create_db, drop_db
from wsgiref.simple_server import make_server
from ggrc import settings
use_migrations = True
def before_all(context):
context.base_url = 'http://localhost:9000'
create_db(use_migrations)
app.debug = False
a... |
import re
from oslo.config import cfg
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.openstack.common import strutils
from nova import utils
from nova.virt import driver
CONF = cfg.CONF
CONF.import_opt('default_ephemeral_format', 'n... |
from amo.utils import chunked
from mkt.developers.tasks import generate_image_assets
from mkt.webapps.models import Webapp
def run():
for chunk in chunked(Webapp.objects.all(), 50):
for app in chunk:
try:
generate_image_assets.delay(app)
except Exception:
... |
import sys
from . import constants
from .constants import eStart, eError, eItsMe
from .charsetprober import CharSetProber
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8SMModel
ONE_CHAR_PROB = 0.5
class UTF8Prober(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
... |
from __future__ import absolute_import, unicode_literals
import os
import json
from .util import u, slugify
import codecs
def get_tags_count(journal):
"""Returns a set of tuples (count, tag) for all tags present in the journal."""
# Astute reader: should the following line leave you as puzzled as me the first t... |
import sys
import os
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idlelib import Replac... |
from msrest.serialization import Model
class FlowLogStatusParameters(Model):
"""Parameters that define a resource to query flow log status.
:param target_resource_id: The target resource where getting the flow
logging status.
:type target_resource_id: str
"""
_validation = {
'target_res... |
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Authors:
Jekkay Hu | jekkay<@>gmail.com
Daniel Garcia Garcia a.k.a cr0hn | cr0hn<@>cr0hn.com
Mario Vilas | mvilas<@>gmail.com
Golismero project site: http://golismero-project.com
Golismero project mail: contact@golismero-project.com
This pr... |
"""
Site: http://www.beebeeto.com/
Framework: https://github.com/n0tr00t/Beebeeto-framework
"""
import time
import struct
import random
import socket
import select
import urlparse
from baseframe import BaseFrame
from utils.common.str import hex_dump
class MyPoc(BaseFrame):
poc_info = {
# poc相关信息
'po... |
ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: osx_defaults
author: Franck Nijhof (@frenck)
short_description: osx_defaults allows users to read, write, and delete Mac OS X user defaults from Ansib... |
"""Miscellaneous network utility code."""
from __future__ import absolute_import, division, print_function, with_statement
import errno
import os
import platform
import socket
import stat
from tornado.concurrent import dummy_executor, run_on_executor
from tornado.ioloop import IOLoop
from tornado.platform.auto import s... |
from m1 import <error descr="Cannot find reference 'foo' in 'm1.pyi'">foo</error>
from m1 import <error descr="Cannot find reference 'bar' in 'm1.pyi'">bar</error>
from m1 import bar_imported
from m1 import <error descr="Cannot find reference 'm2' in 'm1.pyi'">m2</error>
from m1 import m2_imported
print(foo, bar, bar_i... |
'''
Full setup, used to distribute the debugger backend to PyPi.
Note that this is mostly so that users can do:
pip install pydevd
in a machine for doing remote-debugging, as a local installation with the IDE should have
everything already distributed.
Reference on wheels:
https://hynek.me/articles/sharing-your-labor-o... |
from tests.integration import use_singledc, PROTOCOL_VERSION
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from cassandra import InvalidRequest
from cassandra.cluster import Cluster
from cassandra.query import PreparedStatement, UNSET_VALUE
def setup_module():
use_singledc()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.