gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
#
# Copyright 2014 Quantopian, 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 ... | |
from __future__ import print_function
from cmd3.console import Console
from cmd3.shell import command
from cloudmesh_inventory.command_inventory import inventory
import hostlist
from cloudmesh_base.locations import config_file
# TODO: delete row
# TODO: add columns
# TODO: ATTRIBUTE=VALUE
class cm_shell_inventory:
... | |
"""
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from scipy.spatial import distance
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.dbscan_ ... | |
#!/usr/bin/env python
# irc.py - IRC protocol library
import random
import sys
"""
irc - IRC protocol library
Unlike most IRC protocol implementations, this library is solely concerned with
speaking the IRC protocol; it does not do any networking of its own. This module
provides five classes: "IRC", "Event", "Channe... | |
"""
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 use this ... | |
#!/usr/bin/env python
"""
------------------------------------------------------------------------
Routine to translate X and Y pixel coordinates to RA, DEC values in
multiprocessing mode.
Usage: python pix2sky_multi.py [options] image pixfile
Input:
image: Input image with basic header k... | |
#!/usr/bin/env python3
#
# Copyright (c) 2015-2017 Nest Labs, 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/lice... | |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import sys
from mixbox.binding_utils import *
from . import cybox_common
from . import gui_object
class GUIDialogboxObjectType(gui_object.GUIObjectType):
"""The GUIDialogboxObjectType type is intended to char... | |
import os
import sys
import stat
import fnmatch
import threading
import traceback
from queue import Queue
from threading import Thread, Event
from collections import defaultdict
from functools import wraps, partial, reduce
from itertools import filterfalse, chain
import sublime
# The primary DB is indexed on the fly... | |
from pytest import fixture
from mock import MagicMock
ACTION_PARENT = """
{
"class": [ "test" ],
"properties": { "Name": "Parent" },
"actions": [
{
"name": "action-one",
"method": "GET",
"href": "http://api.x.io/actions/one",
"type": "application/x-www-form-urlencoded",
"fields"... | |
"""
#;+
#; NAME:
#; igm.tau_eff
#; Version 1.0
#;
#; PURPOSE:
#; Module for tau effective
#; 07-Nov-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function
import os, imp, pickle
import numpy as np
from scipy import interpolat... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Openstack, LLC
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 ... | |
from __future__ import print_function
import fnmatch
import os
import re
import sys
import py
import pytest
import execnet
import xdist.remote
def parse_spec_config(config):
xspeclist = []
for xspec in config.getvalue("tx"):
i = xspec.find("*")
try:
num = int(xspec[:i])
e... | |
import copy
import unittest
import os
import shutil
import sys
import traceback
import numpy as np
from numpy.linalg import LinAlgError
import sklearn.datasets
from autosklearn.data.util import convert_to_bin
from autosklearn.data.competition_data_manager import CompetitionDataManager
from autosklearn.models.holdout_... | |
# Test case for the os.poll() function
import os
import random
import select
import _testcapi
try:
import threading
except ImportError:
threading = None
import time
import unittest
from test.test_support import TESTFN, run_unittest, reap_threads
try:
select.poll
except AttributeError:
raise unittest.S... | |
import inspect
import functools
import asyncio
import typing as t
import contextlib
import types
from .module import Module
from .util import isasync
FuncType = t.Callable[..., t.Any]
Decorator = t.Callable[[FuncType], FuncType]
UNSET = inspect.Parameter.empty
class NoProvider(RuntimeError):
pass
class Inje... | |
# Copyright (C) 2015 Atsushi Togo
# All rights reserved.
#
# This file is part of phono3py.
#
# 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
# noti... | |
"""
playa.ext.audio.index
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import
import hashlib
import os.path
import re
import time
import threading
from collections import defaultdict
from mutagen.easymp4 import Eas... | |
#!/usr/bin/env python
# coding=utf-8
import random,os,sys,unittest,run_app,codecs
reload(sys)
sys.setdefaultencoding( "utf-8" )
class TestCaseUnit(unittest.TestCase):
def test_positive_cmd1(self):
self.assertEqual("PASS", run_app.tryRunApp("cmd1-positive", "/opt/wrt-packertool-android-tests/apks/arm/cmd1... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
"""Wrapper to call Phabricator's Maniphest Conduit API."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# phlcon_maniphest
#
# Public Functions:
# create_task
# update_task
# query
#
# Pub... | |
# Copyright 2015, Google Inc.
# 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 conditions and the f... | |
from common_fixtures import * # NOQA
from cattle import ApiError
@pytest.fixture(scope='module')
def config_id(client):
default_lb_config = client. \
create_loadBalancerConfig(name=random_str())
default_lb_config = client.wait_success(default_lb_config)
return default_lb_config.id
# test (C)
de... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""PrograReader and ProgramEditor need to be able to read UserRole resources.
Revision ID: 3e08ed6b47b8
Revises: 2785a204a673
Create Date: 2013-12-18 22:58:18.613406
"""
# revision identifiers, used by A... | |
from __future__ import unicode_literals
import json
from moto.core.responses import BaseResponse
from .models import kinesis_backends
from werkzeug.exceptions import BadRequest
class KinesisResponse(BaseResponse):
@property
def parameters(self):
return json.loads(self.body.decode("utf-8"))
@pr... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Uber Technologies, 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 ... | |
# Lint as: python2, python3
# Copyright 2019 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
#
... | |
"""
Django settings for Library project.
Generated by 'django-admin startproject' using Django 1.9.7.
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
im... | |
import os
import time
import numpy as np
from scipy.interpolate import interp1d
from math import log, pi, sqrt, e, isnan
from matplotlib import pylab as plt
from matplotlib import mlab as mlab
from openmdao.main.api import Assembly, Component
from openmdao.lib.datatypes.api import Float, Bool, Str
from openmdao.lib.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Database abstraction layer. Simplyfies database
handling a bit.
An example of common usecase could be as such:
# Import the module
from databaselayer import database
# Create the database
myDB = database.Database('SQLite', 'database.sql')
# Create a table
myDB.execut... | |
import collections
from .base_array import base_array
from .composite import codec_kind, distance_to_next_multiply, struct_packed
from .descriptor import DescriptorField
from .exception import ProphyError
from .scalar import u32
from .six import long
class _generator_base(type):
"""
Base metaclass type i... | |
# Copyright 2014 OpenMarket Ltd
#
# 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 writin... | |
#{% macro render_field( field ) %}
# <dt>{{ field.name }}</dt>
# <dd>{{ field(**kwargs)|safe }}
# {% if field.errors %}
# <ul class=errors>
# {% for error in field.error %}
# <li> {{ errror }} </li>
# {% endfor %}
# </ul>
# {... | |
#!/usr/bin/env python
# Copyright 2014 the V8 project 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 itertools
import js2c
import multiprocessing
import optparse
import os
import random
import re
import shutil
import signal
imp... | |
from django.contrib import admin
from .models import *
class IndianlegacysectionschannelAdmin(admin.ModelAdmin):
list_display = [f.name for f in Indianlegacysectionschannel._meta.get_fields()]
admin.site.register(Indianlegacysectionschannel, IndianlegacysectionschannelAdmin)
class IndianlegacysectionsconversionE... | |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for build stages."""
from __future__ import print_function
import mock
from chromite.cbuildbot import cbuildbot_unittest
from chromite... | |
from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from sentry.models import Organization, OrganizationStatus, User, UserOption
from sentry.testutils import APITestCase
class UserDetailsTest(APITestCase):
# TODO(dcramer): theres currently no way to look up other user... | |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... | |
# thinIt, a JS/CSS minifier written in Python 2.7.12
# ------------ Setup ------------------
import os, sys, re
fileName = ""
jsTextArray = []
jsText = ""
jsMinName = ""
fileType = ""
commentsOpen = False
singleQuoteOpen = False
doubleQuoteOpen = False
madeAChange = True
comment = ""
syntax = '> thinIt.py [fileNam... | |
#!/usr/bin/python
# app.py
from flask import Flask
from flask import request, render_template
import re
import sys
import pymongo
from pymongo import MongoClient
import urlparse
import requests
import logging
import os
from flask import json
from bson.objectid import ObjectId
import ast # to convert unicode to dict
#i... | |
#!/usr/bin/env python
from google.appengine.ext.webapp import template
from google.appengine.ext import ndb
from google.appengine.api import mail
import cgi
import logging
import os.path
import webapp2
import models
from webapp2_extras import auth
from webapp2_extras import sessions
from webapp2_extras.auth import ... | |
"""Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | |
# 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... | |
# step 1. imports
from sqlalchemy import (create_engine, MetaData, Table, Column, Integer,
String, ForeignKey, Float, DateTime, event)
from sqlalchemy.orm import sessionmaker, mapper, relationship
from sqlalchemy.ext.horizontal_shard import ShardedSession
from sqlalchemy.sql import operators, visitors
import date... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
"""
kombu.transport.redis
=====================
Redis transport.
"""
from __future__ import absolute_import
from __future__ import with_statement
from bisect import bisect
from contextlib import contextmanager
from time import time
from Queue import Empty
from anyjson import loads, dumps
from kombu.exceptions impo... | |
import datetime
import json
import os
import sys
import freezegun
import pretend
import pytest
from mock import patch
from pip._vendor import pkg_resources
from pip._internal import self_outdated_check
from pip._internal.index import InstallationCandidate
from pip._internal.network.session import PipSession
from pip.... | |
# kae.py
#
# Generated on Sun Dec 30 17:39:53 +0000 2007
# AEDataModel.h
typeBoolean = b'bool'
typeChar = b'TEXT'
typeStyledUnicodeText = b'sutx'
typeEncodedString = b'encs'
typeUnicodeText = b'utxt'
typeCString = b'cstr'
typePString = b'pstr'
typeUTF16ExternalRepresentation = b'ut16'
typeUTF8Text = b'utf8'
typeS... | |
"""
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
import asyncio
import logging
from datetime import timedelta
from itertools import groupby
import voluptuous as vol
from homeassistant.core ... | |
#!/usr/bin/env python
"""
Module for simulation.
"""
import copy
import os
import numpy as np
import scipy.interpolate
import astropy.io.fits as pyfits
import healpy as hp
import numpy.lib.recfunctions as recfuncs
import fitsio
import ugali.observation.catalog
import ugali.observation.mask
import ugali.observation.r... | |
from wxPython._controls import wxLIST_MASK_STATE
from wxPython._controls import wxLIST_STATE_SELECTED
import os.path
# Modified by Francois Malan, LUMC / TU Delft
# December 2009
#
# based on the SkeletonAUIViewer:
# skeleton of an AUI-based viewer module
# Copyright (c) Charl P. Botha, TU Delft.
# set to False for 3D... | |
#!/usr/bin/env python
# Copyright 2017 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 argparse
import json
import logging
import os
import pipes
import posixpath
import random
import re
import shlex
import sys
imp... | |
# -*- coding: utf-8 -*-
from classytags.arguments import Argument, MultiValueArgument
from classytags.core import Options, Tag
from classytags.helpers import InclusionTag, AsTag
from classytags.parser import Parser
from cms.models import Page, Placeholder as PlaceholderModel
from cms.plugin_rendering import render_plac... | |
# Natural Language Toolkit: Combinatory Categorial Grammar
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Graeme Gange <ggange@csse.unimelb.edu.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
import re
from collections import defaultdict
from nltk.c... | |
from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy, mse... | |
# Copyright 2018 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... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | |
"""Defines the main menu module for a program that inputs a MemberHub directory dump,
a school roster, and a hub map to perform analyses on the MemberHub directory.
"""
import roster_tools
import hub_map_tools
import family
# import person
import roster
def FindMissingEmail(arg_list):
"""menu.FindMissingEmail
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Tintri, 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 withou... | |
"""User statistics M/C.
.. moduleauthor:: Dave Zimmelman <zimmed@zimmed.io>
Exports:
"""
import math
from core.datamodel import DataModelController, Collection
from core.decorators import classproperty
class UserStatistics(DataModelController):
@classproperty
def MODEL_RULES(cls):
rules = super(U... | |
from pyglet.gl import *
from pyglet import font
from plot_object import PlotObject
from util import strided_range, billboard_matrix
from util import get_direction_vectors
from util import dot_product, vec_sub, vec_mag
from sympy.core import S
class PlotAxes(PlotObject):
def __init__(self, *args, **kwargs):
... | |
# vim:ts=4:sts=4:sw=4:expandtab
from datetime import datetime
from django.db import models
import inspect
from satori.ars.model import *
from satori.ars import perf
from satori.core.export.type_helpers import DefineException, ArsDeferredStructure, python_to_ars_type
from satori.core.export.pc import AccessDenie... | |
# 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... | |
"""
inference
=========
EP inference drivers (in the future, other inference methods could be
implemented here as well).
"""
import numpy as np
import scipy.linalg as sla
import scipy.sparse as ssp
import scipy.io # DEBUG: Load Matlab files
import numbers
import time # For profiling
import apbsint.helpers as help... | |
# -*- coding: utf-8 -*-
"""
Django Extensions additional model fields
"""
import re
import six
import string
import warnings
try:
import uuid
HAS_UUID = True
except ImportError:
HAS_UUID = False
try:
import shortuuid
HAS_SHORT_UUID = True
except ImportError:
HAS_SHORT_UUID = False
from django... | |
"""Utilities for handling PDBQT files."""
from typing import Dict, List, Optional, Set, Tuple
from deepchem.utils.typing import RDKitMol
def pdbqt_to_pdb(filename: Optional[str] = None,
pdbqt_data: Optional[List[str]] = None) -> str:
"""Extracts the PDB part of a pdbqt file as a string.
Either ... | |
"""This module provides a generic interface for tree models
It centers around the TreeModel, which is used for all kinds of trees.
The tree gets customized by the TreeItems. Each TreeItem holds
a specific ItemData subclass. The ItemData is responsible for
delivering the data. Make sure that all TreeItems in one hierar... | |
# Copyright 2018 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... | |
"""Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2009 Benoit Chesneau <benoitc@e-engura.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all... | |
# 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
# d... | |
"""
Module for creating Three.js geometry JSON nodes.
"""
import os
from .. import constants, logger
from . import base_classes, io, api
FORMAT_VERSION = 3
class Geometry(base_classes.BaseNode):
"""Class that wraps a single mesh/geometry node."""
def __init__(self, node, parent=None):
logger.debug(... | |
# -*- coding: utf-8 -*-
# coding=utf-8
# Copyright 2019 The SGNMT 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 requir... | |
import lib.spell
from dateutil import relativedelta as rdelta
class Templates(object):
current = "Curently, it's %s and %s. "
forecast_parts = (
"By the %(period)s, the weather will turn %(description)s. ",
"The %(period)s will be %(description)s. ",
"It looks like the %(period)s of %(... | |
import laph3 as L
NONE = ()
def Spaces(n):
if n > 20:
raise 'TOO DEEP'
return '\n\n' + (n * ' * ')
class AltVisitor:
def __init__(compiled):
.compiled = compiled
.top = .compiled.tree
.mem = {}
def visitTuple(p, here, togo, shadow, real, stops, depth):
print '%s visitTuple <<< %s [[ %s ]... | |
# testing/exclusions.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..util import decorator
from . import config
from .. imp... | |
# Copyright 2012 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
#
# Unless required by a... | |
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from fileserver.HashCalc import HashSumType, hashsum, hashsum_of_file
from fileserver.ResponseWorker import ResponseByType, ResponseType
from fileserver.AdminWorker import InitializeVariables, GenerateAdmin, \
CheckAdminFrom... | |
import unittest
from test import support
import binascii
import copy
import pickle
import random
import sys
from test.support import bigmemtest, _1G, _4G
zlib = support.import_module('zlib')
requires_Compress_copy = unittest.skipUnless(
hasattr(zlib.compressobj(), "copy"),
'requires Compress.copy()')
... | |
from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib.admin import (site, ModelAdmin, SimpleListFilter,
BooleanFieldListFilter)
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
... | |
# We no longer support the old, non-colour editor!
from pywin.mfc import docview, object
from pywin.framework.editor import GetEditorOption
import win32ui
import os
import win32con
import string
import traceback
import win32api
import shutil
BAK_NONE=0
BAK_DOT_BAK=1
BAK_DOT_BAK_TEMP_DIR=2
BAK_DOT_BAK_BAK_DIR=3
MSG_C... | |
from kivy.app import App
from kivy.uix.stacklayout import StackLayout
from kivy.core.window import Window
from kivy.storage.jsonstore import JsonStore
from kivy.core.clipboard import Clipboard
from Crypto.PublicKey import RSA
import myrsa
import primenum
class Mainpage(StackLayout):
store = JsonStore('data.json... | |
import os, sys, shutil, subprocess, logging, string
import ksl.process, logging.handlers
import ksl.process.util as util
from ksl.process.install.installer import installer
from ksl.process.install.installer import getch
def main():
host_arch = os.uname()[4]
parser = build_parser(host_arch, 'kslinstall')
c... | |
from __future__ import unicode_literals
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_vali... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.autograd import Variable
from tensorboardX import SummaryWriter
dummy_input = (torch.zeros(1, 3),)
class LinearInLinear(nn.Module):
def __init__(self):
super(LinearInLinear, self).__init__()
self.l = ... | |
# ======================================================================================================================
# Libraries and Modules
# Core modules
import numpy as np
import matplotlib.pyplot as plt
import illustris_python as ilpy
import translate_coordinates as tc #renato's code for camera projectio... | |
# Copyright 2016 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... | |
# Copyright 2015 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 by applicable law or a... | |
# 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/python
#
# Copyright 2009 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... | |
import abc
from typing import Union
from . import xdr as stellar_xdr
from .exceptions import MemoInvalidException
from .type_checked import type_checked
from .utils import hex_to_bytes
__all__ = ["Memo", "NoneMemo", "TextMemo", "IdMemo", "HashMemo", "ReturnHashMemo"]
@type_checked
class Memo(object, metaclass=abc.A... | |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Windows specific tests. These are implicitly run by test_psutil.py."""
import errno
import os
import platform
import signal
imp... | |
import logging
import tornado.web
import os
import binascii
import bcrypt
import json
import datetime
import urllib
import database
import socket
import time
import threading
import tornado.web
from tornado import gen, web, httpclient
from tornado.gen import Return
from models import DeviceModel
from models import Sens... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | |
from CoreIOCs import *
import pytest
from freezegun import freeze_time
Client.severity = 'INFO'
client = Client({'url': 'https://example.com'})
def d_sort(in_dict):
return sorted(in_dict.items())
class TestGetHeaders:
def test_empty_case(self):
"""
Given:
Empty params
... | |
# Natural Language Toolkit: Probabilistic Chart Parsers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for ass... | |
"""Tests for sysconfig."""
import unittest
import sys
import os
import shutil
import subprocess
from copy import copy, deepcopy
from test.test_support import run_unittest, TESTFN, unlink, get_attribute
import sysconfig
from sysconfig import (get_paths, get_platform, get_config_vars,
get_path, ... | |
from __future__ import unicode_literals
from jinja2 import Template
from six.moves.urllib.parse import parse_qs, urlparse
from moto.core.responses import BaseResponse
from .models import route53_backend
import xmltodict
class Route53(BaseResponse):
def list_or_create_hostzone_response(self, request, full_url, he... | |
import json
from django import http
from django.db import IntegrityError
from django.db.models import F
from django.forms.models import modelformset_factory
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.csrf import csrf_exempt
import commonware.log
import waffle
import... | |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Centralize knowledge about how to create standardized Google Storage paths.
This includes definitions for various build flags:
SKIP - means a g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.