gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Command-line interface to the app.
"""
# Copyright (c) 2013 contributors; see AUTHORS.
# Licensed under the Apache License, Version 2.0
# https://www.apache.org/licenses/LICENSE-2.0
import glob
import os
import sys
import plac # pylint: disable=F0401
from gossamer.main import dispatch
from gossamer.constant imp... | |
#Problem Set
#Name: Andrew Trattner
#Collaborators: none
#Time Spent: 0:
#for leslie kaelbling bling bling
#Michael and Andy
#Weight of time and solution cost
import time
import heapq
from math import log
import sys
import random
class Puzzle:
"""
A 15-puzzle instance which takes input startin_state as a w... | |
# -*- coding: utf-8 -*-
"""
werkzeug.urls
~~~~~~~~~~~~~
``werkzeug.urls`` used to provide several wrapper functions for Python 2
urlparse, whose main purpose were to work around the behavior of the Py2
stdlib and its lack of unicode support. While this was already a somewhat
inconvenient situat... | |
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | |
# Copyright (c) 2013 - 2019 Adam Caudill and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
import argparse
import sys
from typing import List
from yawast._version import get_version
from yaw... | |
from __future__ import unicode_literals
import os
import pickle
import time
from datetime import datetime
from django.test import RequestFactory, TestCase
from django.conf import settings
from django.template import Template, Context
from django.template.response import (TemplateResponse, SimpleTemplateResponse,
... | |
#!/usr/bin/env python
# coding=utf-8
"""Author: Konrad Zemek
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Runs a command in a dockerized development environment. The files are copied
from 'source directory' to 'output directory' and then the command is ran... | |
# encoding: utf-8
"""
attribute.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
from struct import pack
from exabgp.bgp.message.notification import Notify
from exabgp.util.cache import Cache
# ================================================================... | |
# Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2014 Red Hat, 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... | |
import os
import pprint
import sys
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core import files
from devilry.apps.core.models import AssignmentGroup
from devilry.apps.core.models import Candidate
from devilry.devilry_comment.models import Comment, CommentFile
from devi... | |
"""
Google Drive (Sheets and Docs) preprocessors allow you to store content in
Google Drive and bring it into Grow. Grow will authenticate to the Google
Drive API using OAuth2 and then download content as specified in
`podspec.yaml`.
Grow supports various ways to transform the content, e.g. Sheets ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
from . import TestCase, skipIf, SkipTest, Server
import os
import testdata
import endpoints
from endpoints.environ import *
from endpoints.utils import ByteString
from endpoints.http import Request, Response
fro... | |
"""Code to handle a Hue bridge."""
import asyncio
from functools import partial
import logging
from aiohttp import client_exceptions
import aiohue
import async_timeout
import slugify as unicode_slug
import voluptuous as vol
from homeassistant import core
from homeassistant.const import HTTP_INTERNAL_SERVER_ERROR
from... | |
# pyOCD debugger
# Copyright (c) 2020 Cypress Semiconductor Corporation
# SPDX-License-Identifier: Apache-2.0
#
# 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/lic... | |
"""Support for PlayStation 4 consoles."""
import asyncio
from contextlib import suppress
import logging
from pyps4_2ndscreen.errors import NotReady, PSDataIncomplete
from pyps4_2ndscreen.media_art import TYPE_APP as PS_TYPE_APP
import pyps4_2ndscreen.ps4 as pyps4
from homeassistant.components.media_player import Medi... | |
import os
import unittest
import numpy
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import dicom
from slicer.util import VTKObservationMixin
#
# AutoSegmentationSliceletWidget
#
class AutoSegmentationSliceletWidget:
def __init__(self, parent=None):
try:
parent
... | |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | |
#!/usr/bin/env python
#
# Copyright 2010 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 o... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser.vel3d_l_wfp
@file marine-integrations/mi/dataset/parser/vel3d_l_wfp.py
@author Steve Myerson (Raytheon)
@brief Parser for the vel3d_l_wfp dataset driver"
This file contains classes for both the vel3d_l_wfp parser (recovered data)
and the vel3d_l_wfp_sio_mule parser ... | |
import os
import platform
import textwrap
import unittest
import pytest
from conans.model.ref import ConanFileReference, PackageReference
from conans.test.assets.sources import gen_function_cpp, gen_function_h
from conans.test.utils.tools import TestClient, NO_SETTINGS_PACKAGE_ID, replace_in_file
from conans.util.fil... | |
# -*- coding: utf-8 -*-
"""
myads_service.models
~~~~~~~~~~~~~~~~~~~~~
Models for the users (users) of AdsWS
"""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.mutable import Mutable
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy import Column, String, Text
fro... | |
# The MIT License
#
# Copyright 2011 Sony Ericsson Mobile Communications. All rights reserved.
# Copyright 2012 Sony Mobile Communications. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... | |
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Base object for building python classes to represent the data
in a database row.
See DBHashObject and DBRangeObject.
DBObject: base class of all data objects
"""
__author__ = 'spencer@emailscrubbed.com (Spencer Kimball)'
from functools import partial
impor... | |
import httplib as http
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException, AuthenticationFailed
def get_resource_object_member(error_key, context):
from api.base.serializers import RelationshipField
field = context['vie... | |
# -*- mode: python; coding: utf-8 -*-
import os
import re
import logging
import datetime
import mimetypes
import time
import jinja2
import email.Utils
from Cookie import BaseCookie
from routes import url_for
from google.appengine.ext.webapp import Response
from google.appengine.api import memcache, users
from drydrop.l... | |
from __future__ import unicode_literals
import django
from django import VERSION
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, transaction
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
from dj... | |
# -*- coding: utf-8 -*-
"""
ambari_jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team... | |
from lixian_query import ExactQuery
from lixian_query import SearchQuery
from lixian_query import query
from lixian_query import bt_query
import lixian_hash_bt
import lixian_url
import lixian_encoding
import re
##################################################
# queries
############################################... | |
import warnings
import numpy as np
import pandas as pd
from statsmodels.base import model
import statsmodels.base.wrapper as wrap
from statsmodels.tools.sm_exceptions import ConvergenceWarning
class _DimReductionRegression(model.Model):
"""
A base class for dimension reduction regression methods.
"""
... | |
from __future__ import division
import numpy as np
from scipy.linalg import solve
import sys
import time
from properties import *
from parse_file import *
class RealTime(object):
"""A RealTime object contains important parsed data from a Gaussian RealTime
log file.
Attributes:
name: A s... | |
import random
import math
class Board:
"""
A Board object represent the Dots puzzle, which is a container for MxN array of tiles. Each tile in turn may contain
a 'colored' dot or sometimes can be empty as in blockage tile.
"""
def __init__(self, rows, cols, gen):
"""
Create a Board... | |
# Copyright (c) 2015 - present. Boling Consulting Solutions, BCSW.net
#
# 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 ... | |
# Copyright 2012 IBM Corp.
# Copyright 2013 Red Hat, 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 r... | |
from __future__ import unicode_literals
import json
import boto
import boto.s3
import boto.s3.key
import boto.cloudformation
from boto.exception import BotoServerError
import sure # noqa
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises # noqa
from nose.tools import... | |
"""
This is a REST server that accept requests to control the PiGlow board.
A few interesting things about this server:
* It is designed with a RESTful Api
* It uses a global lock to queue up operations to the PiGlow
Run this server like this:
python pg_rest_server.py
Example in using th... | |
#coding=UTF-8
'''
Created on 2011-7-5
@author: Administrator
'''
import threading
import time
from spider import soufang
from spider import ganji
from spider import tongcheng58
from spider.threadpool import ThreadPool, makeRequests
import urllib2
import urllib
from spider.globalvars import fetch_quere
from spider.jjr... | |
''' Script to check the correctness of the clustering for different data types.
'''
import unittest
import os
import numpy as np
from pixel_clusterizer.clusterizer import HitClusterizer, default_hits_descr, default_hits_dtype, default_clusters_dtype, default_clusters_descr, default_cluster_hits_descr, default_cluste... | |
"""
Novell ASAM Runner
==================
.. versionadded:: 2015.8.0
Runner to interact with Novell ASAM Fan-Out Driver
:codeauthor: Nitin Madhok <nmadhok@g.clemson.edu>
To use this runner, set up the Novell Fan-Out Driver URL, username and password in the
master configuration at ``/etc/salt/master`` or ``/etc/salt... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:55881")
else:
access = Se... | |
import tensorflow as tf
import os
import sys
sys.path.append(os.path.realpath(".."))
import helpers.utils as hlp
import subprocess
from redis import Redis
import time
from helpers.layers import denselayer
from models.ddpg_network import DDPGNetwork
import numpy as np
class DDPGTrainer(DDPGNetwork):
def __init_... | |
# -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by Jurgen Hermann found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by Fernando Perez (fperez@colorado.edu).
Information on the original HTML highligh... | |
# Natural Language Toolkit: API for alignment and translation objects
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Will Zhang <wilzzha@gmail.com>
# Guan Gui <ggui@student.unimelb.edu.au>
# Steven Bird <stevenbird1@gmail.com>
# Tah Wei Hoon <hoon.tw@gmail.com>
# URL: <http://nltk.org/>
# F... | |
# 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... | |
"""
footer
======
**Module** : ``footer.footer.py``
Contains the :py:class:`.Footer`, the footer of the application.
Contains the :py:class:`.FooterSpinner`, for information and
the menus in the footer.
"""
from kivy.uix.stacklayout import StackLayout
from kivy.uix.spinner import Spinner
from kivy.properties import... | |
# 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... | |
#!/usr/bin/env python
#
# Copyright (c) 2002 Vivake Gupta (vivakeATomniscia.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or ... | |
# Copyright (c) 2014,Vienna University of Technology, Department of Geodesy and Geoinformation
# 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 a... | |
import os
import shutil
import tempfile
import warnings
import numpy
from pickle import loads
from pickle import dumps
from sklearn.datasets import get_data_home
from sklearn.datasets import clear_data_home
from sklearn.datasets import load_files
from sklearn.datasets import load_sample_images
from sklearn.datasets im... | |
#
# Copyright (c) SAS Institute 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 in w... | |
import csv
import sys
import numpy
import math
from numpy import genfromtxt
from numpy.linalg import inv
import random
from random import randint
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes3D
import time
start_time = time.time()
# Given values
d = 5 # number of dime... | |
#!/usr/bin/env python
#
# Copyright 2010 The Closure Linter 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
#... | |
# coding=utf-8
# Copyright 2021 The Deadunits 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... | |
# Python 3 migration-ify
# (20200910/vicchi)
# import types
import os
import os.path
import csv
import json
import geojson
import logging
import math
import tempfile
import urllib
import requests
import mapzen.whosonfirst.machinetag
import machinetag.elasticsearch.hierarchy
import mapzen.whosonfirst.utils
import map... | |
"""
Library for processing SHARAD data
Author: Cyril Grima <cyril.grima@gmail.com>
"""
import numpy as np
import pandas as pd
import raw
from scipy.interpolate import splrep, splev
import matplotlib.pyplot as plt
import scipy.constants as ct
from planetbody import mars, ellipsoid
import rsr.utils
import rsr.fit
import... | |
# Copyright (c) 2018-2020, Manfred Moitzi
# License: MIT License
import pytest
import ezdxf
import math
from ezdxf.math import (
ConstructionArc,
ConstructionCircle,
ConstructionLine,
UCS,
Vec3,
Vec2,
arc_segment_count,
)
from math import isclose
def test_arc_from_2p_angle_complex():
... | |
"""
SoftLayer.tests.CLI.modules.server_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a series of integration tests designed to test the complete
command line interface.
:license: MIT, see LICENSE for more details.
"""
import mock
from SoftLayer.CLI import exceptions
from SoftLayer impor... | |
#!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com>
#
# 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',
... | |
# -*- coding: utf-8 -*-
"""
Most statements correspond to some action on the database. Some of these
actions may be complex, but intuitively ``a.B()``, the Query form, will query
against the database for the value or values that are related to ``a`` through
``B``; on the other hand, ``a.B(c)``, the Update form, will a... | |
#
# OpenMX.py
#
# Interface to OpenMX (http://openmx-square.org)
#
# Copyright (c) 2018 Yuto Tanaka
#
# This file is distributed under the terms of the MIT license.
# Please see the file 'LICENCE.txt' in the root directory
# or http://opensource.org/licenses/mit-license.php for information.
#
import numpy as np
"""Op... | |
# Copyright 2016 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... | |
from pycket.values import W_MVector, W_VectorSuper, W_Fixnum, W_Flonum, W_Character, UNROLLING_CUTOFF, wrap
from pycket.base import W_Object, SingletonMeta
from pycket import config
from rpython.rlib import debug, jit
from rpython.rlib import rerased
from rpython.rlib.objectmodel import newlist_hint, import_from_mixi... | |
#!/usr/bin/env python
# Copyright 2016 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.
"""api_static_checks.py - Enforce Cronet API requirements."""
import argparse
import os
import re
import shutil
import sys
import te... | |
"""Submodule for timing components of a code.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from datetime import datetime
import warnings
import numpy as np
import click
from . import inout_core
__all__ = ['Timer', 'Timings', 'TimeIt']
class TimeIt:
def __init__(self... | |
r"""
This is based on SmartyPants.py by `Chad Miller`_.
Copyright and License
=====================
SmartyPants_ license::
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitt... | |
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime
from django import forms
from django.conf import settings
from django.core.validators import URLValidator
from django.forms import widgets
from django.forms.extras.widgets import SelectDateWidget
from django.forms.models import modelformset_fa... | |
"""GradingPeriods API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class GradingPeriodsAPI(BaseCanvasAPI):
"""GradingPeriods API Version... | |
"""
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | |
# 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 agree... | |
#!/usr/bin/env python
"""Build 837 parsers and 837 Segment definitions from XML Configuration.
Synopsis
========
:samp:`make837.py -p {python} -d {django} -b {baseDir} {name=source}...`
Description
===========
Reads the PyX12 source files (in .XML) and writes a Python parser module
for unmarshalling messages as wel... | |
# 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... | |
from {{appname}}.database.mongodblib import db, client
from {{appname}}.lib.powlib import pluralize
import datetime
import xmltodict
import simplejson as json
import datetime, decimal
from {{appname}}.conf.config import myapp
from {{appname}}.lib.powlib import merge_two_dicts
from {{appname}}.lib.encoders import pow_js... | |
#!/usr/bin/python
# Copyright 2015 The ANGLE 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.
#
# gen_texture_format_table.py:
# Code generation for texture format map
#
import json
import math
import pprint
import re
template... | |
#!/usr/bin/env python
import os
import sys
import shutil
import tempfile
import subprocess
from distutils.core import setup, Command
from distutils.dir_util import remove_tree
MODULE_NAME = "binwalk"
SCRIPT_NAME = MODULE_NAME
# Python2/3 compliance
try:
raw_input
except NameError:
raw_input = input
# cd into... | |
from __future__ import absolute_import
from __future__ import unicode_literals
import mock
import sys
if sys.version_info >= (2, 7):
import unittest
else: # pragma: nocover
from django.utils import unittest # noqa
from django import forms
from django.test import TestCase
from django_filters.fields import ... | |
import itertools
from random import random, choice, randint
from field import wall, Location
from shared import *
"""
Simplify path finding? * available starting points; - and |: available doorways
|*
|*
#
--##
**
**
##--
#
*|
"""
class Path(object):
def __init__(self):
self.pat... | |
#!/usr/bin/python
# Copyright 2016 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 a... | |
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
#from flask.ext.sqlalchemy import SQLAlchemy
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
from time import sleep
""" BeagleBone Black setup """
GPIO.setup("P8... | |
#!/usr/bin/env python
# encoding: utf-8
"""
This module of native functions is implemented for
compatability with 010 editor functions. Some of these functions
are nops, some are fully implemented.
"""
import six
import sys
from pfp.native import native
import pfp.fields
import pfp.errors as errors
import pfp.bitwra... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | |
# In order to manipulate the array
import numpy as np
# In order to load mat file
from scipy.io import loadmat
# In order to import the libsvm format dataset
from sklearn.datasets import load_svmlight_file
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import Imputer
from sklearn.preprocess... | |
"""
Module to provide ceph control with salt.
:depends: - ceph_cfg Python module
.. versionadded:: 2016.11.0
"""
import logging
log = logging.getLogger(__name__)
__virtualname__ = "ceph"
try:
import ceph_cfg
HAS_CEPH_CFG = True
except ImportError:
HAS_CEPH_CFG = False
def __virtual__():
if HA... | |
from django.contrib.auth.models import User
from core.tests import datautil
from package.models import Category, Package, Version
from profiles.models import Profile
def load():
category, created = Category.objects.get_or_create(
pk=2,
description=u'Large efforts that combine many python modules ... | |
# Copyright 2014 The Oppia 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 applicable ... | |
#!/usr/bin/python
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for ... | |
#!/usr/bin/env python
# Copyright 2017 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... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | |
# 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... | |
#!/usr/bin/env python
# coding: utf-8
# Based on the pylletTown demo, Copyright (c) 2015 Renfred Harper
# Copyright (c) 2015 Dominic Delabruere
from __future__ import print_function
import pygame
from . import find_res
from . import tmx
from .player import Player
from .font import RegularFont
from .menu import Menu... | |
#!/usr/bin/env python
"""
OpenMM ForceField residue template generators.
"""
from __future__ import absolute_import
import numpy as np
import os, os.path, sys
from simtk.openmm.app import ForceField
from openmoltools.amber import run_antechamber
from openmoltools.openeye import get_charges
from simtk.openmm.app impo... | |
import imp
import threading
from django.conf import settings
from webassets.env import (
BaseEnvironment, ConfigStorage, Resolver, url_prefix_join)
from webassets.exceptions import ImminentDeprecationWarning
from django_assets.glob import Globber, has_magic
__all__ = ('register',)
class DjangoConfigStorage(Co... | |
# Copyright (c) 2015 Mirantis, 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 requir... | |
"""
Internal shared-state variables such as config settings and host lists.
"""
import os
import sys
from optparse import make_option
from fabric.network import HostConnectionCache, ssh
from fabric.version import get_version
from fabric.utils import _AliasDict, _AttributeDict
#
# Win32 flag
#
# Impacts a handful o... | |
from __future__ import absolute_import, division, print_function
from datetime import timedelta
from datetime import datetime
import astropy.units as u
from sunpy.time import parse_time
from sunpy import config
from sunpy.extern.six.moves import range
TIME_FORMAT = config.get('general', 'time_format')
__all__ = ['... | |
import math
from datetime import datetime
from conch import analyze_segments
from conch.analysis.segments import SegmentMapping
from .helper import generate_pitch_function
from ..segments import generate_utterance_segments
from ...exceptions import SpeakerAttributeError
from ..classes import Track, TimePoint
from ..... | |
'''
Unit tests for yedit
'''
import os
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error
# place yedit in ... | |
# Copyright 2014 Cloudera 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 in writing, so... | |
"""
===============================================================================
Use pysam model to calculate the AS from bam file
===============================================================================
Author : Shujia Huang
Date : 2014-03-25 14:29:08
"""
import sys
import re
import optparse
import os
impo... | |
# Copyright 2013 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 ap... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import calendar
from ujson import loads
from tests.unit.base import ApiTestCase
from preggy import expect
from tornado.testing import gen_test
from tornado.httpclient import HTTPError
from datetime import datetime
from tests.fixtures import ReviewFactory, PageFact... | |
from __future__ import absolute_import
import logging
import six
from collections import defaultdict
from sentry import features
from sentry.models.useroption import UserOption
from sentry.shared_integrations.exceptions import ApiError, IntegrationError
from sentry.models import Activity, ExternalIssue, Group, GroupL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.