gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from django.shortcuts import get_object_or_404
from django.db.models import Q
from rest_framework import viewsets, filters
from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAdminUser, IsAuthenticated
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentica... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import abc
import errno
import fcntl
import fnmatch
import logging
import argparse
import contextlib
from concurrent import futures
import lehash
class File(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
def openflag(self):
... | |
# Copyright 2018 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... | |
# -*- coding: utf-8 -*-
from collections import Mapping, Sequence
from operator import itemgetter
import math
import time
import numpy as np
import scipy.sparse as sp
import random
from sklearn.preprocessing import normalize
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import atleast... | |
"""
API routes
~~~~~~~~~~
Routes from this file are included first.
Routes that can't be grouped under an endpoint go here
"""
import os
from app import gpg
from app.core import ApiResponse, ApiException
from app.tasks import send_to_ks
from flask import current_app, request
from flask_jsonschema impo... | |
# Natural Language Toolkit: Classifier Interface
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# Dan Garrette <dhgarrette@gmail.com>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Interfaces and base classes for theorem provers and model builders.
``Prover`` is a standard interfac... | |
import errno
import msgpack
from twisted.python import failure
from twisted.internet import protocol
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet import task
from twisted.protocols import policies
MSGTYPE_REQUEST=0
MSGTYPE_RESPONSE=1
MSGTYPE_NOTIFICATION=2
class Msgpa... | |
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin... | |
import sys
import pytest
from click.core import Argument
from click.core import Command
from click.core import Group
from click.core import Option
from click.shell_completion import CompletionItem
from click.shell_completion import ShellComplete
from click.types import Choice
from click.types import File
from click.t... | |
# Copyright 2020 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
"""Tests for the _pyjava module.
This package contains tests for the internal components of PyJava, implemented
in C as the _pyjava package. Even if it is not used directly but rather through
the pyjava Python interface, the package is covered by tests.
"""
import math
import _pyjava
from base import PyjavaTestCas... | |
# Copyright 2012 Nebula, 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 agree... | |
"""
This is one of the Kolibri core components, the abstract layer of all contents.
To access it, please use the public APIs in api.py
The ONLY public object is ContentNode
"""
from __future__ import print_function
import os
import uuid
from gettext import gettext as _
from django.core.urlresolvers import reverse
fr... | |
import os
from datetime import timedelta
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from django.core.urlresolvers import reverse_lazy
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_DIR = os.path.join(BASE_DIR, '..', '..')
SECRET_KEY = 'na2p&yexkp-g83$2m^&b!r+a%nv2ci1!d9vh^a_7h!... | |
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# pyOCD debugger
# Copyright (c) 2019-2020 Arm Limited
# Copyright (C) 2020 Ted Tawara
# Copyright (c) 2021 Chris Reed
# Copyright (c) 2021 Matthias Wauer
# 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 L... | |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | |
# Copyright (c) 2005 The Regents of The University of Michigan
# 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 ... | |
#!/usr/bin/env python2
# The MIT License (MIT)
#
# Copyright (c) 2015 Kyle A. Barlow, Shane O'Connor
#
# 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 ... | |
"""Wrappers and utils for PatchMatch
Originally written by Neeraj Kumar <me@neerajkumar.org>
Licensed under the 3-clause BSD License:
Copyright (c) 2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that th... | |
import unittest
from labella.distributor import Distributor
from labella.node import Node
class DistributorTestCase(unittest.TestCase):
def test_computeRequiredWidth_1(self):
options = {
'algorithm': 'overlap',
'layerWidth': 960,
'density': 0.85,
... | |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
#!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
# Copyright 2022 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, ... | |
from __future__ import absolute_import
import unittest
from six.moves import xrange
import copy
from bokeh.core.properties import List, String, Instance, Dict, Any, Int
from bokeh.model import Model
from bokeh.embed import _ModelInDocument
from bokeh.document import Document
from bokeh.core.property.containers import ... | |
#!/usr/bin/env python
#
# Generated by generateDS.py.
#
import sys
from string import lower as str_lower
from xml.dom import minidom
import supers as supermod
#
# Globals
#
ExternalEncoding = 'utf-8'
#
# Data representation classes
#
class stageTypeSub(supermod.stageType):
def __init__(self, labelSuffix=Non... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project Compiler
#
import os, sys, re, shutil, time, run, sgmllib, codecs, tempfile, subprocess
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
sys.path.append(os.path.abspath(os.path.join(template_dir,'..')))
sys.path.append(os.pa... | |
#!/usr/bin/env python
# BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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... | |
import struct
import unittest
import json
from manticore.platforms import evm
from manticore.core import state
from manticore.core.smtlib import Operators, ConstraintSet
import os
class EVMTest_SLOAD(unittest.TestCase):
_multiprocess_can_split_ = True
maxDiff = None
def _execute(self, new_vm):
la... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/frames/tree_reduce.py
# Helper module to "Reduce" tree using frames
# @see Ostap::DataFrame
# @see ROOT::RDataFrame
# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
# @date 201... | |
#!/usr/bin/env python
#
# Copyright (C) 2015 Narf Industries <info@narfindustries.com>
#
# 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
# th... | |
#!/usr/bin/env python
""" generated source for module EWrapperMsgGenerator """
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
from ib.ext.AnyWrapperMsgGenerator import AnyWrapperMsgGenerator
from ib.ext.EClientSocket... | |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | |
"""Support for RFXtrx sensors."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import Callable
from RFXtrx import ControlEvent, SensorEvent
from homeassistant.components.sensor import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_SIGNAL_STR... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
#!/usr/bin/env python
import pyaudio
import wave
import multiprocessing
from tkinter import *
from time import sleep
import sys
import datetime
import os
import argparse
class App():
def __init__(self, master, queue, save_file, recording_process):
# Init stuff
frame = Frame(master)
... | |
# -*- coding: utf-8 -*-
from gluon import *
from gluon.storage import Storage
from s3 import *
from s3theme import NAV, SECTION
# =============================================================================
class S3MainMenuLayout(S3NavigationItem):
""" Custom Main Menu Layout """
@staticmethod
def layou... | |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
# Copyright 2018 The Containerd 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... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from collections import OrderedDict, defaultdict
from datetime im... | |
#
# 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
# ... | |
from django.conf import settings
from django.core.management import call_command
from django.db import connection
from django.test.utils import _set_autocommit, TEST_DATABASE_PREFIX
import os, re, sys
def getstatusoutput(cmd):
"A simpler version of getstatusoutput that works on win32 platforms."
stdin, stdout,... | |
import os
import cPickle
import numpy as np
import xml.etree.ElementTree as ET
import random
import svgwrite
from IPython.display import SVG, display
from svg.path import Path, Line, Arc, CubicBezier, QuadraticBezier, parse_path
def calculate_start_point(data, factor=1.0, block_size = 200):
# will try to center the ... | |
# 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... | |
import npc
import pytest
import subprocess
def run_create(tmp_path, *extra_args):
if not extra_args:
extra_args = []
npc.cli.start(['--campaign', str(tmp_path), 'werewolf'] + list(extra_args))
def test_calls_correct_function(tmp_path, mocker):
mocker.patch('npc.commands.create_character.werewolf'... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
import os
import time
import random
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.operations.vm_... | |
import random
from ..config import query
from ..domains import ZZ
from .polyerrors import CoercionFailed, DomainError
from .rings import PolyElement, PolynomialRing
from .rootisolation import _FindRoot
class UnivarPolynomialRing(PolynomialRing, _FindRoot):
"""A class for representing univariate polynomial rings.... | |
#FLM: Mark Feature Generator
###################################################
### THE VALUES BELOW CAN BE EDITED AS NEEDED ######
###################################################
kInstancesDataFileName = "instances"
kPrefsFileName = "MarkFeatureGenerator.prefs"
################################################... | |
"""
Utility classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
.. autosummary::
:toctree: generated/
PolyError base class for... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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
#
# h... | |
from __future__ import print_function
import os, sys, inspect
import h5py
import numpy as np
import matplotlib
import random
import math
import multiprocessing
from PIL import Image
from Crypto.Random.random import randint
from functools import partial
# Load the configuration file
import config
cmd_folder = os.path.... | |
# Copyright (c) 2015 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 required by applicable law or ... | |
#!/usr/bin/env python
import sys
import pysam
import argparse
import random
import subprocess
import os
import bamsurgeon.replacereads as rr
import bamsurgeon.aligners as aligners
import bamsurgeon.mutation as mutation
import traceback
from bamsurgeon.common import *
from uuid import uuid4
from re import sub
from shu... | |
import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Alex Grigorevskiy
# Licensed under the BSD 3-clause license (see LICENSE.txt)
"""
Testing state space related functions.
"""
import unittest
import numpy as np
import GPy
import GPy.models.state_space_model as SS_model
from .state_space_main_tests import generate_x_points, ... | |
import inspect
import sys
from kafka.errors import (
KafkaError,
IllegalStateError,
IllegalArgumentError,
NoBrokersAvailable,
NodeNotReadyError,
KafkaProtocolError,
CorrelationIdError,
Cancelled,
TooManyInFlightRequests,
StaleMetadata,
UnrecognizedBrokerVersion,
CommitFa... | |
import json
import click
import six
from odlclient import client
from odlclient import cmdutils
@click.group()
@click.option('--debug/--no-debug', default=False,
help='Displays http request/response')
@click.option('--verbose/--no-verbose', default=False,
help='Displays http response bod... | |
import logging
import reversion
import json
from django.db import models
from django.conf import settings
from rest_framework.exceptions import ValidationError
from ..fields import SequenceField
from .base import AbstractBase, SequenceMixin
LOGGER = logging.getLogger(__file__)
@reversion.register
class ContactTyp... | |
# 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... | |
# Copyright 2014 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.
"""The testing Environment class."""
import logging
import shutil
import time
import traceback
from xml.etree import ElementTree
from xml.sax.saxutils impor... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import time
import json
import sys
from collections import OrderedDict
from random import random, randrange, uniform
from pokemongo_bot import inventory
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.human_behaviour import sleep... | |
#
# 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 us... | |
# 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/LICENSE-2.0
#
# Unless require... | |
# Copyright 2015 Objectif Libre
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
from 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:5888")
else:
access = Ser... | |
import sys
import re
import urllib, urllib2
import time
from ..plugins import SoCoPlugin
__all__ = ['Talk']
class TalkerPlugin(SoCoPlugin):
"""
The main use of this plugin is to make your Sonos system speak text. It works by sending a request to the
Google Text To Speech service, downloading ... | |
"""
5_0 to 5_0_5
Revision ID: 62a8d746d13b
Revises: 423a1643f365
Create Date: 2019-08-23 13:36:03.985636
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from manager_rest.storage.models_base import JSONString, UTCDateTime
# revision identifiers, used by Alembic.
revision... | |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Module tests."""
from __future__ import absolute_import, print_function
import ... | |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | |
# Copyright (C) 2013 Yahoo! 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 ... | |
import arrow
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import aliased, contains_eager, joinedload
import sqlalchemy as sa
import web
from libweasyl.models.content import Report, ReportComment
from libweasyl.models.users import Login
from libweasyl import constants, legacy, staff
from weasyl.... | |
"""
Python version of the runProcessOCV Matlab file for A123_OCV battery cell.
"""
import matplotlib.pyplot as plt
import numpy as np
import json
from models import BatteryData, FileData, ModelOcv
from funcs import OCVfromSOCtemp
from pathlib import Path
# Parameters and Data
# -------------------------------------... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
import os
import shutil
import sys
import... | |
__all__ = ['KanesMethod']
from sympy import Symbol, zeros, Matrix, diff, solve_linear_system_LU, eye
from sympy.utilities import default_sort_key
from sympy.physics.mechanics.essential import ReferenceFrame, dynamicsymbols
from sympy.physics.mechanics.particle import Particle
from sympy.physics.mechanics.point 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... | |
"""Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals... | |
from lxml import etree
from numbers import Number
from troveclient.compat import exceptions
from troveclient.compat.client import TroveHTTPClient
XML_NS = {None: "http://docs.openstack.org/database/api/v1.0"}
# If XML element is listed here then this searches through the ancestors.
LISTIFY = {
"accounts": [[]],
... | |
# 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
#
# Unless required by applica... | |
# 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... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
fixedwidth.py:
Read or write a table with fixed width columns.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
from . import core
from ... | |
"""Metadata read/write support for bup."""
# Copyright (C) 2010 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
import errno, os, sys, stat, pwd, grp, struct, re
from cStringIO import StringIO
from bup import vint, xstat
from bup.d... | |
# testing/requirements.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
"""Global database feature support policy.
Provides decorators to mark test... | |
#
# flightlines_to_DTM_and_DSM.py
#
# (c) 2014, martin isenburg - http://rapidlasso.com
# rapidlasso GmbH - fast tools to catch reality
#
# This LAStools pipeline classifies very large LAS
# or LAZ files by operating with a tile-based multi-
# core pipeline. The input file is first tiled using
# lastile with the sp... | |
#!/usr/bin/env python
'''
Copyright 2012 the original author or authors.
See the NOTICE file distributed with this work for additional
information regarding copyright ownership.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obt... | |
#####################################################################
##### IMPORT STANDARD MODULES
#####################################################################
#Python 3 support:
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
import pandas as pd
impo... | |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 12:52:42 2015
@author: jdh
"""
import os
import logging
from glob import glob
import re
import gdal
from gdal import gdalconst
import osr
from datetime import datetime
import numpy
from EOtools.DatasetDrivers import SceneDataset
from EOtools.execute import execute
i... | |
"""
GRUB configuration - files `/boot/grub/grub2.cfg` and `/boot/grub.conf`
=======================================================================
This parser reads the configuration of the GRand Unified Bootloader, versions
1 or 2.
This is currently a fairly simple parsing process. Data read from the file
is put i... | |
#!/usr/bin/env/python
import numpy as np
from scipy import signal
from scipy.ndimage import filters
# ================================================================
# General purpose funcs
# ================================================================
# ------------------------ create classic patterns
def cyl... | |
import argparse
import getpass
import os
from os.path import expanduser
import requests
import sys
import time
import yaml
from yaml import SafeDumper
import logging
class ConfigurationCache():
def __init__(self, filename=None):
self.cache = None
self.filename = filename if filename is not None e... | |
import httplib
import re
import os
import requests
import json
from datetime import datetime
from distutils.version import LooseVersion
from cumulusci.tasks.release_notes.github_api import GithubApiMixin
from cumulusci.tasks.release_notes.parser import ChangeNotesLinesParser
from cumulusci.tasks.release_notes.parser ... | |
import gui
#Global Variables
b = '[ ]'
GRID_HEIGHT = 5
GRID_WIDTH = 5
KNIGHT_MOVE = [[2,1], [2,-1], [-2,1], [-2,-1], [1,2], [1,-2], [-1,2], [-1,-2]]
#Grid Class
class Grid:
def __init__(self):
# empty grid
self.board = [[b,b,b,b,b], \
[b,b,b,b,b], \
[b,b,b,b,b], \
... | |
import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... | |
#!/usr/bin/env python
"""A simple script to download all Gmail emails with a given label.
This script will write a CSV file with the name passed to '--output-file'.
The CSV file will have the format:
<sender domain name>,<email subject>,<email text>
The label you wish to download all emails from is provided with '... | |
"""
eld.py: economic load dispatching in electricity generation
Approach: use an SOS2 constraints for modeling non-linear functions.
Copyright (c) by Joao Pedro PEDROSO and Mikio KUBO, 2012
"""
from pyscipopt import Model, quicksum, multidict
import math
import random
from piecewise import convex_comb_sos
def cost(... | |
# 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... | |
#!/usr/bin/env python
lookup_table = {
'RAD_FACILITY': {
'CITY_NAME':
('The name of the city, town, or village where a facility is '
'located.'),
'CONGRESSIONAL_DIST_NUM':
('The number that represents a Congressional District for a '
'state within t... | |
# -*- coding: utf-8; fill-column: 78 -*-
import re
#import string
import sys
try:
import threading
except ImportError: # pragma:nocover
import dummy_threading as threading
# derived from ASPN Cookbook (#36302)
class lazy_property(object):
"""An @property that is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.