src stringlengths 721 1.04M |
|---|
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
from unittest import TestCase
import numpy as np
from AnyQt.QtCore import QModelIndex, Qt
from Orange.data import ContinuousVariable, DiscreteVariable, \
StringVariable, Table, Domain
from Orange.widgets.data.owedi... |
#-*-coding-utf-8-*-
import logging
from datetime import datetime
from rest_framework import generics
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view
from django.conf import settings
from django.contrib.auth.models import User
from django.u... |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from ButtonBox import ButtonBox
class HButtonBox(ButtonBox):
"... |
# -*- coding: utf-8 -*-
"""Model definitions for Bloem's files application.
This module defines the various models used as part of Bloem's files
application.
"""
import os
from django.db import models
class Directory(models.Model):
"""Defines the Directory model used in Bloem's files application.
Fields... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 22 17:15:03 2015
@author: Tim Kunze
Copyright (C) 2015, Tim Kunze. All rights reserved.
This script is a modified version of the RUM Detector:
instead of sweeping over He and Hi in every diagram, we sweep over lenge and intensity of the impulse (as in the actiation p... |
#!/usr/bin/env python
#
# Use with scripts/helloBatchWorldMessages.scm to enable batch mode
import gtk
from gimpfu import *
def helloBatchWorldMessagesFn(messageType) :
#dictionary mapping case values to functions see -> https://docs.python.org/faq/design.html#why-isn-t-there-a-switch-or-case-statement-in-python... |
#!/usr/bin/env python
import radical.utils as ru
#import radical.analytics as ra
import radical.entk as re
from radical.entk import Pipeline, Stage, Task, AppManager
import os
import tarfile
import writeInputs
import time
import git
#import replica
#os.environ['RADICAL_SAGA_VERBOSE'] = 'INFO'
os.environ['R... |
from urllib.parse import parse_qs
from django.core.cache import cache
from django.test import TestCase
from wellsfargo.connector.client import WFRSGatewayAPIClient
import requests_mock
class WFRSGatewayAPIClientTest(TestCase):
def setUp(self):
super().setUp()
cache.clear()
@requests_mock.Mock... |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from datetime import datetime, timedelta
import operator
from textwrap import dedent
from typing import Union
import warnings
import numpy as np
from pandas._libs import algos as libalgos, index as libindex, lib
import pandas._libs.join as libjoin
from pandas._libs.lib import is_datetime_array
from pandas._libs.tslib... |
!/bin/python
#-*- coding: utf-8 -*-
#
#
#
import wxversion
wxversion.select('2.8')
import sqlite3
import HandyUtilities as HU
def CreateTable(sql_file, table_name, column_info):
con = None
exists = None
con = sqlite3.connect(sql_file)
print('----------------------------------------')
with con:
... |
# ca_wizard_mechanical, version 0.2
# Allows the generation of comm-files for simple 3D structural analyses in code_aster with an interactive GUI
#
# This work is licensed under the terms and conditions of the GNU General Public License version 3
# Copyright (C) 2017 Dominik Lechleitner
# Contact: kakt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: W2IO (https://github.com/Pablites/W2IO)
# Authors: Paweł Wichary & Michał Waleszczuk
# Date: 21 July 2015
# Licence: available on github
"""
Setup of W2IO install all files of plugin
Instal directory is: ~/.starcluster/plugins
"""
import logging
import os
impor... |
# Global Forest Watch API
# Copyright (C) 2015 World Resource Institute
#
# 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 2 of the License, or
# (at your option) any later version... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Score'
db.delete_table('lizard_measure_score')
# Deleting model 'MeasuringRod'
... |
import pytest
from pg13 import sqex, pgmock, sqparse2, treepath
def test_sub_arraylit():
from pg13.sqparse2 import ArrayLit,Literal,SubLit
arlit=ArrayLit([Literal('a'),SubLit,Literal('b')])
path,=treepath.sub_slots(arlit, lambda x:x is sqparse2.SubLit)
assert path==(('vals',1),)
arlit[path] = Literal('hello'... |
"""Methods for testing a code library against Fortran best practices to
help uncover subtle bugs that took a while for us to track down. See
especially http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html"""
def _exec_check_pointers(executable):
"""Checks the specified executable for the pointer condition that not
... |
# Copyright (c) 2015 Thales Services SAS
#
# 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 l... |
"""
sentry.models.user
~~~~~~~~~~~~~~~~~~
: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 warnings
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import Inte... |
import numpy as np
from pyFTS.common import FLR
from pyFTS.models.seasonal import sfts
class MultiSeasonalFTS(sfts.SeasonalFTS):
"""
Multi-Seasonal Fuzzy Time Series
"""
def __init__(self, name, indexer, **kwargs):
super(MultiSeasonalFTS, self).__init__("MSFTS")
self.name = "Multi Seas... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... |
"""Test code for iiif.error."""
import unittest
import re
from iiif.error import IIIFError
class TestAll(unittest.TestCase):
"""Tests."""
def test01_str(self):
"""Test str method."""
e = IIIFError()
self.assertEqual(str(e), 'UNKNOWN_ERROR')
e = IIIFError(text='aa', parameter=... |
"""ThreatConnect TI Victim"""
from .mappings import Mappings
# import local modules for dynamic reference
module = __import__(__name__)
class Victim(Mappings):
"""Unique API calls for Victim API Endpoints"""
def __init__(self, tcex, **kwargs):
"""Initialize Class properties.
Args:
... |
#!/usr/bin/env python
#coding=utf-8
# Filename: parse.py
'''
解析数据数据语法
@author: 15th
@data: 2017.4.12
'''
import re
#添加组变量: *
#组变量添加方式为: *字段名
#例: 某一步骤的返回报文中有一字段名为uid, 现在要将其添加为组变量. 则在该步骤的返回报文中填写 *uid
#对于不同测试用例/不同步骤中的同一返回字段, 若都将其添加为组变量, 他们相互之间并不会覆盖, 为不同的组变量.
RE_SET_SHAREDVAR = re.compile(r'^\*[^*]+')
#添加组唯一变量: **
#组变量... |
"""
Django settings for blog project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Buil... |
import copy
import random
from typing import Tuple
import networkx as nx
import numpy as np
from torch_geometric.data import Dataset, DataLoader
from torch_geometric.utils import from_networkx
class SyntheticGraphDataset(Dataset):
def __init__(self):
self.min_nodes = 19
self.max_nodes = 20
... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
import pytest
from src.Numbers.credit_card_validator import CardValidator, CardError
class TestCreditCard:
def test_valiator_success(self):
card = CardValidator(4556821195558787)
assert card.__str__() == "************8787"
assert card.__repr__() == "<Credit Card: ************8787>"
d... |
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
# -*- coding: utf-8 -*-
from unittest import TestCase
from datetime import datetime, timedelta
from pytz import utc
from asynx import TaskQueueClient
class TQClientTestCase(TestCase):
def test_add_task(self):
tqc = TaskQueueClient('http://localhost:17969', 'test')
# a simple task
task =... |
import pyprind
from datetime import datetime
from django.utils.translation import ugettext as _
from arches.app.models import models
from arches.app.models.resource import Resource
from arches.app.models.system_settings import settings
from arches.app.utils import import_class_from_string
from arches.app.search.search_... |
import numpy
import time
from matplotlib import pyplot
def main (params):
angle = params['p0']
vel = params['v0']
sign = params['sign']
# Plan the trajectory if it is not planned
T = 0
Ta = 0
Td = 0 ... |
class Solution:
def intToRoman(self, num):
"""
:type num: int
:rtype: str
"""
res = ""
while num:
if num >= 1000:
res += (num//1000) * 'M'
num = num%1000
elif num >= 900:
res += 'CM'
... |
import re
from django.db import models
from django.utils.functional import cached_property
from landing.utils import markup_markdown
class ServiceManager(models.Manager):
def last_modified(self):
return self.latest('modified').modified
class Service(models.Model):
objects = ServiceManager()
class... |
# -*- coding: utf-8 -*-
""" This module contains a GUI through which the Manager core class can be controlled.
It can load and reload modules, show the configuration, and re-open closed windows.
Qudi is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publish... |
"""
Provides small event framework
"""
from typing import Callable, List, Dict, Any
from loguru import logger
logger = logger.bind(name='event')
class Event:
"""Represents one registered event."""
def __init__(self, name: str, func: Callable, priority: int = 128) -> None:
self.name = name
s... |
import sys
sys.path[0:0] = [""]
import unittest
import uuid
from nose.plugins.skip import SkipTest
from datetime import datetime, timedelta
import pymongo
from pymongo.errors import ConfigurationError
from pymongo.read_preferences import ReadPreference
from bson import ObjectId
from mongoengine import *
from mongo... |
"""This module contains the general information for HuuFirmwareCatalogComponent ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class HuuFirmwareCatalogComponentConsts:
pass
class HuuFirmwareCatalogComponent(ManagedObject... |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
"""
test spatial discretization
---------------------------
test for spatial discretizors.
"""
## Imports
import numpy as np
from itertools import product
#import matplotlib.pyplot as plt
from pySpatialTools.Discretization import *
from pySpatialTools.utils.artificial_data import *
from pySpatialTools.Discretization... |
import unittest
import os
from contextlib import closing
import shutil
import tempfile
import tables
from simphony.core import CUBA
from simphony.core.data_container import DataContainer
from simphony.io.h5_cuds import H5CUDS
from simphony.io.h5_mesh import H5Mesh
from simphony.io.h5_particles import H5Particles
from ... |
import os
import requests # pip install requests
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.
# Base URL for PDF.co Web API requests
BASE_URL = "https://localhost"
# Source PDF file
SourceFile = ".\... |
''' geodat import AST (gdal)'''
# -*- coding: utf-8 -*-
#-------------------------------------------------
#-- geodat import AST (gdal)
#--
#-- microelly 2016 v 0.1
#--
#-- GNU Lesser General Public License (LGPL)
#-------------------------------------------------
#http://geoinformaticstutorial.blogspot.de/2012/09/rea... |
# The MIT License (MIT)
#
# Copyright (c) 2015 WUSTL ZPLAB
#
# 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, modif... |
"""Example macro."""
revision = "$Rev: 6326 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/HelloWorld.py $"
#
# The following shows the code for macro, old-style.
#
# The `execute` function serves no purpose other than to illustrate
# the example, it will not be used anymore.
#
# ... |
from __future__ import print_function
from builtins import range
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
import random
from h2o.estimators.deeplearning import H2ODeepLearningEstimator
def cv_cars_dl():
# read in the dataset and construct training set... |
import numpy as np
import pandas
import matplotlib.pyplot as plt
def entries_histogram(turnstile_weather):
'''
Before we perform any analysis, it might be useful to take a
look at the data we're hoping to analyze. More specifically, let's
examine the hourly entries in our NYC subway data and d... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import pickle
import os
import tensorflow as tf
import ray
from ray.rllib.common import Agent, TrainingResult
from ray.rllib.dqn import logger, models
from ray.rllib.dqn.common.... |
import codecs
from datetime import datetime, timedelta
from optparse import make_option
from os import path, unlink
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon, Persona
fro... |
# encoding: utf-8
"""
parse_process.py
Created by Thomas Mangin on 2015-06-05.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import time
import copy
from collections import defaultdict
from exabgp.configuration.core import Section
from exabgp.configura... |
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import models
class CommentManager(models.Manager):
def filter_by_instance(self, instance):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright 2013 to 2017 University of Manchester
#
# HydraPlatform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or... |
#!/usr/bin/env python
from __future__ import print_function
from common import *
def getArchitecture():
out = S(subprocess.check_output(["uname", "-a"]))
if "x86_64" in out:
return "amd64"
return "i386"
def getLibraryPackage(libName):
out = S(subprocess.check_output(["dpkg-query", "-S", libNa... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/env python
#
# Get stats from a Unifi AP controller using the API
#
# Requires the unifi python module
#
import argparse
import json
from unifi.controller import Controller
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--controller', default='unifi', help='the controller address (default "... |
import json
import logging as log
from collections import namedtuple
import requests
class Api:
def __init__(self, gitlab_url, auth_token):
self._auth_token = auth_token
self._api_base_url = gitlab_url.rstrip('/') + '/api/v4'
def call(self, command, sudo=None):
method = command.metho... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import ah_bootstrap
from setuptools import setup
#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin_... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Tag'
db.create_table(u'core_tag', (
(u'id', s... |
# -*- coding: utf-8 -*-
import base64
import re
from collections import OrderedDict
from io import BytesIO
from odoo import api, fields, models, _
from PIL import Image
import babel
from odoo.tools import html_escape as escape, posix_to_ldml, safe_eval, float_utils, format_date, pycompat
import logging
_logger = loggi... |
# Copyright (c) 2011 OpenStack Foundation
# 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 ... |
"""
The `ModelSerializer` and `HyperlinkedModelSerializer` classes are essentially
shortcuts for automatically creating serializers based on a given model class.
These tests deal with ensuring that we correctly map the model fields onto
an appropriate set of serializer fields for each case.
"""
from __future__ import ... |
# VMware vSphere Python SDK
# Copyright (c) 2008-2015 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... |
# log.py
#
# Copyright 2017 Daniel Mende <mail@c0decafe.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2018 CERN.
#
# CERN Analysis Preservation Framework 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... |
"""Manage Overpass API connexion."""
import logging
import os
import re
from typing import List
from qgis.core import QgsFileDownloader
from qgis.PyQt.QtCore import QDir, QEventLoop, QFileInfo, QTemporaryFile, QUrl
from QuickOSM.core.exceptions import (
NetWorkErrorException,
OverpassBadRequestException,
... |
#!/usr/bin/python
import lutin.module as module
import lutin.tools as tools
import lutin.debug as debug
import os
def get_type():
return "LIBRARY"
def get_desc():
return "clang generic lib c++"
def get_licence():
return "bsd-like"
def get_compagny_type():
return "com"
def get_compagny_name():
return "Univers... |
from boto3 import Session
from botocore.exceptions import BotoCoreError, ClientError
from contextlib import closing
DEFAULTS = {
"region_name": "ap-southeast-2", # Sydney
"voice_id": "Nicole",
"input_text_type": "text",
"output_format": "mp3",
"output_filename": "polly_speech.mp3"
}
def status_cod... |
from PyQt5 import QtGui, QtWidgets, QtCore, QtMultimedia, uic
from semantic_version import Version
import os
import logging
logger = logging.getLogger(__name__)
class Theme():
"""
Represents a single FAF client theme.
"""
def __init__(self, themedir, name):
"""
A 'None' themedir repre... |
# Copyright (C) 2014-2015 The BET Development Team
"""
This module contains tests for :module:`bet.sensitivity.chooseQoIs`.
Most of these tests should make sure certain values are within a tolerance
rather than exact due to machine precision.
"""
import unittest
import bet.sensitivity.gradients as grad
import bet.sens... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-10-09 01:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20171008_2259'),
]
operations = [
migrations.CreateModel(... |
#$Id$#
from books.model.ChartOfAccount import ChartOfAccount
from books.model.ChartOfAccountList import ChartOfAccountList
from books.model.TransactionList import TransactionList
from books.model.Transaction import Transaction
from books.model.PageContext import PageContext
class ChartOfAccountsParser:
"""This cl... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.electric_load_center import GeneratorMicroChp
log = logging.getLogger(__name__)
class TestGeneratorMicroChp(unittest.TestCase):
def setUp(self):
self.fd, self.path ... |
#!/usr/bin/env python3
#coding=utf-8
"""
How many reversible numbers are there below one-billion?
Problem 145
Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits.
For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so ... |
# Copyright (c) 2013 Calin Crisan
# This file is part of motionEye.
#
# motionEye 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.
#
# ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test scan logfiles in cclib"""
import os
import unittest
import numpy
import cclib
from skip import s... |
"""
Views to show a course outline.
"""
import re
import datetime
from completion import waffle as completion_waffle
from django.contrib.auth.models import User
from django.template.context_processors import csrf
from django.template.loader import render_to_string
from opaque_keys.edx.keys import CourseKey
from pytz i... |
"""
WSGI config for JMS 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
this application via the ``WSGI_APPLICATION`` sett... |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
from openturns.testing import *
TESTPREAMBLE()
# Test 1
sampleSize = 6
dimension = 1
f = NumericalMathFunction(['x0'], ['y'], ['x0 * sin(x0)'])
X = NumericalSample(sampleSize, dimension)
X2 = NumericalSample(sampleSize, dimension... |
#! /usr/bin/env python3
"""
Author: Guanyu Yi @ CPU Verification Platform Group
Email: yigy@cpu.com.cn
Description: mux verilog code generation flow
"""
import os
import configparser
import argparse
import itertools
import pprint
import jinja2
import copy
def gen_args_top():
"""to parse mux_sel top arguments"""
... |
from django.shortcuts import render
from pybb.models import *
from pybbm_tag.models import Tag
from pybb.views import ForumView,AddPostView,EditPostView,TopicView
def add_tag(request,**kwargs):
# check permissions before calling this function
# in kwargs we expect the LABEL of the tag to add(not object) and the TO... |
#!/usr/bin/env python3
# Copyright 2015 Iain Peet
#
# 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.
from gi.repository... |
#!/usr/bin/env python
#
# Copyright 2004,2007,2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... |
# -*- coding: utf-8 -*-
"""
RED Plugin
Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com>
program_page_files.py: Program Wizard Files Page
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 Foundati... |
# (c) 2017 Johann Gail
#
# StrategyMinTraveling.py -- cut strategy algorithms for a Graphtec Silhouette Cameo plotter
#
# Strategy is:
# At each end of a cut search the nearest starting point for the next cut.
# This will probably not find find the global optimum, but works well enough.
# Calculates the distance betw... |
XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
SVG_HEADER = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="600" viewBox="0 0 600 600">'
SVG_FOOTER = "</svg>"
class Svg:
def __init__(self):
self.elements = []
def line(self, x1, y1, x2, y2, width, colo... |
# -*- coding: utf-8 -*-
import sys
from rhsmlib.services import config
from ..test_managercli import TestCliCommand
from subscription_manager import managercli
from subscription_manager.cli_command import config as config_command
from ..fixture import Capture
from mock import patch
class TestConfigCommand(TestCl... |
"""
Contains configuration for schedules app
"""
from crum import get_current_request
from edx_toggles.toggles import LegacyWaffleSwitch, LegacyWaffleFlagNamespace, LegacyWaffleSwitchNamespace, WaffleFlag
from lms.djangoapps.experiments.flags import ExperimentWaffleFlag
from lms.djangoapps.experiments.models import E... |
#-*- encoding=UTF-8 -*-
"""
Django settings for nthuoj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path... |
from backdoors.backdoor import *
class Php(Backdoor):
prompt = Fore.RED + "(php) " + Fore.BLUE + ">> " + Fore.RESET
def __init__(self, core):
cmd.Cmd.__init__(self)
self.intro = GOOD + "Using php module..."
self.core = core
self.options = {
"port" : Option("po... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file."""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
#!/usr/bin/env python
# Author: Willie Lawrence
"""
'themes' has the default themes of lightk.
If you want create a new theme just follow these models
"""
LIGHT_BTN=[
{
"normal":{"fill":"#000","font":("TkDefaultFont",10)},
"over":{"fill":"#000","font":("TkDefaultFont",10)},
"clicked":{"fill":"#000","font":("TkDe... |
import pytest
import os
import subprocess
from looker_sdk import methods, models
from looker_deployer.commands import deploy_content
from looker_deployer.utils import parse_ini
class mockSettings:
base_url = "taco"
class mockAuth:
settings = mockSettings()
sdk = methods.LookerSDK(mockAuth(), "bar", "baz",... |
#!usr/bin/env python
# -*-coding:utf-8-*-
"""
author:wubaichuan
"""
import json
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, HttpResponse
from blog.forms import ArticleForm
from blog.models import Article, ArticleType, User, Reply
from blog.tools.json_type im... |
from django.core.management.base import BaseCommand
from query.base_models import ModelDelegator
import json
import tensorflow as tf
import facenet
import cv2
import os
import json
# TODO(wcrichto): merge this with the other embed faces script
# TODO(pari): for dummy, can just add same labels rather than rerunning scr... |
from datetime import datetime
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
class LogMessage:
def __init__(self,
log_level,
*messages,
delimiter=' ',
timestamp=None):
if log_level not in LOG_LEVEL.reverse:
raise Val... |
# -*- coding: utf-8 -*-
#
# Inventory Tweaks documentation build configuration file, created by
# sphinx-quickstart on Sat May 12 12:32:31 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2016 jianglin
# File Name: api.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2016-11-11 16:05:44 (CST)
# Last Update: Sunday 2018-09-30 17:50:04 (CST)
# By:
# D... |
"""Unit tests of authorization records."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
@pytest.mark.usefixtures("authorization_record_class_fixture", "authorization_record_test_fixture")
class TestAuthorizationRecord(object):
"""Tests for Au... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.