src stringlengths 721 1.04M |
|---|
import pygame
from texture import Texture
def borders(surface):
width, height = surface.get_size()
y0 = 0
y1 = 0
x0 = 0
x1 = 0
i = 0
while i < height:
r,g,b,a = surface.get_at((0,i))
if a > 0:
y0 = i
break
i += 1
while i < height:
... |
from generator import load_settings
from generator.builders.type_builder import TypeBuilder
from office365.runtime.odata.odata_v3_reader import ODataV3Reader
from office365.runtime.odata.odata_v4_reader import ODataV4Reader
def generate_files(model, options):
"""
:type model: office365.runtime.odata.odata_mo... |
# Copyright 2020 Tensorforce Team. 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 la... |
import climate
import collections
import lmj.cubes
import lmj.plot
import matplotlib.colors
import numpy as np
import pandas as pd
COLORS = {
'marker00-r-head-back': '#9467bd',
'marker01-r-head-front': '#9467bd',
'marker02-l-head-front': '#9467bd',
'marker03-l-head-back': '#9467bd',
'marker07-r-sh... |
###
# Copyright (c) 2013, KG-Bot
# 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 condition... |
# Copyright (c) 2014 Mark Samman <https://github.com/marksamman/pylinkshortener>
#
# 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... |
"""
TODO create create_environment_file(.) to build a template env file with defaults
"""
# pylint: disable=C0111
import os
import sys
import logging
_CDIR = os.path.dirname(sys.argv[0] if __name__ == '__main__' else __file__)
# Location of qx ourdir when compiled using docker-compose -f docker-compose.dev.yml run... |
#!/usr/bin/env python
import time
from sys import exit
try:
from PIL import Image
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
import unicornhathd
print("""Unicorn HAT HD: Show a PNG image!
This basic example shows use of the Python Pillow libra... |
"""Place representing a geographical point on the map."""
from django.db import models
from model_utils import Choices
class PlaceTypeMixin:
"""Place type definitions."""
PLACE_TYPES = Choices(
('city', 'City'),
('town', 'Town'),
('beach', 'Beach'),
('cafe', 'Cafe'),
(... |
from django.dispatch import receiver
from django.db.models.signals import pre_save, post_save
from valhalla.userrequests.models import UserRequest, Request
from valhalla.userrequests.state_changes import on_request_state_change, on_userrequest_state_change
from valhalla.proposals.notifications import userrequest_notif... |
import random
import turtle
moveforward = ("Move forward")
turnleft = ("Turn Left")
movebackward = ("Move Backward")
turnright = ("Turn Right")
square = ("square")
circle = ("circle")
penUp = ("pen up")
penDown = ("pen down")
goto = ("go to")
house = ("house")
Instructions = ("Intructions")
def Instuctions():
p... |
import re
from django.conf import settings
from django.db.models.loading import get_model
from django.core.cache import cache
from django.utils.safestring import mark_safe
class ObjectLinkerMiddleware(object):
def process_response(self, request, response):
print response['Conte... |
from collective.workspace.interfaces import IWorkspace
from plone import api
from ploneintranet.workspace.browser.viewlets import JoinViewlet
from ploneintranet.workspace.tests.base import BaseTestCase
from ploneintranet.workspace.browser.viewlets import SharingViewlet
from ploneintranet.workspace.policies import PART... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-10-01 14:15
from __future__ import unicode_literals
from django.db import migrations, models
import sapl.sessao.models
import sapl.utils
class Migration(migrations.Migration):
dependencies = [
('sessao', '0045_auto_20190816_1337'),
]
... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... |
"""
Different classifiers in decoding the Haxby dataset
=====================================================
Here we compare different classifiers on a visual object recognition
decoding task.
"""
import time
### Fetch data using nilearn dataset fetcher ################################
from nilearn import datasets
... |
bl_info = {
"name": "Dial and Scale",
"author": "stacker, sambler",
"version": (1, 2),
"blender": (2, 80, 0),
"location": "3DView > Add > Curve > Dial and Scale",
"description": "Add an array of text number objects or watch dials.",
"warning": "",
"wiki_url": "https://github.com/3dbug/bl... |
#!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan
Last updated: July 2015
File name: circles3_traj.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib; roslib... |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import contextlib
import datetime
from dateutil.relativedelta import relativedelta
import traceback
import sys
import logging
from ..config import CONFIG
from ..model import Mode... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
PcrasterMapstackVisualisation
A QGIS plugin
PCRaster Mapstack visualisation
-------------------
begin : 2014-06-28
copy... |
# Copyright (C) 2017 Daniel Fava. All Rights Reserved.
import re
import myunittest
class Common(myunittest.TestCase):
def test_k(self):
self.assertEqual(len(self.config.goroutines), 1)
m = re.match("channel \( .* \) <- 6", self.config.goroutines[0].k)
self.assertNotEqual(m, None)
pass
def test_c_f... |
import unittest
from bfdpie import *
class Test(unittest.TestCase):
def test_large_vma(self):
b = Binary()
# 32-bit limit test
dis1 = b.disassemble(b"\x90", ARCH_I686, 0x80000000)
dis2 = b.disassemble(b"\x90", ARCH_X86_64, 0x80000000)
self.assertTrue(dis1[0].vma >= 0)
self.asse... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
# Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# -*- coding: utf-8 -*-
# Yedek Subay Sınıflandırma Sonuçları Gözlemcisi v1.0
#
# Bu program belirtilen doneme ait yedek subay sinav sonuclarinin
# TSK web sitesinde yayinlanmasi durumunda belirtilen
# e-posta adresine e-posta gondererek sizi bilgilendirmektedir.
# Not: Gmail e-posta adresi kullanmanız gerekmekte... |
import os
import sys
import pyauparser
def main():
g = pyauparser.Grammar.load_file("data/operator.egt")
# every production has a lambda handler which evaluates value from childs.
# Because LALR is a bottom-up parser, handler would be called from bottom.
h = pyauparser.ProductionHandler({
... |
from mutagen.easyid3 import EasyID3
from mutagen.mp4 import MP4, MP4Tags, error, delete
from mutagen.mp3 import MP3
import mutagen
# We're treating every audio file as an individual object
class TiKiFile:
def __init__(self):
print ('Opened music file')
### Object globals ###
self.fileName ... |
"""
Acceptance tests for the teams feature.
"""
from __future__ import absolute_import
import json
import random
import time
from uuid import uuid4
import ddt
from dateutil.parser import parse
from selenium.common.exceptions import TimeoutException
from six.moves import map, range
from common.test.acceptance.fixture... |
# -*- coding: utf8 -*-
# Copyright (C) 2014 Ben Ockmore
# 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 progr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = '''
---
module: public_cloud_instance
short_description: Manage OVH API for public cloud instance creatikon
descripti... |
"""TVM operator fully connected compute."""
from __future__ import absolute_import
import tvm
from .. import tag
def dense_default(data, weight, bias=None):
"""The default implementation of dense in topi.
Parameters
----------
data : tvm.Tensor
2-D with shape [batch, in_dim]
weight : tvm.... |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.fixedTools import fixedToFloat, floatToFixed
from fontTools.misc.textTools import safeEval
import array
import io
import logging
import struct
import sys
# https://www.microsoft.com/typography/otspec... |
import pandas as pd
from .utils import update_with_verbose
import django
def to_fields(qs, fieldnames):
for fieldname in fieldnames:
model = qs.model
for fieldname_part in fieldname.split('__'):
try:
field = model._meta.get_field(fieldname_part)
except djang... |
import socket
class Client:
def __init__(self, host, port, timeout, bsize):
# network client configuration
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.connection.connect((host, port))
self.connection.settimeout(timeout)
self.bsize = bsize
... |
"""
Django settings for gitbrowser project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... |
"""Support for Harmony Hub devices."""
import json
import logging
import voluptuous as vol
from homeassistant.components import remote
from homeassistant.components.remote import (
ATTR_ACTIVITY,
ATTR_DELAY_SECS,
ATTR_DEVICE,
ATTR_HOLD_SECS,
ATTR_NUM_REPEATS,
DEFAULT_DELAY_SECS,
)
from homeass... |
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************************************... |
# encoding=utf-8
__author__ = 'Q-Whai'
'''
DESC: 与CSV文件操作相关测试Demo
Blog: http://blog.csdn.net/lemon_tree12138
Create Date: 2016/2/25
Last Modify: 2016/3/9
version: 0.0.1
'''
import csv
# ----------------------------------------- #
# 读取CSV文件中的内容 #
# ----------------------------------------- #... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field xdays on 'Group'
db.create_table('rainman_group_xdays', (
('id', mo... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... |
# 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
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
# Copyright 2012 Christoph Reiter
# 2020 Nick Boultbee
#
# 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.
impo... |
from dec.spectral import *
from dec.grid1 import *
import matplotlib.pyplot as plt
def fix_axis_labels():
plt.tick_params(labelsize=45)
plt.xticks((-1, 0, 1), ('$-1$', '$0$', '$+1$'))
plt.yticks((0, 1), ('$0$', '$1$'))
plt.axis([-1.5, 1.5, -0.5, 1.5])
def draw_stemlines(x, y):
markerline, stemline... |
# defina una función que dado una lista de numeros
# retorne la suma de ellos
def sumalista(l):
# calcula l[0] + l[1] + l[2] + ... + l[??]
# el largo de la lista l se obtiene con len(l)
suma = 0
i = 0
while i < len(l):
suma = suma + l[i]
i = i + 1
return suma
def sumalista_cool(l):
... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import socket
import pytest
from datadog_checks.dev import docker_run, get_here, run_command
from datadog_checks.dev.conditions import WaitFor
from .common import HOST, INSTANCE
def wait_for_thrift()... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Precice(CMakePackage):
"""preCICE (Precise Code Interaction Coupling Environment) is a
... |
from flask import Blueprint, render_template, flash, redirect, request, url_for, current_app
from flask_security.decorators import login_required
from flask_security import current_user
from recruit_app.ia.managers import IaManager
from recruit_app.user.eve_api_manager import EveApiManager
from recruit_app.ia.forms i... |
import requests, json, sys
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
def getXms(ip,user,pwd):
try:
response = requests.get('https://%s/api/json/v2/types/xms/?name=xms' %(ip),auth=(user,pwd),verify=False)
return json.loads(response.text)
except requests.excep... |
"""
GraphQL definitions for the Authentication App
"""
import datetime
from django.contrib.auth.models import User
from graphene import Argument, Field, Float, Int, List, Mutation, \
NonNull, String, relay
from graphene_django import DjangoObjectType, DjangoConnectionField
from trading.models import TradingAccount
... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Case.source'
db.add_column(u'djecks_case', 'source',
... |
from buffalo import utils
class Tray(object):
FEATHER = 10
# FEATHER is the number of pixels away from the edges of a tray
# that the "resize region" goes
DEFAULT_MIN_WIDTH = 150
DEFAULT_MAX_WIDTH = 1000
DEFAULT_MIN_HEIGHT = 150
DEFAULT_MAX_HEIGHT = 1000
DEFAULT_COLOR = (0, 0, 100, 15... |
"""Utilities for working with ID tokens."""
from __future__ import absolute_import
import json
from time import time
from django.conf import settings
from edx_django_utils.monitoring import set_custom_metric
from edx_rbac.utils import create_role_auth_claim_for_user
from jwkest import jwk
from jwkest.jws import JWS
... |
import sys
sys.path.append('../tethne')
import unittest
import tempfile
import os
from xml.etree import ElementTree as ET
import networkx as nx
import csv
from tethne.model.corpus.mallet import LDAModel
from tethne.readers.wos import read
from tethne import FeatureSet, tokenize
from tethne.networks import topics
dat... |
#!/usr/bin/env python
# Exercise the listtransactions API
# Add python-catchcoinrpc to module search path:
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-catchcoinrpc"))
import json
import shutil
import subprocess
import tempfile
import traceback
from catchcoin... |
import time, re, datetime
from common.steps import service_created_precond,device_with_commands_created_precond,check_status_info
from lettuce import step, world
from iotqautils.cbUtils import CBUtils
from common.gw_mqtt_commands import mqtt_command
from threading import Thread
from common.gw_configuration import... |
'''
'''
import re
import http
import asyncio
from itertools import *
from versa.driver import memory
from versa import I, VERSA_BASEIRI, ORIGIN, RELATIONSHIP, TARGET, ATTRIBUTES
from versa.reader import rdfalite
from versa.reader.rdfalite import RDF_NS, SCHEMAORG_NS
from versa import util as versautil
#from bibfram... |
#!/bin/env python
import os
import sys
import shlex
import subprocess
import shutil
#
# Constants
#
WELCOME_STRING = """
########################################################
# Running Installation Script for Workstation #
########################################################\n\n\n
"""
RAN_SCRIP_ST... |
# Copyright © 2017 Vincent Gripon (vincent.gripon@imt-atlatique.fr) and IMT Atlantique
#
# This file is part of PyRat.
#
# PyRat 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 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import unittest
from imtransform import affine_transformation_2d, affine_transformation_3d
####################################
class TestImtransform(unittest.TestCase):
def test_image_transform_2d(self):
import skimage.io as skio
fimg =... |
__author__ = 'drichner'
"""
docklr -- docklr_tests.py
Copyright (C) 2014 Dan Richner
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 v... |
import logging, json
from flask import current_app, redirect, Response
from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer,
SignatureExpired, BadSignature)
import sqlalchemy as sa
from sqlalchemy.sql.expression import func
from pypnusershub.db.tools import (
Insuff... |
# Copyright (c) Mathias Kaerlev 2011-2012.
# This file is part of pyspades.
# pyspades 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... |
### Imports
import pickle, os, platform, random
### Functions
def main():
curPlayer = loadPlayer( 'Tory' )
curGame = loadGame( 'Python_Tutorial' )
startGame(curPlayer, curGame)
def banner():
'''
if platform.system() == "Windows":
clearCmd = "cls"
elif platform.system() == "Linux":
clearCmd = "clear"
... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
USER_MODEL = getattr(settings, 'SOCIAL_AUTH_USER_MODEL', None) or \
getattr(settings, 'AUTH_USER_MODEL', None) or \
'auth.User'
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
def setup_python3():
# Taken from "distribute" setup.py
from distutils.filelist import FileList
from distutils import dir_util, file_util, util, log
from os.path import join, exists
tmp_src = join("build", "src")
if exists(tmp... |
from ..statichtml import HtmlGenerator
import os, shutil
import filecmp
def savePost(postToSave, postDataStrategy):
postSaveResult = postDataStrategy.savePost(postToSave)
if postSaveResult:
postPageHtml = HtmlGenerator.generateHtmlForPostPage(postToSave)
mainPageHtml = HtmlGenerator.generateHtm... |
from config import config
class CardValue:
rankValue = {
"2" : 2,
"3" : 3,
"4" : 4,
"5" : 5,
"6" : 6,
"7" : 7,
"8" : 8,
"9" : 9,
"10": 10,
"J" : 11,
"Q" : 12,
"K" : 13,
"A" : 14,
}
order = ['2', '3', ... |
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
# -*- coding: utf-8 -*-
from django.db import models
import requests
import re
class Project(models.Model):
name = models.CharField(max_length=50)
environment = models.CharField(max_length=10, choices=(('DEV', 'DEV'), ('QA', 'QA'), ('PROD', 'PROD')))
related_project = models.ManyToManyField('Project', bla... |
from django.test import TestCase
from phonebook.models import Contact
from phonebook.forms import LoginForm, ContactForm
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
class ContactTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user(username=... |
# Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + poplib."""
import socket
from poplib import POP3, POP3_SSL_PORT
from tlslite.tlsconnection import TLSConnection
from tlslite.integration.clienthelper import ClientHelper
class POP3_TLS(POP3, ClientHelper):
... |
# Copyright 2015 Canonical Ltd
# 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... |
# Copyright 2015 datawire. 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 agr... |
# 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 ... |
# TODO RaduW 8.06.2019 remove the sentry.filters package and rename this module to filters
from __future__ import absolute_import
import collections
from collections import namedtuple
import re
from sentry.models.projectoption import ProjectOption
from sentry.utils.data_filters import FilterStatKeys
from rest_framewo... |
# coding=utf-8
# Copyright 2021 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# graphs.py
# This file is part of FORD.
#
# Copyright 2015 Christopher MacMackin <cmacmackin@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 Softwa... |
import heimdall
from heimdall import tasks
from heimdall import resources
from heimdall import supplies, demands
from heimdall.predicates import *
from game_item import comparePlatforms
import datetime
import difflib
import urllib
import xml.etree.ElementTree as ET
baseImageUrl = "http://thegamesdb.net/banners/"
de... |
import unittest
from SeaBattle import Position, User, Utils
class TestBoard(unittest.TestCase):
def setUp(self):
pass
def testPositive(self):
self.assertTrue(True, "What?")
#def testNegative(self):
# self.assertTrue(False, "Failed as expected")
def testGet... |
# Utility functions for various actions
import os
import sys
import time
import shutil
import hashlib
from bit.instance import bit
from bit.cprint import error, warning
def hash(file_name):
try:
with open(file_name, 'rb') as hashable:
algo = hashlib.new(bit.options.hash_type)
algo... |
import unittest2 as unittest
from mox3.mox import MoxTestBase
from gevent import socket, ssl
from slimta.http import HTTPConnection, HTTPSConnection, get_connection
class TestHTTPConnection(unittest.TestCase, MoxTestBase):
def test_connect(self):
self.mox.StubOutWithMock(socket, 'create_connection')
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a main window class with styling support.
"""
from __future__ import unicode_literals
from PyQt5.QtWidgets import QMainWindow, QStyleFactory, QApplication
from .E5Application import e5App
from ... |
import sys
from functools import (
cmp_to_key,
wraps
)
from django.db.utils import DatabaseError
from django.db.models.sql.where import (
WhereNode,
AND,
OR
)
def safe_call(func):
@wraps(func)
def _func(*args, **kwargs):
try:
return func(*args, **kwargs)
exce... |
#!/usr/bin/env python3
from bs4 import BeautifulSoup
from requests import get
from bs4.element import Tag
ignore = {'Lisp Machines, Inc.', 'Symbolics', 'Texas Instruments', 'Xerox'}
levels = {}
levels['Apple Inc.'] = {3}
levels['On S/360, S/370, and successor mainframes'] = {3}
levels['On other hardware platforms']... |
# Copyright 2019,2020,2021 Sony Corporation.
#
# 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... |
# Copyright (c) 2014, James Hensman, Max Zwiessele
# Distributed under the terms of the GNU General public License, see LICENSE.txt
import numpy as np
from scipy.special import gamma, digamma
from scipy import stats
class student_t():
def __init__(self):
self._set_params(np.ones(2))
def _set_params(se... |
import os
from unittest import skipUnless
from decimal import Decimal
from django.conf import settings
from django.test import TestCase
from django.core.files import File
from ccstraps.models import Strap, StrapImage
red = os.path.exists('%s/ccstraps/red.png' % settings.STATIC_ROOT)
purple = os.path.exists('%s/ccstra... |
import unittest
import extraction
from extraction.tests.data import *
from extraction.examples.new_return_type import AddressExtractor
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.extractor = extraction.Extractor()
def test_rewriting_relative_urls(self):
"Test rewritin... |
##
## pyGBot - Versatile IRC Bot
## Copyright (C) 2008 Morgan Lokhorst-Blight, Alex Soborov
##
## 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, ... |
import os
import string
import pathlib
import pandas as pd
import sqlalchemy
from sqlalchemy.engine.url import URL
from sqlalchemy.pool import QueuePool
from sqlalchemy_utils.functions import create_database, database_exists
from sqlalchemy.orm import sessionmaker, scoped_session
database_name = 'JARVIS_DB'
database_... |
import os
import json
import pickle
import pandas as pd
import numpy as np
import datetime
from collections import OrderedDict
from .utils import JSONEncoderCustom
from httplib2 import Http
from django.conf import settings
# google
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import Ins... |
# coding: latin1
## Copyright 2005 Luc Saffre
## This file is part of the Lino project.
## Lino 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 ... |
""" GraphDB- A Graph-managing Database
GraphDB is a Connection object which allows for a flexible implementation of
graph-structured data.
Consider the following Example Database:
Table: Country (name)
Table: Person (name)
Table: AnimalSpecies (name)
Table: Food (name)
There are ... |
#!/usr/bin/env python
# Copyright (c) 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.
# This script is used to copy all dependencies into the local directory.
# The package of files can then be uploaded to App Engine.... |
#! /usr/bin/env python
'''Libraries for events
Interactions, pedestrian crossing...'''
import numpy as np
from numpy import arccos
import multiprocessing
import itertools
import moving, prediction, indicators, utils, cvutils
__metaclass__ = type
def findRoute(prototypes,objects,i,j,noiseEntryNums,noiseExitNums,minS... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-09-18 23:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import user.models
class Migration(migrations.Migration):
initial = True
dependencies = ... |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class SIndexPerformance(BaseModel):
"""
4.89 中国股票指数业绩表现
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Wind代码 ... |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the... |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.