content
string
import datetime import json import re from connexion import request # anchore modules import anchore_engine.apis from anchore_engine.apis.authorization import ( get_authorizer, RequestingAccountValue, ActionBoundPermission, ) import anchore_engine.common.helpers from anchore_engine.clients.services.catalo...
import os import cv2 import numpy as np import multiprocessing class SiftExtractor: def __init__(self, feature_data, collection_data): """ Creates a SiftExtractor. :param feature_data: Feature data set. :param collection_data: Collection data set. """ self.__feature_dat...
from twisted.internet import defer from twisted.python import log, failure from twisted.web import server from twisted.web.iweb import IRenderable from twisted.web.resource import Resource, IResource, getChildForRequest from twisted.web.template import flattenString from werkzeug.exceptions import HTTPException from k...
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Agent', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_crea...
#!/usr/bin/env python """ @file csv2vss.py @author Michael Behrisch @date 2013-06-04 @version $Id: csv2vss.py 22608 2017-01-17 06:28:54Z behrisch $ Create variable speed signs from comma separated detector data. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2013-2017 DLR (http://www...
#!/usr/bin/env python2.7 from collections import namedtuple from datetime import datetime from ConfigParser import ConfigParser import argparse import itertools import os import random import sys from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver from flask import Flask from ...
""" GUI-specific interface functions for X11. """ __revision__ = "$Rev$" __date__ = "$Date$" __author__ = "$Author$" from shotfactory04.gui.linux import firefox as base class Gui(base.Gui): """ Special functions for Mozilla GranParadiso. """ pass
""" Form Widget classes specific to the Django admin site. """ import copy from django import forms from django.forms.widgets import RadioFieldRenderer from django.forms.util import flatatt from django.utils.html import escape from django.utils.text import truncate_words from django.utils.translation import ugettext a...
""" Exception definitions. """ import itertools class ClientException(Exception): """The base exception class for all exceptions this library raises. """ pass class MissingArgs(ClientException): """Supplied arguments are not sufficient for calling a function.""" def __init__(self, missing): ...
from django.contrib.auth.models import User from django.db import models from variants.models import Variant class GenomeAnalysis(models.Model): """Model for uploaded file and its processed output. Output is a processed output file """ # This associates a user with a specific genome analysis. us...
"""Generate a base64 encoded HMAC signature. """ __module_id__ = "$Id$" #end_pymotw_header import base64 import hmac import hashlib f = open('lorem.txt', 'rb') try: body = f.read() finally: f.close() digest = hmac.new('secret-shared-key-goes-here', body, hashlib.sha1).digest() print base64.encodestring(dig...
__author__ ="Daniel Berenguer" __date__ ="$Sep 20, 2011 4:38:12 PM$" ######################################################################### from ConfigDialog import ConfigDialog from swap.xmltools.XmlDevice import XmlDeviceDir import wx class DeviceSelector(ConfigDialog): """ SWAP device selsctor ...
import mongoengine as me import term from rmc.shared import util class SectionMeeting(me.EmbeddedDocument): """A set of consistent weekly times and a location that a section will meet at. Each section has one or more of these meetings. """ # Seconds since 0:00:00. eg. 52200 (2:30 pm) start_...
"""cbsa_blockgroup.py Output one shapefile per MSA containing all the blockgroups it contains. """ import os import csv import fiona # # Read preliminary data # # Crosswalk between blockgroups and CBSAs cbsa_to_bg = {} with open('data/crosswalks/cbsa_blockgroup.txt', 'r') as source: reader = csv.reader(source,...
import urllib import traceback from sickbeard import logger from sickbeard import tvcache from sickbeard.providers import generic from sickbeard import show_name_helpers from sickbeard.bs4_parser import BS4Parser class TokyoToshokanProvider(generic.TorrentProvider): def __init__(self): generic.TorrentPr...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages long_desc = open('README.rst').read() requires = ['Sphinx>=0.6', 'Markdown'] setup( name='sphinxcontrib-markdown', version='0.1.0', url='https://github.com/tk0miya/sphinxcontrib-markdown/', license='BSD', author='Takeshi KOMIYA'...
import codecs from collections import OrderedDict from copy import deepcopy import yaml import yaml.reader from . import errors class ProjectInfo: """Information gained from the snap's snapcraft.yaml file.""" def __init__(self, *, snapcraft_yaml_file_path) -> None: self.snapcraft_yaml_file_path = s...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.contenttypes.fields import GenericRelation from model_utils import Choices from model_utils.models import StatusModel, TimeStampedModel from .datafile import Datafile from .submission import Submission fr...
import math class Point(object): def __init__(self, x, y): self.x = float(x) self.y = float(y) def __repr__(self): return "(%d, %d)" % (self.x,self.y) def to_graphic(self, terrain, max_x=2047, max_y=2047): """Convert from warbirds coordinates (bottom left is 0, 0) to ...
""" Testing Anomaly Detector batch scores """ from __future__ import absolute_import from bigmler.tests.world import (world, common_setup_module, common_teardown_module, teardown_class) import bigmler.tests.basic_tst_prediction_steps as test_pred import bigmler.tests.basic_batch_tst...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock import pytest import responses import six from django.core.urlresolvers import reverse from exam import fixture from social_auth.models import UserSocialAuth from sentry.models import ( UserEmail, LostPasswordHash, User, UserOption ) fro...
from __future__ import print_function, unicode_literals __docformat__ = 'plaintext' class PyRiveObjects(object): """A RiveScript object handler for Python code. This class provides built-in support for your RiveScript documents to include and execute object macros written in Python. For example: > object b...
""" info """ import re from gnr.core.gnrstring import toJson from collections import defaultdict from itertools import imap from gnr.core.gnrstring import splitAndStrip, toText from gnr.web.gnrbaseclasses import BaseComponent class GetInfoPage(BaseComponent): py_requires = 'reportcmp/getinfo:QuickQueryTool' d...
# -------------------------------------------------------------- # TogglPy is a non-cluttered, easily understood and implemented # library for interacting with the Toggl API. # -------------------------------------------------------------- import base64 from datetime import datetime # for making requests import urllib...
from .abstract import (AbstractOrganization, AbstractOrganizationUser, AbstractOrganizationOwner) from django.contrib.sites.models import Site from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.db import models from...
from .utils import PyKEArgumentHelpFormatter import re import numpy as np import sys from matplotlib import pyplot as plt from astropy.io import fits as pyfits from . import kepio, kepmsg, kepkey __all__ = ['kepdraw'] def kepdraw(infile, outfile=None, datacol=None, ploterr=False, errcol='SAP_FLUX_ERR', ...
""" Title: Linear Programming Problem Solver Author: Anthony Chiemeka Emmanuel Date: 16-10-2016 Email: <EMAIL> Version: 1.0 """ from __future__ import print_function import sys from ortools.linear_solver import linear_solver_pb2 from ortools.linear_solver import pywraplp def RunLinearExampleNaturalLanguageAPI(optimi...
"""The Independent distribution class.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape fro...
from __future__ import unicode_literals from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin, BaseUserManager) from django.db import models from django.utils import timezone from django.contrib.auth.models import AbstractUser class EmailUserManager(BaseUse...
import pytest from plenum.test.delayers import nv_delay from plenum.test.stasher import delay_rules from plenum.test.helper import waitForViewChange, perf_monitor_disabled, view_change_timeout from plenum.test.node_request.helper import sdk_ensure_pool_functional from plenum.test.node_catchup.helper import ensure_all_...
from mapwidgets.widgets import GooglePointFieldWidget from django.contrib import admin from django.contrib.gis.db import models from django.utils.translation import ugettext as _ from homes_for_sale.models import * class SaleAdmin(admin.ModelAdmin): prepopulated_fields = {'slug': ('title',), } list_filter =...
from sos.report.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os class OpenStackIronic(Plugin): short_desc = 'OpenStack Ironic' plugin_name = "openstack_ironic" profiles = ('openstack', 'openstack_undercloud') containers = ('.*ironic_api',) var_puppet_gen = "/var/lib/con...
import logging from .remove_place_with_no_qcode import remove_place_with_no_qcode from .reuters_derive_dateline import reuters_derive_dateline logger = logging.getLogger(__name__) def reuters_health_auto_publish(item, **kwargs): try: if (item.get('source', '').upper() == 'REUTERS' or item.get('source', '...
import numpy as np import pandas as pd import datetime from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor, BaggingRegressor from sklearn.metrics import mean_squared_error from sklearn.cross_validation import train_test_split from sklearn.preprocessing import Imputer import matplotlib.pyplot as plt i...
from ltk.actions.action import * class ImportAction(Action): def __init__(self, path): Action.__init__(self, path) self.skip_ids = [] def _get_import_ids(self,info): mapper = choice_mapper(info) chosen_ids = [] while not len(chosen_ids) > 0: prompt_message =...
import concurrent.futures import functools import math import os import sys import iotbx.merging_statistics import iotbx.phil import libtbx from libtbx.introspection import number_of_processors from cctbx import uctbx from cycler import cycler from dials.util.options import OptionParser help_message = """ """ phil_s...
from random import randrange import numpy as np # If the code is not Cython-compiled, we need to add some imports. from cython import compiled if not compiled: from mazelib.generate.MazeGenAlgo import MazeGenAlgo class Prims(MazeGenAlgo): """ The Algorithm 1. Choose an arbitrary cell from the grid, a...
# -*- coding: 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 M2M table for field expertise on 'Profile' db.create_table('user_profiles_expertise', ( ...
from CIM14.IEC61970.Dynamics.ExcitationSystems.ExcitationSystem import ExcitationSystem class ExcAC6A(ExcitationSystem): """IEEE (1992/2005) AC6A Model The model is used to represent field-controlled alternator-rectifier excitation systems with system-supplied electronic voltage regulators. The maximum output of ...
""" about: This code was written by Mostafa El-Marzouki @iSuperMostafa ------------------------------------------------------------ summery: Make a square with size 4*4 by using 4 or 5 pieces. The pieces can be rotated or flipped and all pieces should be used to form a square. There may be more than one possible...
{ "name": "MRP Subcontracting", "version": "1.0", "author": "OdooMRP team," "AvanzOSC," "Serv. Tecnol. Avanzados - Pedro M. Baeza", "contributors": [ "Incaser Informatica S.L.", "Ana Juaristi <<EMAIL>>", "Pedro Manuel Baeza <<EMAIL>>", "Alfredo...
"""Tests for tfx.components.transform.component.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json from typing import Text import tensorflow as tf from tfx.components.transform import component from tfx.orchestration import data_types from tfx...
from app import db, bcrypt from app.mixins import CRUDMixin from flask.ext.login import UserMixin class User(UserMixin, CRUDMixin, db.Model): __tablename__ = 'users_user' id = db.Column(db.Integer, primary_key=True) last_login = db.Column(db.DateTime) nickname = db.Column(db.String(64), ...
""" Tests for XML library integration @since: 0.4 """ import unittest import pyamf class ElementTreeTestCase(unittest.TestCase): """ Tests the type mappings. """ amf0_encoding = '\x0f\x00\x00\x00\x11<foo bar="baz" />' amf3_encoding = '\x0b#<foo bar="baz" />' def _encode(self, mod): e...
#!/usr/bin/python import sys import os import json # remoteJSON = 'http://portal.midatlanticocean.org/media/data_manager/geojson/ArtificialReefsNoDecimals.json' REMOTE_JSON = 'http://ofr-coastal-use.point97.io/reports/geojson/ofr-mapping-with-counts/q4' # localFile = '/Users/sfletcher/dev/ofr-mp/cronjobs/test.json' LO...
from gettext import gettext as _ from urllib import unquote from swift.common.utils import public, csv_append from swift.common.constraints import check_metadata, MAX_CONTAINER_NAME_LENGTH from swift.common.http import HTTP_ACCEPTED from swift.proxy.controllers.base import Controller, delay_denial, \ cors_validati...
import OpenGL.GL as gl import os import subprocess import sys from blitzloop import ffmsvideo, graphics, layout, mpvplayer, song s = song.Song(sys.argv[1]) output = sys.argv[2] width = int(sys.argv[3]) height = int(sys.argv[4]) fps = float(sys.argv[5]) variant = int(sys.argv[6]) if len(sys.argv) > 6 else 0 headstar...
#!/usr/bin/python import os import sys import time import shutil # buildBinaries.py # Exports the IMOS Toolbox from SVN and # # - Runs Util/imosCompile.m to create a ddb.jar and imosToolbox executables # # Both of these files are copied to the relevant directory and commited to SVN. # # python, git, ...
"""Concatenation.""" from . import HDLObject from .const import HDLIntegerConstant import hdltools.abshdl.expr import hdltools.abshdl.signal class HDLConcatenation(HDLObject): """Concatenation of HDLObjects.""" def __init__(self, value, *args, size=None, direction="rl"): """Initialize.""" se...
import os import sys from copy import deepcopy import alembic.command from alembic.script import ScriptDirectory from flask import current_app from flask_migrate import MigrateCommand as DatabaseManager from flask_migrate import stamp from flask_pluginengine import current_plugin from flask_script import Command from...
""" Validate changes to an XBlock before it is updated. """ from collections import Counter from submissions.api import MAX_TOP_SUBMISSIONS from openassessment.assessment.serializers import rubric_from_dict, InvalidRubric from openassessment.assessment.api.student_training import validate_training_examples from openass...
import threading import flask.ext.whooshalchemy from flask import redirect, render_template, Blueprint, request, url_for, flash from flask_user import current_user, login_required, roles_accepted from app import app, db, oid from app.core.models import UserProfileForm, PopulateForm, AddGameForm, Games from app.core.a...
#!/usr/bin/env python # -*- coding: utf-8 -*- #---Generator function--- def fib(Max): n, a, b = 0, 0, 1 while n < Max: yield b n += 1 a, b = b, a + b #---Generator--- g = fib(100) #---Open a file with w+--- fp = open("fib.txt","w+") #---Write fib-number to fib.txt--- print('-'*25) pr...
""" Provides support to compile networks both AOT and JIT. """ import logging import os.path import tarfile from pathlib import Path import tvm from tvm import autotvm, auto_scheduler from tvm import relay, runtime from tvm.contrib import cc from tvm.contrib import utils from . import common, composite_target, fronte...
""" Support for VOC. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.volvooncall/ """ import logging from homeassistant.components.volvooncall import VolvoEntity from homeassistant.components.binary_sensor import BinarySensorDevice _LOGGER...
# 52. N-Queens II QuestionEditorial Solution My Submissions # Total Accepted: 53077 # Total Submissions: 126364 # Difficulty: Hard # Contributors: Admin # Follow up for N-Queens problem. # # Now, instead outputting board configurations, return the total number of distinct solutions. # # Subscribe to see which comp...
""" Cube functions for coordinate categorisation. All the functions provided here add a new coordinate to a cube. * The function :func:`add_categorised_coord` performs a generic coordinate categorisation. * The other functions all implement specific common cases (e.g. :func:`add_day_of_month`). ...
#!/usr/bin/env python # (C) 2009 Chris Liechti <<EMAIL>> # redirect data from a TCP/IP connection to a serial port and vice versa # using RFC 2217 import sys import os import threading import time import socket import serial import serial.rfc2217 import logging class Redirector: def __init__(self, serial_instan...
from _msi import * import os, string, re, sys AMD64 = "AMD64" in sys.version Itanium = "Itanium" in sys.version Win64 = AMD64 or Itanium # Partially taken from Wine datasizemask= 0x00ff type_valid= 0x0100 type_localizable= 0x0200 typemask= 0x0c00 type_long= 0x0000 type_sho...
from prer import PreR class AlonePackets(PreR): """Show information about alone packets in a window - Result Dict which has the number of queries, number of answers and two lists, one for the queries without answers and another for answers without queries, in current the window - Example ...
#GetAllVMWTemplates.py from VMWConfigFile import * from pyVim import connect from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim, vmodl import atexit import os import ssl import requests import argparse import time # Disabling urllib3 ssl warnings requests.packages.urllib3.disable_warnings() ...
""" Downloads trimmed-down Android Tools from Google Cloud Storage and extracts them to INSTALL_DIR, updating INSTALL_DIR/VERSION_* stamp files with current version. Does nothing if INSTALL_DIR/VERSION_* are already up to date. """ import multiprocessing import os import shutil import subprocess import sys import tarf...
# OWL from app.general.constants import * from app.general.functions import * from app.Config import Config class Node: def __init__(self, nb, coords, access_points, aliases=tuple()): self.nb = nb self.coords = coords self.access_points_ = access_points self.color = Config.COLOR_VAL...
import binascii from netlib import tutils from netlib.http import authentication, Headers def test_parse_http_basic_auth(): vals = (b"basic", b"foo", b"bar") assert authentication.parse_http_basic_auth( authentication.assemble_http_basic_auth(*vals) ) == vals assert not authentication.parse_h...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function __author__ = 'kmu' """ Retrieve data from netcdf files from thredds.met.no and do some statistics. """ import ipdb #import matplotlib #matplotlib.use('Agg') #import matplotlib.pyplot as plt import numpy as np import netCDF...
import time from core.settings import Settings import testing as T class PushTemplateTest(T.TemplateTestCase): authenticated = True push_page = 'push.html' push_status_page = 'push-status.html' push_info_page = 'push-info.html' push_button_bar_page = 'push-button-bar.html' push_dialogs_page =...
# -*- coding: utf-8 -*- """Utility methods for marshmallow.""" from __future__ import absolute_import, unicode_literals import collections import datetime import inspect import json import re import time import types from calendar import timegm from decimal import Decimal, ROUND_HALF_EVEN, Context, Inexact from email....
import os def resolve_target_sources(target_sources, extension): """given a list of pants targets, extract their sources as a list""" resolved_sources = [] if target_sources: for target in target_sources: for resolved in target.resolve(): if hasattr(resolved, 'sources'): resolved_sou...
from __future__ import unicode_literals from time import sleep from c1218.errors import C1218ReadTableError from c1219.data import C1219_TABLES from termineter.module import TermineterModuleOptical # 0 - 2039 Standard Tables # 2048 - 4087 Manufacturer Tables 0 - 2039 # 4096 - 6135 Standard Pending Tables 0 ...
# -*- coding: utf8 ''' This Scripts filters users and items from the trace based the amount of users who tagged an item. ''' from __future__ import division, print_function __authors__ = ['Flavio Figueiredo - flaviovdf <at> gmail <dot-no-spam> com'] __date__ = '26/05/2011' from collections import defaultdict from ta...
""" Forms and validation code for user registration. """ from django import newforms as forms from django.core.validators import alnum_re from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from registration.models import RegistrationProfile # I put this on all required ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 """ WSGI config for gooserver project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover...
# -*- coding: utf-8 -*- """ Created on Mon Jun 26 10:51:54 2017 @author: Johan Steunenberg <<EMAIL>> """ from simplev20.oandaaccount import OandaAccount import os import pandas as pd import v20 class OandaSession: """ An OandaSession gives access to accounts, curves, streams On init the accounts associa...
from logging import getLogger from ckan.lib.base import request, BaseController, abort, json, c from ckan.plugins import toolkit import ckan.plugins as p import json import pylons.config as config import subprocess import shlex import os, sys log = getLogger(__name__) class Resource_api_harvestController(BaseContro...
# -*- coding: utf-8 -*- from odoo.tests.common import HttpCase class AccountingTestTemplConsistency(HttpCase): '''Test the templates consistency between some objects like account.account when account.account.template. ''' def check_fields_consistency(self, model_from, model_to, exceptions=[]): ''...
import sys import traceback from Utils import Logger from SketchFramework.Point import Point from SketchFramework.Annotation import Annotation, AnnotatableObject from xml.etree import ElementTree as ET logger = Logger.getLogger('Stroke', Logger.WARN ) #FIXME: this module is in dire need of some documentati...
""" Various definitions, errors and constants that can be used throughout the program """ import sys CONTIGUOUS = 'contiguous' # contiguous chunking # String formatting template for numbered dimension names DIM_TEMPLATE = "dim-{}" SUB_DIM_TEMPLATE = "subdim-{}" # Use different unicode character per platform as it ...
# encoding: UTF-8 import os from time import sleep from vnxtptrader import * #---------------------------------------------------------------------- def printDict(d): """""" print '-' * 50 l = d.keys() l.sort() for k in l: print k, d[k] #########################################...
from django import forms from django.conf.urls import patterns, url from django.contrib import admin from django.db import models from django.conf.urls import patterns from django.utils.translation import ugettext_lazy as _ from .models import * from ..widgets import TestMailWidget from feincms.admin import item_edi...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from contextlib import contextmanager from pants.fs.archive import archiver, archiver_for_path from pants.util.contextutil import temporary_dir from pants_t...
from contextlib import contextmanager import json import os from django.contrib.auth.decorators import login_required as django_login_required from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseBadRequest, Http404, HttpResponse from django.views.decorators.http import require_POS...
from __future__ import division import datetime from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard import api from openstack_dashboard.usage import quotas class Bas...
'''alignak.brokerlink is deprecated. Please use alignak.objects.brokerlink now.''' from alignak.old_daemon_link import make_deprecated_daemon_link from alignak.objects import brokerlink make_deprecated_daemon_link(brokerlink)
# -*- coding: utf-8 -*- __all__ = ['Actions'] import dbus import dbus.service import os from subprocess import Popen import dal import bill from lib import common, scheduler from lib.utils import force_string from lib.utils import Message from db.billstable import BillsTable class Actions(object): def __init__...
#!/usr/bin/python import errno import getopt import math import os import progress import re import select import signal import socket import subprocess import sys import time from xml.dom.minidom import parse,parseString from xml.dom import DOMException from pprint import pprint from configtool import getConfigVal, s...
# coding: utf-8 # Test the support for SSL and sockets import sys import socket # Divergence: unittest2 so that we have assertRaisesRegexp if sys.version_info < (3,): import unittest2 as unittest else: import unittest from backports import ssl_match_hostname as ssl class BasicSocketTests(unittest.TestCase)...
import random import time import sys def enum(arr): _max = 0 for i in range(len(arr)): for j in range(i, len(arr)): _sum = sum(arr[i:j+1]) if _sum > _max: _max = _sum return _max def better_enum(arr): _max = 0 for i in range(len(arr)): _sum...
import math import os #path for mingw64 (XGBoost requirement) pathx = 'C:\\Program Files\mingw-w64\\x86_64-7.1.0-posix-seh-rt_v5-rev2\\mingw64\\bin' os.environ['PATH'] = pathx + ';' + os.environ['PATH'] from lightgbm import LGBMRegressor from mlxtend.regressor import StackingRegressor, StackingCVRegressor from...
from ordereddict import OrderedDict from qapi import * import sys import os import getopt import errno def type_visitor(name): if type(name) == list: return 'visit_type_%sList' % name[0] else: return 'visit_type_%s' % name def generate_decl_enum(name, members, genlist=True): return mcgen('...
bl_info = { "name": "Seam Cutter", "author": "Victor Yurievich Dorofeyev - @vinvirinvi", "version": (1, 0, 0), "blender": (2, 78, 0), "location": "Mesh > Seam Cutter", "description": "Cuts a mesh into separate meshes created from chunks of linked polygons, like areas defined by seams.", "wik...
from __future__ import absolute_import, division, print_function import os.path, tempfile import pytest import pw._gpg from pw._gpg import is_encrypted, has_armor, unencrypted_ext, decrypt, encrypt def test_detection(): # is_encrypted assert not is_encrypted("test.txt") assert is_encrypted("test.asc") ...
from django.apps import apps from django.conf import settings from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.test import TestCase, Client from django.utils import six from django.contrib.contenttypes.models import ContentType from comments.views import AL...
import ctypes NULL = None LPVOID = ctypes.c_void_p DWORD = ctypes.c_uint UINT = ctypes.c_uint LPWSTR = ctypes.c_wchar_p va_list = ctypes.c_char_p MAX_PATH = 260 FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100 FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000 FORMAT_MESSAGE_FROM_HMODULE = 0...
import unittest import Tkinter def get_tk_root(): try: root = Tkinter._default_root except AttributeError: # it is possible to disable default root in Tkinter, although # I haven't seen people doing it (but apparently someone did it # here). root = None if root is N...
""" Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user's news feed. Your design should support the following methods: postTweet(userId, tweetId): Compose a new tweet. getNewsFeed(userId): Retrieve the 10 most recen...
# -*- coding: utf-8 -*- # Banco de dados db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all']) # no generic views response.generic_patterns = [] from gluon.tools import Auth # autenticação do usuário auth = Auth(db) # campos adicionais do usuário auth.settings.extra_fields['auth_user'] = [ Fi...
from absl.testing import absltest import tensorflow as tf from tensorflow_federated.python.core.api import computations from tensorflow_federated.python.core.impl.compiler import building_blocks from tensorflow_federated.python.core.impl.context_stack import context_stack_impl from tensorflow_federated.python.core.imp...
from django.contrib import messages from django.contrib.auth import get_user_model, login from django.contrib.auth.decorators import login_required from django.contrib.auth.views import ( login as base_login, password_reset as base_password_reset, password_reset_confirm as base_password_reset_confirm, ) from dj...
""" Defines ArrayPlotData. """ from numpy import array # Enthought library imports from traits.api import Dict # Local, relative imports from abstract_plot_data import AbstractPlotData class ArrayPlotData(AbstractPlotData): """ A PlotData implementation class that handles a list of Numpy arrays (or a 2-D N...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from ansible.compat.tests.mock import patch from ansible.modules.network.nxos import nxos_bgp_af from .nxos_module import TestNxosModule, load_fixture, set_module_args class TestNxosBgpAfModule(TestNxosModule): ...