src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from os import path
from nextgisweb.component import Component, require
from .model import Base, PROJECT_STATUS_PROJECT
from .ident import COMP_ID
from nextgisweb_compulink.init_data.command import DBInit
from .view import get_regions_from_resource, get_... |
###### SequentialGUID
import os
import datetime
import sys
from binascii import unhexlify, hexlify
import uuid
class SequentialGUID:
SEQUENTIAL_GUID_AS_STRING = 0
SEQUENTIAL_GUID_AS_BINARY = 1
SEQUENTIAL_GUID_AT_END = 2
def __init__(self):
pass
@staticmethod
def NewGUID(guid_type = SE... |
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import re
import threading
from odoo import models, api, tools
class IrMailServer(models.Model):
_inherit = "ir.mail_server"
def _tracking_headers_add(self, tracking_emai... |
# -*- coding:utf-8 -*-
## src/session.py
##
## Copyright (C) 2008-2014 Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2008 Brendan Taylor <whateley AT gmail.com>
## Jonathan Schleifer <js-gajim AT webkeks.org>
## Stephan Erb <steve-e AT h3c.de>
##
## This file is part o... |
# -*- coding: utf-8 -*-
# renderer-console
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#... |
import sys
import types
from functools import wraps
'''
These decorators allow you to register functions to be called before, around,
or after certain events in the toothpick object lifecycle.
Methods that are to be registered as hooks should take a single `self`
argument.
Both `register_hook` and `hook_provider` ... |
## @package ChirpPython
#
# Python Chirp bindings.
#
# The objects and methods provided by this package correspond to the native
# C API in @ref chirp_reli.h and chirp_swig_wrap.h
#
# The SWIG-based Python bindings provide a higher-level interface that
# revolves around:
#
# - @ref Chirp.Client
# - @ref Chirp.Stat
imp... |
# Copyright (C) 2015 KillerInstinct
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in... |
#!/usr/bin/python3
import gi
gi.require_version('AccountsService', '1.0')
from gi.repository import GObject, AccountsService
import os
from util import utils, trackers
class AccountsServiceClient(GObject.Object):
"""
Singleton for working with the AccountsService, which we use
to retrieve the user's face... |
# Copyright (c) 2011-2013 Jason Dobies
#
# This file is part of Okaara.
#
# Okaara is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# Ok... |
# Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
from coriolis import utils
from coriolis.conductor.rpc import client as rpc_conductor_client
from coriolis.minion_manager.rpc import client as rpc_minion_manager_client
class API(object):
def __init__(self):
self._rpc_conductor_client = rpc_... |
#!/usr/bin/env python2.7
import pprint
import gnupg
import re
import logging
import psycopg2
from psycopg2 import errorcodes
# need to call init() to initialize this
gpgdict = dict()
# ----------------------------------------------------
# functions
def insert_pgp_key(k, dbcursor):
if (k == None or k == ""):
... |
import contextlib
from ..exception import RunException
from ..interface import Connection
from .context import LiveRunContext, NullRunContext
class RunFactory(object):
CONFIG_CONTEXT_KEY = 'run_connection'
RUN_CONTEXT_KEY = 'run_context'
_global_run_context = None
_global_connection = None
_null_run_conte... |
from . import wsapp,socketio
import json
wsapp.testing = True
class TestBoxOfficeApp(object):
def test_day_cinema(self):
client = socketio.test_client(wsapp, namespace='/boxoffice')
client.emit('cn_day_cinema', {"query":"ok"}, namespace='/boxoffice')
received = client.get_received('/boxoff... |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import openerp.http as http
import base64
from ope... |
# -*- coding: utf-8 -*-
import re
import time
import urlparse
from module.plugins.internal.Account import Account
from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies
class XFSAccount(Account):
__name__ = "XFSAccount"
__type__ = "account"
__version__ = "0.38"
__descript... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
from . import Command
from ..console import log
class Quickstart(Command):
@classmethod
... |
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2017 Keeper Security Inc.
# Contact: commander@keepersecurity.com
#
# Example showing how to create a record and upload
# to the server, then deleting the record from ... |
import mysql.connector
SQL_CREATE_TABLE = \
"""
CREATE TABLE `{}` (
`date` date NOT NULL UNIQUE,
`chair` char(64) NOT NULL DEFAULT '',
`minute` char(64) NOT NULL DEFAULT '',
PRIMARY KEY (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
"""
def create_database(cursor, database_name):
try:
curs... |
'''
http://stackoverflow.com/a/5943381
'''
import argparse
import sys
class ArgParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
"""Initialisation method for the parser class"""
super(ArgParser, self).__init__(*args, **kwargs)
#argparse.ArgumentParser.__init__(self, *... |
"""
fabcloudkit
:copyright: (c) 2013 by Rick Bohrer.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
# pypi
from fabric.context_managers import cd, prefix, settings
from fabric.operations import run, sudo
from fabric.state import env
# package
from fabcloudkit impo... |
import json
import RegistryParse as reg_parse
def util_load_json(path):
with open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_get_sub_keys():
key = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList'
folder_output_key = 'Sid'
mo... |
# 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.
from metrics import timeline as timeline_module
from metrics import timeline_interaction_record as tir_module
from telemetry.page import page_measurement
fro... |
# Copyright 2012 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 copy
import logging
import optparse
import os
import shlex
import socket
import sys
from telemetry.core import browser_finder
from telemetry.core imp... |
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that i... |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
# TODO: add any additional package requirements here
'charlesbot',
]
test_requirements = [
# TODO: add any additional package test requirements here
'asynctest',
'c... |
"""Coredata Module
Core is a rather ambigious term - includes upfront questions such
as DOB and patient / staff role. Basic diagnosis and procedure
questions.
Interventions will sometimes require their own set of data, for which the
`/api/coredata/*` endpoints exist.
"""
from abc import ABCMeta, abstractmethod
impo... |
# Copyright 2015 Isotoma Limited
#
# 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... |
# SIM-CITY client
#
# Copyright 2015 Joris Borgdorff <j.borgdorff@esciencecenter.nl>
#
# 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
#
# Unl... |
# Copyright 2017 Become 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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
setup_util.replace_text('dart-stream/postgresql.yaml', 'host: .*', 'host: ' + args.database_host)
setup_util.replace_text('dart-stream/mongodb.yaml', 'host: .*', 'host: ' + args.database_host)
try:
#
# install dar... |
import os.path
import urllib
import smtplib
import string
import StringIO
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from lxml import etree
from lxml.html.soupparser import fromstring
from lxml.cssselect import CSSSelector
from PIL impor... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... |
# Copyright 2013, 2014, 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... |
#!/usr/bin/env python
# -*- encoding: UTF-8 -*-
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is... |
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world
from .factories import *
from django.conf import settings
from django.http import HttpRequest
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.contrib.auth.middleware import Authenticati... |
import pytest
import tempfile
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
import numpy as np
from skopt import gp_minimize
from skopt import load
from skopt import dump
from skopt import expected_minimum
from skopt.... |
#!/usr/bin/env python
#
# Copyright (c) 2017, Pivotal Software Inc.
#
from gppylib.commands import base
from gppylib.commands.unix import *
from gppylib.commands.gp import *
from gppylib.gparray import GpArray
from gppylib.gplog import get_default_logger
from gppylib.gphostcache import *
class GpResGroup(object):
... |
tests=[
("python","UnitTestChem.py",{}),
("python","UnitTestChemv2.py",{}),
("python","UnitTestChemAtom.py",{}),
("python","UnitTestChemBond.py",{}),
("python","UnitTestChemSmarts.py",{}),
("python","UnitTestFragmentDescriptors.py",{}),
("python","UnitTestGraphDescriptors.2.py",{}),
("python","UnitTest... |
"""Tests for the pdfgen API. """
from datetime import datetime
from mock import patch
from django.test import RequestFactory
from certificates import api as certs_api
from certificates.models import CertificateGenerationConfiguration, CertificateStatuses, GeneratedCertificate
from certificates.tests.factories import ... |
# Copyright 2018 Google, Inc.
#
# 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 following disclaimer;
# redistribu... |
# /usr/bin/python
# -*- coding: utf-8 -*-
"""
This program is to
extract named entities from an annotated data file
CS137B, programming assignment #1, Spring 2015
"""
import sys
reload(sys)
sys.setdefaultencoding('utf8')
__author__ = 'krim'
__date__ = '2/6/2015'
__email__ = 'krim@brandeis.edu'
def read(input_file... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: helloworld.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... |
"""
Copyright 2016 Mellanox Technologies. All rights reserved.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
nogahf@mellanox.com (Nogah Frankel)
"""
from lnst.Controller.Task import ctl
from TestLib import TestLib
f... |
import struct
import time
from distutils.version import LooseVersion
import pytest
from unit.applications.lang.python import TestApplicationPython
from unit.applications.websockets import TestApplicationWebsocket
from unit.option import option
class TestASGIWebsockets(TestApplicationPython):
prerequisites = {
... |
"""
The MIT License (MIT)
Copyright (c) 2016 Louis-Philippe Querel l_querel@encs.concordia.ca
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... |
import os
import subprocess
class ScpMocker(object):
"""
This class interfaces to scpmocker - a programmable command mock.
"""
def __init__(self, scpMockerPath, sandboxPath):
self.scpMockerPath = scpMockerPath
self.sandboxPath = sandboxPath
self.binPath = os.path.join(self.sand... |
from JumpScale import j
j.system.platform.ubuntu.check()
import fabric
import fabric.api
# from fabric.api import run as frun
# from fabric.api import execute as fexecute
# from fabric.api import env as fenv
# from fabric.api import open_shell as fopen_shell
# from fabric.api import path as fpath
# from fabric.api i... |
#!/usr/bin/env python
"""
MagPy-transfer: Procedures for data transfer
Written by Roman Leonhardt and Rachel Bailey 2011/2012/2013/2014
Version 1.0 (from the 23.02.2012)
"""
from __future__ import print_function
from __future__ import absolute_import
from magpy.stream import *
import ftplib
import subprocess
try:
... |
# coding=utf-8
# Copyright 2015 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 logging
from... |
from django.contrib import admin
from polls.models import Question, Choice
class ChoiceInLine( admin.TabularInline ):
model = Choice
extra = 3
class QuestionAdmin( admin.ModelAdmin ):
### By default, the Question object's str() is displayed on the "list of
### questions" page. Tell it to display ... |
import sys
import time
import test_utils
all_modules = ['linalg', 'decomp', 'prox', 'dictLearn']
modules = []
# for debug
simul = False
def usage(lst):
print "Usage : %s [-32] [test-or-group-name]+" %sys.argv[0]
print ' Run specified test or group of tests (all by default)'
print ' -32 : use float32... |
# -*- coding: utf-8 -*-
# AwesomeTTS text-to-speech add-on for Anki
# Copyright (C) 2010-Present Anki AwesomeTTS Development Team
#
# 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 versi... |
# vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Joao Paulo de Souza Medeiros.
#
# Author(s): João Paulo de Souza Medeiros <ignotus21@gmail.com>
#
# 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 Founda... |
# Copyright (c) 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
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
from django.forms import Form, CharField, EmailField, ModelChoiceField, Textarea
from django.utils.html import strip_tags
from .models import ContactReason
from .utils import mail_list
class ContactForm(Form):
name = CharField(label="Name", max_length=128,)
email = EmailField(label="E-mail", max_length=128)
... |
import json
from Map import Map
from Door import Door
from Room import Room
from Item import Item
"""
Define um gerador de mapas.
"""
class MapFactory:
"""
Cria uma nova instancia de gerador de mapas.
"""
def __init__(self):
self.RoomsList = [] # Lista de salas geradas.
self.DoorsList = [] # Lista de portas... |
# coding: utf-8
from django.contrib import admin
from comment.models import Comment
from models import Article
class CommentInline(admin.TabularInline):
model = Comment
readonly_fields = ("owner", "content", "status", "create_timestamp")
fieldsets = (
(None, {
"fields": ("owner", "con... |
"""Test instance and class attributes."""
from pytype.tests import test_inference
class TestAttributes(test_inference.InferenceTest):
"""Tests for attributes."""
def testSimpleAttribute(self):
with self.Infer("""
class A(object):
def method1(self):
self.a = 3
def method2(self... |
# Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import PyQt5
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import time
import math
import winsound
EXERCISETIME = 60
class MainWidget(QWidget):
freqChangeSignal = pyqtSignal(object)
togglerSignal = pyqtSignal()
"""... |
# Copyright (C) 2006, Red Hat, Inc.
# Copyright (C) 2009, One Laptop Per Child Association Inc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... |
#FLM: AT Compatibility check
#Check compatibility of selected glyphs between the current font and declared fontCompare (Postcrit Full Name)
# By Andres Torresi
# http://www.huertatipografica.com
#fullName of font you want to compare with current font
fontCompare='ABBvoice Bold';
colorCompatible=150
colorIncompatible=... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-06 07:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('boites', '0008_auto_20170801_1406'),
]
operations ... |
import gdbremote_testcase
import lldbgdbserverutils
import os
import select
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestStubSetSIDTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
def ge... |
#!/usr/bin/env python
import socket
import os
import subprocess
from optparse import OptionParser
from time import time, sleep
from select import select
import sys
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
def main(argv=sys.argv):
parser = Optio... |
"""
Problem 3_3:
Write a function that will convert a date from one format to another.
Specifically, 06/10/2016 should convert to June 17, 2016. Actually, you
will input the 6, the 17, and the 2016 as separate integers (numbers) and
the function will assemble and print the date as June 17, 2016. I suggest
that ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# break simple CAPTCHA
import re
import base64
import urllib.request, urllib.error, urllib.parse
import os.path
import http.cookiejar
import subprocess
from PIL import Image
from PIL import ImageDraw
URL1 = 'http://challenge01.root-me.org/programmation/ch8/'
def main():
... |
from __future__ import absolute_import, division, print_function
from operator import add
from copy import deepcopy
import dask
import pytest
from dask.async import *
fib_dask = {'f0': 0, 'f1': 1, 'f2': 1, 'f3': 2, 'f4': 3, 'f5': 5, 'f6': 8}
def test_start_state():
dsk = {'x': 1, 'y': 2, 'z': (inc, 'x'), 'w'... |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... |
#
# django-coconuts
# Copyright (c) 2008-2019, Jeremy Lainé
# 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 notice,
# ... |
# -*- coding: utf-8 -*-
import os
"""
the operation ( =, -, +, * for respectively keep, delete, insert, substitute)
the coordinate in the first
and in the second string.
"""
def square_list(a, b, value=0):
return [[value, ] * b for j in range(a)]
def arg_min(* arg_list):
arg_s = None
for i, arg in enu... |
import os
from ray.rllib.utils.annotations import DeveloperAPI
@DeveloperAPI
class EvaluatorInterface:
"""This is the interface between policy optimizers and policy evaluation.
See also: RolloutWorker
"""
@DeveloperAPI
def sample(self):
"""Returns a batch of experience sampled from this... |
"""
Module logging facilities. If the colorama module is found, colourized output will be used
"""
from logging import StreamHandler, getLogger as realGetLogger, Formatter, INFO
try:
from colorama import Fore, Back, init, Style
class ColourStreamHandler(StreamHandler):
""" A colorized output SteamHand... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
#!/usr/bin/env python
from setuptools import setup
from PyFileMaker import __version__
setup(
name='PyFileMaker',
version=__version__,
description='Python Object Wrapper for FileMaker Server XML Interface',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
import pygame, numpy, threading, timeit
from .SceneBase import SceneBase
from .DrawingUtils import *
from models.game import Game, Board, Move, TimeLimitedBot
from services import ImageService, FontService, SceneManager, SettingsService as Settings
class PlayGame(SceneBase):
"""
This scene shows a graphical re... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import json
import logging
import os
import pathlib
import shlex
import shutil
import signal
import subprocess
import sys
import ... |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
from contextlib import contextmanager
from django.conf import settings
import sqlalchemy
from sqlalchemy.orm.scoping import scoped_session
from sqlalchemy.orm.session import sessionmaker
from django.core import signals
DEFAULT_ENGINE_ID = 'default'
UCR_ENGINE_ID = 'ucr'
ICDS_UCR_ENGINE_ID = 'icds-ucr'
def create_en... |
from datetime import datetime
from pytest import fixture, raises
from lsf_ibutils.ibsub.output import build_command, BuildScript
from tests.helpers import assert_exc_info_msg
@fixture
def flags_simple():
return [
['-J', 'awesomename'],
['-P', 'awesomeproj'],
['-n', '10'],
]
@fixtur... |
try:
import aiohttp.web
except ImportError:
print("The dashboard requires aiohttp to run.")
import sys
sys.exit(1)
import argparse
import copy
import datetime
import errno
import json
import logging
import os
import platform
import threading
import time
import traceback
import yaml
import uuid
import g... |
"""Tests for import."""
import unittest
from pytype import utils
from pytype.tests import test_inference
class ImportTest(test_inference.InferenceTest):
"""Tests for import."""
def testBasicImport(self):
with self.Infer("""\
import sys
""", deep=True, solve_unknowns=True) as ty:
self.asse... |
"""
@summary: This module tests the single tile base module
@author: CJ Grady
@version: 1.0
@status: beta
"""
from nose.tools import raises
import numpy as np
import os
from slr.common.costFunctions import seaLevelRiseCostFn
from slr.singleTile.base import SingleTileLCP
from tests.helpers.testConstants import (BELOW_... |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... |
"""
This page is in the table of contents.
Stretch is very important Skeinforge plugin that allows you to partially compensate for the fact that extruded holes are smaller then they should be. It stretches the threads to partially compensate for filament shrinkage when extruded.
The stretch manual page is at:
http://... |
import governorhub
import logging
import os
import json
import loggly.handlers
from datetime import datetime
from gcloud import pubsub
from dfe_data import update_dfe_data
logging.basicConfig(level=logging.INFO)
# Turn off requests INFO level logging
requests_log = logging.getLogger("requests")
requests_log.setLevel... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests of KojiCloneTagForReleaseMilestone script.
"""
import unittest
import os
import sys
from mock import Mock, patch
DIR = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(DIR, ".."))
from releng_sop.common import Environment, Release # noqa
from releng_sop... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import pythonmid.apps.community.models
class Migration(migrations.Migration):
dependencies = [
('community', '0005_sponsor_level'),
]
operations = [
migrations.AlterField(
... |
#!/usr/bin/env python
# Filename: base.py
#=====================================================================#
# Copyright (c) 2015 Bradley Hilton <bradleyhilton@bradleyhilton.com> #
# Distributed under the terms of the GNU GENERAL PUBLIC LICENSE V3. #
#===========================================================... |
# -*- coding: utf-8 -*-
# script.module.python.koding.aio
# Python Koding AIO (c) by TOTALREVOLUTION LTD (support@trmc.freshdesk.com)
# Python Koding AIO is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
# You should have received a copy of the license along w... |
# _*_ coding:utf-8 _*_
__author__ = 'Y-ling'
__date__ = '2017/9/14 9:10'
from selenium import webdriver
import unittest
import random
import time
import os
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import utils
from elements_path import REGISTER_FORM, LOGIN_FORM, TOP_BAR, FIND_WAIT_TIME
'''
注册模块的自动化测试模块... |
import sys, os, inspect, imp
import jarray
class classPathHacker(object):
"""Original Author: SG Langer Jan 2007, conversion from Java to Jython
Updated version (supports Jython 2.5.2) From http://glasblog.1durch0.de/?p=846
Purpose: Allow runtime additions of new Class/jars either from
local files or... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# AutoBit documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 23 15:36:02 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... |
from sqlalchemy import Column, Integer, String, Text, ForeignKey
from pyfsw import db
class ShopCategory(db.Model):
__tablename__ = 'shop_category'
# Standard columns
id = Column(Integer, primary_key=True, unique=True)
name = Column(String(32))
enabled = Column(Integer, default=1)
# Relationship
items = db.re... |
import sys,os
import logging
import numpy as np
import colorsys
#Current path
cur_path = os.path.dirname(os.path.realpath( os.path.basename(__file__)))
#Logging
logger = logging.getLogger("SRL Bench")
logger.setLevel(logging.DEBUG)
logger.propagate = False
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
for... |
"""Provide the Subreddits class."""
from typing import TYPE_CHECKING, Dict, Iterator, List, Optional, Union
from warnings import warn
from ..const import API_PATH
from . import Subreddit
from .base import PRAWBase
from .listing.generator import ListingGenerator
from .util import stream_generator
if TYPE_CHECKING: # ... |
__author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import pandas as pd
import os
import shutil
# RiBuild Modules
from delphin_6_automation.sampling import inputs
from delp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.