src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: recorders/abstract_recorder.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------... |
import sqlite3
class HanDatabaseProvider(object):
_CREATE_HANDB_TABLE = 'CREATE TABLE IF NOT EXISTS handb (id INTEGER PRIMARY KEY, \
hanword TEXT)'
_GET_RANDOM_WORD = 'SELECT hanword FROM handb ORDER BY RANDOM() LIMIT 1'
_INSERT_WORD = 'REPLACE INTO handb(id, hanword) VALUE... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dota2api
import datetime
import time
import thread
api = dota2api.Initialise()
seed_user_id = 161877399
#seed_user_id = 98887913
hero_list = api.get_heroes()['heroes']
item_list = api.get_game_items()['items']
# heroes
# {
# count - Numbe... |
from i3pystatus import IntervalModule
from pyzabbix import ZabbixAPI
class Zabbix(IntervalModule):
"""
Zabbix alerts watcher
Requires: pyzabbix
.. rubric:: Available formatters
* {default} - Full output count alerts like total:a5/a4/a3/a2/a1/a0
* {total} - Total count of alerts
* {aX_co... |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
# 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... |
"""
sentry.models.organizationmember
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from django.core.urlresolvers import reverse
from django.db.models i... |
#!/usr/bin/env python
# we're using python 3.x style print but want it to work in python 2.x,
from __future__ import print_function
import os
import argparse
import sys
import subprocess
parser = argparse.ArgumentParser(description="Validates directory containing integerized "
"text d... |
# coding: utf-8
import pytest
from mmvdApp.utils import products, distances
from mmvdApp.shortest_path import a_star, neighbors
@pytest.mark.utils
@pytest.mark.map
def test_drop_zone(drop_zone1):
"""
Test if correct coordinates are returned for the drop zone in
warehouse_map1.
:param fixture drop_zo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Flavien Chantelot (@Dorn-)
# Copyright: (c) 2018, Antoine Levy-Lambert (@antoinell)
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
... |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License.
#
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
# ------------------------------------------------------------------... |
## @file
#
# Copyright (c) 2011 - 2018, 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 accompanies this
# distribution. The full text of the license may be found at
# http://open... |
__author__ = 'frank'
import os
import os.path
import traceback
import zstacklib.utils.uuidhelper as uuidhelper
from kvmagent import kvmagent
from kvmagent.plugins.imagestore import ImageStoreClient
from zstacklib.utils import jsonobject
from zstacklib.utils import linux
from zstacklib.utils import shell
from zstackli... |
# Copyright (c) 2015 Uber Technologies, Inc.
#
# 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, publ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it u... |
"""
This module contains all commands for searching the database for events with given criteria. The most important function here is searchNordic and most other functions and classes are here just to support it.
Functions and Classes
---------------------
"""
import numpy as np
from datetime import date
from datetime ... |
#!/bin/env python
# Automatically translated python version of
# OpenSceneGraph example program "osgvnc"
# !!! This program will need manual tuning before it will work. !!!
import sys
from osgpypp import osgDB
from osgpypp import osgViewer
from osgpypp import osgWidget
# Translated from file 'osgvnc.cpp'
#includ... |
import glob
import json
import os
import numpy as np
import pandas as pd
import torch as T
def flat_items(d, prefix):
"""Recurses through a dict-of-dicts yielding ((key_0..key_n), value)."""
if isinstance(d, dict):
for k, v in d.items():
yield from flat_items(v, prefix + (k,))
else:
... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseForbidden, HttpResponseServerError
import hashlib
def generate_signature(params, secret):
sig = "".join(params[k].encode('utf-8') for k in sorted(params.k... |
from datetime import date
from dateutil.relativedelta import relativedelta
from unittest import TestCase
from todone.parser.format import (
ApplyFunctionFormat,
DateFormat,
PassthroughFormat,
)
class TestPassthroughFormat(TestCase):
def test_values_are_left_untouched(self):
formatter = Passth... |
# -*- coding: utf-8 -*-
import datetime
import urlparse
from collections import defaultdict
from django.shortcuts import render
import datetime
import ujson
from django.http import HttpResponse, Http404
from django.views.decorators.http import require_http_methods
### local module
from web.models import WebUrl, U... |
# Check the various features of the GoogleTest format.
# FIXME: this test depends on order of tests
# RUN: rm -f %{inputs}/googletest-upstream-format/.lit_test_times.txt
# RUN: not %{lit} -j 1 -v %{inputs}/googletest-upstream-format > %t.out
# RUN: FileCheck < %t.out %s
#
# END.
# CHECK: -- Testing:
# CHECK: PASS: g... |
"""The knitting pattern module.
Load and convert knitting patterns using the convenience functions listed
below.
"""
# there should be no imports
#: the version of the knitting pattern library
__version__ = '0.1.19'
#: an empty knitting pattern set as specification
EMPTY_KNITTING_PATTERN_SET = {"version": "0.1", "ty... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import os
from idn_completer import Completer
import core
import yaml
class SnippetCompleter(Completer):
def __init__(self, stc):
Completer.__init__(self, stc)
self.snippets = []
for path in [os.path.join(core.MainFrame.cwd, "data", "erlang", "ide_snippets.yaml"),
os.... |
#!/usr/bin/python3
import torch
import torch.nn as nn
import torch.optim as optim
from mysql.libmysql8_dev import MySQLBase
"""
1.create network
2.create training set
3.training
4.test
5.running
"""
from events import EventStockPrice
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from ... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... |
from matplotlib import pyplot as plt
from matplotlib import cm as cm
from matplotlib import mlab as ml
import numpy as np
from draggable_points import DraggablePoint
import matplotlib.patches as patches
def test_heatmap_transform():
"""
This function test the dynamic heatmap module used to help perform 2D his... |
# The MIT License (MIT)
#
# Copyright (c) 2014 Matěj Šmíd
#
# 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... |
from email import message_from_string, utils
import json
from django.db import models
from dateutil.parser import parse
class EmailManager(models.Manager):
def create_from_message(self, mailfrom, rcpttos, data):
from .models import Recipient
message = message_from_string(data)
realnames =... |
# -*- coding: utf-8 -*-
# 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,
# distribute, sub... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import j... |
# -*- coding: utf-8 -*-
# Copyright 2014 Foxdog Studios
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Deepin, Inc.
# 2012 Kaisheng Ye
#
# Author: Kaisheng Ye <kaisheng.ye@gmail.com>
# Maintainer: Kaisheng Ye <kaisheng.ye@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
# -*- coding:utf-8 -*-
import os
import flaskr
import unittest
import tempfile
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp()
flaskr.app.config['TESTING'] = True
self.app = flaskr.app.test_client()
flaskr.in... |
import re
from dateutil.relativedelta import relativedelta
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
import psycopg2.extensions
def _parse_opt_num(s):
if not s:
# For the ISO 8601 duration specifications, fields... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author : Matt Lorentzen
# Twitter : @lorentzenman
import os, sys, time, argparse
def banner():
version = "part of the spiderweb"
banner = """
_
_ __ __ _ _ _ __| | __ _ _ _
| '_ \ / _` | | | |/ _` |/ _` | | | |
| |_) | (_| | |_| ... |
"""
"""
import re
import logging
import rfc3987
import urlparse
def url_encode_non_ascii(b):
return re.sub('[\x80-\xFF]', lambda c: '%%%02x' % ord(c.group(0)), b)
def ensure_url(iri):
'''If IRI, convert to URL
If fragments (#), remove
http://stackoverflow.com/posts/4391299/revisions
'''
# i... |
# pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2008-20 pywws contributors
# 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;... |
"""
Django settings for kakeibo project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... |
from setuptools import setup, find_packages
long_description = open('README.rst').read()
setup(name='keras_tqdm',
version='1.0.7',
install_requires=['Keras', 'tqdm'],
author="Ben Striner",
author_email="bstriner@gmail.com",
url="https://github.com/bstriner/keras-tqdm",
download_url... |
from setuptools import setup, find_packages
from reversion_log.version import get_version
setup(
name='django-reversion-log',
version=get_version(),
description="Log build on revisiions.",
keywords='django, reversion',
author='Lubos Matl',
author_email='matllubos@gmail.com',
url='https://g... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from ..company import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}}-{{last_name}}',
'{{company_prefix}} {{last_name}}-{{last_name}}',
'{{c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import proteindf_tools as pdf
import logging
logger = logging.getLogger(__name__)
def main():
# parse args
parser = argparse.ArgumentParser(description='show matrix contents')
parser.add_argument("path",
nargs=1,
... |
# Generated by YCM Generator at 2016-02-07 13:10:00.249398
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... |
#! /usr/bin/python
import sys
import os
import json
import grpc
import time
import subprocess
from google.oauth2 import service_account
import google.oauth2.credentials
import google.auth.transport.requests
import google.auth.transport.grpc
from google.firestore.v1beta1 import firestore_pb2
from google.firestore.v1be... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2013-12-12
@author: samuelchen
'''
import logging, logging.handlers
import os
import sys
class LogLevelFilter(object):
def __init__(self, level):
self.__level = level
def filter(self, logRecord):
return logRecord... |
__author__ = 'mirko'
import sys
import time
import oauth2 as oauth
import json
import config as cfg
import MySQLdb
db = MySQLdb.connect(host=cfg.mysql['host'], # your host, usually localhost
user=cfg.mysql['user'], # your username
passwd=cfg.mysql['passwd'], # your password
db=cf... |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
# Copyright (c) 2015. Librato, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Terminal ... |
from p3 import P3
from pyvows import Vows, expect
import lxml
from lxml.etree import ElementBase
from lxml.html import builder as E
from lxml.html import fromstring, tostring
from lxml.cssselect import CSSSelector
@Vows.batch
class SelectionSelectAll(Vows.Context):
class SelectBody(Vows.Context):
"""se... |
"""
Django settings for redigit 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, ...)
im... |
#Rana
principal = float(
raw_input('Enter the outstanding balance on your credit card: '))
print(principal)
interest_rate = float(
raw_input('Enter the annual credit card interest rate as decimal: '))
print(interest_rate)
min_monthly_payment_rate = float(
raw_input('Enter the minimal monthly payment rate as... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/alan/dev/personal/v/ui_editar.ui'
#
# Created: Sat Jan 31 18:27:20 2015
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QSt... |
# #
# Copyright 2013-2016 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 (... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from models import _User, CSVUsuario
from forms import _UserChangeForm,_UserCreationForm
def deactivate(modeladmin, request, queryset):
queryset.update(i... |
"""Unit testing framework for the logic interpreter.
Usage: python3 logic_test.py FILE
Interprets FILE as interactive logic facts and queries, and compares each line
of printed output from the read-eval-print loop and from any output functions
to an expected output described in a comment. For example,
(query (app... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import sftoolboxmaya.utils
from sftoolboxqt import qtgui
from sftoolboxqt.widgets import ProjectWidget
class MayaProjectWidget(sftoolboxmaya.utils.DialogWidget):
"""toolbox widget
"""
def _wrapped_set_window_title(self, func):
"""wrap for the set window title to keep it synced
"""
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-28 05:54
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0001_initial'),
]
operat... |
import datetime
from urllib import urlencode
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core import urlresolvers
from django.http import HttpResponse, Http404, HttpResponsePermanentRedirect, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.template im... |
import re
from autotest.client.shared import error
from autotest.client.virt import virt_utils, virt_vm, aexpect
def run_pci_hotplug(test, params, env):
"""
Test hotplug of PCI devices.
(Elements between [] are configurable test parameters)
1) PCI add a deivce (NIC / block)
2) Compare output of m... |
import json
import urllib
from django.core import mail
from django.core.urlresolvers import reverse
from nose.tools import eq_
from abuse.models import AbuseReport
from mkt.api.tests.test_oauth import RestOAuth
from mkt.api.tests.test_throttle import ThrottleTests
from mkt.site.fixtures import fixture
from mkt.webap... |
# -*- coding: utf-8 -*-
"""
Unit tests for the spike_train_generation module.
:copyright: Copyright 2014-2016 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import os
import sys
import unittest
import warnings
import neo
import n... |
# test\TestDataEntityManager.py
import unittest
from unittest import TestCase
from datatasks.DataEntityManager import DataEntityManager
from datatasks.DataEntity import DataEntity
from datatasks.sources import FileSource
from datatasks.destinations import DatabaseDestination
class DataEntityManagerTests(TestCase):
... |
# Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from collections import defaultdict, Counter
def runoff(voters):
"""
a function that calculates an election winner from a list of voter selections using an
Instant Runoff Voting algorithm. https://en.wikipedia.org/wiki/Instant-runoff_voting
Each voter selects several candidates in order of preference.
... |
from __future__ import absolute_import, unicode_literals
import warnings
from django.conf import settings
from django.utils import six
from debug_toolbar.compat import import_module
# Always import this module as follows:
# from debug_toolbar import settings [as dt_settings]
# Don't import directly CONFIG or PANE... |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test the sendbranchmail script"""
import transaction
from lp.code.enums import (
BranchSubscriptionDiffSize,
BranchSubscriptionNotificationLevel,
CodeReviewNo... |
import itertools
from parser import Parser
from log2sqlite import cli
from parameters import JSONParamsParser, PARAMS_TAG
__author__ = 'brandon'
class GrappaLogParser(Parser):
def __init__(self, includes_params=True):
self.includes_params = includes_params
def recorditer(self, inputstr):
jpa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A full featured python IRC bot"""
import configparser
import ssl
import time
import datetime
import re
import sys
import codecs
import irc.bot
import threading
import socketserver
import signal
from jaraco.stream import buffer
from plugins.event import url_announce, Log... |
#%%
from collections import defaultdict
from nltk.corpus import brown
from nltk import bigrams
pos = defaultdict(lambda:defaultdict(int))
brown_news_tagged = brown.tagged_words(categories='news',tagset='universal')
for ((w1,t1),(w2,t2)) in bigrams(brown_news_tagged):
pos[(t1,w2)][t2] += 1
pos[('DET','right')]
#%... |
"""
The MIT License (MIT)
Copyright (c) 2014 - 2015 Jos "Zarthus" Ahrens and contributors
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 rig... |
# 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 __future__ import print_function
from __future__ import absolute_import
import os
import sys
import multiprocessing
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# Anceps Copyright (C) 2014 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of Anceps.
# Anceps is free software: you can redistribute it and/or modify
# ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# kaizen - Continuously improve, build and manage free software
#
# Copyright (C) 2011 Björn Ricks <bjoern.ricks@gmail.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 publishe... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# MonsterTV - XBMC Add-on by Juarrox (juarrox@gmail.com)
# Version 0.2.9 (18.07.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plug... |
from substitutionkeygenerator import *
from .. import utils
import random
class PermutationKeyGenerator(SubstitutionKeyGenerator):
def __init__(self, sequence=utils.alphabet, rand_func=lambda x: x ** 5, **kwargs):
"""Similar to SubstitutionTranslator, but returns just lists"""
SubstitutionKeyGenerator.__init__(se... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
from __future__ import print_function
from collections import namedtuple
import doctest
import os.path
import unittest
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import QED
doLong = False
TestData = namedtuple('TestData', 'lineNo,smiles,mol,expected')
dataNCI200 = os.path.join(RDConfig.RDCode... |
from .models import Event
import calendar
import datetime
from django.conf import settings
from django.db.models import Q
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render
from django.template.defaulttags import register
from django.template.loader import render_t... |
from os import environ
import base64
from multiprocessing import Process, Queue
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy_splash import SplashRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from misbot.mis_utils import solve_captc... |
# move.py
# 1. 导入gdb模块来访问gdb提供的python接口
import gdb
import re
map_re = re.compile('\[([0-9]*)\] = (0x[0-9a-f]*)')
# 2. 用户自定义命令需要继承自gdb.Command类
class Move(gdb.Command):
# 3. docstring里面的文本是不是很眼熟?gdb会提取该类的__doc__属性作为对应命令的文档
"""Move breakpoint
Usage: jack old_breakpoint_num new_breakpoint
Example:
... |
#!/usr/bin/env python
"""
test_alt_inputs.py: Test whether phylo2owl supports multiple input types,
including NEXUS and NexML. All of these file types should return exactly the
same RDF/XML output.
"""
import libphylo2owl
import pytest
import os
def test_newick_convert_to_OWL(path_tre):
""" Test all .tre files... |
# -*- coding: utf-8 -*-
"""
Django settings for Scoop project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_liter... |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def wunderground_to_climacons(value, arg='day'):
# Mapping form
# http://www.nickschaden.com/weather/js/main.min.js?10015
day_dict = {
"chanceflurries":"p",
"chancer... |
# (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... |
'''
Created on 28 de mar. de 2016
@author: IHC
'''
from PyQt4.QtCore import QObject, pyqtSignal
from qgis.core import QgsRectangle, QgsLayerTreeLayer, QgsLayerTreeGroup, \
QgsProject, QgsMapLayerRegistry
from qgis.utils import iface
from threading import RLock
class LayerGroupifier(QObject):
... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
from base import Task
from common import phases
from common.exceptions import TaskError
class HostDependencies(Task):
description = 'Determining required host dependencies'
phase = phases.preparation
@classmethod
def run(cls, info):
info.host_dependencies.add('debootstrap')
from common.fs.loopbackvolume imp... |
#!/usr/bin/env python3
# encoding: utf-8
import argparse
import os
import sqlite3
import json
"""import_to_sql.py: Imports the Horoscope database into a SQLite"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
parser = argparse.ArgumentParser(description="Awesome SQLite importer")... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016-2018 Mathew Topper
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
from flask import Blueprint, request, url_for, jsonify
from datetime import datetime
from app.models import Simulation, Home, Circuit, PowerConsumption, db
from app.neurioclient import neurio_api
from app.controllers import feedgenerator
api = Blueprint('api', __name__)
@api.route('/')
def home():
return jsonify(... |
# encoding: utf-8
# module gtk.gdk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so
# by generator 1.135
# no doc
# imports
from exceptions import Warning
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
import pango as __pango
import pangocairo as __p... |
import re
import os
import shutil
import sys
# Regexes are in from most used to least used regex for
# a given file pattern.
regexShow = [
'''
# Matches with Show.S01E10.mp4
^ #Beginning of a string
(?P<ShowName>.+?) #Show name
[\.\_\-\s]+ #If it has dot, underscore or dash
... |
# Copyright 2014 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.