src stringlengths 721 1.04M |
|---|
"""
17 May 2013
Liftover (1) wrapper applied to the comparison of topologically associated
domains.
This script allows to compare Hi-C experiments (mainly align TAD boundaries)
done with different assemblies (e.g.: NCBI36 and GRCh37 for human genome), or
in different species.
INSTALL:
- liftover tool needs to b... |
# Copyright (c) 2016 OpenStack Foundation
#
# 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 ... |
# -*- coding: utf-8 -*-
#
# uds/views.py
#
# Copyright (C) 2011-19 Tomáš Pecina <tomas@pecina.cz>
#
# This file is part of legal.pecina.cz, a web-based toolbox for lawyers.
#
# This application is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published ... |
from distutils.core import setup
from py2exe.build_exe import py2exe
import os, os.path, shutil, sys
upxFlag = False
if '-upx' in sys.argv:
sys.argv.remove('-upx')
upxFlag = True
dir = 'distrib/windows'
print '[[ Freezing Reggie! ]]'
print '>> Destination directory: %s' % dir
sys.argv.append('py... |
'''
Created on 30/01/2014
@author: jdsantana
'''
import threading
import time
from Common.Request import Request
import json
class qualifieldThread(threading.Thread):
def __init__(self, dbManager, parameters):
threading.Thread.__init__(self)
self.__dbManager = dbManager
self.__parameters... |
"""SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... |
""" Peephole optimization using the pipe-filter approach.
We face a certain stream of instructions. We take a look
at a very specific window and check if we can apply the
optimization. It's like scrolling over a sequence of
instructions and checking for possible optimizations.
"""
import logging
from ..binutils.outs... |
"""Defines the database models for various system metrics."""
from __future__ import unicode_literals
import datetime
import logging
import sys
import django.contrib.gis.db.models as models
import django.utils.timezone as timezone
from django.db import transaction
from error.models import Error
from job.models impor... |
#pinagem do pir = vcc|signal|gnd com os pinos proximos ao observador
from telegram.ext import Updater, CommandHandler, RegexHandler, MessageHandler, Filters, ConversationHandler, CallbackQueryHandler
from subprocess import call
from telegram import KeyboardButton, InlineKeyboardButton, ReplyKeyboardMarkup, InlineKeybo... |
# -*- coding: utf-8 -*-
"""Sphinx documentation plugin used to document tasks.
Introduction
============
Usage
-----
Add the extension to your :file:`docs/conf.py` configuration module:
.. code-block:: python
extensions = (...,
'celery.contrib.sphinx')
If you'd like to change the prefix for ... |
import numpy as np
from scipy import linalg
import random as rnd
import matplotlib
import matplotlib.pyplot
'''
execfile('pca.py')
p = pulseTrain(1000)
e = eigens(p)
plot(e['eigenvectors'][0])
plot(e['eigenvectors'][1])
testan(e,2);
'''
print 'running pca.py'
def makePulse(L=100.0,t1=10.0,t2=1.0,a1=1.0,a2=1.... |
from __future__ import absolute_import, print_function, division
import logging
import os
import tempfile
import io
from contextlib import contextmanager
from hashlib import sha1
import six
log = logging.getLogger(__name__)
class Asset(object):
"""
Generic superclass for other asset handler classes to in... |
# -*- coding: utf-8 -*-
# Copyright 2014 Metaswitch 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 applicab... |
# Copyright 2017 The TensorFlow 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... |
from pytest import raises
from mkcrowbar import network
from fake import *
def test_iface_has_ipv4_addr(capsys, monkeypatch):
local = LocalCommands()
monkeypatch.setattr('mkcrowbar.network.local', local)
args = ['-f', 'inet', 'addr', 'show', 'eth0']
local.has('ip', expect_args(args, load_fixture('i... |
import copy
import numbers
import os.path
import warnings
from collections import namedtuple
import audioread
import librosa
import numpy as np
import scipy.io.wavfile as wav
import scipy
from scipy.signal import check_COLA
import soundfile as sf
from . import constants
from . import utils
from . import masks
__all_... |
import json
import os
import sys
"""
Load the reference package. This will fail if the directory doesn't exist.
"""
try:
GENERIC_PATH = os.environ['GTDBTK_DATA_PATH']
except KeyError:
print('\n' + '=' * 80)
print(' ERROR '.center(80))
print('_' * 80 + '\n')
print("The 'GTDBTK_DATA_PATH' environment... |
# -*- coding: utf-8-*-
# ###################################################################
# FILENAME: examples/session_client_example.py
# PROJECT:
# DESCRIPTION: Cassandra session wrappers.
#
# ###################################################################
# (C)2015 DigiTar, All Rights Reserved
# ############... |
from __future__ import absolute_import, print_function
from django.conf.urls import include, patterns, url
from .endpoints.api_tokens import ApiTokensEndpoint
from .endpoints.auth_index import AuthIndexEndpoint
from .endpoints.broadcast_index import BroadcastIndexEndpoint
from .endpoints.catchall import CatchallEndpo... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, modify, merge, publish,
... |
'''
Register one person (sin) with a driver licence.
- If that person does not exist in database, user has an option to add that
person to the database
- If that person already have a driver licence, raise an error message and
return
'''
import random
import cx_Oracle
import datetime
from addperson import *
... |
#!/usr/bin/env python3
#
# This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2020 Damien P. George
# Copyright (c) 2020 Jim Mussared
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated document... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... |
#
# Matt Shelton <matt@mattshelton.com>
#
from SimpleXMLRPCServer import SimpleXMLRPCServer
import threading, xmlrpclib, unittest
from test import test_support
HOST = "127.0.0.1"
PORT = 7218
def multiply(x, y):
return x * y
class MyService:
"""This test class is going to be used to test an entire class bein... |
### -*- coding: utf-8 -*-
###
### Copyright (C) 2016 Peter Williams <pwil3058@gmail.com>
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; version 2 of the License only.
###
### This pr... |
#!/usr/bin/env python
import os
from os.path import join
from itertools import chain
from math import log
from pylab import plot, show, legend, close, figure, title, xlabel, ylabel, barh, savefig
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
N = 0 ... |
from pprint import pprint
def print_personal_information():
personal_information = \
{
'name': 'Bram Snoek',
'address': 'Lithsedijk 33, 5397ea, Lith',
'phone': '0636489308',
'college major': 'Bioinformatics'
}
print("\n My name is {}, my address... |
#!/usr/bin/python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from __future__ import unicode_literals
import os
from clint.textui import colored, indent, puts
from glob import glob
from wand.image import Image
sizes = {
'A0': (841.0, 1189.0),
'A1': (594.0, 841.0),
'A2': (420.0, 594.0),
'A3': (297.0, 420.0),
'A4': (210.0, 297.0),
'A5': (148.0, 210.0),
... |
# Copyright (c) 2014 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... |
# Copyright (C) 2015, Carlo de Franchis <carlo.de-franchis@cmla.ens-cachan.fr>
# Copyright (C) 2015, Gabriele Facciolo <facciolo@cmla.ens-cachan.fr>
# Copyright (C) 2015, Enric Meinhardt <enric.meinhardt@cmla.ens-cachan.fr>
from __future__ import print_function
import os
import numpy as np
from s2plib import rpc_mod... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# 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/LICEN... |
###################################################
# Tabbed interface script
# www.sunjay-varma.com
###################################################
__doc__ = info = '''
This script was written by Sunjay Varma - www.sunjay-varma.com
This script has two main classes:
Tab - Basic tab used by TabBar for main functio... |
"""
Tests for the dashboard APIs functions that deal with the edx cached data
"""
from datetime import timedelta
from unittest.mock import patch, MagicMock, ANY
import ddt
from requests.exceptions import HTTPError
from edx_api.certificates.models import Certificate, Certificates
from edx_api.enrollments.models import... |
#! /usr/bin/env python
# -*- coding: utf8 -*-
import sys
import os
# space separated list of hosts
#remote_hosts = "localhost node-1:2 node-3:4"
remote_hosts = "localhost"
test_dir = os.path.dirname(os.path.realpath(__file__))
start_script = sys.executable + " " + test_dir + os.sep + \
"t_distributed_python_wra... |
# (c) Fugro GeoServices. MIT licensed, see LICENSE.rst.
from django.core.management.base import BaseCommand
from ddsc_core.models.models import Source, Manufacturer
from django.utils import timezone
import csv
import string
class Command(BaseCommand):
args = '<CSV file>'
help = 'Imports a CSV file... |
import datetime
from datetime import datetime
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, DateTime, ForeignKey, UniqueConstraint
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
try:
... |
#!/usr/bin/env python
############################################################################
#
# 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 A... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
"""
Rotation handling module
"""
__author__ = "Hannes Ovrén"
__copyright__ = "Copyright 2013, Hannes Ovrén"
__license__ = "GPL"
__email__ = "hannes.ovren@liu.se"
import numpy as np
from numpy.testing import assert_almost_equal
... |
from collections import deque
import unittest
from test import support, seq_tests
import gc
import weakref
import copy
import pickle
from io import StringIO
import random
import struct
import sys
BIG = 100000
def fail():
raise SyntaxError
yield 1
class BadCmp:
def __eq__(self, other):
raise Runti... |
# Copyright 2012 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... |
# -*- coding: utf-8 -*-
"""Command Line Interface test cases."""
import argparse
import logging
import os
import tempfile
import unittest
from StringIO import StringIO
from mock import (
MagicMock as Mock,
patch,
)
from pic2map.cli import (
add,
count,
main,
parse_arguments,
remove,
... |
import pytest
try:
import cPickle as pickle
except:
import pickle
class SomeClass(object):
pass
pos_data = [
(('test', 'demo', 1), {'age': 1, 'name': 'name1'}),
(('test', 'demo', 2), {'age': 2, 'name': 'Mr John', 'bmi': 3.55}),
(('test', 'demo', 'boolean_key'), {'is_pr... |
''' Computes feature representations '''
from __future__ import division, print_function
from hscom import __common__
(print, print_, print_on, print_off,
rrr, profile) = __common__.init(__name__, '[fc2]')
# scientific
import numpy as np
# python
from os.path import join
# hotspotter
from hscom import helpers as util
... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import shutil
from tempfile import mkdtemp
from nipype.testing import assert_equal, assert_true
from nipype.interfaces import utility
import nipype.pipeline.engine as pe
def test_rename():
... |
from snippets.models import Snippet
from snippets.serializers import SnippetSerializer
from rest_framework import mixins
from rest_framework import generics
class SnippetList(mixins.ListModelMixin,
mixins.CreateModelMixin,
generics.GenericAPIView):
queryset = Snippet.objects.al... |
# -*- coding: utf-8 -*-
"""
(c) COPYRIGHT GNU-GPL V3
@author: Félix Molina
@version: 1.0
"""
import pygtk
import controller
pygtk.require('2.0')
import gtk as Gtk
class InitialisationMenu:
"""
This class constructs a window containing a menu to choose type of initialization.
This code results of modi... |
import sublime, sublime_plugin, os
import RailsGoToSpec.resolver
import re
class RailsGoToSpecCommand(sublime_plugin.WindowCommand):
def run(self):
sublime.status_message('Running Rails Go To Spec')
win = self.window
view = win.active_view()
current_file = view.file_name()
# remove the root dir
root_pat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from unicorns import storage
from unicorns.Unicorn import Unicorn
storage.setup()
unicorns = storage.fetch_unicorns()
for unicorn in unicorns:
print(str(unicorn.id) + ': ' + unicorn.name)
print("")
unicorn = storage.fetch_unicorn(3)
print(str(unicorn.id) + ': ' + u... |
"""
Classes to scale data.
Some of these classes are called internally by other modules, but they can also be used independently as a pre-processing stage.
Scalers can fit to one set of data, and used to transform other data sets with the same number of dimensions.
Examples
--------
Fitting scaler implicitly during... |
import unittest
from mpf.system.machine import MachineController
from MpfTestCase import MpfTestCase
from mock import MagicMock
import time
class TestBallDevicesHoldCoil(MpfTestCase):
def getConfigFile(self):
return 'test_hold_coil.yaml'
def getMachinePath(self):
return '../tests/machine_files/ball_... |
import enum
def named_enum(name, item):
if isinstance(item, str):
item = item.split(' ')
item = list(map(str.strip, item))
return enum.Enum(name, dict(zip(item, item)), module=__name__)
@enum.unique
class AreaOfBusiness(enum.Enum):
All = 0
Marketplace = 1
Property = 2
Motors = 3
... |
'''
Copyright (C) 2011 Mihnea Dobrescu-Balaur
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in ... |
# Licensed under the terms of the GNU GPL License version 2
"""
This module handles the creation and configuration of the Flask application.
"""
import collections
import datetime
from flask_restful import Api
from sqlalchemy.orm.exc import NoResultFound
import flask
from . import default_config, db, __version__, ui... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This module defines the classes for the protocol handling.
"""
import json
import logging
import os
import socket
from ipaddress import ip_address, ip_network
from select import select
import xfrm
from ikesa import IkeSa
from message import (Message, TrafficSelector)... |
import setpath
import functions
import json
registered=True
def convert(data):
if isinstance(data, basestring):
return str(data)
elif isinstance(data, collections.Mapping):
return dict(map(convert, data.iteritems()))
elif isinstance(data, collections.Iterable):
return type(data)(map... |
#
# Open Modeling Framework (OMF) Software for simulating power systems behavior
# Copyright (c) 2015, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundat... |
import argparse
import logging
from server import EnvironmentServer, WeightServer
import signal
import sys
from torch.multiprocessing import Lock
def main():
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)
parser = arg... |
#!/usr/bin/python
import matplotlib.pyplot as plt
import numpy as np
#import calendar
from datetime import datetime
from django.conf import settings
settings.configure()
import os
#para conexion con la bases de datos de beeton (asteriskbee)
import sqlite3 as dbapi
##Directorio de la aplicaion
### STATIC_ROOT = '/va... |
#!/usr/bin/env python
from __future__ import print_function
import os
import platform
from numpy.distutils.system_info import get_info
from scikits.odes._build import cython
#from Cython.Distutils import build_ext
base_path = os.path.abspath(os.path.dirname(__file__))
lapack_opt = None
def win():
... |
import web
import traceback
import webbrowser
from web.contrib import template
import os
import json
from datetime import datetime
#from ir.idehgostar.modir.assistant.mind import Mind
from ir.ac.iust.me_ahmadi.multiProcessMind.mind import Mind
render = template.render_genshi(['./templates/'])
urls = (
'/(.*)', ... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
"""
Project Euler Problem 6: https://projecteuler.net/problem=6
Sum square difference
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 55^2 = 3025
Hence the difference between the sum of... |
from common import * # NOQA
from cattle import ApiError
SERVICE_KIND = 'kubernetesService'
def from_context(context):
return context.client, context.agent_client, context.host
def test_bad_agent(super_client, new_context):
_, account, agent_client = register_simulated_host(new_context,
... |
import httplib2
import json
import urllib
from optparse import OptionParser
#from AptUrl.Parser import parse
h = httplib2.Http()
host = 'http://localhost:8080/kuzenko-ws/api/'
def setHost(hostName) :
global host
host = hostName
def setDatabaseName(name) :
resp, content = h.request(host + 'database/' + n... |
#! /usr/bin/env python
#
# update_po - a gramps tool to update translations
#
# Copyright (C) 2006-2006 Kees Bakker
# Copyright (C) 2006 Brian Matherly
# Copyright (C) 2008 Stephen George
# Copyright (C) 2012
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of t... |
import json
from django.test import TestCase
from django.urls import reverse
from . import factories
class TestGameApi(TestCase):
def setUp(self):
self.num_games = 10
self.games = []
for n in range(self.num_games):
self.games.append(
factories.GameFactory(name... |
# Copyright 2016 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 -*-
# Generated by Django 1.10.5 on 2017-03-10 21:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.t... |
from src.web_page import WebPage
import src.model
from libs.bottle import request, redirect
import pprint
class UpdateDB(WebPage):
def __init__(self, pagepath, page_id):
WebPage.__init__(self, pagepath)
self.main_template = "update_db.tpl"
self.request_params = dict(request.params)
... |
# Import os, json, UUD
import uuid, os, json
# Import jsonify
from flask import jsonify, request
# Import resource
from flask_restful import Resource
# Import Redis
from redis import Redis
# Import rq
from rq import Worker, Queue, Connection
# Import buildPDF method which we will pass to our redis queue
from app.m... |
# Copyright (c) 2012 OpenStack Foundation.
# Administrator of the National Aeronautics and Space Administration.
# 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 a... |
#################################
## Sub-code used in WF simulation
## It creates a csv file for the input of fax
## by Qing Lin
## @ 2016-09-12
##
## HARDCODE WARNING: The FV dimensions below need to be modified
## according to the detector you wish to simulate
##
## Ref: http://xenon1t.github.io/pax... |
# 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
# d... |
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from email import encoders
from email.header import Header
from email.utils import parseaddr, formataddr
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
# 格式化邮件地址,如果包含中文需要通过Header对象进行编码
def _format_addr(s):
name, addr... |
# Tai Sakuma <tai.sakuma@gmail.com>
import copy
import logging
import pytest
import unittest.mock as mock
from alphatwirl.loop import ReaderComposite
##__________________________________________________________________||
@pytest.fixture()
def obj():
return ReaderComposite()
def test_repr(obj):
repr(obj)
de... |
#!/usr/bin/env python
# Copyright 2010 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... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.db import connection
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import viewsets
from MySQLdb.cursors import SSDictCursor
from django.core.mail i... |
"""Unit tests for the sparsifier computation functions."""
import pytest
import networkx as nx
from networkx.utils import py_random_state
_seed = 2
def _test_spanner(G, spanner, stretch, weight=None):
"""Test whether a spanner is valid.
This function tests whether the given spanner is a subgraph of the
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# ... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class Canalc2IE(InfoExtractor):
IE_NAME = 'canalc2.tv'
_VALID_URL = r'https?://(?:(?:www\.)?canalc2\.tv/video/|archives-canalc2\.u-strasbg\.fr/video\.asp\?.*\bidVideo=)(?P<id>\d+)... |
def algorithm3(arr):
maxLength = 0
if len(arr) <= 0:
return 0
if len(arr) == 1:
return 1
for i in arr:
print "i is: " + str(i)
temp = [arr[i-1]]
for j in range(len(arr) - i):
spliceArrayJ = arr[j+1:]
print "reversed array: "
reversedArray = spliceArrayJ[::-1]
print reversedArray
print "Th... |
#!/usr/bin/env python
# Copyright (c) 2015. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Description here
"""
from mongoengine import *
from seriation import idss_version
import datetime
import loggi... |
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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... |
## @file GenInfFile.py
#
# This file contained the logical of transfer package object to INF files.
#
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompa... |
# Authors:
# Ana Krivokapic <akrivoka@redhat.com>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... |
# encoding: utf-8
from setuptools import setup, find_packages
import os.path
# Package data
# ------------
_name = 'jpl.mcl.site.policy'
_version = '1.0.2'
_description = "Policy package for MCL"
_url = 'http://mcl.jpl.nasa.gov/software/' + _name
_downloadURL = 'http://oodt.jpl... |
"""
Deployment for Bedrock in production.
Requires commander (https://github.com/oremj/commander) which is installed on
the systems that need it.
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from commander.deploy import task, hostgroups
import commander_settings as settings
... |
"""Provide functionality to stream video source."""
import logging
import secrets
import threading
import voluptuous as vol
from homeassistant.const import CONF_FILENAME, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpe... |
#!/usr/bin/env python3
import amici
import sys
import CS_Signalling_ERBB_RAS_AKT_petab as model_module
def main():
arg = sys.argv[1]
model = model_module.getModel()
solver = model.getSolver()
# TODO
edata = amici.ExpData(model)
edata.setTimepoints([1e8])
edata.setObservedData([1.0])
... |
#!/usr/bin/env python2
from gimpfu import *
## WORKFLOW
#
# Right-click on layer -> alpha to selection
# Grow selection by 1 pixel
# Make a new empty layer
# Fill selection with black
# Move new layer below old layer
# Merge down old layer
def add_text_outline(image, layer):
gimp.pdb.gimp_image_undo_group_start... |
import os
import operator
from pkg_resources import parse_version
from pkg_resources import resource_filename as pkg_res_resource_filename
from pprint import pformat
import requests
import json
import logging
# from terminaltables import AsciiTable as OutputTableType
from terminaltables import SingleTable as OutputTab... |
# Copyright (c) 2019 PaddlePaddle 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 appli... |
import os
import argparse
from gifted.gifted import load_images, write_gif
# Strings
PNG = 'PNG'
png = 'png'
JPG = 'JPG'
jpg = 'jpg'
GIF = 'GIF'
gif = 'gif'
OUTPUT_FILE = "output.gif"
DEFAULT_DURATION = 0.2
def get_args():
"""
Parses command line arguments
"""
parser = argparse.ArgumentParser()
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 - 2011, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('authors', '0001_initial'),
]
operations = [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.