code stringlengths 1 199k |
|---|
from core import FM
from core.FMOperation import FMOperation
class CopyFiles(FM.BaseAction):
def __init__(self, request, paths, session, target, overwrite, **kwargs):
super(CopyFiles, self).__init__(request=request, **kwargs)
self.paths = paths
self.session = session
self.target = ta... |
from hyperspy import messages
from hyperspy.io_plugins import (msa, digital_micrograph, fei, mrc,
ripple, tiff)
io_plugins = [msa, digital_micrograph, fei, mrc, ripple, tiff]
try:
from hyperspy.io_plugins import netcdf
io_plugins.append(netcdf)
except ImportError:
pass
#... |
"""CSS selector structure items."""
import copyreg
from collections.abc import Hashable, Mapping
__all__ = (
'Selector',
'SelectorNull',
'SelectorTag',
'SelectorAttribute',
'SelectorContains',
'SelectorNth',
'SelectorLang',
'SelectorList',
'Namespaces',
'CustomSelectors'
)
SEL_EM... |
'''just a annoying dummy to get rid of Gtk2 and Gtk3 incompatibilities'''
from infrapix import infrapix
import sys
infrapix.ndvi(sys.argv[1],sys.argv[2], show_histogram = True,) |
"""
InaSAFE Disaster risk assessment tool developed by AusAid **Messaging styles.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 ve... |
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QDialog, QVBoxLayout, QPlainTextEdit, QTimer, \
QDialogButtonBox, QPushButton, QApplication, QIcon, QMessageBox
def step_dialog(parent,... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: ovirt_quota_facts
short_description: Retrieve facts about one or more oVirt/RHV quotas
version_added: "2.3"
author: "Red Hat"
description:
- "Ret... |
import re
from core import logger
from core import scrapertools
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("( page_url='%s')")
video_urls = []
itemlist = []
data1 = ''
data2 = ''
url = ''
alerta = '[filesmonster premium]'
enlace = "no... |
"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any lat... |
__author__ = 'ztorstri'
from etlExceptions import * |
"""Fixes bug 970406 - add raw_adi_logs table
Revision ID: 32b54dec3fc0
Revises: 1ab8d5514ce2
Create Date: 2014-06-12 11:47:19.398882
"""
revision = '32b54dec3fc0'
down_revision = '1ef041dfc3d5'
from alembic import op
from socorrolib.lib import citexttype, jsontype, buildtype
from socorrolib.lib.migrations import fix_pe... |
from __future__ import absolute_import, print_function, unicode_literals, division
from flask import request
from werkzeug.exceptions import HTTPException
import logging
from jormungandr.new_relic import record_exception
__all__ = ["RegionNotFound", "DeadSocketException", "ApiNotFound", "InvalidArguments"]
def format_e... |
import logging
from flask_babel import lazy_gettext
import superdesk
from .broadcast import ArchiveBroadcastResource, ArchiveBroadcastService, ARCHIVE_BROADCAST_NAME
logger = logging.getLogger(__name__)
def init_app(app) -> None:
endpoint_name = ARCHIVE_BROADCAST_NAME
service = ArchiveBroadcastService(endpoint_... |
from . import stock_move
from . import product_product |
from django.contrib import admin
from alert.donate.models import Donation
from alert.userHandling.models import UserProfile
class DonorInline(admin.TabularInline):
model = UserProfile.donation.through
max_num = 1
raw_id_fields = (
'userprofile',
)
class DonationAdmin(admin.ModelAdmin):
reado... |
import requests
import json
misperrors = {'error': 'Error'}
mispattributes = {'input': ['md5', 'sha1', 'sha256', 'domain', 'url', 'email-src', 'ip-dst|port', 'ip-src|port'], 'output': ['text']}
moduleinfo = {'version': '0.1', 'author': 'Corsin Camichel', 'description': 'Module to search for an IOC on ThreatFox by abuse... |
"""
This creates Django signals that automatically update the elastic search Index
When an item is created, a signal is thrown that runs the create / update index API of the Search Manager
When an item is deleted, a signal is thrown that executes the delete index API of the Search Manager
This way the Policy compass da... |
"""
Views - Index - Tests
"""
from instance.tests.base import WithUserTestCase
class IndexViewsTestCase(WithUserTestCase):
"""
Test cases for views
"""
def test_index_unauthenticated(self):
"""
Index view - Unauthenticated users go to login page
"""
response = self.client... |
'''
Set of moment tensor utility functions
'''
import numpy as np
from math import fabs, log10, sqrt, acos, atan2, pi
def tensor_components_to_use(mrr, mtt, mpp, mrt, mrp, mtp):
'''
Converts components to Up, South, East definition
USE = [[mrr, mrt, mrp],
[mtt, mtt, mtp],
[mrp, mtp, mp... |
from __future__ import absolute_import
from tests.integration.base_test import PollBaseTest
from unittest import skip
class TestSubmitButton(PollBaseTest):
@skip("Flaky test")
def test_submit_button(self):
"""
Goal: We have to make sure that submit button gets disabled right
after it is ... |
from openerp.osv import orm
import time
class SaleOrder(orm.Model):
_inherit = 'sale.order'
def action_wait(self, cr, uid, ids, context=None):
product_obj = self.pool['product.product']
res = super(SaleOrder, self).action_wait(cr, uid, ids, context)
for o in self.browse(cr, uid, ids, con... |
"""
A wxValidator that matches APDU in hexadecimal such as:
A4 A0 00 00 02
A4A0000002
__author__ = "http://www.gemalto.com"
Copyright 2001-2010 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file is part of pyscard.
pyscard is free software; you can redistribute it and/or modify
... |
'''
fit best estimate of magnetometer offsets, trying to take into account motor interference
'''
import sys, time, os, math
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--no-timestamps",dest="notimestamps", action='store_true', help="Log doesn't have timestamps"... |
"""
This module defines the :class:`FeatureArtist` class, for drawing
:class:`Feature` instances with matplotlib.
"""
from __future__ import (absolute_import, division, print_function)
import warnings
import weakref
import matplotlib.artist
import matplotlib.collections
import cartopy.mpl.patch as cpatch
class FeatureA... |
from jinja2 import Template
import sys
tmpl = """
{% for link in links %}
{{ loop.index0 }}: <a href="{{link.href}}">{{link.name}}</a>
{{ loop.index }}: <a href="{{link.href}}">{{link.name}}</a>
{% endfor %}
"""
if __name__ == '__main__':
links = [
{'name': 'Google', 'href': 'https://www.google.com'},
{'name'... |
'''
Specto Add-on
Copyright (C) 2015 lambda
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.
This pro... |
#!/usr/bin/env python
"""User friendly / multi platform builder script"""
import argparse
import datetime
import glob
import logging
import os
import platform
import shutil
import sys
import time
from distutils.dir_util import copy_tree
from enum import Enum
from subprocess import check_call
from util import *
KNOWN_V... |
"""Draws DAG in ASCII."""
import logging
import os
import pydoc
import sys
from rich.pager import Pager
from dvc.env import DVC_PAGER
from dvc.utils import format_link
logger = logging.getLogger(__name__)
DEFAULT_PAGER = "less"
LESS = "LESS"
PAGER_ENV = "PAGER"
def prepare_default_pager(
clear_screen: bool = False,... |
'''
Module to share configuration information across modules.
This global object is used through out to store and retreive configuration.
This is to avoid passing gConfig as variables throughout.
All the configurations needed are added in ezReverseProxy.
'''
import sys
import os
import time
from gevent.queue import Joi... |
"""Module for testing commands that remove virtual hardware."""
import unittest
if __name__ == "__main__":
import utils
utils.import_depends()
from brokertest import TestBrokerCommand
class TestDel10GigHardware(TestBrokerCommand):
def test_200_del_hosts(self):
for i in range(0, 8) + range(9, 17):
... |
from __future__ import print_function
from phoenix_utils import tryDecode
import os
import subprocess
import sys
import phoenix_utils
phoenix_utils.setPath()
args = phoenix_utils.shell_quote(sys.argv[1:])
hbase_config_path = phoenix_utils.hbase_conf_dir
java_home = os.getenv('JAVA_HOME')
hbase_env_path = None
hbase_env... |
"""
Copyright 2013 LinkedIn Corp. 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 agreed to in... |
"""Tests for parsers.py"""
import asyncio
import unittest
import unittest.mock
from aiohttp import errors
from aiohttp import parsers
class StreamParserTests(unittest.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(self):
self.lines_parser = parsers.LinesParser()
self.loop = asyncio.new_eve... |
import contextlib
import ftplib
import os
import uuid
import paramiko
from nova.openstack.common import log as logging
from nova.openstack.common import processutils
from nova.virt.powervm import constants
from nova.virt.powervm import exception
LOG = logging.getLogger(__name__)
class Connection(object):
def __init... |
import random
from six import moves
import testtools
from tempest.api.object_storage import base
from tempest import clients
from tempest.common import custom_matchers
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
class AccountTest(base.BaseObjectTest... |
from traits.api import Float, Tuple
from pychron.core.helpers.strtools import csv_to_ints
from pychron.hardware.axis import Axis
MAPPING = dict(
acceleration="HA",
deceleration="HD",
# emergency_deceleration = 'HE',
jerk="HJ",
velocity="HV",
axes="HN",
)
class NewportGroup(Axis):
# accelerat... |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import hashlib
import csv
from product_spiders.items i... |
from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.neutron import neutron
from heat.engine import support
from heat.engine import translation
class Listener(neutro... |
import nsiqcppstyle_checker
import unittest
import nsiqcppstyle_rulemanager
import nsiqcppstyle_reporter
import nsiqcppstyle_state
errors = []
def AddError(err):
errors.append(err)
def CheckErrorContent(msg):
for err in errors :
if err[1] == msg :
return True
return False
def MockError(t... |
import tarfile
from urllib import quote, unquote
from xml.sax import saxutils
from swift.common.swob import Request, HTTPBadGateway, \
HTTPCreated, HTTPBadRequest, HTTPNotFound, HTTPUnauthorized, HTTPOk, \
HTTPPreconditionFailed, HTTPRequestEntityTooLarge, HTTPNotAcceptable, \
wsgify
from swift.common.utils... |
"""
Drop-in replacement for django.contrib.messages which handles Horizon's
messaging needs (e.g. AJAX communication, etc.).
"""
from django.contrib import messages as _messages
from django.contrib.messages import constants
from django.utils.encoding import force_unicode # noqa
from django.utils.safestring import Safe... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kubern... |
import simplejson as json
import os
import time
import logging
import traceback
import sys
from oslo_config import cfg
from yabgp.common import constants as bgp_cons
from yabgp.handler import BaseHandler
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
MSG_PROCESS_OPTS = [
cfg.BoolOpt('write_disk',
... |
import base64
import zlib
from google.protobuf import descriptor_pb2
FILE_DESCRIPTOR_SET = descriptor_pb2.FileDescriptorSet()
FILE_DESCRIPTOR_SET.ParseFromString(zlib.decompress(base64.b64decode(
'eJzlvX10ZFd1J0pVqaTSbbV0VN2222o3fV3+aKktVbvbxoY2xqOW5LZMd6unpIaYGSyuqq6kcp'
'fqirpVLcuBlWQyhI98vEcAY+eBSfgyMQFCgCQD... |
__author__ = "João Magalhães <joamag@hive.pt>"
""" The author(s) of the module """
__version__ = "1.0.0"
""" The version of the module """
__revision__ = "$LastChangedRevision$"
""" The revision number of the module """
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright... |
import os
from flask import Blueprint, make_response, send_file
from flask import jsonify, request, abort
from werkzeug import secure_filename
from muranorepository.utils.parser import ManifestParser
from muranorepository.utils.archiver import Archiver
from muranorepository.consts import DATA_TYPES, MANIFEST
from oslo.... |
import sys
import os
import shutil
import errno
sys.path.insert(0, os.path.abspath('.'))
shutil.rmtree(
"%s/reference/api" % os.path.dirname(os.path.abspath(__file__)), ignore_errors=True)
shutil.rmtree(
"%s/reference/pyspark.pandas/api" % os.path.dirname(os.path.abspath(__file__)),
ignore_errors=True)
try:... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param ip_other_block_alloc: {"optional": true, "size": "8", "type": "number", "oid": "17", "format": "counter"}
:param entry_match_drop: {"optional": true, "size"... |
"""Networks package definition."""
from REDACTED.tf2_bert.modeling.networks.albert_transformer_encoder import AlbertTransformerEncoder
from REDACTED.tf2_bert.modeling.networks.classification import Classification
from REDACTED.tf2_bert.modeling.networks.encoder_scaffold import EncoderScaffold
from REDACTED.tf2_bert.mod... |
"""This library brings support for forked_daapd to Home Assistant."""
import asyncio
from collections import defaultdict
import logging
from pyforked_daapd import ForkedDaapdAPI
from pylibrespot_java import LibrespotJavaAPI
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.component... |
from django.utils.translation import ugettext_lazy as _
from glanceclient import exc
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
def str2bool(value):
"""Convert a string value to boolean
"""
return value.lower() in ("yes", "true",... |
from collections import OrderedDict
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from horizon import tables
from horizon import tabs
from horizon.utils im... |
from nova.objects import base as obj_base
from nova.objects import fields
EVENT_NAMES = [
# Network has changed for this instance, rebuild info_cache
'network-changed',
# VIF plugging notifications, tag is port_id
'network-vif-plugged',
'network-vif-unplugged',
]
EVENT_STATUSES = ['failed', 'complet... |
'''
FanFilm Add-on
Copyright (C) 2015 lambda
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.
This pr... |
import pwsimple
def InitViewState (cameraFocalPoint, cameraPosition, colorArrayName, colorMap, sofPoints, viewSize):
if type(colorArrayName) is unicode:
colorArrayName = colorArrayName.encode('ascii', 'ignore')
activeView = pwsimple.CreateIfNeededRenderView()
activeView.CameraFocalPoint = cameraFocalPoint
a... |
from trt_layer_auto_scan_test import TrtLayerAutoScanTest, SkipReasons
from program_config import TensorConfig, ProgramConfig
import numpy as np
import paddle.inference as paddle_infer
from functools import partial
from typing import Optional, List, Callable, Dict, Any, Set
import unittest
class TrtConvertGroupNormTest... |
import sys
from neutronclient.neutron.v2_0.qos import rule as qos_rule
from neutronclient.tests.unit import test_cli20
class CLITestV20QoSRuleJSON(test_cli20.CLITestV20Base):
non_admin_status_resources = ['bandwidth_limit_rule', 'dscp_marking_rule']
def setUp(self):
super(CLITestV20QoSRuleJSON, self).se... |
import base64
import copy
import json
import os
import sys
import threading
BOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(
0,
os.path.join(os.path.dirname(BOT_DIR), '..', '..', '..', 'client', 'tests'))
import httpserver
sys.path.pop(0)
sys.path.insert(0, os.path.join(os.path.dirname(BOT_... |
"""Tests for mfcc_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import random_... |
import pickle
import pytest
import pyarrow as pa
import pyarrow.types as types
MANY_TYPES = [
pa.null(),
pa.bool_(),
pa.int32(),
pa.time32('s'),
pa.time64('us'),
pa.date32(),
pa.timestamp('us'),
pa.timestamp('us', tz='UTC'),
pa.timestamp('us', tz='Europe/Paris'),
pa.float16(),
... |
# coding: utf-8
import sys
import datetime
import unittest
from requests import Session
from azure.storage import (
AccessPolicy,
SharedAccessPolicy,
SignedIdentifier,
SignedIdentifiers,
)
from azure.storage.queue import (
QueueService,
QueueSharedAccessPermissions,
)
from azure.common import (... |
"""
Support for Eneco Slimmer stekkers (Smart Plugs).
This provides controls for the z-wave smart plugs Toon can control.
"""
import logging
from homeassistant.components.switch import SwitchDevice
import custom_components.toon as toon_main
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devi... |
"""Contains the logic for `aq unbind client --cluster`."""
from aquilon.aqdb.model import Cluster
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.commands.unbind_client_hostname import \
CommandUnbindClientHostname
class CommandUnbindClientCluster(CommandUnbindClientHost... |
'''======================================================
Created by: D. Spencer Maughan
Last updated: May 2015
File name: IRIS_DF_Controller.py
Organization: RISC Lab, Utah State University
Notes:
======================================================'''
import roslib; roslib.load_manifest('r... |
"""
Utilities to simplify the boilerplate for native lowering.
"""
import collections
import contextlib
import inspect
import functools
from enum import Enum
from numba.core import typing, types, utils, cgutils
from numba.core.typing.templates import BaseRegistryLoader
class Registry(object):
"""
A registry of ... |
import unittest
from ..gwt import GwtIO
from ...FileIO import FileIO as psopen
from .... import examples as pysal_examples
import tempfile
import os
import warnings
class test_GwtIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal_examples.get_path('juvenile.gwt')
self.obj = G... |
from __future__ import unicode_literals
import os
import datetime
from django.test import TestCase, Client, override_settings
from django.utils import timezone
from ..models import Show, Episode, Enclosure
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
@ove... |
import urlparse
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.http.response import HttpResponseBadRequest
from .base import Mixin
from .. import strings
class SuccessURLAliasViewMixin(Mixin):
def get_success_url(self):
return reverse(self.success_url_alias)
c... |
import os
import sys
if __name__ == "__main__":
os.environ['DJANGO_SETTINGS_MODULE'] = 'lfs_downloads.tests._settings'
import django
from django.conf import settings
from django.test.utils import get_runner
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
failu... |
"""private_base will be populated from puppet and placed in this directory"""
import logging
import os
import dj_database_url
from lib.settings_base import (
CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING, CSP_SCRIPT_SRC,
CSP_FRAME_SRC)
from .. import splitstrip
import private_base as private
ENGAGE_ROBOTS = ... |
"""
Test lldb-mi -var-xxx commands.
"""
from __future__ import print_function
import lldbmi_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@sk... |
from django.test import TestCase
from api.models import UsernameSnippet
class TestUsernameSnippet(TestCase):
@classmethod
def setUpTestData(cls):
UsernameSnippet.objects.create(available=True)
def test_existence(self):
u = UsernameSnippet.objects.first()
self.assertIsInstance(u, UsernameSnippet)
self.assertE... |
class AjaxTemplateMixin(object):
ajax_template_name = ''
template_name = ''
def dispatch(self, request, *args, **kwargs):
if not hasattr(self, 'ajax_template_name'):
split = self.template_name.split('.html')
split[-1] = '_inner'
split.append('.html')
s... |
from ..libmp.backend import xrange
from .calculus import defun
@defun
def polyval(ctx, coeffs, x, derivative=False):
r"""
Given coefficients `[c_n, \ldots, c_2, c_1, c_0]` and a number `x`,
:func:`~mpmath.polyval` evaluates the polynomial
.. math ::
P(x) = c_n x^n + \ldots + c_2 x^2 + c_1 x + c_... |
from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import numpy as np
import numpy.ma as ma
from numpy.lib._iotools ... |
import time,os,re,csv,sys,uuid,joblib
from datetime import date
import numpy as np
from sklearn import svm
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
def train_model(X,y,saved_model):
"""
function to train model
"""
... |
"""
Compatibility helpers for older Python versions.
"""
import sys
PY2 = sys.version_info[0] == 2 |
I = complex(0,1)
ha2ev = 27.211396132
ev2cm1 = 8065.5440044136285
bohr2ang = 0.52917720859
atomic_mass = [ None, 1.00794, 4.002602, 6.941, 9.012182,
10.811, 12.0107, 14.0067, 15.9994, 18.9984032,
20.1797, 22.98976928, 24.305,26.9815386, 28.0855,
... |
from core_types import IncompatibleTypes, ImmutableT
class FnT(ImmutableT):
"""Type of a typed function"""
def __init__(self, input_types, return_type):
self.input_types = tuple(input_types)
self.return_type = return_type
self._hash = hash(self.input_types + (return_type,))
def __str__(self):
inp... |
"""Package-wide configuration"""
try:
import __builtin__ as builtins
except ImportError: # pragma: no cover
import builtins
from tag.comment import Comment
from tag.directive import Directive
from tag.feature import Feature
from tag.sequence import Sequence
from tag.range import Range
from tag.reader import GF... |
__author__ = 'j.s@google.com (Jeff Scudder)'
import unittest
import coverage
import all_tests
import atom.core
import atom.http_core
import atom.mock_http_core
import atom.auth
import atom.client
import gdata.gauth
import gdata.client
import gdata.data
import gdata.blogger.data
import gdata.blogger.client
import gdata.... |
import test_expectations
ANGLE_MODIFIERS = ['d3d9', 'd3d11', 'opengl']
BROWSER_TYPE_MODIFIERS = [
'android-webview-shell', 'android-content-shell', 'debug' ]
class _FlakyExpectation(object):
def __init__(self, expectation, max_num_retries):
self.expectation = expectation
self.max_num_retries = max_num_ret... |
from __future__ import absolute_import, print_function
from datetime import timedelta
from django.utils import timezone
from freezegun import freeze_time
from sentry.models import CheckInStatus, Monitor, MonitorCheckIn, MonitorStatus, MonitorType
from sentry.testutils import APITestCase
@freeze_time("2019-01-01")
class... |
command = testshade("-g 128 128 -od uint8 -o Cout out.tif test")
outputs = [ "out.txt", "out.tif" ] |
import json
from os.path import join
from django.conf import settings
from django.core.management.base import NoArgsCommand
from program.models import ProgramSlot
class Command(NoArgsCommand):
help = 'checks the automation_ids used by program slots against the exported'
def handle_noargs(self, **options):
... |
import sys
import wx
import os
import matplotlib
if matplotlib.get_backend() != "WXAgg":
matplotlib.use("WXAgg")
import matplotlib.pyplot as plt
from pmagpy import pmagplotlib
import pmagpy.command_line_extractor as extractor
import pmagpy.ipmag as ipmag
import dialogs.pmag_widgets as pw
import dialogs.pmag_menu_di... |
"""
.. _sfm-reconst:
==============================================
Reconstruction with the Sparse Fascicle Model
==============================================
In this example, we will use the Sparse Fascicle Model (SFM) [Rokem2015]_, to
reconstruct the fiber Orientation Distribution Function (fODF) in every voxel.
Fi... |
import numpy as np
from brew.base import Ensemble
from brew.metrics.diversity.paired import kuncheva_double_fault_measure
from .base import DCS
class DSKNN(DCS):
"""DS-KNN
The DS-KNN selects an ensemble of classifiers based on
their accuracy and diversity in the neighborhood of the
test sample.
Attr... |
import array
import struct
import zlib
from enum import Enum
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
from .exif import Exif
class Jpeg(KaitaiStruct):
class ComponentId(Enum):
y = 1
cb = 2
cr = 3
i = 4
q = 5
def __init__(self, _io, _parent=None, _root=... |
import numpy
import pandas
import statsmodels.api as sm
def complex_heuristic(file_path):
'''
You are given a list of Titantic passengers and their associating
information. More information about the data can be seen at the link below:
http://www.kaggle.com/c/titanic-gettingStarted/data
For this exe... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "logger.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
import os
from holster.enum import Enum
from rowboat.types import Model, SlottedModel, Field, DictField, text, raw, rule_matcher
CooldownMode = Enum(
'GUILD',
'CHANNEL',
'USER',
)
class PluginConfigObj(object):
client = None
class PluginsConfig(Model):
def __init__(self, inst, obj):
self.cli... |
import logging
try:
from configparser import ConfigParser
except ImportError:
# Python 2 support
from ConfigParser import ConfigParser
logger = logging.getLogger("packges.knightos.org")
logger.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(as... |
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.directnotify.DirectNotifyGlobal import directNotify
from otp.otpbase import OTPGlobals
from otp.avatar.Avatar import teleportNotify
from otp.friends import FriendResponseCodes
class PlayerFriendsManager(DistributedObjectGlobal):
... |
import pygame
import enemies
from core import balloon, bullet, game, gem, particle, player, world
from scenes import credits, scene, splashscreen
from ui import menu, text
from utils import prettyprint, utility, vector
from utils.settings import *
pygame.init()
utility.read_settings()
if settings_list[SETTING_FULLSCREE... |
from django import http
from django.conf.urls import patterns
from django.contrib import admin
from django.db import models
from django.forms.models import modelform_factory
from django.shortcuts import get_object_or_404
from django.template import loader, Context
from django.views.generic import View
def get_printable... |
"""
Script to set up a custom genome for bcbio-nextgen
"""
from __future__ import print_function
from argparse import ArgumentParser
import collections
import gzip
import os
from Bio import SeqIO
import toolz as tz
from bcbio.utils import safe_makedir, file_exists, chdir, is_gzipped
from bcbio.distributed.transaction i... |
from .ctp_gateway import CtpGateway |
import os
from jedi._compatibility import FileNotFoundError, force_unicode, scandir
from jedi.api import classes
from jedi.api.strings import StringName, get_quote_ending
from jedi.api.helpers import match
from jedi.inference.helpers import get_str_or_none
class PathName(StringName):
api_type = u'path'
def complete... |
__revision__ = "src/engine/SCons/Tool/mssdk.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""engine.SCons.Tool.mssdk
Tool-specific initialization for Microsoft SDKs, both Platform
SDKs and Windows SDKs.
There normally shouldn't be any need to import this module directly.
It will usually be imported throu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.