text stringlengths 12 6.59M |
|---|
# Copyright (c) 2014 Christian Schwede <christian.schwede@enovance.com>
#
# 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 __future__ import with_statement
import sys
import unittest
import warnings
import pymunk as p
from pymunk import *
from pymunk.vec2d import Vec2d
####################################################################
class UnitTestSpace(unittest.TestCase):
def setUp(self):
p.reset_shape... |
import unittest
from datetime import datetime
from stock import Stock
class StockTest(unittest.TestCase):
def setUp(self):
self.stock = Stock("GOOG")
def test_new_stock_price(self):
"""A new stock should have a price that is None.
"""
self.assertIsNone(self.stock.price)
... |
import juglib.task
def add1(x):
return x + 1
def add2(x):
return x + 2
def _assert_tsorted(tasks):
for i in xrange(len(tasks)):
for j in xrange(i+1,len(tasks)):
for dep in list(tasks[i].dependencies) + tasks[i].kwdependencies.values():
if type(dep) is list:
... |
import os
import sys
import shutil
import unittest
from oct.core.exceptions import OctConfigurationError
from oct.utilities.commands import main
class ToolsTest(unittest.TestCase):
def setUp(self):
self.base_dir = os.path.dirname(os.path.realpath(__file__))
self.output_file = '/tmp/oct-test-outp... |
import numpy
import unittest
import os
import filecmp
from trussme import truss
TEST_TRUSS_FILENAME = os.path.join(os.path.dirname(__file__), 'example.trs')
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
# Build truss from scratch
self.T1 = truss.Truss()
self.T1.add_sup... |
import unittest
import datetime
from schematics.types import (
BaseType, StringType, DateTimeType, DateType, IntType, EmailType, LongType,
URLType,
)
from schematics.exceptions import ValidationError, StopValidation, ConversionError
class TestType(unittest.TestCase):
def test_date(self):
toda... |
import nose
import claripy
import angr
from angr.sim_type import SimTypeFunction, SimTypeInt, SimTypePointer, SimTypeChar, SimStruct, SimTypeFloat, SimUnion, SimTypeDouble, SimTypeLongLong, SimTypeLong, SimTypeNum
from angr.utils.library import convert_cproto_to_py
def test_type_annotation():
my_ty = angr.sim_t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import run_tests # set sys.path
# Following lines fix: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
import os
import sys
import imp
module_name = "test_types_settings"
settings_module = imp.new_module(module_name)
sett... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import json
import os
import stat
import sys
import unittest
import textwrap
import time
import click
import yaml
from click.testing import CliRunner
from collections import deque
from mock import Mock, MagicMock, patch
from scrapinghub imp... |
import argparse
import tempfile
import warnings
from io import StringIO
from itertools import product
from tempfile import NamedTemporaryFile, TemporaryDirectory
from unittest.mock import patch
import numpy as np
import pandas as pd
from numpy.testing import assert_almost_equal
from itertools import count
from nose.... |
import unittest
import json
import timeit
import sys
import datetime
import re
import threading
import uuid
from bugsnag.utils import (SanitizingJSONEncoder, FilterDict,
is_json_content_type, parse_content_type,
ThreadContextVar)
class TestUtils(unittest.TestCase... |
import os
import io
import json
import unittest
import configparser
import tempfile
import shutil
from snipper import utils
TEST_DIR = os.path.dirname(__file__)
config = configparser.ConfigParser()
config.read(os.path.join(TEST_DIR, 'snipperrc'))
snippet_parent_dir = tempfile.mktemp(prefix='snipper_home_')
os.mkdir... |
# Copyright 2013 Donald Stufft
#
# 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... |
import sys
import unittest
import numpy as np
import os
from pyinduct import register_base, \
core as cr, \
simulation as sim, \
shapefunctions as sh, \
utils as ut, \
visualization as vt, \
placeholder as ph
if any([arg in {'discover', 'setup.py', 'test'} for arg in sys.argv]):
show_plots... |
# -*- coding: utf-8 -*-
"""
werkzeug.utils test
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD license.
"""
import sys
from datetime import datetime
from StringIO import StringIO
from nose.tools import assert_raises
from werkzeug.utils impor... |
# Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013 SCoT Development Team
import unittest
from importlib import import_module
import numpy as np
import scot.backend
import scot.utils
backend_modules = [import_module('scot.backend.' + b) for b in scot.backend.__all__]
c... |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange 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 applic... |
import pytest, yaml, os
@pytest.mark.parametrize('tested, val, key, expected', [
({}, 'val', ['key'], {'key': 'val'}),
({}, 'val', ['key1', 'key2', 'key3'], {'key1': {'key2': {'key3': 'val'}}}),
({'a_key': 'a_val', 'b_key1': {'b_key2': {'b_key3': 'b_val'}}}, 'x_val',
['b_key1', 'b_key2'], {'a_key':... |
from io import UnsupportedOperation
from pilkit.exceptions import UnknownFormat, UnknownExtension
from pilkit.lib import Image
from pilkit.utils import (extension_to_format, format_to_extension, FileWrapper,
save_image, prepare_image)
from nose.tools import eq_, raises, ok_
from tempfile impor... |
import unittest
import sciter
from sciter.value import value, VALUE_TYPE
class TestSciterValue(unittest.TestCase):
def test_01empty(self):
v = value()
self.assertIsNotNone(v)
self.assertIsNotNone(v.data)
self.assertIsNotNone(v.ptr)
self.assertEqual(v.data.t, VALUE_TYPE.T_... |
# coding=utf-8
from __future__ import print_function
import os
import authcode
from authcode._compat import to_unicode
from authcode.views import pop_next_url
from flask import Flask, request
from sqlalchemy_wrapper import SQLAlchemy
from helpers import SECRET_KEY
def test_pop_next_url():
auth = authcode.Auth(S... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Views tests for the OSF."""
from __future__ import absolute_import
import datetime as dt
import httplib as http
import json
import time
import pytz
import unittest
import mock
from nose.tools import * # noqa PEP8 asserts
from django.utils import timezone
from django.... |
import functools
import gzip
import bz2
import itertools
import lzma
import io
import os
import random
import shutil
import string
import sys
import time
import pytest
from pathlib import Path
from contextlib import contextmanager
from itertools import cycle
from xopen import (
xopen,
PipedCompressionReader,
... |
import gzip
import io
import os
import random
import shutil
import signal
import sys
import time
import pytest
from pathlib import Path
from xopen import (
xopen,
PipedCompressionReader,
PipedCompressionWriter,
PipedGzipReader,
PipedGzipWriter,
PipedPigzReader,
PipedPigzWriter,
PipedIGz... |
#!/usr/bin/env python2.3
from basetest import BaseTest
import sys, tempfile, os, shutil
import unittest, logging
sys.path.insert(0, '..')
from zeroinstall.injector import distro, model
class TestDistro(BaseTest):
def setUp(self):
BaseTest.setUp(self)
self.feed = model.Interface('http://example.com/feed.xml')
d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import pickle
import unittest
import io
import base58
import maxminddb
import mock
from mock import Mock, patch
from datetime import datetime, timedelta
import heartbeat
from RandomIO import RandomIO
from downstream_node.startup import app, db
from ... |
#!/usr/bin/env python
from novaclient.client import Client
from novaclient import exceptions
from proboscis import test
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_true
import paramiko
from helpers.helpers import wait, tcp_ping, TimeoutError
import re
import time
import os
import sys... |
from django.contrib import admin
from .models import Playbook, Registry, Repository
admin.site.register(Playbook)
admin.site.register(Registry)
admin.site.register(Repository)
admin.site.site_header = 'Ansible Admin'
|
# -*- coding: utf-8 -*-
"""
All unit tests for the newspaper library should be contained in this file.
"""
import logging
import sys
import os
import unittest
import time
import traceback
from collections import defaultdict, OrderedDict
import concurrent.futures
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
PA... |
import re
import os
from ._compat import unittest
from pydal import DAL, Field
DEFAULT_URI = os.getenv('DB', 'sqlite:memory')
NOSQL = any([name in DEFAULT_URI for name in ("datastore", "mongodb", "imap")])
IS_IMAP = "imap" in DEFAULT_URI
regex_isint = re.compile('^[+-]?\d+$')
def drop(table, cascade=None):
# mo... |
'''
Data class
Retrieves misc. data from the CB API
'''
import json
import requests
import datetime as dt
from coinbasewalletauth import CoinbaseWalletAuth
class Data():
def __init__(self):
# initialize generic api url
self.api_url = "https://api.coinbase.com/v2/"
# initial setup
a... |
"""TFTA module is to receive and decode messages and send responses from
and to other agents in the system"""
import sys
import xml.etree.ElementTree as ET
import logging
logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger('TFTA')
from kqml import KQ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 shmilee
'''
Source fortran code:
1. diagnosis.F90:opendiag():739, ::
write(iodata1d,101)ndstep,mpsi+1,nspecies,nhybrid,mpdata1d,nfield,mfdata1d
2. diagnosis.F90:opendiag():790, ::
ndata=(mpsi+1)*(nspecies*mpdata1d+nfield*mfdata1d)
diagnosis.F90:194-203, ::
w... |
"""TFTA module is to receive and decode messages and send responses from
and to other agents in the system"""
import sys
import re
import time
import xml.etree.ElementTree as ET
import logging
logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s',
level=logging.INFO)
logger = logging.g... |
import lxml.etree
from slimit.parser import Parser
from js2xml.xmlvisitor import XmlVisitor
_parser = Parser()
_visitor = XmlVisitor()
def parse(text, debug=False):
tree = _parser.parse(text, debug=debug)
xml = _visitor.visit(tree)
return xml
|
############################################
# Copyright (c) 2012 Microsoft Corporation
#
# Z3 Python interface
#
# Author: Leonardo de Moura (leonardo)
############################################
"""Z3 is a high performance theorem prover developed at Microsoft Research. Z3 is used in many applications such as: so... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... |
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017 SML
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy... |
# import modules
import os
import git
import re
## Module Constants
DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
def parse_diff(path, branch='master'):
"""
Returns a generator which iterates through all commits of
the repository located in the giv... |
# -*- coding: utf-8 -*-
import logging
import mock
import requests
from builtins import object
from django.test import override_settings
from requests import Response
from typing import Any, Dict, Tuple, Text, Optional
from zerver.lib.outgoing_webhook import do_rest_call, OutgoingWebhookServiceInterface
from zerver.... |
# Copyright (c) 2015,2016,2017,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools to process GINI-formatted products."""
from __future__ import absolute_import
import contextlib
from datetime import datetime
try:
from enum import Enum
... |
import datetime
import pytz
import eveapi
from django.db import IntegrityError
from celery.task import PeriodicTask
from celery.task.schedules import crontab
from apps.common.util import cast_empty_string_to_int, cast_empty_string_to_float
from .models import *
from .api_exceptions import handle_api_exc... |
"""
Utility functions for the api controllers
These functions may raise/use api exception types
"""
import copy
import jsonschema
import re
from anchore_engine.apis.exceptions import BadRequest
from anchore_engine.utils import parse_dockerimage_string
from anchore_engine.subsys import logger
REGISTRY_TAG_SOURCE_SCHE... |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import sys
import time
import rwproperty
import unicodedata
import venusian
import zope.copy
import transaction
import zmq
import string
from zmq.eventloop.ioloop import... |
# -*- coding: utf-8 -*-
import os
import pytest
import gevent
import itertools
from ethereum import slogging
from raiden.api.python import RaidenAPI
from raiden.tests.utils.blockchain import wait_until_block
from raiden.transfer.state import (
CHANNEL_STATE_SETTLED,
)
log = slogging.getLogger(__name__)
@pytest... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import sys
import threading
import subprocess
from time import sleep
from datetime import datetime
import multiprocessing
import boto.ec2.autoscale
from pprint import pprint
import json
#our timestamping function, accurate to milli... |
from fabric import colors
import logging
import socket
from decorator import decorator
from django.http import HttpRequest, HttpResponse
import json
import jsonlogger
# http://stackoverflow.com/questions/384076/how-can-i-make-the-python-logging-output-to-be-colored
_logger = logging.getLogger(__name__)
class NoUse... |
# Copyright (c) 2012 Leif Johnson <leif@leifjohnson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... |
"""mist.io.shell
This module contains everything that is need to communicate with machines via
SSH.
"""
from time import time, sleep
from StringIO import StringIO
import paramiko
import websocket
import socket
import uuid
import thread
from mist.io.exceptions import BackendNotFoundError, KeypairNotFoundError
from ... |
'''
@author: mingjian
'''
import crypt
import os
from zstacklib.utils import log
from zstacklib.utils import shell
logger = log.get_logger(__name__)
class ChangePasswd(object):
def __init__(self):
self.password = None
self.account = None
self.image = None
self.crypt = {'SHA512':cry... |
#!/usr/bin/env python3
from utility import get_time, rd_print
import argparse
import os
import sys
import subprocess
import json
import codecs
import awsremote
import scheduler
import sshslot
# Finding files such as `this_(that)` requires `'` be placed on both
# sides of the quote so the `()` are both captured. Files... |
from __future__ import with_statement
import doctest
import filecmp
import os
from StringIO import StringIO
import sys
import shutil
import tempfile
import unittest
from xattr import xattr, XATTR_NOFOLLOW
from . import store, helpers, lrucache
from .archiver import Archiver
class Test(unittest.TestCase):
prefix... |
"""mist.io.views
Here we define the HTTP API of the app. The view functions here are
responsible for taking parameters from the web requests, passing them on to
functions defined in methods and properly formatting the output. This is the
only source file where we import things from pyramid. View functions should
only ... |
# Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
|
#!/usr/bin/env python
# encoding: utf-8
import codecs
from datetime import datetime
from optparse import OptionParser
import random
import re
import time
import cookielib
import urllib
import urllib2
import logging
from bs4 import BeautifulSoup, NavigableString
class Message:
def __init__(self, thread_url, send... |
"""mist.io.views
Here we define the HTTP API of the app. The view functions here are
responsible for taking parameters from the web requests, passing them on to
functions defined in methods and properly formatting the output. This is the
only source file where we import things from pyramid. View functions should
only ... |
"""mist.io views"""
import os
import logging
import json
import tempfile
from pyramid.response import Response
from pyramid.view import view_config
from libcloud.compute.base import Node
from libcloud.compute.base import NodeSize
from libcloud.compute.base import NodeImage
from libcloud.compute.base import NodeLocati... |
#!/bin/python
#
#
# The MIT License (MIT)
#
# Copyright (c) 2016 JP Senior jp.senior@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 limitat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "0.5.0"
|
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
"""
SQLAlchemy Database class to handle access to Pstgres through ORM
"""
try:
from sqlalchemy import create_engine, or_, case, func
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import sessionmaker, with_polymorphic
from sqlalchemy.sql.expression import func
except ImportError:
rai... |
# Details: Proc and data access method text generator for Dealspan referential data
# Author: Jon Fast
# Last Modified: 9/29/2014
import re
import pymssql
# common delimiters
commaDelim = ', '
commaNewLineDelim = ', \n'
slashDelim = '/'
# DealSpan proc names (imported from database)
tableNames = []
procNames = []
# ... |
from __future__ import print_function
from hotcidr import util
from hotcidr import ports
from hotcidr import state
import boto.ec2
import contextlib
import os.path
import shutil
import sys
import tempfile
import yaml
def dump(x):
return state.dump(x, default_flow_style=False)
def append_to_rules(connection, rules... |
"""
SQLAlchemy Database class to handle access to Pstgres through ORM
"""
try:
from sqlalchemy import create_engine, and_, or_, case, func
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import sessionmaker, with_polymorphic
from sqlalchemy.sql.expression import desc
from sqlalchemy.s... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012 TSH Labs <projects@tshlabs.org>
# 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 copyr... |
# -*- coding: utf-8 -*-
# @Author: Eddie Ruano
# @Date: 2017-06-01 14:25:28
# @Last Modified by: Eddie Ruano
# @Last Modified time: 2017-06-04 23:26:00
import RPi.GPIO as GPIO
class Sentinel(object):
def __init__(self):
"""Create an instance of Sentinel"""
# Locks/Mutex/Counters
self.Ac... |
import logging
import os
import shutil
from django.conf import settings
from readthedocs.doc_builder.config import ConfigWrapper
from readthedocs.doc_builder.loader import get_builder_class
from readthedocs.projects.constants import LOG_TEMPLATE
log = logging.getLogger(__name__)
class PythonEnvironment(object):
... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2019 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Kubernetes Job Manager."""
import ast
import logging
import os
import traceback
import uui... |
# -*- coding: utf-8 -*-
"""Tools for inspecting Python objects.
Uses syntax highlighting for presenting the various information elements.
Similar in spirit to the inspect module, but all calls take a name argument to
reference the name under which an object is being read.
"""
# Copyright (c) IPython Development Team... |
#!/bin/env python
# Copyright (c) 2002-2018, California Institute of Technology.
# All rights reserved. Based on Government Sponsored Research under contracts NAS7-1407 and/or NAS7-03001.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following con... |
# -*- coding: utf-8 -*-
"""Tools for inspecting Python objects.
Uses syntax highlighting for presenting the various information elements.
Similar in spirit to the inspect module, but all calls take a name argument to
reference the name under which an object is being read.
"""
#***************************************... |
# -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import utils
from utils import UserAttrib, Event, initBy
import T... |
#!/usr/bin/env python3
"""
requires Astropy 1.0 or newer. Try usevallado=True if you have an old
Astropy (Vallado accuracy is worse).
Michael Hirsch
GPLv3+
"""
from __future__ import division,absolute_import
from numpy import sin, cos, degrees, radians,arcsin, arctan2, atleast_1d
try:
from astropy import units as ... |
"""
Flow Synchronous API Python Module.
All Flow API responses are represented with Python dicts.
"""
import base64
import sys
import subprocess
import tempfile
import platform as platform_module
import json
import threading
try:
import Queue
except ImportError:
import queue as Queue
import os
import string
... |
# Copyright 2020, 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 agreed to in writin... |
import numpy as np
import os
import pickle
import model
import random
import babi_graph_parse
import convert_story
import gzip
from enum import Enum
from babi_graph_parse import MetadataList, PreppedStory
from graceful_interrupt import GracefulInterruptHandler
from pprint import pformat
import util
from train_exit_stat... |
import cupy
from cupy import _core
from cupy._core import fusion
from cupy import _util
from cupy._core import _routines_indexing as _indexing
from cupy._core import _routines_statistics as _statistics
def argmax(a, axis=None, dtype=None, out=None, keepdims=False):
"""Returns the indices of the maximum along an ... |
# Copyright 2013 Donald Stufft and individual contributors
#
# 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... |
# -*- coding: utf-8 -*-
"""
Things to know:
* raw subprocess calls like .communicate expects bytes
* the Command wrappers encapsulate the bytes and expose unicode
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import os.path
import json
import re
import tempfile
import u... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Qt.QtApplication import QtApplication
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Camera import Camera
from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Math.Quaternion impo... |
#!/usr/bin/env python
# DoseAccumulate.py
# Copyright (C) 2007 STFC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# A module to determine the accumulated dose as a function of exposure epoch
# for a given set of images, a... |
"""
Commands bot subclass.
"""
import random
import re
import inspect
import importlib
import traceback
import typing
import curio
import sys
from curious.client import Client
from curious.commands.command import Command
from curious.commands.context import Context
from curious.commands.plugin import Plugin
from curi... |
# coding: utf-8
from __future__ import unicode_literals, division
import glob
import logging
import shlex
import socket
import re
import time
from pkg_resources import parse_version
"""
This module implements basic kinds of jobs for QChem runs.
"""
import os
import shutil
import copy
import subprocess
from pymatgen... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import time, datetime
import threading
import component
import log
class Router (component.Receiver):
incoming_phases = ('parse', 'handle', 'cleanup')
outgoing_phases = ('outgoing',)
def __init__(self):
component.Receiver.__init__(self)
... |
import discord
import json
import random
import requests
import asyncio
import sys
import os
raw = ''
discToken = ''
riotKey = ''
regions = ['NA1', 'RU', 'KR', 'EUN1', 'EUW1', 'TR1', 'LA1', 'LA2', 'BR1', 'OC1', 'JP1']
if len(sys.argv) == 1:
riotKey = os.environ.get('RIOTKEY')
discToken = os.environ.get('DISCKE... |
import sublime
import sublime_plugin
import os
import sys
import subprocess
import locale
if os.name == 'nt':
try:
import _winreg
except (ImportError):
import winreg as _winreg
from ctypes import windll, create_unicode_buffer
class NotFoundError(Exception):
pass
if sys.version_info >... |
import os
import logging
import tkinter.filedialog as filedialog
import tkinter.messagebox as tkmessagebox
from libs.json2gui import *
from libs.CFCrypto import StringCrypto
logging.basicConfig(level=logging.ERROR)
# 文本选中时的处理
class TextSection(object):
def __init__(self, master_widget, text_area):
self.m... |
#! /usr/bin/env python
#-*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import os
class Tutsplus:
login_url= 'https://tutsplus.com/amember/login.php'
home_url = 'https://tutsplus.com'
def __init__(self, username, password):
self.username = username
self.password = pa... |
import json
import storj
from PyQt4 import QtCore, QtGui
from mainUI import MainUI
from qt_interfaces.login_ui_new import Ui_Login
from utilities.account_manager import AccountManager
from utilities.log_manager import logger
# Login section
class LoginUI(QtGui.QMainWindow):
def __init__(self, parent=None):
... |
import sys
import os
import logging
def main():
logging.basicConfig(filename='bar.log', level=logging.INFO, format='%(asctime)s = %(message)s');
os.system('cls' if os.name == 'nt' else 'clear');
while True:
print u'\U0001F37A \U0001F37A \U0001F37A \U0001F37A \U0001F37A \U0001F37A \U0001F37A \U0001F37A \U0... |
"""Recruiters manage the flow of participants to the experiment."""
from boto.mturk.connection import MTurkConnection
from psiturk.psiturk_config import PsiturkConfig
from psiturk.models import Participant
from dallinger.config import get_config
from dallinger.utils import get_base_url
from dallinger.utils import gene... |
from channels.auth import AuthMiddlewareStack
from django.urls import path
from channels.routing import ProtocolTypeRouter, URLRouter
from EOSS.consumers import EOSSConsumer
from AT.SARIMAX_AD import SARIMAX_AD
from AT.KNN import adaptiveKNN
from AT.I_Forest import iForest
from daphne_brain import settings
from experi... |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... |
from django.test import TestCase
from django.db.models import Sum
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
import datetime
from .models import StockLocation, StockItem, StockItemTracking
from .models import StockItemTestResult
from part.models import Part
cla... |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
# -*- coding: utf-8 -*-
'''
Copyright 2012 Rodrigo Pinheiro Matias <rodrigopmatias@gmail.com>
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... |
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import datetime
from types import IntType, StringType, ListType
from noink import mainDB
from noink.dataModels import Entry, Tag, TagMapping
from noink.pickler import PEntry, pickle, depickle
from noink.eventLog import EventLog
class EntryDB:
__borg_st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.