src stringlengths 721 1.04M |
|---|
import msgpack
import zmq
from flask import current_app
from alfred_db.models import Push
from .database import db
def get_shell():
try:
from IPython.frontend.terminal.embed import InteractiveShellEmbed
except ImportError:
import code
return lambda **context: code.interact('', local=c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright [2016] Hewlett Packard Enterprise Development LP 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 Unless required by applicable
# ... |
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2013 KNX-User-Forum e.V. http://knx-user-forum.de/
#########################################################################
# ... |
#!/usr/bin/python
import pandas as pd
from sklearn import ensemble
from sklearn import linear_model
from sklearn.cross_validation import cross_val_score
import data
import reduced_alphabet
"""
Build models off Dana-Farber Repository for Machine Learning in Immunology
For details of the repository, please refer to th... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
# Author: Thomi Richards, Martin Mrazik
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Fou... |
# -*- coding: utf-8 -*-
import sys
import alcide.settings
import django.core.management
from datetime import datetime
import csv
django.core.management.setup_environ(alcide.settings)
from alcide.dossiers.models import PatientRecord
from alcide.actes.models import Act
from django.db import transaction
@transaction.c... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# DChars Copyright (C) 2012 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of DChars.
# DChars is free software: you can redistribute it and/or modify
# ... |
import unittest
import os
from os.path import dirname, isfile, isdir
import shutil
from sqlalchemy import create_engine
from sqlalchemy.sql import text
from context import tagi
from tagi import data
from tagi.data import Document, Tag, Tagi
import string
import random
def create_test_database():
# if isfile('ta... |
from sigtools import support, specifiers, signatures
from sigtools.tests.util import Fixtures, tup
_wrapped = support.f('x, y, *, z')
class Py3AutoforwardsTests(Fixtures):
def _test(self, func, expected, expected_src, incoherent=False):
sig = specifiers.signature(func)
self.assertSigsEqual(sig, ... |
#!/usr/bin/env python
import sys
import argparse
import pkg_resources
from moneywagon import service_table
from moneywagon.supply_estimator import write_blocktime_adjustments
from subprocess import call
parser = argparse.ArgumentParser()
parser.add_argument('--minor', action='store_true', help='Make minor release.'... |
import json
import logging
import os
import subprocess
import textwrap
import uuid
import boto3
import passlib.hash
import pytest
from dcos_installer import backend
from dcos_installer.config import Config, make_default_config_if_needed, to_config
os.environ["BOOTSTRAP_ID"] = "12345"
def test_password_hash():
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 1 17:07:33 2015
@author: malkaguillot
"""
from ipp_work.utils import survey_simulate, df_weighted_average_grouped
from ipp_work.simulations.ir_marg_rate import varying_survey_simulation
from ipp_work.example.quantiles_of_revimp import make_weighted_deciles_of_variable
i... |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... |
###
# Copyright (c) 2014, spline
# All rights reserved.
#
#
###
"""
Add a description of the plugin (to be presented to the user inside the wizard)
here. This should describe *what* the plugin does.
"""
import supybot
import supybot.world as world
# Use this for the version of this plugin. You may wish to put a CV... |
#########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
#!/usr/bin/env python3
# ******************************************************************************
#
# Project: GDAL
# Purpose: Example computing the magnitude and phase from a complex image.
# Author: Frank Warmerdam, warmerdam@pobox.com
#
# *****************************************************************... |
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-wms-job-get-output
# Author : Stuart Paterson
########################################################################
"""
Retrieve output sandbox for a DIRAC job
"""
__RCSID__ = "$Id$"
import ... |
from Products.CMFCore.utils import getToolByName
from Products.LDAPMultiPlugins import manage_addLDAPMultiPlugin
def install(context):
if not context.readDataFile('uwosh.intranet.policy.txt'):
return
setupLDAPPlugin(context)
def setupLDAPPlugin(context):
ldap_plugin_id = 'ldap_authentication'
... |
from __future__ import unicode_literals
import boto
import boto3
import boto.ec2.autoscale
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale import Tag
import boto.ec2.elb
import sure # noqa
from moto import mock_autoscaling, ... |
"""
Copyright (c) 2012-2014, Austin Benson and David Gleich
All rights reserved.
This file is part of MRTSQR and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
"""
"""
BtA.py
===========
Driver code f... |
""" Test class dependency finder """
import os
import time
from sfdclib import SfdcToolingApi
def retrieve_apex_classes(session, classes=None):
""" Retrieves list of Apex classes """
tooling = SfdcToolingApi(session)
query = "SELECT Id,Name FROM ApexClass"
if classes is not None:
query += " W... |
# Copyright (c) 2013 Rackspace, 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 wr... |
# Copyright 2013 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.
"""Convert parse tree to AST.
This module converts the parse tree to the AST we use for code generation. The
main entry point is OrderedModule, which gets pa... |
# -*- coding: utf-8 -*-
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = 'steven.c.projects@gmail.com'
__created_on__ = '12/3/2014'
"""
Created on Wed Dec 3 17:36:17 2014
@author: steven_c
"""
acidtest = """Can you talk piglatin to piglatin.
"""
quotes = """A Tale of ... |
# -*- coding: utf-8 -*-
import random
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MultishareCz(SimpleHoster):
__name__ = "MultishareCz"
__type__ = "hoster"
__version__ = "0.40"
__pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P<ID>\d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2020 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... |
# !/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
ERP+
"""
__author__ = ['António Anacleto', 'Jair Medina']
__credits__ = []
__version__ = "1.0"
__maintainer__ = ['António Anacleto', 'Jair Medina']
__status__ = "Development"
__model_name__= 'sai_pesquisacont.SaiPesquisacont'
#import base_models#auth,
from orm impo... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand.- XBMC Plugin
# Canal para cinestreaming01.com
# http://blog.tvalacarta.info/plugin-xbmc/streamondemand.
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
... |
from geopandas import GeoDataFrame
from .....utils.geom_utils import set_geometry
from .constants import COUNTRY_FILTER, CATEGORY_FILTER, PROVIDER_FILTER, PUBLIC_FILTER
from .entity_repo import EntityRepository
GEOGRAPHY_TYPE = 'geography'
_GEOGRAPHY_ID_FIELD = 'id'
_GEOGRAPHY_SLUG_FIELD = 'slug'
_ALLOWED_FILTERS = ... |
# -*- coding: utf-8 -
from django.conf.urls import url
from django.contrib.auth import views as django_auth_views
from . import forms
from . import views
urlpatterns = [
url(r'^signup/$', views.SignupView.as_view(template_name='concierge/signup.html'), name='signup'),
url(r'^login/$', django_auth_views.logi... |
import numpy as np
import unicodecsv
import codecs
import goslate
import sqlite3
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
def imp_load(filename):
texts = []
books = []
chapters = []
verses = []
# Read in a whole bible
w... |
"""
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue.
Note:
The number ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Delivery Transsmart Ingegration - Address Consolidation
# Copyright (C) 2016 1200 Web Development (<http://1200wd.com/>)
# (C) 2015 ONESTEiN BV (<http://www.onestein.nl>)
#
# This program is ... |
from __future__ import division, unicode_literals, absolute_import
import os, tempfile, copy, math, itertools, sys
import numpy as np
from operator import itemgetter
from itertools import product
try:
import scipy
except:
print('functions.py: no scipy, smoother() will not work()')
from siman import header
... |
# Project: lnotify
# Description: A libnotify script for weechat. Uses
# subprocess.call to execute notify-send with arguments.
# Author: kevr <kevr@nixcode.us>
# License: GPL3
#
# 0.1.2
# added option to display weechat's icon by tomboy64
#
# 0.1.3
# changed the way that icon to WeeChat notification is specified.... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""
Tests for wiki permissions
"""
from django.contrib.auth.models import Group
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.utils import override_settings
from cour... |
#
# -*- coding: utf8 -*-
#
# Tarot
# Copyright (C) 2009-2010 mathgl67@gmail.com
#
# This file is part of Tarot
#
# Tarot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Meng xiangguo <mxgnene01@gmail.com>
#
# H A P P Y H A C K I N G !
# _____ ______
# ____==== ]OO|_n_n__][. | |]
# [________]_|__|________)< |MENG|
# oo oo 'oo OOOO-| oo\_ ~o~~~o~'
# +--+--+--+--+--+--+... |
from rpython.rlib import jit
from rpython.rlib.listsort import make_timsort_class
from rpython.rlib.objectmodel import always_inline, specialize
import base
import reader
import space
class ProgramBody:
def __init__(self, blocks, functions, is_generator):
self.blocks = reverse_postorder(blocks[0])
... |
"""
34. 「AのB」
2つの名詞が「の」で連結されている名詞句を抽出せよ.
"""
# -*- coding: utf-8 -*-
import codecs
list_d = [] #文書のリスト
def do_mecab(textfile):
import codecs
import copy
list_s = [] #文章単位のリスト
#list_d = [] #文書のリスト
# load data
with codecs.open(textfile, 'r', 'utf-8') as f:
for line in f:
... |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
import unittest
import json
from music21 import converter
from music21 import duration
from music21.chord import Chord
from music21.meter import TimeSignature
from music21.note import Note, Rest
from music21.key import KeySignature
from music21.tempo import MetronomeMark
from vmf_converter.core import vmf_converter_c... |
import json
import os
from errata_tool import ErrataConnector, Erratum
from errata_tool.build import Build
from errata_tool.products import ProductList
from errata_tool.product import Product
from errata_tool.product_version import ProductVersion
from errata_tool.release import Release
from errata_tool.variant import V... |
from raptiformica.actions.mesh import stop_detached_cjdroute
from raptiformica.shell.execute import COMMAND_TIMEOUT
from tests.testcase import TestCase
class TestStopDetachedCjdroute(TestCase):
def setUp(self):
self.log = self.set_up_patch('raptiformica.actions.mesh.log')
self.execute_process = se... |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
from rest_framework_swagger.views import get_swagger_view
import contentstor... |
import itertools
from common import ImplementsReduce
from ops import inject_reduce_methods
import variable
import dataset
import numpy as np
def unique_value_groups(ar):
"""Group an array by its unique values.
Parameters
----------
ar : array-like
Input array. This will be flattened if it is... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#-----------------------------------------------------------------------------
# Copyright 2012-2016 Claude Zervas
# email: claude@utlco.com
#-----------------------------------------------------------------------------
"""
Offset Line/Arc segments in a tool path to compensate for tool trail offset.
"""
# Python 3 comp... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
import sys, ctypes
fr... |
from __future__ import unicode_literals
from .. import errors
from ..tools import extract_namespace
from .. import namespaces
from ..compat import itervalues
from collections import defaultdict
import inspect
class Meta(object):
logic_skip = False
virtual_tag = False
is_call = False
is_try = False
... |
import json
import os
from collections import defaultdict
from datetime import datetime
import listenbrainz_spark.stats.user.release as release_stats
from listenbrainz_spark import utils
from listenbrainz_spark.path import LISTENBRAINZ_DATA_DIRECTORY
from listenbrainz_spark.tests import SparkTestCase
from pyspark.sql ... |
# 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
# distribu... |
from collections import OrderedDict
from itertools import groupby
from operator import itemgetter, and_
import datetime
from flask import render_template, redirect, request, url_for, current_app, flash
from slackclient import SlackClient
from sqlalchemy import extract, or_
from sqlalchemy import func
from app import... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
"""
Translate a sequence (eg. a metagenome) and print the longest ORF
"""
import sys
import os
from robseq import translate
from rob import read_fasta
from rob import rc
try:
faf = sys.argv[1]
size = int(sys.argv[2])
except:
sys.exit(sys.argv[0] + " <fasta file> <min orf size in amino acids>")
fa = r... |
"""
Author: ikosenn
This is a program to eliminate stale git branches.
It checks last commits and based on the staleness threshold
eliminates all stale branches
Another CL function is provided to eliminate all available branches.
You can also remove all branches that have already been merged ... |
"""
[2017-09-29] Challenge #333 [Hard] Build a Web API-driven Data Site
https://www.reddit.com/r/dailyprogrammer/comments/739j8c/20170929_challenge_333_hard_build_a_web_apidriven/
# Description
A common theme in present-day programming are web APIs. We've had a previous challenge where you had to _consume_ an
API, to... |
# gaf.netlist - gEDA Netlist Extraction and Generation
# Copyright (C) 1998-2010 Ales Hvezda
# Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
# Copyright (C) 2013-2019 Roland Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
import pytest
import responses
from pynano import User # noqa
def test_userhist_wordcount(kromey_hist_response):
with responses.RequestsMock() as rsps:
kromey_hist_response(rsps)
kromey = User('kromey')
# Access history first to query the history API
kromey.history
asser... |
"""
nco module. Use Nco class as interface.
"""
import distutils.spawn
import os
import re
import shlex
import six
import subprocess
import tempfile
from distutils.version import LooseVersion
class NCOException(Exception):
def __init__(self, stdout, stderr, returncode):
super(NCOException, self).__init_... |
# Copyright 2016 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... |
# coding: utf-8
#
from django import forms
from django.utils.translation import ugettext_lazy as _
from common.fields import FormDictField, FormEncryptCharField
from .base import BaseForm
__all__ = ['LDAPSettingForm']
class LDAPSettingForm(BaseForm):
AUTH_LDAP_SERVER_URI = forms.CharField(
label=_("L... |
"""
dtaidistance.dtw - Dynamic Time Warping
__author__ = "Wannes Meert"
__copyright__ = "Copyright 2016 KU Leuven, DTAI Research Group"
__license__ = "APL"
..
Part of the DTAI distance code.
Copyright 2016 KU Leuven, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
... |
import sys
if sys.version_info < (3, 7):
from ._zsrc import ZsrcValidator
from ._z import ZValidator
from ._ysrc import YsrcValidator
from ._y import YValidator
from ._xsrc import XsrcValidator
from ._x import XValidator
from ._wsrc import WsrcValidator
from ._w import WValidator
fr... |
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 the ZAP development team
#
# 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... |
from __future__ import absolute_import
from __future__ import unicode_literals
import glob
import os
import tempfile
from behave import given
from behave import register_type
from behave import when
from behave.model import Table
import jinja2
import parse
from whichcraft import which
from command_steps import step_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from functools import wraps
from inspect import getargspec
from django_asynctasks.models import AsyncTask
HIGH=1
NORMAL=2
LOW=3
def define(label, schedule=None, bucket=None, priority=2):
if not schedule:
schedule = 'onetime'
... |
"""
Support for Xiaomi Mi Flora BLE plant sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.miflora/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.entity i... |
# Copyright (C) 2013, 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribut... |
import logging
from mock import Mock
from slippinj.databases.drivers.sqlserver import Sqlserver
class TestSqlserver:
def setup_method(self, method):
self.logger = logging.getLogger('test')
self.logger.addHandler(logging.NullHandler())
def teardown_method(self, method):
self.logger =... |
# -*- coding: utf-8 -*-
#
# calibre documentation build configuration file, created by
# sphinx-quickstart.py on Sun Mar 23 01:23:55 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pick... |
class Optimizable(object):
def __init__(self,comp_names_list,paramname,valfrom,valto,**kwargs):
self.names = comp_names_list
self.paramname = paramname
self.minStep = 2 #default
self.vFrom = valfrom
self.vTo = valto
self.val = 0
for name, value in kwargs.it... |
# -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2014 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... |
import unittest
import operator
import six
import random
from six.moves import range,reduce
import ctypes
from ctypes import CFUNCTYPE
from arybo.lib.exprs_asm import llvmlite_available
if llvmlite_available:
import llvmlite.binding as llvm
import arybo.lib.mba_exprs as EX
from arybo.lib import MBA
from arybo.l... |
from __future__ import unicode_literals
import os
import hmac
import hashlib
from . import tables
from .base import BaseTableModel
class AuthError(RuntimeError):
"""Authentication error
"""
class BadPassword(AuthError):
"""Raised when user tries to authenticate with wrong password
"""
c... |
from framework.routing import Rule, json_renderer
from website.addons.s3 import views
settings_routes = {
'rules': [
Rule(
[
'/project/<pid>/s3/newbucket/',
'/project/<pid>/node/<nid>/s3/newbucket/',
],
'post',
views.crud.cre... |
import os, os.path
import math, random
import numpy as np
import utils
from skimage import io
from tqdm import tqdm
from itertools import repeat
from face_preproc import FaceDetector, FaceAligner, clip_to_range
DEV_RATIO = 0.04
TEST_RATIO = 0.06
IMG_SIZE = 217
BORDER = 5
DATA_DIR = '../data/cnn_tpe/'
TRAIN_DIR = DA... |
import os
import sys
import argparse
import subprocess
import json
import time
from datetime import date
from subprocess import Popen, PIPE
search_dirs = ["/hps/nobackup/production/xfam/rfam/RELEASES/14.3/miRNA_relabelled/batch1_chunk1_searches",
"/hps/nobackup/production/xfam/rfam/RELEASES/14.3/miRNA_r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017 The Authors. All Rights Reserved.
# License: MIT.
# Author: acrazing <joking.young@gmail.com>.
# File: config.
"""
默认配置
"""
import logging
import os
import sys
api_config = {
'persist_file': os.path.join(os.path.expanduser("~"), ".__cache__dbapi.json... |
""" This file is a part of pixel-fighters-2D made by Maltouzes """
def change_background(self, keycode):
""" Change the background """
if keycode[1] == '&':
self.img_back.source = (self.path +
'/background/fight-backgrounds-16.gif')
self.default_y_character = 11... |
"""Pete likes to bake some cakes. He has some recipes and ingredients. Unfortunately he is not good in maths. Can you help him to find out, how many cakes he could bake considering his recipes?
Write a function cakes(), which takes the recipe (object) and the available ingredients (also an object) and returns the maxi... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright IBM Corp. 2013 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... |
# File created 26/01/2015
# Contains main method to write Braille output to a tablet
# Pins are [12, 16, 18, 22, 24, 26] in GPIO.BOARD mode
import RPi.GPIO as GPIO
import time
import atexit
from braille_converter import convert_string
from braille_dict import braille_dict as bdict
led_pins = [12, 16, 18, 22, 24, 26]... |
import os
import benchmark
import numpy as np
import rasterio as rio
from skimage.morphology import disk
from geoblend.vector import create_vector
class Benchmark_Vector_Small(benchmark.Benchmark):
def setUp(self):
directory = os.path.dirname(os.path.realpath(__file__))
fixtures = os.path.join... |
"""Business objects for Action
"""
# Copyright 2010,2011 Good Energy Research Inc. <graham@goodenergy.ca>, <jeremy@goodenergy.ca>
#
# This file is part of Good Energy.
#
# Good Energy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Class for reading beam CST files."""
import re
import warnings
import numpy as np
from .uvbeam import UVBeam
from .. import utils as uvutils
__all__ = ["CSTBeam"]
class CSTBeam(UVB... |
from rez.utils.formatting import indent
from rez.utils.data_utils import cached_property
from rez.utils.logging_ import print_debug
from rez.utils import py23
from inspect import getsourcelines
from textwrap import dedent
from glob import glob
import traceback
import os.path
def early():
"""Used by functions in p... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import argparse
import urllib2
import time
from random import random
from lib import init_charging, stop_charging, charging_stats, rel_set, get_amp
# ==API==
#
# charging/start:
# <- charging_session_id
#
# charging/update?charging_session_id=
# &watt_current=
# &watt... |
# -*- coding: utf-8 -*-
# Get elemenatry features from COW-DOM.
import os.path
import sys
import glob
import re
from lxml import etree as ET
# Just for rounding. StringHandler etc. maybe?
class FloatHandler:
def __init__(self, digits):
self.digits = digits
def act(self, d):
return str(round... |
#!/usr/bin/env python
# written by r3dact3d (brady)
import requests
import tweepy
from random import choice
from config import *
'''
Chucknorris.io is free and will always be! However, as maintaining this service costs $$$,
we are glad to be sponsored by Jugendstil.io.
'''
# Available Catagories - I did this way so s... |
import uuid
from itertools import groupby
from urllib.parse import urlunparse
from django.conf import settings
from jinja2.sandbox import SandboxedEnvironment
from controls.enums.statements import StatementTypeEnum
from controls.oscal import Catalogs, Catalog
from siteapp.settings import GOVREADY_URL
def get_jinja2... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
from django.utils.timezone import utc
import datetime
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL... |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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... |
#!/usr/bin/env python
#
# Pyntheon; A resource for common lab specimens from virus to human
# to analyze their proteins for the presence of Posttranslational modifications (PTMs)
# in a large set of proteins of interest, also analyze the presence of mutations
# overlap with the modified residues.
# Besides this, Pynt... |
import math
from PIL import Image, ImageDraw
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response
from boundaries.models import Boundary
from parties.models import Party
from leaflets.models import Leaflet
google_dist = 20037508.34
def leaflet_polygon_options(boundary):
... |
import operator
### Setting up a quick dataflow structure model for handling
### Originally inspired for handling transformations in importing mail
### messages for the mail database project (see Projects/MailSys) but
### useful enough that I wanted it globa.
### XXX: There probably are improvements to make in the ba... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.