gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# encoding: utf-8
"""
setup.py
Created by Thomas Mangin on 2014-12-23.
Copyright (c) 2014-2015 Exa Networks. All rights reserved.
"""
from exabgp.configuration.environment import environment
_SPACE = {
'space': ' '*33
}
HELP_STDOUT = """\
where logging should log
%(space)s syslog (or no setting) sends the data to... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
import copy
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import refs_aggregate, Q
from django.u... | |
#-*- coding: utf-8 -*-
""" EOSS catalog system
Reads data provided by USGS directly via http or csv files (from http://landsat.usgs.gov/metadatalist.php) and creates Catalog_Dataset objects
"""
__author__ = "Thilo Wehrmann, Steffen Gebhardt"
__copyright__ = "Copyright 2016, EOSS GmbH"
__credits__ = ["Thilo Wehrmann",... | |
import pygame, sys, PR
from pygame.locals import *
from npc import *
#CONSTANTS
WIN_WIDTH = 600
WIN_HEADER = 40
WIN_HEIGHT = WIN_WIDTH+WIN_HEADER
GAME_WIDTH = WIN_WIDTH
GAME_HEIGHT = WIN_HEIGHT - WIN_HEADER
GAME_BORDER = 5
BLACK = (0,0,0)
WHITE = (255, 255, 255)
BOSS_GREEN = (0, 200, 122)
RED = (255, 0, 0)
MAX_FRAM... | |
# Copyright 2017 The Forseti Security 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 ap... | |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import configparser
from dataclasses import dataclass
from enum import Enum
from io import StringIO
from pathlib import PurePath
from typing import Any,... | |
import unittest
from robot.variables import VariableSplitter, VariableIterator
from robot.utils.asserts import assert_equal, assert_false, assert_true
class TestVariableSplitter(unittest.TestCase):
_identifiers = ['$', '@', '%', '&', '*']
def test_empty(self):
self._test('')
self._test(' ... | |
# Copyright (c) 2016 Jamie Bull
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""Run functions f... | |
from __future__ import absolute_import
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import GEOSGeometry, LineString
from django.contrib.gis.measure import D # alias for Distance
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatial... | |
"""Contains classes that represent a collection of addresses."""
import re
class InvalidAddressError(Exception):
"""The format of the given address was not recognized."""
pass
def _format_ip4(addr):
"""Return a string holding the human-friendly version of the IPv4
address *addr* in an integer repres... | |
#!/usr/bin/env python
#
# Copyright 2007 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... | |
from __future__ import absolute_import, unicode_literals
from datetime import date
import unittest
import warnings
from django import forms
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.models import (modelform_factory, M... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#******************************************************************************
# $Id: gdal_polygonize.py 27044 2014-03-16 23:41:27Z rouault $
#
# Project: GDAL Python Interface
# Purpose: Application for converting raster data to a vector polygon layer.
# Author: ... | |
import Queue
import json
import os
import signal
from subprocess import CalledProcessError
import sys
import threading
from mysos.common.cluster import ClusterListener, get_cluster_path
from mysos.common.zookeeper import parse
from .installer import PackageInstaller
from .state import StateManager
from .task_runner i... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "VOUnit" unit format.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...extern import six
from ...extern.six.moves import zip
import copy
import keyword
import operato... | |
# -*- coding: utf-8 -*-
import os
import pytest
import pipenv.utils
from pipenv.exceptions import PipenvUsageError
# Pipfile format <-> requirements.txt format.
DEP_PIP_PAIRS = [
({"requests": "*"}, "requests"),
({"requests": {"extras": ["socks"], "version": "*"}}, "requests[socks]"),
({"django": ">1.10... | |
import logging
from six.moves.urllib.parse import urljoin
from xml.etree import ElementTree
import recurly
import recurly.js as js
from recurly.errors import *
from recurly.resource import Resource, Money, PageError
"""
Recurly's Python client library is an interface to its REST API.
Please see the Recurly API doc... | |
from itertools import product
import numpy as np
from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix,
dok_matrix, lil_matrix)
from sklearn import metrics
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.... | |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 deal in the Software without restriction, including
# without limitation the rights ... | |
# Copyright 2018 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.
"""Translate between test paths and Descriptors.
Test paths describe a timeseries by its path in a tree of timeseries.
Descriptors describe a timeseries sem... | |
import collections
import logging
import re
import sys
import time
import warnings
from contextlib import contextmanager
from functools import wraps
from unittest import TestCase, skipIf, skipUnless
from xml.dom.minidom import Node, parseString
from django.apps import apps
from django.apps.registry import Apps
from dj... | |
#!/usr/bin/env python
# encoding: utf-8
import argparse
import errno
import logging
import os
import platform
import re
import sys
import subprocess
import tempfile
try:
import winreg
except ImportError:
import _winreg as winreg
try:
import urllib.request as request
except ImportError:
import urllib a... | |
# COPYRIGHT 2012, Michael Ball
# Licensed under BSD License (3-clause).
"""This file pulls the sets from from flickr for a given user"""
from __future__ import division
import flickrapi
import math
import sys
# my flickr credentials and info
api_key = '948b85af8b1b9df0a4d38febe7ce75d6'
api_secret = '2a394b9079033cf8... | |
import pickle
import numpy as np
import pytest
from numpy.testing import assert_array_equal
from sklearn.utils._encode import _unique
from sklearn.utils._encode import _encode
from sklearn.utils._encode import _check_unknown
@pytest.mark.parametrize(
"values, expected",
[(np.array([2, 1, 3, 1, 3], d... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""system.py Unit Tests
..moduleauthor:: Timothy Helton <timothy.j.helton@gmail.com>
"""
import logging
import os
import os.path as osp
import shutil
import subprocess
import pytest
import numpy as np
from strumenti.tests.fixtures import \
ChromalogLogCapture
from... | |
import pytest
from diofant import (I, Matrix, MutableDenseMatrix, MutableSparseMatrix,
PurePoly, Rational, ShapeError, SparseMatrix, eye, ones,
zeros)
from diofant.abc import x, y, z
__all__ = ()
def test_sparse_matrix():
def sparse_eye(n):
return SparseMatrix.... | |
# Copyright 2013 Spanish National Research Council (CSIC)
#
# 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... | |
# -*- coding: utf-8 -*-
"""
Unit tests for the spike_train_generation module.
:copyright: Copyright 2014-2016 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import unittest
import os
import warnings
import neo
import numpy as np
from nu... | |
# -*- coding: utf-8 -*-
# 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 the cbuildbot script."""
from __future__ import print_function
import argparse
import glob
import optparse ... | |
#!/usr/bin/env python
"""
Calculate output results dictionary.
"""
from collections import OrderedDict as odict
import numpy as np
import yaml
import numpy.lib.recfunctions as recfuncs
import astropy.coordinates
from astropy.coordinates import SkyCoord
import astropy.units as u
import ugali.analysis.source
import u... | |
#!/usr/bin/python
import random
import os
import subprocess as sub
import shlex
import multiprocessing as mp
import numpy as np
##########Modules specific to SR's environment
#import config as cfg
#import parallel
#THIS CODE WILL TAKE SOME EFFORT TO MODIFY FOR A NEW ENVIRONMENT#
#Notes created during develop... | |
import time
import objc
from Foundation import NSKeyValueObservingOptionNew, NSKeyValueObservingOptionOld, NSNotFound
from AppKit import *
from nsSubclasses import getNSSubclass
from vanillaBase import VanillaBaseObject, VanillaError, VanillaCallbackWrapper
# first, determine which column autosizing method is needed.... | |
"""Base classes and helpers for unit tests."""
try:
from unittest import mock
except ImportError:
import mock
import github3
import json
import os.path
import pytest
import unittest
def create_url_helper(base_url):
"""A function to generate ``url_for`` helpers."""
base_url = base_url.rstrip('/')
... | |
# $Id$
#
# Copyright (C) 2007 greg Landrum
#
# @@ All Rights Reserved @@
#
import unittest,subprocess,os
from rdkit import RDConfig
from rdkit.Dbase.DbConnection import DbConnect
class TestCase(unittest.TestCase):
def test1Create(self):
p = subprocess.Popen(('python', 'CreateDb.py','--dbDir=testData/bzr','-... | |
using PyCall,DataFrames,RCall
unshift!(PyVector(pyimport("sys")["path"]), "")
@pyimport ncdata
len = length
filename = "./reaction_classify/cri2_nhept.nc"
data = ncdata.get(filename)
specs = names!(DataFrame(data["spec"]),[Symbol(i)for i in data["sc"]])
rates = names!(DataFrame(data["rate"]),[Symbol(i)for i in data["... | |
from __future__ import print_function
import click
import datetime
import errno
from functools import wraps
import json
import logging
import filelock
import os
import sys
from onecodex.api import Api
from onecodex.lib.auth import check_version, fetch_api_key_from_uname
from onecodex.utils import collapse_user
from on... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Cisco Systems, Inc.
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use... | |
from __future__ import print_function
import sys
import time
import traceback
import warnings
from functools import wraps
from six import iteritems
from . import formats
from . import levels
from . import outputs
from .lib import iso8601time
from .message import Message
def emit(level):
"""a decorator that emi... | |
#!/usr/bin/env python
# Copyright 2017 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... | |
#!/usr/bin/env python
# ---- MODULE DOCSTRING
__doc__ = """
(C) Hive, Romain Wuilbercq, 2017
_
/_/_ .'''.
=O(_)))) ...' `.
\_\ `. .'''X
`..'
.---. .---..-./`) ,---. ,---. .-''-.
| | |_ _|\ .-.')| / | | .'_ _ \
| | ( ' )/ `-' \| | | .'... | |
import numpy
from six import moves
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import configuration
from chainer import function_node
from chainer.functions.connection import convolution_2d
from chainer import utils
from chainer.utils import conv
from chainer.utils import ... | |
# This module provides classes and procedures for converting the JSON example we have been provided with into
# Python classes.
# We only have an example of a create account request so far so to process that call JSONtoAccountRequest(JSONData)
# where JSONData is a string with an account request.
# Also includes fai... | |
from questionnaire.models import Questionnaire, Section, SubSection, Question, QuestionGroupOrder, QuestionOption
from questionnaire.models.question_groups import QuestionGroup
from questionnaire.tests.base_test import BaseTest
class QuestionGroupTest(BaseTest):
def setUp(self):
self.question = Question.o... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Grid Dynamics
# Copyright 2013 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... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, Inc.
# Copyright 2013 Freescale, 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
# ... | |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
import requests
from flask import json
from Norman import settings
from Norman.api.base import base
from Norman.errors import HttpError
from Norman.messenger.userProfile import Profile
from Norman.norman.user import NormanUser
from Norman.settings import FBConfig, MessageConfig, ServiceListConfig
from Norman.utils imp... | |
import sys
import textwrap
import pytest
import salt.modules.state as state
import salt.state
import salt.utils.files
import salt.utils.json
from tests.support.mock import MagicMock, patch
pytestmark = [
pytest.mark.skipif(
sys.version_info < (3, 6), reason="Dictionaries are not ordered under Py3.5"
)... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Node composer instrument
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 1.1.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... | |
################################################################################
# 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... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from collections imp... | |
# Copyright 2019 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 datetime
import logging
import os
import platform
import re
import subprocess
from telemetry.internal.backends.chrome import minidump_symbolizer
from... | |
"""
jobs.py - pdf rasterization routines
Author
Sacha Zyto <sacha@csail.mit.edu>
License
Copyright (c) 2010-2012 Massachusetts Institute of Technology.
MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
"""
import sys,os
import datetime
if "" not in sys.path:
sys... | |
#!/usr/bin/env python3
# *************************************************************
#
# The OpenTRV project licenses this file to you
# under the Apache Licence, Version 2.0 (the "Licence");
# you may not use this file except in compliance
# with the Licence. You may obtain a copy of the Licence at
#
# http://www.a... | |
# Copyright 2020 Verily Life Sciences LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Functions for plotting incidence, recruitment, and events in the Baseline Site Selection Tool."""
from bsst... | |
import dis
import re
import sys
import textwrap
import unittest
from test.support import cpython_only
from test.bytecode_helper import BytecodeTestCase
class TestTranforms(BytecodeTestCase):
def test_unot(self):
# UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE'
def unot(x):
if not... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import s... | |
"""
fs.mountfs
==========
Contains MountFS class which is a virtual filesystem which can have other filesystems linked as branched directories.
For example, lets say we have two filesystems containing config files and resources respectively::
[config_fs]
|-- config.cfg
`-- defaults.cfg
[resources_fs]
... | |
import numpy as np
import math
from python_qt_binding.QtCore import Qt, QMetaType, QDataStream, QVariant, pyqtSignal
from python_qt_binding import loadUi
from rqt_gui_py.plugin import Plugin
from python_qt_binding.QtWidgets import QWidget, QTreeWidget, QTreeWidgetItem,QListWidgetItem, \
QSlider, QGroupBox, QVBoxLay... | |
from __future__ import division
from .base import BaseMode
from ..models import Meeting, Group, TalkProposal, ThunderdomeVotes
from copy import copy
from datetime import datetime
from random import randint
import re
class Mode(BaseMode):
"""A mdoer for handling Thunderdome sessions."""
def __init__(self, bot... | |
#
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Li... | |
# -*- coding: utf-8 -*-
"""
XForms - Controllers
"""
module = request.controller
# -----------------------------------------------------------------------------
def create():
"""
Given a Table, returns an XForms to create an instance:
http://code.javarosa.org/wiki/buildxforms
http://w... | |
#!/usr/bin/env python
"""A variety of methods to solve ODE boundary value problems.
AUTHOR:
Jonathan Senning <jonathan.senning@gordon.edu>
Gordon College
Based Octave functions written in the spring of 1999
Python version: October-November 2008
"""
import numpy
#-------------------------------------... | |
# 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 may ... | |
#!/usr/bin/python
# blastn tblastn blastx parser revised 14-1-2016.
# drosofff@gmail.com
import sys
import argparse
from collections import defaultdict
def Parser():
the_parser = argparse.ArgumentParser()
the_parser.add_argument('--blast', action="store", type=str, help="Path to the blast output (tabular for... | |
"""
SoftLayer.dedicatedhost
~~~~~~~~~~~~~~~~~~~~~~~
DH Manager/helpers
:license: MIT, see License for more details.
"""
import logging
import SoftLayer
from SoftLayer.managers import ordering
from SoftLayer import utils
# Invalid names are ignored due to long method names and short argument names
# ... | |
## @file
# process FV generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be ... | |
#!/usr/bin/env python
#
# Copyright 2013 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.
"""Runs all types of tests from one unified interface."""
import argparse
import collections
import itertools
import logging
import ... | |
# 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.
import base64
import logging
import os
import xml.dom.minidom as minidom
from xml.parsers.expat import ExpatError
import crash_utils
from repository_parser_... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
The iPOPO composer agent
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 3.0.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | |
""" Imports Maya API methods in the 'api' namespace, and defines various utilities for Python<->API communication """
# They will be imported / redefined later in Pymel, but we temporarily need them here
import inspect
import re
import itertools
import pymel.api as api
import pymel.versions as versions
import pymel.u... | |
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 -*-
'''
Return config information
'''
# Import python libs
from __future__ import absolute_import
import re
import os
# Import salt libs
import salt.utils
import salt.syspaths as syspaths
# Import 3rd-party libs
import salt.ext.six as six
# Set up the default values for all systems
DEFAULTS = {'... | |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Jan 1, 2011
@author:Drew Bratcher
@contact: dbratcher@gatech.edu
@summary: Contains tutorial for backteste... | |
import unittest
import tempfile
from nineml.document import Document
from nineml.utils.comprehensive_example import (
instances_of_all_types, doc1, conPropB1)
from nineml.exceptions import (NineMLNameError, NineMLUsageError)
# from tempfile import mkdtemp
import os.path
from nineml.abstraction.dynamics import Trigg... | |
#!/usr/bin/python3
import os
import sys
import requests
import subprocess
import json
import click
from termcolor import colored, COLORS
from urllib.parse import urlencode
import webbrowser
from config import *
TWITCH_CLIENT_ID = 'e0fm2z7ufk73k2jnkm21y0gp1h9q2o'
COLORS.update({
'light_grey': 90,
'light_red': 9... | |
from unittest import TestCase
import unittest
from .context import PySimpleAutomata
import copy
import itertools
from PySimpleAutomata import NFA
from PySimpleAutomata import AFW
from PySimpleAutomata import automata_IO
class TestAfwWordAcceptance(TestCase):
def setUp(self):
self.maxDiff = None
se... | |
"""
Websocket client for protocol version 13 using the Tornado IO loop.
http://tools.ietf.org/html/rfc6455
Based on the websocket server in tornado/websocket.py by Jacob Kristhammar.
"""
import array
import base64
import functools
import hashlib
import logging
import os
import re
import socket
import struct
import sy... | |
import logging
import os
import sys
from pprint import pprint, pformat
import sloelib
from .sloeyoutube.sloeyoutubeplaylist import SloeYouTubePlaylist
from .sloeyoutube.sloeyoutubesession import SloeYouTubeSession
from .sloeyoutube.sloeyoutubetree import SloeYouTubeTree
from .sloeyoutube.sloeyoutubeupload import Sloe... | |
"""
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... | |
# -*- coding: utf-8 -*-
"""
Contains the logic for requesting pieces, as well as that for writing them to disk.
"""
__all__ = ['PieceRequester']
import asyncio
import dataclasses
import logging
from collections import defaultdict
from typing import Optional
import bitstring
from .errors import NonSequentialBlockEr... | |
import os
import shutil
import time
from typing import Any, Callable, Dict, List
from unittest import mock
import ujson
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import (
check_send_message,
do_change_user_role,
do_set_realm_property,
lo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
========================================================================================
# This small script subscribes to the FeedbackMsg message of teb_local_planner
# and converts the current scene to a svg-image
# publish_feedback must be turned on such that the pla... | |
# -*- coding: utf-8 -*-
"""
sphinx.quickstart
~~~~~~~~~~~~~~~~~
Quickly setup documentation source to work with Sphinx.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
from __future__ import absolute... | |
from google.appengine.ext import db
import lp.error
import lp.time
import re
class Entry(db.Model):
#id = 1
title = db.StringProperty(required = True, default = "(Untitled)", indexed = False)
published = db.DateTimeProperty()
updated = db.DateTimeProperty(auto_now = True)
tags = db.StringListPrope... | |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from __future__ import unicode_literals
import functools
from importl... | |
# MIT License
# Copyright (c) 2016 Diogo Dutra <dutradda@gmail.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 the rights
# to use, co... | |
# 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
# distributed under t... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "Lic... | |
from boto.swf.exceptions import SWFResponseError
from freezegun import freeze_time
import sure # noqa
from moto import mock_swf_deprecated
from moto.swf import swf_backend
from ..utils import setup_workflow
# PollForDecisionTask endpoint
@mock_swf_deprecated
def test_poll_for_decision_task_when_one():
conn = s... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from uuid import uuid4
from datetime import datetime
import hashlib
import logging
import sqlalchemy as sa
from sqlalchemy.orm import relationship
from sqlalchemy import or_
from ujson import dumps
from tornado.concurrent import return_future
from holmes.models im... | |
import fnmatch
import glob
import io
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
import django
from django.core.management.base import CommandError, NoArgsCommand
from django.core.management.utils import (handle_extensions, find_command,
popen_wrapper)
from djang... | |
# 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 may ... | |
# 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... | |
#Game class
# The main class which will provide the framework for the rest of the
# game objects to run in.
# Includes the main event loop, clock, window settings, etc.
# Requires pygame
import pygame
from engine import *
from eventManager import *
from widgets import *
from ball import *
from brick import *
from pad... | |
import itertools
import math
from random import randrange
def Primes(max_num):
"""Returns all primes <= 'max_num'."""
is_prime = [True]*(max_num+1)
is_prime[0] = False
if max_num > 0: is_prime[1] = False
for i in [x for x in range(int(math.sqrt(max_num))+1) if x > 1]:
f = 2
while i*f <= max_num:
... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Objectif Libre
#
# 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 ... | |
'''
helpers functions
@author: Anas Elghafari
'''
import params
import math
#def read_sequence(s):
# s_stripped = s.strip().replace("-", "")
# params.sequence = s_stripped
# params.seq_as_codons = [params.sequence[i:i+3]
# for i in range(0,len(params.sequence)-2, 3)]
def ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.