src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
"""Differential Class which takes the difference between two spectra."""
from typing import Any, Dict, Optional
from spectrum_overload.spectrum import Spectrum
# TODO: Add in s-profile from
# Ferluga 1997: Separating the spectra of binary stars-I. A simple method: Secondary reconstruction
c... |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Guenther Wenninger <robin@bitschubbser.org>
##
## 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 ... |
from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
from wserve.settings import VENT_WD, VENT_WWW_CLIENT_EP
import cPickle as pickle
import json, time, os
def address2key(address):
r = 0
for s in address[0].split('.'):
r = r << 8
... |
import calendar
import glob
import os
import datetime
# from pgeo.config.settings import settings, read_template
from pgeo.metadata.metadata import Metadata
from pgeo.manager.manager import Manager
from pgeo.utils.log import logger
# from pgeo.metadata.metadata import merge_layer_metadata
# from data_processing.process... |
__author__ = 'Mehmet Mert Yildiran, mert.yildiran@bil.omu.edu.tr'
import rethinkdb as r # Rethinkdb Python driver
# Memory class
class Memory(object):
def __init__(self, starting_time, ending_time, data): # Initialize the object
self.starting_time = starting_time # Starting time attribute
self.ending_time = endi... |
#!/usr/bin/env python
"""
Copyright 2015 Ifwe 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... |
# ===============================================================================
# Copyright 2016 ross
#
# 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... |
# import drawing lib
import pygame
# pygame constants as events' constants
from pygame.locals import *
# game constants
from constants import *
from buttonwimage import ButtonWImage
import glob
import os
import textentry
from button import Button
import shutil
class Personnalize:
def __init__(self,... |
# -*- coding: utf-8 -*-
###############################################################################
#
# DeleteHeartRateLog
# Deletes user's heart rate log entry with the given id.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... |
#! /usr/bin/env python3
"""
prototype::
date = 2017-07-31
This module contains a class ``WalkInAST`` to be subclassed so as to walk in
the intermediate AST view made by the class ``parse.ast.AST``, and also to act
regarding the context or the data met during the walk.
info::
The class ``WalkInAST`` do some... |
from ftplib import FTP
import datetime
import os
import webbrowser
conf = {
"source": {
"type": "FTP",
"ftp": {
"base_url": "arthurhou.pps.eosdis.nasa.gov",
"data_dir": "/pub/trmmdata/GIS/"
}
}
}
def list_years(username, password):
"""
List all the ava... |
#!/usr/bin/env python
# Copyright (c) 2007-2008 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
r"""A fast and complete Python implementation of Markdown.
[from http://daringfireball.net/projects/markdown/]
> Markdown is a text-to-HTML filter; it translates an easy-to-read... |
import datetime
from django.db.models import Q
from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
f... |
import socket
from oslo_config import cfg
from oslo_utils import netutils
CONF = cfg.CONF
netconf_opts = [
cfg.StrOpt('my_ip',
default=netutils.get_my_ipv4(),
help='IP address of this host'),
cfg.StrOpt('my_block_storage_ip',
default='$my_ip',
hel... |
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime, timedelta
from django.conf import settings
from django.forms import ValidationError
from django.test.utils import override_settings
from django.utils import translation
import mock
import responses
from rest_framework.response import Respon... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in com... |
#!/usr/bin/env python
import setuptools
from distutils.core import setup, Extension
setup(name='rdpy',
version='1.3.2',
description='Remote Desktop Protocol in Python',
long_description="""
RDPY is a pure Python implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (Client and Server side). RDPY ... |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Pedro Navarro Perez
# Copyright 2013 Cloudbase Solutions Srl
# 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 th... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... |
#
# test script for Datawrapper API
#
import requests
import os
import json
from random import randint
import yaml
config = yaml.load(open('../config.yaml').read())
domain = 'http://' + config['domain']
if 'DATAWRAPPER_DOMAIN' in os.environ:
domain = os.environ['DATAWRAPPER_DOMAIN']
endpoint = domain + '/api/... |
"""
This is the default template for our main set of AWS servers.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# Pylint gets confused by path.py instances, which report themselves... |
"""
hellofriend.py
Author: Ryan Kynor
Credit:
http://stackoverflow.com/questions/19664840/typeerror-cant-convert-float-object-to-str-implicitly
Milo
Assignment:
Write and submit an interactive Python program that asks for the user's name and age,
then prints how much older Python is than the user (based on a simple ... |
import re
swap_positions_regex = r'swap position (\d+) with position (\d+)'
swap_letters_regex = r'swap letter (.) with letter (.)'
rotate_regex = r'rotate (left|right) (\d+)'
rotate_on_letter_position_regex = r'rotate based on position of letter (.)'
reverse_slice_regex = r'reverse positions (\d+) through (\d+)'
move... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main_TEM.ui'
#
# Created: Sun Apr 06 23:25:46 2014
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... |
# -*- encoding: utf-8 -*-
import random
import numpy as np
from numba import jit
from array import array
from timeit import Timer
try:
# python 2
from itertools import izip
except ImportError as err:
# python 3
izip = zip
from .posting_lists_cython import intersect_2cython
from .posting_lists_cython... |
# xml.etree test for cElementTree
import io
import struct
from test import support
from test.support import import_fresh_module
import types
import unittest
cET = import_fresh_module('xml.etree.ElementTree',
fresh=['_elementtree'])
cET_alias = import_fresh_module('xml.etree.cElementTree',
... |
# coding=utf-8
"""
This module represents OctoPrint's settings management. Within this module the default settings for the core
application are defined and the instance of the :class:`Settings` is held, which offers getter and setter
methods for the raw configuration values as well as various convenience methods to acc... |
# Vigenere Cipher Dictionary Hacker
# http://inventwithpython.com/hacking (BSD Licensed)
import detectEnglish, vigenereCipher, pyperclip
def main():
ciphertext = """Tzx isnz eccjxkg nfq lol mys bbqq I lxcz."""
hackedMessage = hackVigenere(ciphertext)
if hackedMessage != None:
print('Copying hacke... |
"""Object Utilities."""
class cached_property:
"""Cached property descriptor.
Caches the return value of the get method on first call.
Examples:
.. code-block:: python
@cached_property
def connection(self):
return Connection()
@connection.set... |
import time
import pytest
import mock
import gevent
from Connection import ConnectionServer
from Config import config
from File import FileRequest
from File import FileServer
from Site import Site
import Spy
@pytest.mark.usefixtures("resetTempSettings")
@pytest.mark.usefixtures("resetSettings")
class TestSiteDownlo... |
#!/usr/bin/python
# Copyright (C) 2011 Tianyang Li
#
# 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 pro... |
import numpy as np
import sys
import subprocess
import os
'''
def makephotfiles(base, nstart, nruns, nimages):
for i in range(nstart,nstart+nruns):
for j in range(1, nimages+1):
subprocess.call("ln -s "+base+"."+np.str(j)+".res.fits " + base+"_"+np.str(i)+"."+np.str(j)+".res.fits", shell=True)
subprocess.c... |
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
import uuid
class GUID(TypeDecorator):
"""Platform-independent GUID type.
Uses PostgreSQL's UUID type, otherwise uses
CHAR(32), storing as stringified hex values.
"""
impl = CHAR
def load_dialect... |
# -*- coding: utf-8 -*-
import os
from cleo import Command, InputOption, ListInput
from orator import DatabaseManager
class BaseCommand(Command):
def __init__(self, resolver=None):
self._resolver = resolver
super(BaseCommand, self).__init__()
def configure(self):
if not self._resol... |
#!/usr/bin/python
########################################################################
# 12 Jan 2015
# Patrick Lombard, Centre for Stem Stem Research
# Core Bioinformatics Group
# University of Cambridge
# All right reserved.
########################################################################
import subproce... |
from ..apibits import *
from ..resources import *
class WireEndpoint(APIEndpoint):
def all_incoming(self, params={}, headers={}):
method = APIMethod("post", "/wirein/show", params, headers, self)
json = self.client.execute(method)
return APIList(Wire, json['wires'], method, self.client... |
"""Test cases for the project."""
import sys
import unittest
# Import modules from sample
sys.path.insert(0, 'sample')
import core
import helpers
# Set up the data that we are using in tests.
data = helpers.open_json_as_dict('jsons/bigsample.json')
class BasicTest(unittest.TestCase):
"""Basic Test functionality... |
"""Test class for helper methods found simon"""
from os.path import abspath, dirname
import numpy as np
from unittest.mock import patch
from pyquil import Program
from grove.simon.simon import Simon, create_1to1_bitmap, create_valid_2to1_bitmap
package_path = abspath(dirname(dirname(__file__)))
EXPECTED_SIMON_ORAC... |
import numpy as np
from gbm.models.core import Parameter, Line, GraphBasedModel
class DemandCurve(GraphBasedModel):
def __init__(self):
super(DemandCurve, self).__init__(name='Demand Curve',
ylabel='price ($)',
xlabel='amount produced... |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url (
regex = '^email/$',
view = 'signup.views.signup_email',
name = 'signup_email'
),
url (
regex = '^logout/$',
view = 'signup.views.signup_logout',
name = 'signup_logout'
)... |
from rrpam_wds.gui import set_pyqt_api # isort:skip # NOQA
import sys
import time
from PyQt5.QtWidgets import QApplication
from rrpam_wds.gui.dialogs import LogDialog
from rrpam_wds.gui.dialogs import MainWindow
from rrpam_wds.tests.test_utils import Test_Parent
from rrpam_wds.tests.test_utils import main
class TC... |
#===============================================================================
# @Author: Madison Aster
# @ModuleDescription:
# @License:
# MediaApp Library - Python Package framework for developing robust Media
# Applications with Qt Library
# Copyright (C) 2013 Madison Aster
# ... |
#!/usr/bin/env python
"""
This code is copyrighted work by Paul Williams.
Distributed under the BSD-3-Clause license available:
https://opensource.org/licenses/BSD-3-Clause
"""
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from random import randint
class WaterMarkerTypeError(TypeEr... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description:
Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with another character while preserving the order of chara... |
#!/usr/bin/env python3
# For more information about this program, see https://github.com/willemw12/mythcli
import argparse
import os
import sys
from mythcli.services.dvr.controllers import conflicting, expiring, recorded, upcoming
def main():
""" For all datetime format codes, see http://docs.python.org/library... |
#!/usr/bin/env python
import argparse
from constants import *
import json
import pdb
from pykafka import KafkaClient
from pykafka.exceptions import OffsetOutOfRangeError, RequestTimedOut
from pykafka.partitioners import HashingPartitioner
import sys
from tc.schema.serialization import Utils
from tc.schema.serializatio... |
import socket # For starting TCP connection
import subprocess # To start the shell in the system
# Attacker IP goes here
ATT_IP = "10.254.141.59"
def connect():
# Creating object soketi
soketi = socket.socket(socket.AF_INE... |
"""Remove Field from Form 85
Revision ID: 185a7d89aa72
Revises: 2eaeb4b0c43f
Create Date: 2018-04-17 14:28:35.098385
"""
import json
from alembic import op
from sqlalchemy import String, Integer, Text
from sqlalchemy.sql import table, column, text
# revision identifiers, used by Alembic.
revision = '185a7d89aa72'
d... |
from __future__ import absolute_import
from django.test import RequestFactory
from exam import fixture
from mock import patch
from sentry.middleware.health import HealthCheck
from sentry.status_checks import Problem
from sentry.testutils import TestCase
from sentry.utils import json
class HealthCheckTest(TestCase):... |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from Dialog import Dialog
class InputDialog(Dialog):
"""
O... |
# -*- coding: utf-8 -*-
# Cluster and compare incidence of activation and inhibition across species
import settings as S
import pandas as pd
import os
import numpy as np
import pdb
import scipy.stats as st
import matplotlib.pyplot as plt
import seaborn as sns
plt.ion()
plt.close('all')
# Minimum number of interactio... |
from django import db
from django.conf import settings
from django.core.management.base import NoArgsCommand
from data.models import ShelterPopulation
import csv
# National Priorities Project Data Repository
# import_new_aids_cases.py
# Updated 6/25/2010, Joshua Ruihley, Sunlight Foundation
# Imports Census Shelter P... |
import csv
import datetime
import json
import sys
from collections import OrderedDict
from decimal import Decimal
import pip
import pytest
from gwaith.processors import raw, raw_python, to_csv, to_json
currency = 'GBP'
# makes testing hardcoded output predictable, easier
rates = OrderedDict([
('2015-10-06T14:15:... |
# -*- coding: utf-8 -*-
#
# Kata documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 15 10:01:47 2014.
#
# 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 ... |
# Flask modules
from flask import (
Blueprint,
render_template,
redirect,
url_for,
request,
flash,
g
)
# FLask Login
from flask_login import (
login_user,
logout_user,
current_user
)
# WTForms
from flask_wtf import Form, RecaptchaField
from wtforms import StringField, SubmitFiel... |
import quickcheck as qc
import unittest
class LeafSpec(qc.ArbitrarySpec):
def __init__(self, simple_only=False):
self.simple_only = simple_only
def arbitrary(self):
specs = [float, int, bool, str, bytes]
if not self.simple_only:
specs.append(qc.arbitrary(qc.Float))
... |
# coding=utf-8
"""
Implementing ETSI CoAP CoRE Tests
"""
import logging
import unittest
from pycolo.codes import codes, msgType, options
from pycolo.codes import mediaCodes
from pycolo.endpoint import Endpoint
from pycolo.message import Response
from pycolo.request import request as coap
from pycolo.resource import ... |
"""Subclass specific to Cisco Viptela."""
from typing import Union, Sequence, TextIO, Any
import re
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoViptelaSSH(CiscoSSHConnection):
"""Subclass specific to Cisco Viptela."""
def session_preparation(self) -> None:
"""Prepare the ... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import os
from test_framework.te... |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import input
from builtins import range
from past.utils import old_div
import sys
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmag as pmag
import pmagpy.pmagpl... |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... |
import urllib2
from bs4 import BeautifulSoup
import json
episode_page = 'https://www.thisamericanlife.org/radio-archives/episode/%i'
DOWNLOAD_URL = 'http://audio.thisamericanlife.org/jomamashouse/ismymamashouse/%i.mp3'
import re
def get_episode_info(episode_id):
req = urllib2.Request(episode_page % episode_id, he... |
# Copyright 2015 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Or... |
# Generated by Django 2.0.2 on 2018-02-17 04:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Accomplishment',
fields=[
... |
# Copyright 2021 The FedLearner 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 applica... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import sqlalchemy.exc
from hyputils.memex import models
from hyputils.memex._compat import PY2
class TestUserIdentity(object):
def test_you_can_save_and_then_retrieve_field_values(
self, db_session, matchers, user
):
... |
# -*- coding: utf-8 -*-
"""
* Purpose : Test der Dokument- und Projektverwaltung (app/view/documents.py)
* Creation Date : 20-11-2014
* Last Modified : Mi 26 Nov 2014 14:58:13 CET
* Author : mattis
* Coauthors : christian
* Sprintnumber : 2
* Backlog entry : -
"""
from app.common.constants import ERROR_MESSAG... |
#!/bin/env python
# encoding:utf-8
#
#
#
__Author__ = "CORDEA"
__date__ = "2014-09-01"
from collections import Counter
infile = open("23andme_minmax.50.csv", "r")
idList = [r.split(",")[0].rstrip("\r\n") for r in infile.readlines()]
infile.close()
infile = open("23andme_extract_data.csv", "r")
lines = infile.rea... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import mwparserfromhell as mwp
from deltas.tokenizers import wikitext_split
from . import revision
from .datasource import Datasource
metadata = Datasource("parent_revision.metadata")
"""
Returns a :class:`~revscoring.datasources.types.RevisionMetadata` for the
parent revision.
"""
text = Datasource("parent_revision... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-13 09:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('people', '0005_auto_20160913_0556'),
]
operations = ... |
#!/usr/bin/env python3
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# LightDM GTK Greeter Settings
# Copyright (C) 2014 Andrew P. <pan.pav.7c5@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License ... |
import threading, time, traceback
from bluepy import btle
from tag import Tag
from messages import DiscoverTagMessage, GWStartupMessage, GWShutdownMessage
from utils import ANSI_RED, ANSI_OFF
class TagScanner:
def __init__(self):
#btle.Debugging = True
self.timeout = 4
self.hci = 0
... |
# Copyright (c) 2010 Howard Hughes Medical Institute.
# All rights reserved.
# Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms.
# http://license.janelia.org/license/jfrc_copyright_1_1.html
from library_item import LibraryItem
from library_frame import LibraryFrame
from pydispatc... |
from flask import Flask
from antminermonitor.blueprints.asicminer import antminer, antminer_json
from antminermonitor.blueprints.user import user
from antminermonitor.extensions import login_manager, migrate
from antminermonitor.blueprints.asicminer.models.miner import Miner
from antminermonitor.blueprints.asicminer.m... |
""" Simple Hypixel-API in Python, by Snuggle | 2017-09-30 to 2018-06-14 """
__version__ = '0.8.0'
# pylint: disable=C0103
# TODO: Add more comments. Explain what's happening!
# TODO: Add API-usage stat-tracking. Like a counter of the number of requests and how many per minute etc.
from random import choice
from time i... |
# 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 ... |
# -*- coding: utf-8 -*-
import pytest
from eth_abi import (
decode_single,
)
from eth_utils import (
is_checksum_address,
is_bytes,
is_string,
is_boolean,
is_dict,
is_integer,
is_list_like,
is_same_address,
)
from web3.exceptions import (
InvalidAddress,
)
from web3.utils.da... |
import datetime
import re
import simplejson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import signals
from oembed.constants import DEFAULT_OEMBED_TTL, MIN_OEMBED_TTL, RESOURCE_TYPES
from oembed.exceptions import AlreadyRegistered, NotRegistered, O... |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2013-2016 The Regents of the University of California,
# Antonino Ingargiola <tritemio@gmail.com>
#
"""
This module contains all the main FRETBursts analysis functions.
`burstslib.py` defines the fundamental object `Data()`... |
from topics import key_compare, SubCommand
class HelpSubcmd(SubCommand):
COMMAND = 'help'
help_summary = 'Print the command summaries'
help_usage = '''\
%prog <subcmd> ...
Display the detailed usage of the sub-command or the list of all supported
sub-commands.
Environment variables KREP_EXTRA_PATH and ... |
"""
End-to-end tests for Student's Profile Page.
"""
from datetime import datetime
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.common.logout import LogoutPage
from common.test.acceptance.pages.lms.learner_profile import LearnerProfilePage
from common.test.... |
#!/usr/bin/env python
# coding: utf-8
# Minimal Contact Binary System
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update ... |
# Copyright 2017 Cloudbase Solutions Srl
# 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 r... |
# 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 ... |
from collections import OrderedDict
import os
from multiprocessing import Process, Queue, JoinableQueue, cpu_count
import math
import MySQLdb
from MySQLdb.cursors import SSDictCursor
from scur_mgr import DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_TABLE_RELATIONSHIPS
__DIR__ = os.path.dirname(os.path.abspath(__file__))
i... |
# 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 u... |
#!/usr/bin/env python
"""
This file is part of Extensible eBook Converter (EeCon),
an advanced ebook analysis and conversion tool.
Copyright (C) 2012 Espen Hovind <espehov@ifi.uio.no>
EeCon is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the ... |
# -*- coding: UTF-8 -*-
# Copyright 2012-2016 Luc Saffre
#
# License: BSD (see file COPYING for details)
"""
Defines models for :mod:`lino_xl.lib.postings`.
"""
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from lino.core import actions
from lino.... |
import pyforms
from pyforms import BaseWidget
from PyQt4 import QtGui, QtCore
from pyforms.Controls import ControlText
from pyforms.Controls import ControlButton
from pyforms.Controls import ControlTree
class ProjectTree(BaseWidget):
def __init__(self):
super(ProjectTree, self).__init__('Project')
self._add... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
#
# 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... |
import urllib
def get_page(url):
try:
return urllib.urlopen(url).read()
except:
return ""
def get_next_target(page):
start_link = page.find('<a href=')
if start_link == -1:
return None, 0
start_quote = page.find('"', start_link)
end_quote = page.find('"', start_qu... |
from setuptools import setup
from os.path import abspath, dirname, join
here = dirname(abspath(__file__))
# Get version
exec(compile(open(join(here, 'src', 'MQTTLibrary', 'version.py'), "rb").read(), join(here, 'src', 'MQTTLibrary', 'version.py'), 'exec'))
# Get the long description
with open(join(here, 'README.rs... |
from Dee import Relation, Key, Tuple, QUOTA, MAX, MIN, IS_EMPTY, COUNT, GENERATE
from DeeDatabase import Database
class darwen_Database(Database):
def __init__(self, name):
"""Define initial relvars and their initial values here
(Called once on database creation)"""
Database.__ini... |
import sys
from ..application.handlers.code_runner import CodeRunner
from ..application.handlers.handler import Handler
from ..io import set_curdoc, curdoc
class ExampleHandler(Handler):
""" A stripped-down handler similar to CodeHandler but that does
some appropriate monkeypatching to
"""
_output_f... |
from CommonClasses import *
from solution import Solution
class TestSuite:
def run(self):
self.test000()
self.test001()
self.test002()
self.test003()
# self.test004()
def test000(self):
print 'test 000\n'
board ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.