gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... | |
# Funicular.js - Websocket Server Component
# https://github.com/adeniszczyc/Funicular.js
#
# Ensure you have read the README and have all dependancies up and running.
# Run through terminal with:
# $ python server.py
#### ------- Settings ------- ####
port = 8888
#### ------- Imports ------- ####
# tornado - Webso... | |
# Copyright (c) 2013 Rackspace Hosting
# 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 req... | |
#!/usr/bin/env python
#coding=utf-8
import os.path
import datetime
from itertools import chain
# from itertools import zip_longest
from io import BytesIO
from reportlab.lib.styles import ParagraphStyle as PS
from reportlab.platypus import PageBreak
from reportlab.platypus.paragraph import Paragraph
from reportlab.pla... | |
# coding: utf-8
# In[15]:
import numpy as np
import Tkinter
import time
import sys
# In[16]:
class Board:
"""
rows: board size
board: a 8x8 matrix of colors
color: a value in [0,1,2]: none, black, white, respectively.
move: a array [row,col]
directions: a set of all nine unit vectors
o... | |
# Copyright 2011 Nicholas Bray
#
# 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... | |
#!/usr/bin/env python3
# for all the images in the fitted group, generate a 2d polygon
# surface fit. Then project the individual images onto this surface
# and generate an AC3D model.
#
# Note: insufficient image overlap (or long linear image match chains)
# are not good. Ideally we would have a nice mesh of match ... | |
"""
utils.py
Various & sundry utility methods, mostly related to dataset conversion and
loading, signal processing, etc. The rationale for providing these functions
here rather than as part of the Net class is to facilitate the convenient
manipulation of data in the interactive shell, particularly when using
NN models... | |
"""Checkout related views."""
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.template.response import TemplateResponse
from ...account.forms import LoginForm
from ...core.utils import (
format_money, get_user_shipping_country, to_local_currency)
fr... | |
# Copyright (c) 2014-2015 Bruno Daniel <bruno.daniel@blue-yonder.com>
# Copyright (c) 2015-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016-2019 Ashley Whetter <ashley@awhetter.co.uk>
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2016 Glenn Matthews <glenn@e-dad.net>
# Copyrigh... | |
import wx
from wx import glcanvas
import pyglet
# this line is very important, we're tricking pyglet into thinking there is a context avalible
# but we can't make it work with the shadow window that alows sharing of
# object between contexts
pyglet.options['shadow_window'] = False
# now that that is set we can impo... | |
from tastypie import http, fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from ..core.api import (ProductVersionResource, ProductResource,
UserResource)
from .models import CaseVersion, Case, Suite, CaseStep, Su... | |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | |
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.core.paginator import Paginator, InvalidPage
from django.core.urlresolvers import reverse, reverse_lazy
from django.http import Http404, HttpResponseRedirect
from django.shortcut... | |
# Copyright 2014 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 agreed to in writing, s... | |
"""Unit test module for Demographics API"""
import json
from flask_webtest import SessionScope
from portal.extensions import db
from portal.models.audit import Audit
from portal.models.auth import AuthProvider
from portal.models.identifier import Identifier
from portal.models.organization import Organization, OrgTre... | |
#!/usr/bin/env python
# Script that runs the functional tests on the Sharpmake. It does not take any argument.
#
# This script supports Python 3.
import os.path
import platform
import sys
if os.name != "nt":
import select
class FunctionalTest(object):
def __init__(self, directory, script_name, extra_args =... | |
""" Bokeh comes with a number of interactive tools.
There are five types of tool interactions:
.. hlist::
:columns: 5
* Pan/Drag
* Click/Tap
* Scroll/Pinch
* Actions
* Inspectors
For the first three comprise the category of gesture tools, and only
one tool for each gesture can be active at a... | |
import os
import sys
from zeus.config import ConfigManager
from zeus.common import FabricManager
from zeus.common import PasswordManager
from zeus.configmanagement import ConfigEditor
from zeus.ubuntu import RepoManager
from zeus.services import ServiceControl
from fabric.api import parallel, roles, run, env, execu... | |
# coding=utf-8
# Copyright 2022 The ML Fairness Gym 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 applicab... | |
import json
import logging
from datetime import timedelta
from django.utils import timezone
from django.urls import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import log... | |
"""
implementation of criteo dataset
"""
# pylint: disable=unused-argument,missing-docstring
import logging
import os
import sys
import re
import time
import random
import numpy as np
import sklearn.metrics
import inspect
# pytorch
import torch
from torch.utils.data import Dataset, RandomSampler
logging.basicConfig... | |
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright (C) 2006 Fluendo, S.A. (www.fluendo.com).
# Copyright 2006,2007,2008,2009 Frank Scholz <coherence@beebits.net>
import time
from urlparse import urlsplit
from twisted.internet import reactor, defer
from twisted.web import re... | |
# Copyright 2020 The TensorFlow Probability 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 applicable law o... | |
import json
import re
from .core import absolute_url
from .curl import curl_connection
from ftp_deploy.conf import *
class repository_parser(object):
def __init__(self, data, service):
self.service = service
self.data = data
self.service_repo = service.repo_source
def credentials(se... | |
# -*- coding: utf-8 -*-
# Code taken from https://github.com/VitaliyRodnenko/geeknote
# Author: Vitaly Rodnenko - vitaliy@rodnenko.ru
# The code does not carry a license, but Vitaly gave personal permission.
import os, sys
import time
import uuid
import logging
try:
# python 3
from http import client as ht... | |
"""
Classes and functions to create PH filtering images for COS FUV observations
( PHAIMAGE )
"""
__author__ = 'Justin Ely'
__maintainer__ = 'Justin Ely'
__email__ = 'ely@stsci.edu'
__status__ = 'Active'
from datetime import datetime
import os
import sys
import glob
from astropy.io import fits
import numpy as np
f... | |
"""
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
# note: avoid importing non-builtin modules
import ... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__=''' $Id: dodyssey.py 3959 2012-09-27 14:39:39Z robin $ '''
__doc__=''
#REPORTLAB_TEST_SCRIPT
import sys, copy, os
from reportlab.platypus import *
_NEW_PARA=os.environ.get('NEW_PARA','0')[0] in ('y','Y','1')
_REDCAP=int(os.envi... | |
from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
import time
import traceback
from io import BytesIO
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_... | |
#!/usr/bin/env python
# Update measurement catalogs using the broken up measid/objectid lists
# from nsc_instcal_combine_breakup_idstr.py
import os
import sys
import numpy as np
import time
from dlnpyutils import utils as dln, db
from astropy.table import Table
from astropy.io import fits
import sqlite3
import socket... | |
import copy
import hearthbreaker.targeting
from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY
from hearthbreaker.game_objects import Card, Minion, MinionCard
class CircleOfHealing(Card):
def __init__(self):
super().__init__("Circle of Healing", 0, CHARACTER_CLASS.PRIEST,
... | |
# Copyright 2020 DeepMind Technologies Limited.
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | |
import unittest
import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
def _sigmoid(x):
half = x.dtype.type(0.5)
... | |
import json
import uuid
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import connection
from django.db.models import Count, Q, Sum
from djang... | |
# Copyright (c) 2015 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
#tetris.py
from Tkinter import *
import random
def tetrisMousePressed(canvas,event):
tetrisRedrawAll(canvas)
def tetrisKeyPressed(canvas,event):
if event.keysym == "r":
tetrisInit(canvas)
if (canvas.data.isTetrisGameOver == False):
if event.keysym == "Left":
moveFallingPiece(c... | |
from direct.gui.DirectGui import *
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.DirectObject import DirectObject
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.toonbase import Toonto... | |
# Copyright 2013 IBM Corp.
#
# 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 wri... | |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import warnings
from ..externals.six import string_types
import numpy as np
from .. import pick_types, pick_channels... | |
#!/bin/env python
from builtins import str
import argparse
import os
import sys
import csv
import time
import datetime
import arrow
import re
from collections import defaultdict
from sqlalchemy import func
file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.abspath(os.path.jo... | |
# Copyright 2017 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... | |
"""
The base Command class.
All commands in Evennia inherit from the 'Command' class in this module.
"""
from builtins import range
import re
from django.conf import settings
from evennia.locks.lockhandler import LockHandler
from evennia.utils.utils import is_iter, fill, lazy_property, make_iter
from future.utils ... | |
#!/usr/bin/python
# Copyright (c) 2011 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.
import os
import time
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils
class HistoryTest(p... | |
import pytest
import copy
from .common import * # NOQA
namespace = {
"cluster": None,
"project": None,
"system_project": None,
"system_project_client": None
}
cluster_query_template = {
"obj": None,
"action_name": "query",
"filters": {},
"metricParams": {},
"interval": "5s",
... | |
import os
import sys
import datetime
from pkg_resources import resource_filename
import numpy as np
import matplotlib.pyplot as plt
import pandas
import nose.tools as nt
import numpy.testing as nptest
from matplotlib.testing.decorators import image_comparison, cleanup
import pandas.util.testing as pdtest
import wqio... | |
from __future__ import absolute_import
import re
from datetime import timedelta
import numpy as np
import pandas as pd
from xarray.core import pycompat
from xarray.core.utils import is_scalar
def named(name, pattern):
return '(?P<' + name + '>' + pattern + ')'
def optional(x):
return '(?:' + x + ')?'
de... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
from __future__ import division
"""
Handles sentence parsing procedures.
"""
PARSE='/Lab/Tools/bin/parse'
import os,pytxt
def getSents(ifn):
f=open(ifn)
t=str(f.read())
f.close()
sents=t.split('<sentence ')
return sents[1:]
def getNumWords(sentence):
return len(sentence.split('<word>'))-1
def parsetxt(txt):
... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 18 01:55:47 2015
@author: marios michailidis
"""
# licence: FreeBSD
"""
Copyright (c) 2015, Marios Michailidis
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions a... | |
# encoding: utf-8
"""Autoshape-related objects such as Shape and Adjustment."""
from __future__ import absolute_import, division, print_function, unicode_literals
from numbers import Number
from pptx.dml.fill import FillFormat
from pptx.dml.line import LineFormat
from pptx.enum.shapes import MSO_AUTO_SHAPE_TYPE, MS... | |
'''
Test to make sure that the downsampling of the catalog
produces (more or less) the same results as the full catalog
'''
import env
import numpy as np
import catalog as Cat
import evolver as Evol
import observables as Obvs
import util as UT
import matplotlib.pyplot as plt
import corner as DFM
from ChangTools.... | |
# Copyright (c) 2016, Intel Corporation.
# 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 r... | |
import os
import re
import codecs
from utils import create_dico, create_mapping, zero_digits
from utils import iob2, iob_iobes
unknown_word='<UNK>';
def load_sentences(path, lower, zeros):
#{{{
"""
Load sentences. A line must contain at least a word and its tag.
Sentences are separated by empty lines.
... | |
#!/usr/bin/env python2
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lice... | |
#! python
#
# Backend for Silicon Labs CP2110/4 HID-to-UART devices.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
# (C) 2019 Google LLC
#
# SPDX-License-Identifier: BSD-3-Clause
# This backend implements support for HID-to-UART devices manu... | |
# BridgeDB by Nick Mathewson.
# Copyright (c) 2007-2013, The Tor Project, Inc.
# See LICENSE for licensing information
"""
This module implements the email interface to the bridge database.
"""
from StringIO import StringIO
import MimeWriter
import gettext
import gpgme
import logging
import re
import rfc822
import ti... | |
import math
import numpy as np
from PyQt5.QtCore import Qt, QPoint, QRect, pyqtSignal
from PyQt5.QtGui import QPainter, QImage, QPen, QColor, QBrush
from PyQt5.QtWidgets import QWidget, QScrollBar, QHBoxLayout
# FIXME[todo]: implementation: up to now this is mainly a stub (a copy of QActivationView)
# FIXME[todo]: ... | |
""" A simple genetic algorithm for parameter search """
import random
import numpy as np
from kernel_tuner.strategies.minimize import _cost_func
from kernel_tuner import util
def tune(runner, kernel_options, device_options, tuning_options):
""" Find the best performing kernel configuration in the parameter space... | |
import numpy as npy
import pyvisa.constants
import time
from .abcvna import VNA
from ...frequency import *
from ...network import *
class HP8510C(VNA):
'''
Slightly more sophisticated 8510 driver than the one in vna_old.py, which is preserved for compatibility.
Features:
* Chunked Sweep -- sweep with ... | |
# Copyright (c) 2012 Rackspace Hosting
# 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 req... | |
import sublime
import os
from .pathhelper import *
from .sublimefunctions import *
def isdigit(string):
try:
int(string)
except ValueError:
return False
else:
return True
def set_status(view, key, value):
if view:
view.set_status(key, value)
else:
sm(value... | |
"""The tests for the Entity component helper."""
# pylint: disable=protected-access
import asyncio
from collections import OrderedDict
import logging
import unittest
from unittest.mock import patch, Mock
from datetime import timedelta
import pytest
import homeassistant.core as ha
from homeassistant.exceptions import ... | |
"""
Manage OS-level configuration.
"""
import logging
l = logging.getLogger("angr.simos")
from archinfo import ArchARM, ArchMIPS32, ArchX86, ArchAMD64
from simuvex import SimState, SimIRSB, SimStateSystem, SimActionData
from simuvex import s_options as o
from simuvex.s_procedure import SimProcedure, SimProcedureConti... | |
#!/usr/bin/env python
import os, sys, re
try:
import rosidl_parser
except ImportError:
print("\n\033[93mUnable to import the rosidl_parser module. Perhaps you haven't yet sourced the \ninstall/setup.bash file in your ros2 workspace?\033[0m\n\n")
sys.exit(1)
def enforce_alignment(cur_alignment, required_alignmen... | |
"""
SpaceCRAFT - Astro Pi competition[http://astro-pi.org/] entry
Conceived by Hannah Belshaw
Created by Martin O'Hanlon[http://www.stuffaboutcode.com]
For the Raspberry Pi Foundation[https://www.raspberrypi.org]
mcmodels.py
A collections of models which can be used in minecraft
"""
from minecraftstuff import Minecr... | |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | |
import unittest
import mock
import logging
import json
import sys
import datetime
import uuid
import os
import esgfpid
# Logging
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
# Test resources:
from resources.TESTVALUES import *
'''
Unit tests for esgfpid.utils.
This module does not ... | |
import inspect
import os
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admindocs import utils
from django.contrib.admindocs.utils import (
... | |
#!/usr/bin/env python3
import argparse
import re
import os
import sys
import itertools
import subprocess
import math
from collections import OrderedDict
parser = argparse.ArgumentParser()
parser.add_argument('log_files', nargs='+')
parser.add_argument('--output')
parser.add_argument('--max-steps', type=int, default=0)... | |
"""
util tests
"""
import os
import stat
import sys
import shutil
import tempfile
import pytest
from mock import Mock, patch
from pip.exceptions import BadCommand
from pip.util import (egg_link_path, Inf, get_installed_distributions,
find_command, untar_file, unzip_file)
from pip.commands.freez... | |
# -*- coding: utf-8 -*-
"""
This file is part of labella.py.
This class is not included in the original Labella.js, but is modelled on
https://kristw.github.io/d3kit-timeline/
The idea is to make a simple timeline of objects which have text or no text.
Items must be added as dicts: {'time': value, 'width': int, 'tex... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Sundry function and class decorators."""
import functools
import inspect
import textwrap
import threading
import types
import warnings
from inspect import signature
from functools import wraps
from .exceptions import (AstropyD... | |
#!python
# -*- coding: utf-8 -*-
"""
Core Haystack Session client tests. This class is intended to test the
core functions of PyHaystack's session class.
"""
# Assume unicode literals as per Python 3
from __future__ import unicode_literals
import pytest
from pyhaystack.client.http import dummy as dummy_http
from py... | |
#!/usr/bin/env python
# Copyright (C) 2012 Zulip, Inc.
#
# 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, m... | |
"""
Run integration tests from pixsim through redshifts
python -m desispec.test.integration_test
"""
from __future__ import absolute_import, print_function
import sys
import os
import random
import time
import numpy as np
from astropy.io import fits
from desispec.pipeline import runcmd
from desispec import io
from d... | |
# encoding: UTF-8
"""
Implement phytool command 'impact-model'.
"""
from __future__ import print_function
import os
import sys
import logging
import traceback
import shutil
from argparse import ArgumentParser
import matplotlib.pyplot as plt
from phantasy.library.lattice.impact import OUTPUT_MODE_END
from phantasy... | |
# Copyright (c) 2012 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... | |
import os, sys
import argparse
import numpy as np
import h5py
from text_utils import TextEncoder # This is my version
#sys.path.append('pytorch-openai-transformer-lm')
import csv
# Needed for BPE stuff
pretrained_model_path = os.path.join('.', 'finetune-transformer-lm', 'model')
# Needed for the train/dev/test f... | |
"""
Tools for generating forms based on SQLAlchemy models.
"""
import inspect
from wtforms import fields as f
from wtforms import validators
from wtforms.form import Form
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField
from wtforms.ext.sqlal... | |
'''
AT-SPI interface viewer plugin.
@author: Eitan Isaacson
@organization: Mozilla Foundation
@copyright: Copyright (c) 2007 Mozilla Foundation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms of the BSD which accompanies this distribution, and
is ava... | |
from datetime import datetime
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ValidationError
from django.http ... | |
import abc
import copy
import logging
import itertools
import os
import uuid
import sys
import time
import datetime
import signal
import subprocess
import re
import multiprocessing
import signal
from yapsy.PluginManager import PluginManager
from yapsy.IPluginLocator import IPluginLocator
from threading import Thread
f... | |
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | |
"""
IDAPython script providing an user interface for setting the configuration for
annotating database files with MSDN information.
Authors: Moritz Raabe, William Ballenthin
Copyright 2014 Mandiant, A FireEye Company
Mandiant licenses this file to you under the Apache License, Version
2.0 (the "License"); you may not... | |
"""Support for computing limited differences needed in reconstruction
of slopes in constructing interface states."""
import numpy as np
def limit(data, myg, idir, limiter):
""" a single driver that calls the different limiters based on the value
of the limiter input variable."""
if limiter == 0:
... | |
"""
Stratified Multiphase Plume
===========================
This module contains the numerical solution for the `stratified_plume_model`
module. Some of the general tools for handling the multiphase components are
contained in `dispersed_phases`.
"""
# S. Socolofsky, November 2014, Texas A&M University <socolofs@tam... | |
from abc import ABCMeta, abstractmethod, abstractproperty
import warnings
import numpy as np
import sympy
import sympy.physics.quantum as sq
from parampy import Parameters
from .operator import Operator
class Basis(object):
'''
A Basis instance describes a particular basis, and allows transformations
of objects... | |
# orm/unitofwork.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The internals for the unit of work system.
The session's flush() process pass... | |
# -*- coding: utf-8 -*-
import re
import warnings
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q
from django.db.models.expressions import RawSQL
from django.utils.translation import gettext_lazy
from .abst... | |
'''
Created on 2013.09.07.
'''
import subprocess
import os
import re
import sys
import time, datetime
import RPi.GPIO as GPIO
import smbus
from libs.Adapy.Adafruit_I2C.Adafruit_I2C import Adafruit_I2C
from node.communication.log_message import LogMessage
from node.sensor.sensor_data import SensorData
from node.sensor... | |
"""Tests for each of the various configuration options.
"""
from nose.tools import assert_raises
from tests.helpers import ProgramTest, SystemExitCaught, NonZeroReturned
from babel.messages import Catalog
class TestNoTemplate(ProgramTest):
"""Template pot file can be disabled.
"""
def test(self):
... | |
# -*- 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 model 'Rss_url'
db.create_table('blogs_rss_url', (
('id', self.gf('django.db.models.fie... | |
## @package rnn_cell
# Module caffe2.python.rnn_cell
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import inspect
import itertools
import logging
import numpy as np
import random
import six
from futu... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import functools
import re
try:
unicode('a')
except:
unicode=str
from ..logger import get_module_logging
logging = get_module_logging(__name__)
navigator_domains = []
#FIXME: hacks!
isDataset = lambda ds: (hasattr(ds, 'dstype') and hasattr(ds, 'datatype'))
QtUserRole ... | |
from __future__ import unicode_literals
import json
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from .const import PAGINATION_CHOICES
try:
from urllib.parse import urlparse
except Imp... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 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.apache.org/l... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
__author__ = 'sean.braley'
import re
import math
import nltk
import string
import progressbar
from knowledge_base import genres_pulp, authors_pulp, transition_words, exclusion_words
from utils import sylco
def average(l):
return reduce(lambda x, y: x + y, l) / float(len(l))
# http://rosettacode.org/wiki/Map_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.