src stringlengths 721 1.04M |
|---|
import gc, os, sys, string, re, pdb, scipy.stats, cPickle
import Mapping2, getNewer1000GSNPAnnotations, Bowtie, binom, GetCNVAnnotations, dictmerge, utils, InBindingSite
TABLE=string.maketrans('ACGTacgt', 'TGCAtgca')
USAGE="%s mindepth snpfile readfiletmplt maptmplt bindingsites cnvfile outfile logfile ksfile"
def r... |
# coding: utf8
import BTrees
import StringIO
import ZODB
import os
import threading
import transaction
import zeit.connector.cache
import zeit.connector.testing
import zope.app.testing.functional
class TestResourceCache(zope.app.testing.functional.FunctionalTestCase):
layer = zeit.connector.testing.zope_connecto... |
from nsbaseresource import NSBaseResource
from nsconfig import NSConfig
from nscspolicy import NSCSPolicy
from nscsvserver import NSCSVServer
from nscsvservercspolicybinding import NSCSVServerCSPolicyBinding
from nscsvserverresponderpolicybinding import NSCSVServerResponderPolicyBinding
from nscsvserverrewritepolicybin... |
# -- coding: utf-8 --
from CsAddress import CsAddress
from CsDatabag import CsCmdLine
class CsConfig(object):
"""
A class to cache all the stuff that the other classes need
"""
__LOG_FILE = "/var/log/cloud.log"
__LOG_LEVEL = "DEBUG"
__LOG_FORMAT = "%(asctime)s %(levelname)-8s %(message)s"
... |
# 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/.
from .unittestbase import PostgreSQLTestCase
from nose.plugins.attrib import attr
from nose.tools import eq_, assert_rai... |
from django.db import models
class SponsorManager(models.Manager):
def active(self):
return self.get_query_set().filter(active=True).order_by("level")
def with_weblogo(self):
queryset = self.raw("""
SELECT DISTINCT
"sponsorship_sponsor"."id",
"sponsorship_... |
# update_hi - receive binary and i) parse it, ii) update json tally as needed, iii) store .hi file for later
# get_hi -- fetch a bin for the emu
# get_json_tally - dump highscore table as json (for fancy frontend to display, say)
# get_html_tally - dump highscore in vaguely readable html table (for web browser quickie... |
# Copyright (C) 2016 ABRT Team
# Copyright (C) 2016 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... |
from celery.utils.log import get_task_logger
from celery.signals import after_setup_task_logger
from thehonestgenepipeline.celery import celery
from riskpredictor.core import predictor as pred
from os import path
from . import GENOTYPE_FOLDER,DATA_FOLDER
from . import get_platform_from_genotype
from .progress_logger ... |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgetbase.py
__version__=''' $Id: widgetbase.py,v 1.1 2006/05/26 19:19:38 thomas Exp $ '''
import string
from reportlab.graphics impor... |
import sc, random, contextlib, wave, os, math
import shlex, subprocess, signal
import NRTOSCParser3
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
# generator class for weighted random numbers
#
# Pass in one or the other:
# - weights: custom weights array
# - size: size of "standard" weights ... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Nicolas P. Rougier
# Distributed under the (new) BSD License.
#
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
# ------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Package utility functionality."""
from __future__ import print_function
import collections
import fileinput
import functools
... |
#
#
# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progr... |
# coding=utf-8
#
# Copyright 2018 F5 Networks 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 ... |
from os import environ as env
import unittest
from .wpull import WpullArgs
from seesaw.item import Item
# taken form pipeline/pipeline.py
if 'WARC_MAX_SIZE' in env:
WARC_MAX_SIZE = env['WARC_MAX_SIZE']
else:
WARC_MAX_SIZE = '5368709120'
def joined(args):
return str.join(' ', args)
class TestWpullArgs(un... |
import os
import sys
import textwrap
from typing import Optional
import requests
__version__ = "1.1"
class AkismetError(Exception):
"""
Base exception class for Akismet errors.
"""
pass
class UnknownArgumentError(AkismetError):
"""
Indicates an unknown argument was used as part of an API... |
# 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)
#
from __future__ import absolute_import, divisi... |
import json, logging
from collections import OrderedDict
from functools import wraps
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.exceptions import ValidationError
from django... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 N... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CommandConfirmation'
db.create_table(u'mail_commandconfirmation', (
(u'id', self... |
# This file is part of Beneath a Binary Sky.
# Copyright (C) 2016, Aidin Gharibnavaz <aidin@aidinhut.com>
#
# Beneath a Binary Sky 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
# Lice... |
#!/usr/bin/env python3
import os, logging, argparse, json, datetime
import requests
import dns.resolver
from bottle import route, request, response, redirect, hook, error, default_app, view, static_file, template
def set_content_type(fn):
def _return_type(*args, **kwargs):
if request.headers.get('Accept') == "appl... |
from Quotes import Quote
from Command import Command
class Quote_Command(Command):
def __init__(self, config):
self.connection = config['connection']
self.event = config['event']
self.channel = config['channel']
pass
def resolve(self):
args = self.event.arguments[0].sp... |
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout, password_reset, password_reset_done, password_reset_confirm,\
password_reset_complete
from django.conf import settings
from django.conf.urls.static import static
from seadssite import view... |
"""
Django models specific to peer assessment.
NOTE: We've switched to migrations, so if you make any edits to this file, you
need to then generate a matching migration for it using:
./manage.py schemamigration openassessment.assessment --auto
"""
import random
from datetime import timedelta
from django.db impo... |
import os
import sys
from pyramid.paster import get_appsettings
from pyramid.paster import setup_logging
from pyramid.scripts.common import parse_vars
from skosprovider_sqlalchemy.models import ConceptScheme
from skosprovider_sqlalchemy.models import Label
from skosprovider_sqlalchemy.utils import import_provider
from... |
#! /usr/bin/env python
from optparse import OptionParser
import os
import os.path
import sys
import re
import json
from alignment_stats import Align_Stats
class QC_Sample:
def __init__(self, options):
self.options = options
self.sample_json = json.load(open(options.json))
self.__softwareDirectory = "/rawdata/l... |
#!/usr/bin/env python
#
# @file CMakeFiles.py
# @brief class for generating the cmake files
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2015 by the California Institute of Technology
# (California, USA), ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack, LLC
# 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
#
# ... |
#!/usr/bin/python
# version 4
# april 2012
# this was written by saikia81 and is copyrighted under the GNU general public license 3
# it was written in notepad++, a program I recommend!
# whitespace ftw!
#import random, system and operating system possibilities.
import os, sys
import random, time #time moduele
#pick... |
# 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/.
import logging
try:
import raven
except ImportError:
raven = None
from socorro.signature.signature_utilities i... |
#!/usr/bin/python3
"""
Given an unsorted array of integers, find the number of longest increasing
subsequence.
Example 1:
Input: [1,3,5,4,7]
Output: 2
Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and
[1, 3, 5, 7].
Example 2:
Input: [2,2,2,2,2]
Output: 5
Explanation: The length of longest contin... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Adriano Monteiro Marques.
#
# Author: Bartosz SKOWRON <getxsick at gmail dot com>
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... |
#! /usr/bin/env python3
#
# In this script we solve the linear elasticity problem on a unit square
# domain, clamped at the left boundary, and stretched at the right boundary
# while keeping vertical displacements free.
from nutils import mesh, function, solver, export, cli, testing
def main(nelems:int, etype:str, bt... |
import json
import random
import datetime
from codalib import APP_AUTHOR
from codalib.bagatom import wrapAtom, makeObjectFeed
from dateutil import parser
from django.conf import settings
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed
from django.core.paginator import Pag... |
from morse.builder import *
# Land robot
morsy = Morsy()
morsy.translate(2.25, -0.75)
pose = Pose()
pose.translate(x=-0.0, z=0.0)
morsy.append(pose)
gripper = Gripper()
gripper.translate(x=0.2000, z=0.5000)
gripper.properties(Angle=360.0, Distance=0.5);
morsy.append(gripper)
camera = VideoCamera()
camera.translate(... |
#!/usr/bin/python
import numpy as np
import argparse
parser = argparse.ArgumentParser(add_help=True)
parser.register('type', 'bool',
lambda v: v.lower() in ("yes", "true", "t", "1"))
parser.add_argument("-db", type="bool", action="store", default=False)
parser.add_argument("-qoi_dim", type=int, action=... |
#!/usr/bin/env python2
# coding=utf-8
"""
Config Handler
"""
__author__ = "Manuel Ebert"
__copyright__ = "Copyright 2015, summer.ai"
__date__ = "2015-11-09"
__email__ = "manuel@summer.ai"
import boto3
import os
from util import AttrDict
path = os.path.dirname(os.path.abspath(__file__))
def load_yaml(filename):
... |
#!/usr/bin/env python3
# vim:fileencoding=utf-8
#
# (C) Copyright 2012 lilydjwg <lilydjwg@gmail.com>
#
# This file is part of xmpptalk.
#
# xmpptalk 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 versi... |
# -*- coding: UTF-8 -*-
# webseach
# create at 2015/10/30
# autor: qianqians
import sys
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append('../')
from webget import gethtml
import pymongo
from doclex import doclex
import time
collection_key = None
def seach(urllist):
def process_keyurl(keyurl):
... |
import doctest
from insights.parsers import neutron_l3_agent_log
from insights.parsers.neutron_l3_agent_log import NeutronL3AgentLog
from insights.tests import context_wrap
from datetime import datetime
AGENT_LOG = """
2017-09-17 10:05:06.241 141544 INFO neutron.agent.l3.ha [-] Router 01d51830-0e3e-4100-a891-efd7dbc0... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from lib.core.settings import IS_WIN, UNICODE_ENCODING
def singleTimeWarnMessage(message): # Cross-linked function
sys.stdout.write(message)
sys.stdout.write("\n")
sys.stdout.flush()
def stdoutencode(data):
retVal = None
try:
da... |
from datetime import datetime, timedelta
from netCDF4 import Dataset
from netCDF4 import num2date
import numpy as np
import time
import os
__author__ = 'Trond Kristiansen'
__email__ = 'trond.kristiansen@imr.no'
__created__ = datetime(2014, 1, 23)
__modified__ = datetime(2014, 1, 23)
__version__ = "0.1"
__status... |
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Just van den Broecke <justb4@gmail.com>
#
# Copyright (c) 2014 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documenta... |
# coding=utf-8
from __future__ import absolute_import, unicode_literals, division
from moarcofy.models import Photo, Album, User
from moarcofy.forms import PhotoForm, UploadPhotoForm
from moarcofy import app, config
from urllib import unquote_plus
from flask import session, request, url_for, abort, redirect, flash
"... |
#
# 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
#-*- coding:utf-8 -*-
__author__ = 'david'
from __builtin__ import *
import gc
import numpy as np
from skimage.feature import greycomatrix, greycoprops
import matplotlib as mpl
mpl.use('TkAgg') # Solve runtime issue
import matplotlib.pyplot as plt
## Fake imge and label volumes to fast test funct... |
# Copyright (c) 2012 Intel
# Copyright (c) 2012 OpenStack Foundation
# Copyright (c) 2015 EMC Corporation
#
# 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
#
#... |
import os
import logging
from flask import Flask
from slack_sdk.web import WebClient
from slackeventsapi import SlackEventAdapter
from onboarding_tutorial import OnboardingTutorial
# Initialize a Flask app to host the events adapter
app = Flask(__name__)
slack_events_adapter = SlackEventAdapter(os.environ["SLACK_SIGNI... |
#! /usr/bin/env python
"""
Build a JSON file with geo-locations from plane crash places in the DB.
"""
import os
import time
import json
import random
import geopy
from geopy.geocoders import Nominatim
import pandas as pd
from planecrashinfo_light import clean_database
geolocator = Nominatim()
def location_to_l... |
"""
data processing and playing with pendexo results
Horizontal Bin: 100ppm
data should be a combination between NIRSpec and MIRI
detection could indicate if the data is from NIRSpec of MIRI.
3 sigma detection: signal1-signal2 > 3*(signal1_error+signal2_error)
"""
"""
['FinalSpectrum', 'OriginalInput', 'timin... |
##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
from .util import cli_run
def test_list(client, first_label):
output = cli_run(client, ['label', 'list'])
assert first_label.short_id in output
output = cli_run(client, ['label', 'list', first_label.short_id])
assert first_label.short_id in output
def test_sensors(client, tmp_label, tmp_sensor):
... |
from django import forms
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views.decorators.cache import never_cache
from django.contrib.auth import authenticate, REDIRECT_FIELD_NAME
from django.contrib.formtools.wizard import FormWizard
from pyppp.django import login
from pyppp... |
# -*- coding: utf-8 -*-
# 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 require... |
# Copyright (c) Victor van den Elzen
# Released under the Expat license, see LICENSE file for details
from struct import pack, unpack, calcsize
from collections import OrderedDict
def getbytes(s, n):
b = s.read(n)
assert len(b) == n, "Unexpected EOF"
return b
def getbyte(s):
return getbytes(s, 1)
cl... |
#!/usr/bin/env python
# coding: utf-8
# © 2015 Instacart
# Published as part of http://tech.instacart.com/ahab/
from contextlib import contextmanager
import logging
from pprint import pformat
from random import randint
import subprocess
from ahab import Ahab
import iptc
log = logging.getLogger()
def main():
lo... |
import func.core.config as c
import func.core.intro as intro
from func.core.lang import t
from func.core.viz import subselector
from func.core.prsnj import Pj
from func.core.export import imprimir_clases
import os
def cargar_archivo(prompt, carpeta):
from func.data.setup import data as s
ars, nom = [... |
from req import WebRequestHandler
from req import Service
import tornado
import math
class WebUsersHandler(WebRequestHandler):
@tornado.gen.coroutine
def get(self):
if self.map_power['user_manage'] not in self.account['power']:
self.write_error(403)
return
args = ["page... |
# All Rights Reserved.
# Copyright 2013 SolidFire 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... |
# Copyright 2012 (C) Mickael Menu <mickael.menu@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; either version 2 of the License, or
# (at your option) any later version.
#
# This pr... |
import copy
from corehq.apps.accounting.models import Subscription
from corehq.apps.domain.models import Domain
from corehq.pillows.base import HQPillow
from corehq.pillows.mappings.domain_mapping import DOMAIN_MAPPING, DOMAIN_INDEX
from dimagi.utils.decorators.memoized import memoized
from django.conf import settings
... |
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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:... |
import numpy
import matplotlib
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter
from matplotlib import rcParams
from scipy.optimize import curve_fit
from data_plots.utils import labeler, titler
rcParams['text.usetex'] = True
def scatter_hist(x, y, *args,
... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Entry point for both build and try bots.
This script is invoked from XXX, usually without arguments
to package an SDK. It autom... |
# MIT License
# Copyright (c) 2016 Diogo Dutra <dutradda@gmail.com>
# 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, co... |
from hcsvlab_robochef.rdf.map import *
PARADISEC = "PARADISEC"
paradisecSpeakerMap = FieldMapper(AUSNC)
paradisecSpeakerMap.add('name', mapto=FOAF.name)
paradisecSpeakerMap.add('role', ignore=True)
paradisecMap = MetadataMapper(PARADISEC, speakerMap=paradisecSpeakerMap, documentMap = get_generic_doc_mapper())
paradi... |
#!/bin/env python
# encoding:utf-8
#
# Author: CORDEA
# Created: 2014-09-12
#
infile = open("ilm_missene.onmis.vcf", "r")
lines = infile.readlines()
infile.close()
msDict = {}
for line in lines:
samples = line.split(",")[5]
tmp = samples.split("|")
for i in range(len(tmp)):
try:
m... |
# coding=utf-8
#
# Copyright 2017 F5 Networks 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 a... |
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from wishlist import exceptions
class WishListItem(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL, related_name='wishlist_items',
verbose_name=_('Owner'), on_... |
#!/usr/bin/env python
# standard library imports
# third party related imports
from boto.exception import BotoServerError
from mock import MagicMock
# local library imports
from mobile_push.actors.create_topic import CreateTopicActor
from mobile_push.db import Session, Topic
from ..base import BaseTestCase
class T... |
# -*- encoding: utf-8 -*-
#
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
#
# Coded by: Vauxoo (info@vauxoo.com)
#
#
# This program is free software: you can redistribute it and/... |
#!/usr/bin/env python3
'''
Where we make the things for EuroIX JSON
'''
import aiohttp
import asyncio
import async_timeout
import glob
import json
import logging
import os
import re
import time
from . import peer
class PeermeDb():
'''
Replaces talking to the Peering DB and generates output based on
... |
# -*- encoding: utf-8 -*-
"""Implements Locations UI"""
from robottelo.constants import FILTER
from robottelo.ui.base import Base
from robottelo.ui.locators import common_locators, locators, tab_locators
from robottelo.ui.navigator import Navigator
class Location(Base):
"""Implements CRUD functions for UI"""
... |
from django.shortcuts import render
from django.conf import settings
from django.core.mail import send_mail
from django.shortcuts import render
from Internet_store.products.models import ProductFeatured, Product
def home(request):
title = 'Sign up now!'
featured_image = ProductFeatured.objects.filter(active=... |
#!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import matplotlib as mpl
import pandas as pd
import numpy as np
mpl.use('Agg')
import time
import matplotlib.pyplot as plt
def convolve_inner_layers(x, W, b):
'''
inner layers of network --- tanh activation
'''
... |
#!/usr/bin/python
import math
import rospy
import random
from sensor_msgs.msg import *
from geometry_msgs.msg import *
from constrained_path_generator.msg import *
from constrained_path_generator.srv import *
def make_pose((px, py, pz), (rx, ry, rz, rw)):
new_pose = Pose()
new_pose.position.x = px
new_po... |
# Copyright 2013 The Distro Tracker Developers
# See the COPYRIGHT file at the top-level directory of this distribution and
# at http://deb.li/DTAuthors
#
# This file is part of Distro Tracker. It is subject to the license terms
# in the LICENSE file found in the top-level directory of this
# distribution and at http:/... |
"""Utilities for manipulating Wine"""
import os
from collections import OrderedDict
from functools import lru_cache
from gettext import gettext as _
from lutris import runtime, settings
from lutris.gui.dialogs import DontShowAgainDialog, ErrorDialog
from lutris.runners.steam import steam
from lutris.util import linux,... |
"""Canadian Insider Transactions.
Usage:
sedi_transactions <issuer_num>...
Options:
-h --help Show this screen.
--version Show version.
"""
import os
from docopt import docopt
from sedi_transactions.transactions import SEDIView
OUTPUT_PATH = os.path.abspath(
os.path.join(os.path.abspath(__f... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('patchwork', '0014_remove_userprofile_primary_project'),
]
operations = [
migrations.CreateM... |
from pprint import pprint
from django.shortcuts import render
from django.views import View
class Mapa(View):
def __init__(self):
self.template_name = 'cd/mapa.html'
self.title_name = 'Mapa'
def mount_context(self):
enderecos = {}
letras = [
{'letra': 'A', 'int_i... |
import theano as _th
import theano.tensor as _T
class Module:
def __init__(self):
self.training_mode = True
self.fn_forward = None
self.fn_accum_grads = None
self.fn_accum_stats = None
#def __hash__(self):
# raise NotImplementedError("You *need* to reimplement hash, e... |
from django.db import models
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, RegexValidator
from filer.fields.file import FilerFileField
from filer.fields.image import FilerImageField
class Browser(models.Model):
class Meta:
ordering = ['name']
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Camille Scott, 2019
# File : cdbg_stream.py
# License: MIT
# Author : Camille Scott <camille.scott.w@gmail.com>
# Date : 11.03.2020
from goetia import libgoetia
from goetia.cdbg import (compute_connected_component_callback,
compute_unit... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'GipsyToolbarMenu.url'
db.alter_column(u'gipsy_toolbar_... |
import itertools
import random
# Directions
NORTH = 'N'
EAST = 'E'
SOUTH = 'S'
WEST = 'W'
DIRECTIONS = [NORTH, EAST, SOUTH, WEST]
REVERSE = {
NORTH: SOUTH,
EAST: WEST,
SOUTH: NORTH,
WEST: EAST,
}
OFFSET = {
NORTH: -16,
EAST: 1,
SOUTH: 16,
WEST: -1,
}
# Masks
M_NORTH = 0x01
M_EAST =... |
# -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib2, urllib, re, string, sys, os, gzip, StringIO, math, urlparse
import base64, time, cookielib
import simplejson
# Plugin constants
__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')
__profile__ = xbmc.translate... |
import contextlib
import sys
import random
from blessings import Terminal
terminal = Terminal()
@contextlib.contextmanager
def noop():
yield
def on_entry(overwrite):
sys.stdout.write(terminal.civis + terminal.normal)
if not overwrite:
sys.stdout.write(terminal.clear)
def on_exit(overwrite):
... |
from collections import OrderedDict
from functools import partial
from math import floor, ceil
from operator import is_not
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... |
from users.views import *
from .add_leader_form import *
from django.db.utils import IntegrityError
def create_leader_user(request, username):
form = LeaderForm()
if request.method == 'POST':
form = LeaderForm(request.POST)
if form.is_valid():
username = request.POST.get('usernam... |
""" Convenience Classes building on the base PMAPI extension module """
#
# Copyright (C) 2013-2015 Red Hat
# Copyright (C) 2009-2012 Michael T. Werner
#
# This file is part of the "pcp" module, the python interfaces for the
# Performance Co-Pilot toolkit.
#
# This program is free software; you can redistribute it and/... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Word',
fields=[
('id', models.AutoField(verbose... |
# Copyright 2014 Douglas RAILLARD
#
# This file is part of BrownBat.
#
# BrownBat is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... |
#!/usr/bin/env python
import csv
import sys
def getChrSizes(chrmFile):
"""
Reads tab-delimiter file with two rows describing the chromossomes and its lengths.
Returns dictionary of chr:sizes.
"""
with open(chrmFile, 'r') as f:
chrmSizes = {}
for line in enumerate(f):
ro... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import json, sys, traceback
import turtle
from functools import partial
class LoggedTurtle(object):
"""Class emulating Turtle behavior while logging all commands.
It won't actually display anything, it will only execute movement commands
through a TNavigat... |
# -*- 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 License, Version 2.0 (the
#... |
"""Manage Treadmill allocations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
import six
from treadmill import admin
from treadmill import cli
from treadmill import context
from tr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.