src stringlengths 721 1.04M |
|---|
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
# THIS THREADING MODULE IS PERMEATED BY THE pl... |
import traceback
TRACE_STACK = []
class Trace(object):
def __init__(self, exception, stack=None):
if not isinstance(exception, Exception):
raise ValueError("Expected an Exception object as first argument")
if not stack:
stack = traceback.extract_stack()
# pop off current frame and initia... |
#
# 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
# ... |
#!/usr/bin/python
# after runing this file you MUST modify nsIdentityinfo.cpp to change the
# fingerprint of the evroot
import tempfile, os, sys
import random
import pexpect
import subprocess
import shutil
libpath = os.path.abspath('../psm_common_py')
sys.path.append(libpath)
import CertUtils
dest_dir = os.getcwd(... |
# Challenges:
# Returns the name of a challenge given a number. The number of epochs is predefined
class Challenges:
def __init__(self):
self.challenge_en10k_filename = {
# all challenges
1: '{}tasks_1-20_v1-2/en-10k/qa1_single-supporting-fact_{}.txt',
2: '{}tasks_1-20_... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_fiscal_icfefetuarpagamentoformatado.ui'
#
# Created: Mon Nov 24 22:25:42 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
from pydaruma.py... |
import pytest
import json
from wheelcms_axle.configuration import ConfigurationHandler
from wheelcms_users.models import ConfigurationHandler as UserConfigurationHandler
from django.contrib.auth.models import User
import mock
from twotest.fixtures import client, django_client
@pytest.fixture
def handler():
pat... |
from django.test import TestCase
from corehq.apps.domain.models import Domain
from corehq.apps.locations.models import LocationType, Location
from corehq.apps.products.models import Product
from corehq.apps.users.models import CommCareUser
from custom.ewsghana.models import FacilityInCharge
class TestDeleteDomain(Tes... |
# Sphinx extension to integrate defines into the Sphinx Build
#
# Runs after the IDF dummy project has been built
#
# Then emits the new 'idf-defines-generated' event which has a dictionary of raw text define values
# that other extensions can use to generate relevant data.
import glob
import os
import pprint
import r... |
# This file is part of pyGenClean.
#
# pyGenClean 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.
#
# pyGenClean is distributed in the... |
from Products.CMFCore.utils import getToolByName
from bika.lims.interfaces import ISample
from bika.lims.utils import tmpID
from bika.lims.utils.sample import create_sample
from bika.lims.utils.samplepartition import create_samplepartition
from bika.lims.workflow import doActionFor
from Products.CMFPlone.utils import _... |
"""@file pit_noise_loss.py
contains the PITNoiseLoss"""
import loss_computer
from nabu.neuralnetworks.components import ops
class PITNoiseLoss(loss_computer.LossComputer):
"""A loss computer that calculates the loss"""
def __call__(self, targets, logits, seq_length):
"""
Compute the loss
Creates the operat... |
import json
from os.path import dirname, abspath
from django import template
from django.conf import settings
from django.template import Template, Context
from django.template.engine import Engine
from django.core.wsgi import get_wsgi_application
from ak_vendor.report import Report
settings.configure()
application = ... |
#!/usr/bin/env python3
import logging
import types
from collections import defaultdict
import os
import sys
import ipaddress
import itertools
import glob
import yaml
from typing import Dict, Tuple
try:
from yaml import CSafeLoader as SafeLoader # type: ignore
except ImportError:
from yaml import SafeLoader # t... |
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic.detail import DetailView
from django.urls import reverse_lazy
from django.contrib.auth import authenticate, login
from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
from users.models import User
from ... |
# -*- coding: utf-8 -*-
"""
Messaging Module - Controllers
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
... |
from BaseHTTPServer import BaseHTTPRequestHandler
# import re
from parse import httpParse
class HttpHandler(BaseHTTPRequestHandler):
def do_GET(self):
h = httpParse(self.headers)
#TODO: check only if mobile, otherwise assume desktop
#TODO: create dictionary, with key stating if client is desktop or not -> isMo... |
from edgy.xml.element import _namespace_map
def lookupPrefix(uri):
return _namespace_map.get(uri, None)
def findtext(n, qname, default=None):
for c in n.getchildren():
#print repr(c), qname
if c.tag == str(qname):
return c.text
return default
def find(n, qname, default=None)... |
import os
import re
from setuptools import find_packages, setup
def get_long_description():
for filename in ('README.rst',):
with open(filename, 'r') as f:
yield f.read()
def get_version(package):
with open(os.path.join(package, '__init__.py')) as f:
pattern = r'^__version__ = [... |
from __future__ import absolute_import
from __future__ import print_function
import argparse
import sys
import nss.nss as nss
import nss.error as nss_error
'''
This example illustrates how one can use NSS to verify (validate) a
certificate. Certificate validation starts with an intended usage for
the certificate and... |
from __future__ import absolute_import, print_function
from os.path import abspath, sep
import unittest
from bokeh.application.handlers import CodeHandler
from bokeh.document import Document
script_adds_two_roots = """
from bokeh.io import curdoc
from bokeh.model import Model
from bokeh.core.properties import Int, I... |
import sqlalchemy as sa
import toolz
import ibis
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.expr.types as ir
from ibis.backends.base.sql.alchemy import (
fixed_arity,
sqlalchemy_operation_registry,
sqlalchemy_window_functions_registr... |
import sys
import os
import shutil
from PIL import Image
def generate_1d_box_limits(dim, num_divs):
'''
Generates the limits of a crop box in a single dimension
Example, if dim is 512 pixels and num_divs is 5, it should return:
[(0, 103), (103, 206), (206, 308), (308, 410), (410, 512)]
'''
ass... |
# This file is part of PyImgur.
# PyImgur 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.
# PyImgur is distributed in the hope that i... |
import logging
import os
import platform
import subprocess
import sys
import warnings
from unittest import skipIf
from pytest import raises, mark
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial import unittest
import scrapy
from scrapy.crawler import Crawler, CrawlerRunner, C... |
# -*- python -*-
#
# OpenAlea.Core
#
# Copyright 2006-2009 INRIA - CIRAD - INRA
#
# File author(s): Fred Boudon <fred.boudon@cirad.fr>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.info/licences/Licence_CeCILL-C_V1-... |
from cis.plotting.generic_plot import Generic_Plot
class Line_Plot(Generic_Plot):
line_styles = ["solid", "dashed", "dashdot", "dotted"]
def plot(self):
"""
Plots one or many line graphs
"""
from cis.exceptions import InvalidDimensionError
self.mplkwargs["linewidth"] =... |
import urllib
import tarfile
import optparse
import os
from django.conf import settings
from django.core import management
from django.core.management import base as management_base
# TODO: Change all prints to self.stdout.write for Django 1.3
class Command(management_base.NoArgsCommand):
"""
This class defines ... |
"""
A python program to retreive recrods from ArXiv.org in given
categories and specific date range.
Author: Mahdi Sadjadi (sadjadi.seyedmahdi[AT]gmail[DOT]com).
"""
from __future__ import print_function
import xml.etree.ElementTree as ET
import datetime
import time
import sys
PYTHON3 = sys.version_info[0] == 3
if PYT... |
# -*- 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... |
'''
Created on Mar 19, 2014
@author: Dario Bonino <dario.bonino@gmail.com>
Copyright (c) 2014 Dario Bonino
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/LICE... |
# coding: u8
from tornado.util import ObjectDict
from sqlalchemy import create_engine
from sqlalchemy import (Column, Integer, Text, String, Boolean)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.attributes import InstrumentedAttribute
import sett... |
from newt.views import AuthJSONRestView
from common.response import json_response
from django.conf import settings
import json
from importlib import import_module
store_adapter = import_module(settings.NEWT_CONFIG['ADAPTERS']['STORES']['adapter'])
import logging
logger = logging.getLogger("newt." + __name__)
# /ap... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 21:31:53 2015
Create random synthetic velocity profile + linear first guesses
@author: alex
"""
import random
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def savitzky_golay(y, window_size, order, deriv=0, rate=1):
r... |
from invoke import task
# from ..config import ()
import os
import os.path as osp
from pathlib import Path
import shutil as sh
from warnings import warn
## Paths for the different things
DOCS_TEST_DIR = "tests/test_docs/_tangled_docs"
DOCS_EXAMPLES_DIR = "tests/test_docs/_examples"
DOCS_TUTORIALS_DIR = "tests/test_... |
import json
import logging
import ryutest
from webob import Response
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.app.wsgi import ControllerBase, WSGIApplication, route
from ryu.lib import dpid as dpid_lib
simple_switc... |
# 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 requ... |
from time import sleep
import time
import threading
class BoxFiller(threading.Thread):
def __init__(self,parent):
threading.Thread.__init__(self)
self.parent = parent
def run(self):
count = 0
for i in range(30):
sleep(.5)
count += 1
self.parent... |
""" Class defintion for simple hastad broadcast exploit """
from RSAExploits import util
from RSAExploits.exploits.exploit import Exploit
class Hastad(Exploit):
""" Class providing a run interface to hastad broadcast exploit"""
def run(self, rsadata_list, info_dict = None):
""" Attempts to recove... |
#
# 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 ... |
'''
@Summary: Handles all notifications for api, including alerts from metron.
@Author: devopsec
'''
#TODO: Ensure username and password needs hidden / parsed from encrypted file.
import base64
import os
import requests
import subprocess
import sys
import traceback
from flask import jsonify, request
from flask_mail ... |
# coding: utf-8
from __future__ import unicode_literals
from .oauth2 import OAuth2
class CooperativelyManagedOAuth2Mixin(OAuth2):
"""
Box SDK OAuth2 mixin.
Allows for sharing auth tokens between multiple clients.
"""
def __init__(self, retrieve_tokens=None, *args, **kwargs):
"""
:... |
__problem_title__ = "Coloured Configurations"
__problem_url___ = "https://projecteuler.net/problem=194"
__problem_description__ = "Consider graphs built with the units A: and B: , where the units are " \
"glued along the vertical edges as in the graph . A configuration of " \
... |
import os
import glob
import warnings
import yaml
from multiprocessing import Process
from time import strftime
from voluptuous.error import Invalid
from CPAC.utils.configuration import Configuration
from CPAC.utils.ga import track_run
from CPAC.longitudinal_pipeline.longitudinal_workflow import (
anat_longitudina... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import cm
from matplotlib.ticker import MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
class DLPlotter:
'''
This class is responsible for plotting decision landscapes. Matplotlib is used as a background.
'''
... |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from slideshow.lib.slide import Slide
from slideshow.settings import Settings
import slideshow.event as event
import cherrypy
def div_id(id):
if id >= 0:
return 'queue_%d' % id
elif id == -1:
return 'queue_int'
else:
raise ValueError, '... |
"""Generic plotting tests."""
from __future__ import annotations
import errno
import functools
import os
import sys
import tempfile
import typing
import pytest
from diofant import (And, I, Integral, LambertW, Piecewise, cos, exp_polar,
log, meijerg, oo, pi, plot, plot3d,
pl... |
# -*- coding: utf-8 -*-
#
# 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 Li... |
import pytest
from unittest import mock
import torch # noqa I201
from mlagents.torch_utils import set_torch_config, default_device
from mlagents.trainers.settings import TorchSettings
@pytest.mark.parametrize(
"device_str, expected_type, expected_index, expected_tensor_type",
[
("cpu", "cpu", None,... |
"""End-to-end example for SNN Toolbox.
This script sets up a small CNN using Keras and tensorflow, trains it for one
epoch on MNIST, stores model and dataset in a temporary folder on disk, creates
a configuration file for SNN toolbox, and finally calls the main function of
SNN toolbox to convert the trained ANN to an ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Processing.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
from build.management.commands.base_build import Command as BaseBuild
from django.conf import settings
from django.db import connection
from django.db.models import Count
from protein.models import Protein, ProteinConformation, ProteinAnomaly, ProteinState, ProteinSegment
from residue.models import Residue, ResidueGen... |
"""Test the Dyson sensor(s) component."""
import unittest
from unittest import mock
from libpurecool.dyson_pure_cool import DysonPureCool
from libpurecool.dyson_pure_cool_link import DysonPureCoolLink
from homeassistant.components import dyson as dyson_parent
from homeassistant.components.dyson import sensor as dyson... |
#!/usr/bin/python
#
# Negamax variant of minmax
#
# This program is for demonstration purposes, and contains ample
# opportunities for speed and efficiency improvements.
#
# Also, a minmax tree is not the best way to program a tic-tac-toe
# player.
#
# This software is hereby granted to the Public Domain
#
import sys,... |
"""
WSGI config for stockstore2 project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... |
"""
libpad is used to sandbox code using codepad.org.
"""
from ehp import *
import requests
def post(data, lang, opt=False):
"""
Used to post code onto codepad.org.
Example:
url, data = libpad.post('print "hi"', 'python', opt=True)
Would print the redirected url and the output "hi".
"""
... |
# Copyright (C) 2013 Synapse Wireless, Inc.
# Subject to your agreement of the disclaimer set forth below, permission is given by
# Synapse Wireless, Inc. ("Synapse") to you to freely modify, redistribute or include
# this SNAPpy code in any program. The purpose of this code is to help you understand
# and learn about ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
GAZE
Turnkey Open Media Center
__ .-.
.-"` .`'. /\\|
_(\-/)_" , . ,\ /\\\/ =o O=
{(=o^O=)} . ./, |/\\\/
`-.(Y).-` , | , |\.-`
/~/,_/~~~\,__.-` =O o=
////~ // ~... |
from datetime import datetime
from iso8601 import iso8601
from m2x import utils
class TestUtils(object):
def test_to_utc(self):
dtime = datetime.now()
utc_dtime = utils.to_utc(dtime)
assert utc_dtime.tzinfo == iso8601.UTC
def test_to_iso(self):
dtime = iso8601.parse_date('20... |
"""
Tests for the .functional.functions module.
"""
from collections import namedtuple
from contextlib import contextmanager
from taipan.testing import TestCase
import taipan.functional.functions as __unit__
# Constant functions
class _ConstantFunction(TestCase):
EMPTY_TUPLE = ()
EMPTY_LIST = []
DIFFE... |
# PYTHON_ARGCOMPLETE_OK
import argparse
import os
from subprocess import run
import logging
from itertools import combinations
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import use_solver
import tables
from pyne.utils import toggle_warnings
import warnings
toggle_warnings()
warni... |
from django.db import models
class Food(models.Model):
name = models.CharField(max_length=45)
protein = models.DecimalField(max_digits=4, decimal_places=2)
carbs = models.DecimalField(max_digits=4, decimal_places=2)
fat = models.DecimalField(max_digits=4, decimal_places=2)
price = models.DecimalFie... |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: vistrails@sci.utah.edu
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification,... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import defaultdict
from contextlib import contextmanager
import functools
import re
import funsor
import numpyro
from numpyro.contrib.funsor.enum_messenger import (
infer_config,
plate as enum_plate,
trace... |
import praw
import requests
import json
import time
import re
# Function iterates over each submission title and checks if the title contains route syntax that indicates the post is about a route
def parse_titles(bot, subreddit):
start_time = time.time()
for submission in subreddit.stream.submissions():
if (submi... |
import numpy as np
from threeML.utils.time_interval import TimeIntervalSet
from threeML.plugins.spectrum.binned_spectrum import BinnedSpectrum
class BinnedSpectrumSet(object):
def __init__(self, binned_spectrum_list, reference_time=0.0, time_intervals=None):
"""
a set of binned spectra with optio... |
# GUI Application automation and testing library
# Copyright (C) 2006-2017 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... |
#!/usr/bin/env python
# This script checks the standard SNMP location oid
# and saves it in a memcached database with hostname as key.
#
# FreeBSD requirements:
# Compile net-snmp with python bindings
# Install py-memcached
# Nagios exit codes:
# 0 OK
# 1 WARNING
# 2 CRITICAL
# 3 UNKNOWN
import netsnmp
import memcac... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from documents.models import DocumentType, Document
from documents.forms import DocumentRegistrationForm
from django_webtest import WebTest
class DocumentModelTest(TestCase):
def setUp(self):
self.dt = DocumentType.objects.crea... |
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
class PriceDisplayOptions(object):
"""
Price display options.
Parameters on... |
import os
import re
import cTPR
class Parser():
def __init__(self, fileName="tweet.txt"):
self.fileName = fileName
self.parsed_list = []
self.count_dic = {}
self.raw_list = []
def parse(self, tweet):
self.parsed_list = []
self.count_dic = {}
self.raw_list = []
filtered_tweet... |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
"""
SMB (Server Message Block), also known as CIFS.
"""
from scapy.packet import *
from scapy.fields import *
from scapy.laye... |
# coding=utf-8
from __future__ import unicode_literals
import pytest
from django.core import mail
from contacts.forms import UpdateContactForm
from .factories import UserFactory
def generate_form_with_data(formclass, instance):
form = formclass(instance=instance)
available_fields = form.changed_data
fo... |
import time
from .Block import Block
from .EntryBlock import EntryBlock
from .CommentBlock import CommentBlock
from ..ProtectFlags import ProtectFlags
from ..TimeStamp import *
from ..FSString import FSString
class FileHeaderBlock(EntryBlock):
def __init__(self, blkdev, blk_num, is_longname):
EntryBlock.__ini... |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from vispy.gloo import Texture2D, VertexBuffer
from vispy.visuals.shaders import Function, Varying
from vispy.visuals.filters import Filter
... |
# LINZ-2-OSM
# Copyright (C) Koordinates Ltd.
#
# 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 ... |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... |
from random import choice
from collections import OrderedDict
import pytest
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.containers.provider import ContainersProvider
pytestmark = [
pytest.mark.tier(2),
pytest.mark.usefixtures('setup_provider'),
pytest.mark.provider([Contain... |
""" Send report using Slack. """
from drupdates.settings import Settings
from drupdates.utils import Utils
from drupdates.constructors.reports import Report
import json, os
class Slack(Report):
""" Slack report plugin. """
def __init__(self):
current_dir = os.path.dirname(os.path.realpath(__file__))
... |
#! /bin/sh
"true" '''\'
if command -v python2 > /dev/null; then
exec python2 "$0" "$@"
else
exec python "$0" "$@"
fi
exit $?
'''
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2013 Simon Cadman
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... |
# Copyright 2015 Red Hat, Inc.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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/L... |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
class Event(models.Model):
'''
This model represents an one-time event
'''
title = models.CharField(max_length=255)
description = models.Tex... |
"""The main config file for Caravel
All configuration in this file can be overridden by providing a caravel_config
in your PYTHONPATH as there is a ``from caravel_config import *``
at the end of this file.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
... |
# -*- coding: utf-8 -*-
#
# Meta test family (MTF) is a tool to test components of a modular Fedora:
# https://docs.pagure.org/modularity/
# Copyright (C) 2017 Red Hat, 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
# ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Ivo Nunes/Vasco Nunes
# 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... |
from daversy.utils import *
from daversy.db.object import Index, IndexColumn
class IndexColumnBuilder(object):
""" Represents a builder for a column in an index. """
DbClass = IndexColumn
XmlTag = 'index-column'
Query = """
SELECT c.column_name, lower(c.descend) AS sort, i.index_name,
... |
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#
# fields.compressed - Some types and objects related to compressed fields. Use in place of IRField ( in FIELDS array to activate functionality )
#
# vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab ... |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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.
... |
import logging
from flumine import config
from flumine.utils import STRATEGY_NAME_HASH_LENGTH
from flumine.markets.middleware import Middleware
from flumine.order.trade import Trade
logger = logging.getLogger(__name__)
class OrdersMiddleware(Middleware):
"""
Middleware to add execution complete orders
to... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Created by Praetorian (ShadowNate) for Classic Adventures in Greek
# classic.adventures.in.greek@gmail.com
#
# DONE Add code and switch option: to get the blade runner installation directory as input, then find the TLK files and export them with proper naming
# DONE fix... |
# vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yaho... |
import sublime
import re
import os
ALIAS_SETTING = "alias"
DEFAULT_INITIAL_SETTING = "default_initial"
USE_CURSOR_TEXT_SETTING = "use_cursor_text"
SHOW_FILES_SETTING = "show_files"
SHOW_PATH_SETTING = "show_path"
DEFAULT_ROOT_SETTING = "default_root"
DEFAULT_PATH_SETTING = "default_path"
DEFAULT_FOLDER_INDEX_SETTING =... |
#!/usr/bin/env python
#
# Generated by generateDS.py.
#
import sys
from string import lower as str_lower
from xml.dom import minidom
import supers as supermod
#
# Globals
#
ExternalEncoding = 'utf-8'
#
# Data representation classes
#
class stageTypeSub(supermod.stageType):
def __init__(self, labelSuffix=Non... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# Copyright (c) James Percent, Byron Galbraith and Unlock contributors.
# 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 notic... |
from collections import OrderedDict
import pandas as pd
import pandas.util.testing as tm
import pytest
import ibis
import ibis.expr.datatypes as dt
@pytest.fixture(scope="module")
def value():
return OrderedDict([("fruit", "pear"), ("weight", 0)])
@pytest.fixture(scope="module")
def struct_client(value):
... |
import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random
import sim, main, sim_items
from util import *
class Potion(sim_items.Potion):
def __init__(self):
sim_items.Potion.__init__(self, "clumsiness", "!",
('go', 'have', 'less'),
... |
from setuptools import setup, find_packages
setup(
name='emencia-django-slideshows',
version=__import__('slideshows').__version__,
description=__import__('slideshows').__doc__,
long_description=open('README.rst').read(),
author='David Thenon',
author_email='dthenon@emencia.com',
url='http:/... |
# -*- coding: utf-8 -*-
"""
dropback.backup
~~~~~~~~~~~~~~
The main application; backs up directory to dropbox
Must be run as Python2, as Dropbox Library doesn't support Python3 yet
:author: Jonathan Love
:copyright: (c) 2015 by Doubledot Media Ltd.
:license: See README.md and LICENSE for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.