text stringlengths 475 200k |
|---|
"""
CCX Enrollment operations for use by Coach APIs.
Does not include any access control, be sure to check access before calling.
"""
import datetime
import logging
import pytz
from contextlib import contextmanager
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from dja... |
"""Dynamo access"""
import os
from time import sleep
import boto.dynamodb2
from .khan_logger import KhanLogger
__author__ = 'mattjmorris'
class Dynamo(object):
def __init__(self, access_key=None, secret=None):
"""
If access_key and/or secret are not passed in, assumes we are accessing erenev's ... |
# 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 ... |
#!/usr/bin/env python
from ..common import *
from ..extractor import VideoExtractor
class Pinterest(VideoExtractor):
# site name
name = "Pinterest"
# ordered list of supported stream types / qualities on this site
# order: high quality -> low quality
stream_types = [
{'id': 'original'}, #... |
"""Tests for the apply_de_morgans transformation."""
import unittest
from tt.errors import InvalidArgumentTypeError
from tt.expressions import BooleanExpression
from tt.transformations import apply_de_morgans
class TestApplyDeMorgans(unittest.TestCase):
def assert_apply_de_morgans_transformation(self, original... |
#!/usr/bin/env python
import wx
import logging
from ui.plugin import PluginPanel
from wx.lib.pubsub import setupkwargs, pub
import constants
import pvscomm
import json
import util
import config
import ui.images
class ProofManagerPlugin(PluginPanel):
PROMPT = "Rule? "
def __init__(self, parent, definition)... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Syncs a database table to the `DocType` (metadata)
.. note:: This module is only used internally
"""
import os
import frappe
from frappe import _
from frappe.utils import... |
# -*- coding: utf-8 -*-
import datetime
import json
import ddt
import mock
from nose.plugins.attrib import attr
from pytz import UTC
from django.utils.timezone import UTC as django_utc
from django.core.urlresolvers import reverse
from django.test import TestCase, RequestFactory
from edxmako import add_lookup
from dja... |
from __future__ import division
import os
import numpy as np
import scipy.io
import scipy.ndimage.interpolation
def load_head_phantom(number_of_voxels=None):
if number_of_voxels is None:
number_of_voxels = np.array((128, 128, 128))
dirname = os.path.dirname(__file__)
dirname = os.path.join(dirname... |
"""
Create account tables.
Revision ID: 36190acd575
Revises:
Create Date: 2015-09-05 11:10:45.283275
"""
from datetime import datetime
from alembic import op
import sqlalchemy as sa
revision = '36190acd575'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('account',
... |
# -*- coding: UTF-8 -*-
# Copyright 2016-2018 Luc Saffre
# License: BSD (see file COPYING for details)
"""Database models specific for the Team variant of Lino Noi.
Defines a customized :class:`TicketDetail`.
"""
from __future__ import print_function
from lino_xl.lib.tickets.models import *
from lino.modlib.users.mi... |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
try:
# Dimension of test
dimension = 3
# Lambda
lambdaVector = NumericalPoint(dimension)
lambdaVector[0] = 0.
lambdaVector[1] = 0.5
lambdaVector[2] = 1
# Init of the function
myF... |
#
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
# Copyright (C) 2016, see AUTHORS.md
#
# 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 program is distributed i... |
# Orca
#
# Copyright (C) 2010-2011 The Orca Team
# Copyright (C) 2011-2012 Igalia, S.L.
#
# Author: Joanmarie Diggs <[EMAIL]>
#
# This library 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
# ve... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
import os
from flask import Flask
from flask import Response
from flask import request
from flask import render_template
from twilio import twiml
from twilio.rest import TwilioRestClient
# Pull in configuration from system environment variables
TWILIO_ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOK... |
# Copyright 2012 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 requ... |
"""Soundex phonetic similarity measure"""
import re
from py_stringmatching import utils
from py_stringmatching.similarity_measure.phonetic_similarity_measure import \
PhoneticSimilarityMeasure
class Soundex(PhoneticSimilarityMeasure):
"""Soundex phonetic simil... |
from urllib.request import Request, urlopen
try:
import json as simplejson
except ImportError:
try:
import simplejson
except ImportError:
from django.utils import simplejson
from social_auth.backends import BaseOAuth2, OAuthBackend
from social_auth.exceptions import AuthCanceled, AuthUnkno... |
class Publisher(models.Model):
name = models.CharField(maxlength=30, help_text='Name', unique=True)
address = models.TextField(maxlength=50)
city = models.CharField(maxlength=60, default='London')
def __str__(self):
return self.name
class Meta:
ordering = ["name"]
# creating and saving
ringo ... |
# PCA for fk data
# rupert small. september 2015
#
from numpy import *
from PIL import Image, ImageDraw
# use mini_training.csv for PCA, then mini_mini for some plots
data = genfromtxt('mini_mini_training.csv', delimiter=',')
data = data[:,30:].T
dims = shape(data)
scatter = dot(data,data.T)
take = 100
#A, V = linal... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <[EMAIL]>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, ei... |
from datetime import datetime, timedelta
import pytz
class InvasionTimer:
invasion_delta = timedelta(hours=18, minutes=30)
invasion_duration = timedelta(hours=6)
def __init__(self, now=None):
if now is None:
now = datetime.now(tz=pytz.utc)
self.now = now
@property
de... |
# This file is part of MSMTools.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group
#
# MSMTools 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
# (a... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [EMAIL], All rights reserved.
# LLNL-CODE-647188
#
# F... |
# Copyright 2015 OpenStack Foundation
#
# 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 ... |
from flask import Blueprint, render_template, abort, request, redirect, url_for, Response, current_app
from jinja2 import TemplateNotFound
from functools import wraps
import hashlib
from bson.objectid import ObjectId
admin = Blueprint('admin', __name__, template_folder='templates')
import auth
from wtforms import Fo... |
# *- coding: utf-8 -*-
# mailbox.py
# Copyright (C) 2013-2015 LEAP
#
# 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 script formats the information gathered from the mapping annalysis so that it can be processed by varanalyzer. For each insertion, the script picks the most probable insertion site by checking the RD values.
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-a', action="store", dest='input... |
#!/usr/bin/env python
def main():
import sys
from ics_utils import get_stencil_num
from utils import load_csv
raw_data = load_csv(sys.argv[1])
k_l = set()
for k in raw_data:
k_l.add(get_stencil_num(k))
k_l = list(k_l)
n_l = set()
for k in raw_data:
n_l.add(k['Global NX'])
n_l = list(n_l)
... |
from __future__ import absolute_import
from . import _base
from html5lib.constants import voidElements, namespaces, prefixes
from xml.sax.saxutils import escape
# Really crappy basic implementation of a DOM-core like thing
class Node(_base.Node):
type = -1
def __init__(self, name):
self.name = name
... |
"""
Copyright 2016 Brocade Communications Systems, 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 or agreed to i... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... |
# Copyright (c) 2017, Barcelona Supercomputing Center
# 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 list of condit... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <[EMAIL]>
# Copyright (C) 2014-2016 Jesús Espino <[EMAIL]>
# Copyright (C) 2014-2016 David Barragán <[EMAIL]>
# Copyright (C) 2014-2016 Alejandro Alonso <[EMAIL]>
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
#!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of c... |
# Copyright (c) 2013-2016 Molly White
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# di... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
sanitized_Request,
urlencode_postdata,
USER_AGENTS,
)... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sage
from sage import config
from twisted.internet import reactor, task
import inspect
from .utils import caller_name
def echo(msg):
"""Echo a message back to the client
:param msg: message to be echoed back to the client.
:type msg: s... |
#! /usr/bin/env python
# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of Olena.
#
# Olena 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, version 2 of the License.... |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016, 2017 CERN.
#
# Zenodo 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 l... |
# Author: Shao Zhang and Phil Saltzman
# Last Updated: 4/18/2005
#
# This tutorial shows how to use a sequence of textures on an object to
# achieve a specific effect. Popular uses of this technique are:
# -Animated sprites
# -Moving shadows
#
# This tutorial also demonstrates the billboard function which orients
# an ... |
# Copyright 2015 The TensorFlow Authors. 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 applica... |
import logging
class StatusUpdateAdapter(logging.LoggerAdapter):
"""Used to notify a callback about changes in the loglevel of a program."""
def __init__(self, status_update_func, logger, extra={}):
"""
:param status_update_func callable: Called when the status changes.
See ... |
from __future__ import print_function
import os
import multiprocessing
from filecleaver import cleave
from cleave_common import compare, remove
def writechunk(basename, i, reader):
with reader.open() as src, open(basename + '{:02}'.format(i), 'wb') as dst:
dst.write(src.read())
return 'Chunk #{}... |
import os
PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
ADMINS = (
('Seshagiri Prabhu', '[EMAIL]'),
)
ADMINS_EMAIL = map(lambda x: x[1], ADMINS)
MA... |
from django.shortcuts import render,reverse,get_object_or_404,get_list_or_404
from .models import Book,Author,BookInstance,Genere,Bookmarks,Profile
from django.views import generic
from django.views.generic.edit import CreateView,UpdateView,DeleteView
from django.contrib.auth.decorators import login_required,permiss... |
import itertools
from math import floor
from typing import Callable, List, Optional, Tuple, TypeVar
from qgis.core import QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsPointXY, QgsProject
from .global_map_tiles import GlobalMercator
from .log_helper import debug
StrOrInt = TypeVar("StrOrInt", str, int)
"... |
# Copyright 2021 The TensorFlow Authors. 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 applica... |
"""Support for the ZHA platform."""
import logging
import time
from homeassistant.components.device_tracker import DOMAIN, SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatc... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright 2003, 2007 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 vers... |
#!/usr/bin/env python
# Copyright 2016 Google, 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 or... |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## event-id.h: ns3::EventId [class]
module.add_class('EventId')
## high-precision-128.h: ns3::HighPrecision [class]
module.add_class('HighPrecision')
... |
import base64
from conf import *
from base import *
MAGIC = "Cherokee supports MD5 password hashes"
REALM = "realm"
USER = "username"
PASSWD = "alo"
PASSWD_MD5 = "$1$JJ3RnzaO$zpsGlLvKvMVrUW4ZNZ7Iw1"
CONF = """
vserver!1!rule!960!match = directory
vserver!1!rule!960!match!directory = /htpasswd_md5... |
#
# Copyright (C) 2015 INRA
#
# 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 program is distributed in the h... |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QLayoutItem(): # skipped bases: <class 'sip.wrapper'>
"""
QLayoutItem(Qt.Alignment alignment=0)
QLay... |
#!/usr/bin/env python
#
# Script for getting Google Page Rank of page
# Google Toolbar 3.0.x/4.0.x Pagerank Checksum Algorithm
#
# original from http://pagerank.gamesaga.net/
# this version was adapted from http://www.djangosnippets.org/snippets/221/
# by Corey Goldberg - 2010
#
# important update (http://www.ser... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# Copyright 2017 Battelle Energy Alliance, 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 agreed t... |
# Standard library
import os
import errno
import shutil
import tempfile
import unittest
# cQuery library
import cquery
def convert(selector):
"""Convert CSS3 selector `selector` into compatible file-path
Arguments:
selector (str): CSS3 selector, e.g. .Asset
Returns:
str: Resolved select... |
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
GObject.threads_init()
import subprocess
import sys
import os
import os.path
import apt_pkg
from AptUrl.UI import AbstractUI
from AptUrl import Helpers
from AptUrl.Helpers import _
from backend import get_backend
class ... |
# -*- 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 'Article'
db.create_table(u'detective_article', (
... |
# Read in a WAV and find the freq's
import pyaudio
import wave
import numpy as np
chunk = 2048
# open up a wave
wf = wave.open('440hz.wav', 'rb')
swidth = wf.getsampwidth()
RATE = wf.getframerate()
# use a Blackman window
window = np.blackman(chunk)
# open stream
p = pyaudio.PyAudio()
stream = p.open(format =
... |
# This is Python 2.7's standard library ConfigParser.py, with
# all write support stripped out, with only RawConfigParser (renamed
# LinedConfigParser), with the ability to get the line number on which
# options are defined, and with configuration strings being returned
# in Unicode.
#
# Modifications done April 2011 a... |
# -*- coding: utf-8 -*-
# pylint: skip-file
"""Manual tests"""
import pytest
from cfme import test_requirements
from cfme.common.provider import BaseProvider
from cfme.markers.env_markers.provider import ONE_PER_CATEGORY
pytestmark = [
pytest.mark.ignore_stream('upstream'),
pytest.mark.manual,
test_requir... |
from django.conf import settings
import django.core.urlresolvers
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.utils.encoding import smart_str, smart_unicode
from django.utils.timezone import utc, localtime
from django.core.mail import send_mail, mail_ad... |
from django.contrib.auth.models import User
from django.db import models
# blogpost type app models
class Post(models.Model):
author = models.ForeignKey(User, related_name='posts')
title = models.CharField(max_length=255)
body = models.TextField(blank=True, null=True)
class Photo(models.Model):
post... |
from __future__ import absolute_import
__all__ = ['timing', 'incr']
from django_statsd.clients import statsd
from django.conf import settings
from random import random
def _get_key(key):
prefix = settings.SENTRY_METRICS_PREFIX
if prefix:
return '{}{}'.format(prefix, key)
return key
def incr(ke... |
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection
class TestDescribeNetworkAcls(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return """
<DescribeNetworkAclsResponse xmlns="http://ec2.amaz... |
# 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 writing, software
# distrib... |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Script to apply fixits generated by clang. This is to work around the fact
# that clang's -Xclang -fixit-recompile flag, which autom... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import re
import urllib.parse as urlparse
import json
import os
import time
import traceback
from urllib.parse import urlencode
from bs4 import BeautifulSoup
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver import FirefoxProfile
f... |
"""
SoftLayer.tests.CLI.modules.vs_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import mock
from SoftLayer import testing
import json
class VirtTests(testing.TestCase):
def test_list_vs(self):
result = self.run_command(['vs', 'list', '--tag=ta... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import functools
import os
from typing import cast
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.build_graph.build_file_aliases import BuildFileAliases,... |
#!/usr/bin/env python
############################################################################
#
# Copyright 2019 Samsung Electronics 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... |
"""Tests for the classification"""
import unittest
import axelrod
class TestClassification(unittest.TestCase):
def test_known_classifiers(self):
# A set of dimensions that are known to have been fully applied
known_keys = ['stochastic',
'memory_depth',
... |
#!/usr/bin/env python
"""
f2py2e - Fortran to Python C/API generator. 2nd Edition.
See __usage__ below.
Copyright 1999--2011 Pearu Peterson all rights reserved,
Pearu Peterson <[EMAIL]>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPR... |
import _init_path
import numpy as np
import caffe
import cv2
''' VGG16:
data (1, 3, 224, 224)
-------------------------
conv1_1 (1, 64, 224, 224)
conv1_2 (1, 64, 224, 224)
pool1 (1, 64, 112, 112)
-------------------------
conv2_1 (1, 128, 112, 112)
conv2_2 (1, 128, 112, 112)
pool2 (1, 128, 56, 56)
-------------... |
#!/usr/bin/env Python3
from yelluw_matches import matches
"""
These are some simple examples
that show the naming conventions
for the library.
Note that the function name follows
the convention of:
match_value_with(key)
This allows the programmer to
understand what is being matched by reading
the function name an... |
"""
Forms and validation code for user registration.
Note that all of these forms assume your user model is similar in
structure to Django's default User class. If your user model is
significantly different, you may need to write your own form class;
see the documentation for notes on custom user models with
django-re... |
#!/usr/bin/env python
import os
from metadata import Struct, Field, String, WString, I32, Array, Compact
from gen_txt import gen_for_top_level_vals
import sys
sys.path.append("scripts") # assumes is being run as ./scrpts/metadata/gen_mui.py
import util
g_script_dir = os.path.realpath(os.path.dirname(__file_... |
# Copyright (C) 2012-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
from __future__ import absolute_import, unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
######################
# FEC Customizations #
######################
# Utility Functions
def get_env_variable(var_name):
"""Get the e... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Eficent (<http://www.eficent.com/>)
# <[EMAIL]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... |
#MenuTitle: Insert Anchors into Ligatures
# -*- coding: utf-8 -*-
__doc__="""
Inserts base glyph anchors into ligatures with appropriate extensions. E.g. c_e will have top_1, bottom_1, top_2, bottom_2, and ogonek_2.
"""
import GlyphsApp
thisFont = Glyphs.font # frontmost font
thisFontMaster = thisFont.selectedFontMas... |
#! /usr/bin/env python
# Copyright (c) 2016-2018, Rethink Robotics 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 ... |
# This file is part of beets.
# Copyright 2014, Adrian Sampson.
#
# 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, ... |
# (c) 2012-2014, Michael DeHaan <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible 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 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from ui_widgetMerge import Ui_GdalToolsWidget as Ui_Widget
from widgetPluginBase import GdalToolsBasePluginWidget as BasePluginWidget
import GdalTools_utils as Utils
class GdalToolsDialog(QWidge... |
#! /usr/bin/env python
############################################################
# Program is part of PySAR v1.0 #
# Copyright(c) 2013, Heresh Fattahi #
# Author: Heresh Fattahi #
#################################... |
# Copyright (c) 2013 OpenStack Foundation
#
# 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 ... |
"""Constants and enums.
@todo: Add stencil components to L{texture_formats}.
@author: Stephan Wenger
@date: 2012-02-29
"""
import glitter.raw as _gl
from glitter.utils.dtypes import uint8, uint16, uint32, int8, int16, int32, float32
from glitter.utils.enum import Enum
format_to_length = {
#_gl.GL_COLOR_INDE... |
"""
=============================================
SNR estimation for Diffusion-Weighted Images
=============================================
Computing the Signal-to-Noise-Ratio (SNR) of DW images is still an open question,
as SNR depends on the white matter structure of interest as well as
the gradient direction corr... |
from lxml import html
import requests
import re
class List:
@classmethod
def list(cls, elems):
return [cls(el) for el in elems]
class Box(List):
DATE_XPATH = './span/text()[2]'
LINK_XPATH = './h4/a'
def __init__(self, box_element):
self.element = box_element
self.link = Li... |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <[EMAIL]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
##############
##############
## on windows: To run, in terminal: bokeh serve --allow-websocket-origin=localhost:5005 bokeh_widget_test.py --port 5005
## on windows: http://localhost:5005/bokeh_widget_test
###############
###############
from bokeh.plotting import curdoc, figure
from bokeh.io import output_file, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.