src stringlengths 721 1.04M |
|---|
# coding: utf-8
"""
The MIT License (MIT)
Copyright (c) 2015 Ryan Vennell
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 sys
import os
import unittest
import tempfile
import shutil
import functools
if sys.version_info[0] >= 3:
from io import StringIO
else:
from StringIO import StringIO
from os.path import realpath, isdir
class ChdirStack(object):
"""Stack of current working directories."""
def __init__(self):
... |
import pytest
import json
import os.path
from fixture.application import Application
import ftputil
from fixture.soap import SoapHelper
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), file)
... |
from ase import Atoms
from ase.structure import molecule
from ase.parallel import paropen
from gpaw import GPAW, Mixer, MixerDif
from gpaw.utilities.tools import split_formula
cell = [14.4, 14.4, 14.4]
data = paropen('data.txt', 'a')
##Reference from J. Chem. Phys. Vol 120 No. 15, 15 April 2004, page 6898
tpss_de = [... |
# -*- coding: utf-8 -*-
import datetime
import six
from decimal import Decimal
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __init__(self, obj, *args):
self.obj = obj
UnicodeDecodeError.__init__(self, *args)
def __str__(self):
original = UnicodeDecodeError.__str__(self)
... |
from __future__ import division
import os
import threading
import sqlite3
import decimal
import logging
from time import time
from copy import copy
from itertools import groupby
from operator import attrgetter, itemgetter
from bitcoin.core import b2lx
from feemodel.config import config, datadir, MINRELAYTXFEE, PRIOR... |
# -*- coding: utf-8; -*-
# Copyright (C) 2009 Østfold University College
#
# This file is part of ANDP.
#
# ANDP 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 you... |
# Copyright 2014-2016, A10 Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
"""
Author: Zach Williams, <zach AT codeforamerica DOT org>
Copyright (c) 2011, Code for America. 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 mu... |
from __future__ import unicode_literals
from django.contrib import admin
from django_comments import get_model
from django_comments.admin import CommentsAdmin
from django_comments.models import CommentFlag
from django_comments_xtd.models import XtdComment, BlackListedDomain
class XtdCommentsAdmin(CommentsAdmin):
... |
import logging
from braces.views import JSONResponseMixin
from django.conf import settings
from django.http import HttpResponseBadRequest
from django.views import View
from rest_framework.authtoken.models import Token
from astrobin_apps_payments.services.pricing_service import PricingService
log = logging.getLogger(... |
import sys
from datetime import datetime
from .exceptions import NoMatchingDatabaseEntryError, CurrentStampNotFoundError
from .mappings import Workday, Project, Customer, Invoice
from .db import Database
from .formatting import yes_or_no, provide_input, value_for
from .mappings import Customer, Project
__all__ = ['ne... |
import sys
import yaml
import re
import datetime as DT
import logging
from rainbow_logging_handler import RainbowLoggingHandler
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn_pandas import DataFrameMapper
# Capturing current module. Needed to call getattr on this module
this_m... |
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2014 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Gene... |
# -*- python -*-
# Copyright (C) 2009-2013 Free Software Foundation, 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 License, or
# (at your option) any later versio... |
# -*- 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):
db.rename_column('carts_carrier_translation', 'name', 'old_name')
db.rena... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Florian Lambert <flambert@redhat.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... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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) a... |
from flask_restful import Resource, abort
from flask_login import current_user, login_required
from peewee import DoesNotExist
from redash.authentication.org_resolving import current_org
from redash.tasks import record_event
class BaseResource(Resource):
decorators = [login_required]
def __init__(self, *arg... |
import tensorflow as tf
distr = tf.contrib.distributions
# RNN decoder with pointer net for the sequence-to-sequence model.
class pointer_decoder(object):
def __init__(self, encoder_output, cell, temperature, C, inference_mode, initializer):
self.encoder_output = encoder_output # Ref vectors ... |
# -*- coding: utf-8 -*-
## begin license ##
#
# "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io
#
# Copyright (C) 2010-2011 Seek You Too (CQ2) http://www.cq2.nl
# Copyright (C) 2011-2015, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2015 Koninklijke B... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.contrib.auth import get_user_model
from rest_framework.test import APIRequestFactory, force_authenticate
from rest_framework import status
from .models import Category, Todo, Profile
from .views ... |
import argparse
import logging
import os
import sys
import re
import json
def initialize_logger(logfile, args):
logger = logging.getLogger('clonotype_cell')
loglevel = logging.INFO
logger.setLevel(loglevel)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)-8s - %(message)s')
# creat... |
from interface.QtAutogen.minimal_autogen import Ui_MainWindow
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtWidgets import QMainWindow, QApplication
from collections import namedtuple
import sys
import cv2
Point = namedtuple('Point', ['x', 'y'])
class MinimalApplication(QMainWindow):
instance = None
... |
#!/usr/bin/env python
# Connect to the ProMS MySQL user database. Includes queries for ProMS
# ID and ProMS ID/password.
import os, sys
import mysql.connector
import sqlalchemy
import logging
from sqlsoup import SQLSoup as SqlSoup
from ginga.misc import log
class ProMSdbError(Exception):
pass
class ProMSdb(obj... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
transferContent
A QGIS plugin
Effectively conduct direct to digital map biographies and traditional land
use studies
-------------------
begin... |
#!/usr/bin/env python3
from distutils.core import setup
version='1.3.2'
setup(
name='vkontakte',
version=version,
author='Mikhail Korobov',
author_email='kmike84@gmail.com',
packages=['vkontakte'],
url='http://bitbucket.org/kmike/vkontakte/',
license = 'MIT license',
description = "v... |
# coding=utf-8
# Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
"""
.. module:: exchange
:platform: Unix, Windows
:synopsis: Provides CAD exchange and interoperability functions
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
import os
import struct
import json
from io import StringIO
from . import compatibility, operations, elements, linalg
from . import _ex... |
# Basic OBJ file viewer. needs objloader from:
# http://www.pygame.org/wiki/OBJFileLoader
# LMB + move: rotate
# RMB + move: pan
# Scroll wheel: zoom in/out
import sys, pygame
from pygame.locals import *
from pygame.constants import *
from OpenGL.GL import *
from OpenGL.GLU import *
# IMPORT OBJECT LOADER
from objloa... |
from pydgin.utils import trim_32
from epiphany.instruction import Instruction
from epiphany.isa import decode
from epiphany.machine import RESET_ADDR
from epiphany.test.machine import StateChecker, new_state
import opcode_factory
import pytest
@pytest.mark.parametrize('rn,rm,is16bit', [(-1, 28, True),
... |
## pythonFlu - Python wrapping for OpenFOAM C++ API
## Copyright (C) 2010- Alexey Petrov
## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR)
##
## 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 F... |
"""
'Contrary to what people may say, there is no upper limit to stupidity.'
- Stephen Colbert
"""
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from dpn.data.models import Node
from dpn.client.tasks import... |
"""Defines the Dandelion class"""
import networkx as nx;
class Dandelion:
"""The Dandelion code"""
def __init__(self, N, k, code = None, kTree = None):
"""Initializes the code."""
self.N = N;
self.k = k;
self._code = None;
self._kTree = None;
if code is not Non... |
import os
import sys
import time
import logging
from exabgp.logger.handler import getLogger
from exabgp.logger.format import formater
def echo(_):
return _
class option(object):
logger = None
formater = echo
short = False
level = 'WARNING'
logit = {}
cwd = ''
# where the log shou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: ogr_couchdb.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: CouchDB driver testing.
# Author: Even Rouault <even dot rouault at mines dash paris do... |
#!/usr/bin/python
import yaml
import SoftLayer
from pprint import pprint
credsFile = open("softcreds.yaml",'r')
creds = yaml.load(credsFile)
#print creds['username']
#print creds['api_key']
client = SoftLayer.Client(username=(creds['username']), api_key=(creds['api_key']))
n = 1
count = 1
kill_file = open("kill-... |
from core.himesis import Himesis
import uuid
class HBasicState2ProcDef(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule BasicState2ProcDef.
"""
# Flag this instance as compiled now
self.is_compiled = True
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-04-25 11:36
import os
from django.db import migrations, models
from django.core import management
from arches.app.models.system_settings import settings
from arches.app.models.concept import Concept
from arches.app.search.search_engine_factory import SearchE... |
from ztreeauth.decorators import authorize_request
from ztree.component.views import SiteHomeView
from akuna.component import get_component
import logging
logger = logging.getLogger('ztree')
#def _request_kwargs(request):
# # XXX QueryDict in release 1.4 will have dict() method
# from ztree.utils import query... |
# -*- coding: utf-8 -*-
# 017_cleaner.py
# CODED TO BE EXECUTED SERVER SIDE :
# cd /home/common/shade
# python3 manage.py shell
import sys
from apis.voca import *
##################################
# Init des paths et noms de fichiers
AddLog('title' , 'Début du nettoyage du fichier')
work_dir = '/home/com... |
# copyright (c) David Wilson 2015
# This file is part of Icarus.
# Icarus 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.
# Icarus is... |
# -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2003-2012
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: d6e1d28165e1e0b54b746762992665e7d30cab04 $'
import re
from . import terminal_interface_base
try:
import ctypes
ctypes_found = True
except ImportError:
ctypes_found = Fa... |
#!/usr/bin/python
## I got started with the tips and outline from:
## https://beagle.whoi.edu/redmine/projects/ibt/wiki/Deploying_Flask_Apps_with_Apache_and_Mod_WSGI
## Together with that starter kit, the contents of this file and the associated Apache config in
## ./celebratio are enough to get the site going.
impo... |
#!/usr/bin/python
#coding: utf-8
#print "Content-type: text/html\n"
#Author: LIPH
import web
import demjson
import json
import string
import time
import urlparse
import webci_attr
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
render = web.template.render('templates/')
urls = ( '/ciattrtyp... |
"""
Small sphinx extension to show a UI example + result
"""
import os
import sys
import hashlib
import warnings
import subprocess
import importlib.util
from sphinx.util.compat import Directive
from docutils import nodes
from flexx import app
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
ROOT_DIR = os.path.... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
#!/usr/bin/env python3
import sys
import psr_common
if len(sys.argv) != 3:
print("Usage: generate_ordering.py maxam outbase")
quit(1)
outbase = sys.argv[2]
def IterateCartesian(g, am):
if g[2] == am:
newg = (-1, -1, -1)
elif g[2] < (am - g[0]):
newg = (g[0], g[1]-1, g[2]+1)
else:
newg = (... |
# -*- coding: utf-8 -*-
'''
Database module, including the SQLAlchemy database object and DB-related
utilities.
'''
from sqlalchemy.orm import relationship
from .extensions import db
# Alias common SQLAlchemy names
Column = db.Column
relationship = relationship
class CRUDMixin(object):
'''Mixin that adds conve... |
import re
from django.core.exceptions import ValidationError
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Person
class ContactUsForm(forms.Form):
sender = forms.EmailField()
subject = forms.CharField()
body = forms.CharField(widget=forms.Textarea)
... |
#!/usr/bin/env python
# Read annotation file, print selected stuff in human-readable format.
# AUTHOR: Tom Skelly (thomas.skelly@fnlcr.nih.gov)
import os
import sys
import optparse
import re # regular expressions
import cPickle as pickle
from tt_log import logger
import Annotations as anno
VERSION = '201504... |
## Does "land_surface_air__latent_heat_flux" make sense? (2/5/13)
# Copyright (c) 2001-2014, Scott D. Peckham
#
# Sep 2014. Fixed sign error in update_bulk_richardson_number().
# Ability to compute separate P_snow and P_rain.
# Aug 2014. New CSDMS Standard Names and clean up.
# Nov 2013. Con... |
import functools
class BaseService:
def __init__(self, wrt):
self._wrt = wrt
self._package = None
@property
def package(self):
if self._package is None:
self._package = self._wrt.get(self.PACKAGE)
return self._package
class BaseServiceSection:
def __ne... |
"""Define the File Type.
The primary purpose of the File object is to track the protocol to be used
to transfer the file as well as to give the appropriate filepath depending
on where (client-side, remote-side, intermediary-side) the File.filepath is
being called from.
"""
import os
import logging
from urllib.parse i... |
import pytest
from test.fixtures import make_test_env, make_fake_space, get_auth
from wsgi_intercept import httplib2_intercept
import wsgi_intercept
import httplib2
import simplejson
from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.web.util import encode_name
def setup_module(module):
make_test_env(m... |
# -*- coding: utf-8 -*-
#
# roasttron documentation build configuration file, created by
# sphinx-quickstart.
#
# 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
# autogenerated file.
#
# All configuration values have... |
#!/usr/bin/env python
from math import ceil
import os
import sys
import argparse
import multiprocessing
import subprocess as sp
import re
#from pprint import pprint
from array import array
from yaml import load, dump
contexts = ('CG','CHG','CHH')
def main():
fCheck = fileCheck() #class for checking parameters
pars... |
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.forms.formsets import formset_factory
from django.forms.models import BaseInlineFormSet
from django.forms.models import ModelFormMetaclass, _get_foreign_key
from django.utils.trans... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pip.req import parse_requirements
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_... |
#############################################################################
##
## Copyright (C) 2015 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance wit... |
# -*- coding: UTF-8 -*-
import sys
from vulkan import *
from PySide2 import (QtGui, QtCore)
validationLayers = [
'VK_LAYER_LUNARG_standard_validation'
]
deviceExtensions = [
VK_KHR_SWAPCHAIN_EXTENSION_NAME
]
enableValidationLayers = True
class InstanceProcAddr(object):
T = None
def __init__(self... |
'''
Created on Feb 21, 2012
@author: Moises Osorio [WCoder]
'''
from MOSolution import MOSolution
from Metrics import Metrics
from MetricsCalc import MetricsCalc
from ResultPlotter import ResultPlotter
import Utils
import dircache
import os
import types
import sys
class Analyzer:
__PARETO__ = "pareto"
__... |
# !/usr/bin/env python
# Basic text processing script in python
# Copyright (C) <2014> <J. Arianna Morgan>
#
# 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, o... |
# testing/engines.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+psycopg2cffi
:name: psycopg2cffi
:dbapi: psyco... |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io/
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... |
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.1.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import integer
class ... |
import datetime
from pprint import pprint
from django.contrib.auth.models import User
from django.db import models
from produto.models import ProdutoItem
class EstoquePermissions(models.Model):
class Meta:
verbose_name = 'Permissões de estoque'
managed = False
permissions = (
... |
# DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2010 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more information about this... |
#
# Copyright 2008 The ndb Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
# Copyright 2012 Rackspace Hosting, 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 ... |
# Copyright 2015-2017 Cisco Systems, 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 req... |
import uuid
from django.db.models import Q
from food.models import Category, Item, WeeklyClosure, OneTimeClosure
def get_closures(current_date):
weekly_closures = set(
vals['location_id'] for vals in WeeklyClosure.objects.filter(
weekday=current_date.weekday())
.values('location_id'))
... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
import json
from typing import Union, Any
registry = {}
default_encoding_name = None
def register_encoding(name, *, default=False):
def decorator(cls):
global default_encoding_name
registry[name] = cls
if default:
default_encoding_name = name
return cls
return dec... |
from __future__ import unicode_literals
import datetime
import pickle
import unittest
from django.db import models
from django.test import TestCase
from django.utils import six
from django.utils.version import get_version
from .models import Container, Event, Group, Happening, M2MModel
class Pickleab... |
# Copyright (C) 2014 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 ... |
import json
import re
import ssl
import time
import traceback
import vt100
auth_re = re.compile(b'^hello ([^ ]+) ([^ ]+)$')
extra_data_re = re.compile(b'\033\]499;([^\007]*)\007')
clear_patterns = [
b"\033[H\033[J",
b"\033[H\033[2J",
b"\033[2J\033[H",
# this one is from tmux - can't possibly imagine ... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python
import csv
import json
import requests
import numpy as np
import sqlite3
csv_filename = "testdata/vic_usgs/south_west_stations.csv"
db_filename = "testdata/vic_usgs/south_west_stations.db"
# open database
conn = sqlite3.connect(db_filename)
c = conn.cursor()
# Create stations table
c.execute('... |
#!/usr/bin/python
#
# 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) any later version.
#
# Ansible is distribut... |
# -*- coding: utf-8 -*-
#
# goo-server api documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 19 10:15:12 2012.
#
# 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
# autogenerated file.
... |
# -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
"""
import sys
import qt.QtCore as qc
import qt.QtGui as qg
import popupcad
from popupcad.filetypes.operation2 import Operation2
from popupcad.widgets.dragndroptree import Draggable... |
XXXXXXXXX XXXXX
XXXX
XXXXXXXXX XXX XXXXXXXXXX XXXXXXXX X XXXXXXXXX XXXXXXXX XXX XXXXXX XXXXXXXXX
XXX XXXXXXXXXX XXX XXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXXXXXXX XXXXX XXXXXXX XXXXXXXX XXXXXXXXXXXXXX
XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXXX XX... |
from __future__ import absolute_import, print_function
import copy
def get(x, *ks):
ks = _ks(ks)
x = x[ks[0]]
for k in ks[1:]:
x = x[k]
return x
def put(x, v, *ks):
ks = _ks(ks)
val = {ks[-1]: v}
for k in reversed(ks[:-1]):
val = {k: val}
return merge(x, val)
def me... |
# -*- 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 model 'TimeEntry'
db.create_table('helpdesk_timeentry', (
('id', self.gf('django.db.mod... |
import animation, colorsys
def colorunpack(color):
color = int(color)
return ((color >> 16) / 255,
((color >> 8) & 255) / 0xff,
(color & 0xff) / 0xff)
def colorpack(color):
return sum(int(color[i] * 0xff) << (16 - 8*i) for i in range(3))
class FadeAnimation(animation.Animation):
... |
# Stopwatch: The Game
# Rohan Roy - 29th Oct 2013
# http://www.codeskulptor.org/#user23_3ZEr6XFSuHrqRSj.py
import simplegui
# define global variables
interval = 100
tens_sec = 0
message = "0:00.0"
score = 0
Is_timer = False
attempt = 0
# define helper function format that converts integer in A:BC.D f... |
""" Run
"""
import sys
import time
import logging
log = logging.getLogger(__file__)
from ott.utils import otp_utils
from ott.utils import web_utils
from ott.utils.cache_base import CacheBase
class Run(CacheBase):
""" run OTP graph
"""
graphs = None
def __init__(self):
super(Run, self).__init... |
import unittest
from oldman.model.attribute import Entry
class AttributeEntryTest(unittest.TestCase):
def test_1(self):
entry = Entry()
value1 = 1
self.assertNotEquals(entry.current_value, value1)
entry.current_value = value1
self.assertEquals(entry.current_value, value1)... |
import re
from topics import all_topics, SubCommand
class TopicSubcmd(SubCommand):
COMMAND = 'topic'
help_summary = 'Print the topic summaries'
help_usage = '''\
%prog <topic> ...
Display all registered topics of the program for debugging purpose.
Topic contains the classes that can be imported from "... |
#!/usr/bin/env python
from __future__ import print_function
from blackjack import BlackJack
def play_blackjack(player):
game = BlackJack()
while True:
print('Your Hand %s is of value %d' % (game.player_hand, game.player_hand_value()))
action = raw_input('Enter: hit (1), stand (2) or split (3) ... |
# Adapted from code & formulas by David Z. Creemer and others
# http://www.zachary.com/blog/2005/01/12/python_zipcode_geo-programming
# http://williams.best.vwh.net/avform.htm
#
# Additions by Jeff Clement
from math import sin,cos,atan,acos,asin,atan2,sqrt,pi, modf, radians,degrees
# At the equator / on another great... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-05 23:20
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('users', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Meneame topic
Usage:
topic.py [--window Number] [--topic Number] [--dbname DB]
Options:
-h, --help show this screen.
--version show version.
--window Number size of the time slice
--topic Number number of topics for the analysis
... |
"""
Copyright (C) 2017 Shane Steinert-Threlkeld
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... |
import bson
from datetime import datetime as dt, timedelta
from mock import patch
import numpy as np
import re
from arctic.arctic import Arctic
def test_save_read_bson(library):
blob = {'foo': dt(2015, 1, 1), 'bar': ['a', 'b', ['x', 'y', 'z']]}
library.write('BLOB', blob)
saved_blob = library.read('BLOB'... |
#!/usr/bin/env python
#
# $LicenseInfo:firstyear=2007&license=mit$
#
# Copyright (c) 2007-2010, Linden Research, 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,... |
# The Hazard Library
# Copyright (C) 2012-2017 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.