code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import glob
import os
import shutil
from sys import argv
bulkPathBaseAE = "/data/isi/d/dhl/ec/VirtualSlides/AE-SLIDES/"
stainHPC = argv[1]
stainBulk = argv[2]
XNum = argv[3]
subDir = argv[4]
copy = argv[5]
filepath = (stainHPC+"/failed_slides/AEprocesslist.txt")
checkList = []
for i in glob.glob(stainHPC + "/" + X... | swvanderlaan/slideToolkit | utilities/qualityCheck.py | Python | mit | 1,087 |
from itty import *
@get('/')
def index(request):
try:
# Should raise an error.
return 'What? Somehow found a remote user: %s' % request.REMOTE_USER
except KeyError:
pass
return "Remote Addr: '{}' & GET name: '{}'".format(
request.REMOTE_ADDR, request.GET.get('name', 'No... | husio/itty | examples/auto_environ_access.py | Python | bsd-3-clause | 343 |
#!/usr/bin/python
# vim: expandtab tabstop=4 shiftwidth=4
"""
A Python implementation of using Notmuch with Mutt that allows for faster
search results, especially on large mailboxes.
It is a multi-threaded class that will build a mailbox to view in mutt using
Unix symlinks (ln -s) from the search query.
Prerequisite:... | mdechiaro/notmuch_mutt | notmuch_mutt.py | Python | mit | 4,881 |
# 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... | klahnakoski/jx-sqlite | vendor/jx_python/expressions/not_op.py | Python | mpl-2.0 | 619 |
#! /usr/bin/env python
from alexandra import Alexandra
from json import dumps
from sys import argv
def box_collisions(movement):
return filter(lambda c: c['entity'] == 'box', movement['collisions'])
def check_movement(movement, alex):
map(lambda c: do_collision_movement(movement, c, alex),
box_collis... | douglassquirrel/alexandra | games/boxes/components/box_collisions/box_collisions.py | Python | mit | 1,132 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | dhuang/incubator-airflow | tests/ti_deps/deps/test_runnable_exec_date_dep.py | Python | apache-2.0 | 4,422 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_labeltools_label_leaves_in_expr_with_numbered_inversion_equivalent_interval_classes_01():
pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10, 6, 5]
staff = Staff(scoretools.make_notes(pitch_numbers, [Duration(1, 8)]))
labeltools.label_leaves_in_expr_wit... | mscuthbert/abjad | abjad/tools/labeltools/test/test_labeltools_label_leaves_in_expr_with_numbered_inversion_equivalent_interval_classes.py | Python | gpl-3.0 | 856 |
#Setup Logging
import logging
log = logging.getLogger(__name__)
#Python modules
#Local modules
from ..alarm import Alarm
from ..utils import *
from telegram_stickers import stickerlist
#External modules
import telepot
class Telegram_Alarm(Alarm):
_defaults = {
'pokemon':{
#'chat_id': If no default, requir... | engle2192/PoGoMap-GUI | PokeAlarm/alarms/Telegram/telegram_alarm.py | Python | agpl-3.0 | 4,601 |
"""Cement core config module."""
import os
from abc import abstractmethod
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.fs import abspath
from ..utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class ConfigInterface(Interface):
"""
This class defines ... | datafolklabs/cement | cement/core/config.py | Python | bsd-3-clause | 6,248 |
# Copyright (C) 2017 Collin Capano
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in t... | tdent/pycbc | pycbc/cosmology.py | Python | gpl-3.0 | 24,568 |
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
# Set AJAX_FILTERED_FIELDS_AUTH_DECORATOR = None
# in your project settings if you want to give public
# access to the views.json_index view.
# Otherwise set it as a auth decorator callable
# (eg: django.contrib.au... | clamothe/django-ajax-filtered-fields | ajax_filtered_fields/settings.py | Python | mit | 1,230 |
# coding=utf-8
"""
Fluff calculators that pertain to specific cases/beneficiaries (mothers)
These are used in the Beneficiary Payment Report and Conditions Met Report
"""
import re
import datetime
from decimal import Decimal
from django.core.urlresolvers import reverse
from django.template.defaultfilters import yesno
f... | puttarajubr/commcare-hq | custom/opm/beneficiary.py | Python | bsd-3-clause | 36,797 |
# Copyright (C) 2005 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN... | liyongyue/dnsspider | dns/rdtypes/ANY/SSHFP.py | Python | isc | 2,900 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import re
import sys
from glob import glob
from os import path
from subprocess import Popen, PIPE
from sys import argv
# Local module: generator for texture lookup builtins
from texture_builtins import generate_texture_functions
builtin... | richard-sim/bgfx | 3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_builtins.py | Python | bsd-2-clause | 9,658 |
import uuid
from datetime import timedelta
import six
from pockets import cached_property, classproperty, groupify, readable_join
from residue import CoerceUTF8 as UnicodeText, UTCDateTime, UUID
from sqlalchemy import and_, exists, func, or_, select
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm... | magfest/ubersystem | uber/models/department.py | Python | agpl-3.0 | 22,150 |
import smtplib
from email.mime.text import MIMEText
from db_pool import *
def send_mail(toaddrs, subject, text):
if toaddrs is None or len(toaddrs) == 0:
return
fromaddr = envget('mailsender.fromaddr')
msg = MIMEText(text)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = to... | codexgigassys/codex-backend | src/Utils/mailSender.py | Python | mit | 694 |
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QApplication, QDesktopWidget, QToolTip, QFont
from PyQt4.QtGui import QMainWindow, QPushButton, QImage, QLabel, QLineEdit
from PyQt4.QtGui import QFileDialog, QAction, QCheckBox, QSlider, QSpinBox
from PyQt4.QtGui import QDoubleSpinBox, QPalette, QColor, QFrame
... | cjlux/Poppy-ENSAM-Talence | Environnement_programmation/Cours python/Tests/2012-juin/Correction/SPWin.py | Python | gpl-3.0 | 21,817 |
from rekt_googlecore.errors import *
| vengefuldrx/rekt-googleplaces | rekt_googleplaces/errors.py | Python | apache-2.0 | 37 |
import math
import random
import os
import platform
class vote:
def __init__(self,myManager,callback):
self.peopleVoting = [] #people allowed to vote
self.choices = [] #list of voteOptions available to vote for
self.onFinish = callback #a function taking a list of choices
self.hasSpoofing = False
self.voter... | fdavies93/irc-mafia | bot/irc_bot.py | Python | gpl-2.0 | 8,251 |
from django.core.exceptions import ValidationError
from django.test import TestCase
from django_x509.models import Ca, Cert
from . import CreateTemplateMixin, CreateVpnMixin
from ..models import Config, Vpn, VpnClient
from ..vpn_backends import OpenVpn
class TestVpn(CreateVpnMixin, CreateTemplateMixin, TestCase):
... | cosgrid001/cosgrid_dn | django_netjsonconfig/tests/test_vpn.py | Python | gpl-3.0 | 8,521 |
import argparse
import urllib2
import urllib
import os
import re
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
import httplib
import StringIO, gzip
import random
import time
_file_name = 'qiaqiafood.txt'
_url = 'http://hongbao.qiaqiafood.com/action.php'
# _file = None
_header = {'Origin': 'http:/... | softtyphoon/tz | tools/qiaqiafood.py | Python | gpl-2.0 | 2,908 |
# 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
import pkg... | tejal29/pants | src/python/pants/java/distribution/distribution.py | Python | apache-2.0 | 9,576 |
# Data and classification test functions for project 4
## tree is right traversal is wrong!!
import random
import sys
import util
import math
import copy
if(len(sys.argv)!=4): print("Need more arguments [test][train][algo]");
elif(sys.argv[0]!="decisionTree.py"): print("Wrong input format");
else:
algo = sys.argv[... | joker23/decision_tree_ai | decisionTree.py | Python | mit | 31,892 |
# -*- coding: utf-8 -*-
import os
import json
import codecs
import httplib
import functools
import furl
import itsdangerous
from flask import request
from flask import redirect
from flask import make_response
from framework.auth import Auth
from framework.sessions import Session
from framework.sentry import log_exce... | himanshuo/osf.io | website/addons/base/views.py | Python | apache-2.0 | 10,535 |
import json
from collections import OrderedDict
def print_power_rankings(teams):
index = 1
print ' TM W-L PWR WV PYTH DIFF PERC O D TO'
for id, team in sorted(teams.iteritems(), key=lambda (x, y): y['power_ranking'], reverse=True):
print '%d. %s %d-%d %.2f %.2f %.2f %.2f %.2f %.2f... | kyleaclark/nfl-power-rankings | src/output.py | Python | mit | 1,178 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | anish/buildbot | master/buildbot/test/unit/test_steps_source_p4.py | Python | gpl-2.0 | 32,234 |
#!/usr/bin/env python
traindat = '../data/fm_train_real.dat'
testdat = '../data/fm_test_real.dat'
parameter_list = [[traindat,testdat],[traindat,testdat]]
def distance_canberra_modular (train_fname=traindat,test_fname=testdat):
from modshogun import RealFeatures, CanberraMetric, CSVFile
feats_train=RealFeatures(CS... | AzamYahya/shogun | examples/undocumented/python_modular/distance_canberra_modular.py | Python | gpl-3.0 | 691 |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import OrganizationMember, OrganizationMemberTeam
from sentry.testutils import TestCase
class HelpPlatformIndexTest(TestCase):
def test_simple(self):
path = reverse('sentry-help-platform-list')
... | ewdurbin/sentry | tests/sentry/web/frontend/test_help_platform_index.py | Python | bsd-3-clause | 5,053 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@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
# t... | AndrewSamokhvalov/python-telegram-bot | tests/test_contact.py | Python | gpl-3.0 | 2,691 |
# -*- mode: python -*-
# -*- coding: iso8859-15 -*-
import pdb, os, sys, string
import traceback
import psycopg2
import psycopg2.pool
import thread
from notes_log import log
from sco_exceptions import *
from types import *
from cgi import escape
import datetime
quote_html = escape
def quote_dict( d ):
"html quot... | denys-duchier/Scolar | notesdb.py | Python | gpl-2.0 | 19,977 |
# 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 django.conf import settings
from jingo import register
from jingo_minify.helpers import css, get_css_urls
from jinj... | jicksy/oneanddone_test | oneanddone/base/helpers.py | Python | mpl-2.0 | 858 |
# -*- coding: utf-8 -*-
"""
Malort Type Mappers
-------
Type mappings for Malort results. Can be extended for other database
types.
New Mappers must inherit from AbstractMapper and implement the five
required type-mapping methods.
"""
from abc import abstractmethod
class AbstractMapper(object):
"""New Mappers n... | wrobstory/malort | malort/type_mappers.py | Python | mit | 3,571 |
from sqlalchemy import Column, Integer, Unicode, UnicodeText, \
Boolean, ForeignKey
from sqlalchemy.orm import relationship
from aston.database.models import Base, JSONDict
from aston.database.models.User import Group
from aston.database.models.Trace import DBTrace
class Palette(Base):
__t... | molliewebb/aston | aston/database/old/Palette.py | Python | gpl-3.0 | 1,870 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins... | willwray/dash | qa/rpc-tests/pruning.py | Python | mit | 16,553 |
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the centers index.") | talbenbasat/ngo-crm-server | ngo_crm_server/centers/views.py | Python | gpl-2.0 | 164 |
import argparse
from satistjenesten import data
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('input_filepath', nargs=1, type=str)
parser.add_argument('output_filepath', nargs=1)
parser.add_argument('--config_filepath', '-c', required=True)
parser.add_argument('--area_nam... | mitkin/avhrr-sic-analysis | scripts/resample_avhrr.py | Python | mit | 836 |
"""Copyright 2008 Orbitz WorldWide
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... | dkulikovsky/graphite-ch-web | webapp/graphite/account/models.py | Python | apache-2.0 | 1,634 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | erja-gp/openthread | tools/harness-automation/cases/router_9_2_15.py | Python | bsd-3-clause | 1,877 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, extract_email_id
from erpnext.controllers.status_updater import StatusUpdater
class Contact(StatusUpdater... | indictranstech/tele-erpnext | erpnext/utilities/doctype/contact/contact.py | Python | agpl-3.0 | 2,520 |
#
# pythologic2.py
#
# Add logic programming (Prolog) syntax and *resolution* into Python.
#
# (c) 2004 Francisco Coelho
# after (c) 2004 Shai Berger
# and AIMA examples
#
import string
import copy
class Struct:
def __init__(self, database, head, subs):
"""
The head and subs are essential - what... | ActiveState/code | recipes/Python/360698_Extending_pythprolog_syntax/recipe-360698.py | Python | mit | 8,888 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-28 06:08
from __future__ import unicode_literals
import wizard_builder.model_helpers
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wizard_builder', '0037_auto_20171028_0142'),
]
operati... | SexualHealthInnovations/django-wizard-builder | wizard_builder/migrations/0038_checkbox_radiobutton.py | Python | bsd-3-clause | 981 |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 20:41:09 2015
@author: oliver
"""
import numpy as np
from sympy import symbols
import mubosym as mbs
###############################################################
# general system setup example
myMBS = mbs.MBSworld('strange_pendulum', connect=False, force_db_setup... | DocBO/mubosym | exa_4_strange_pendulum.py | Python | mit | 2,273 |
# This file is part of Headphones.
#
# Headphones 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.
#
# Headphones is distributed i... | dpendl00/headphones | headphones/albumart.py | Python | gpl-3.0 | 1,448 |
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... | doug-fish/neutron-lbaas-dashboard | neutron_lbaas_dashboard/dashboards/project/ngloadbalancersv2/urls.py | Python | apache-2.0 | 921 |
from twilio.rest.resources import InstanceResource, ListResource
class Credential(InstanceResource):
def update(self, **kwargs):
"""Update this credential."""
return self.parent.update_instance(self.name, **kwargs)
def delete(self):
"""
Delete this credential.
"""
... | kamladi/textback-web | twilio/rest/resources/sip_credential_lists.py | Python | mit | 2,380 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | rwl/PyCIM | CIM15/IEC61970/LoadModel/NonConformLoadSchedule.py | Python | mit | 2,946 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-03 08:41
from __future__ import unicode_literals
from django.db import migrations
from ovp.apps.core.helpers import generate_slug
def foward_func(apps, schema_editor):
Channel = apps.get_model("channels", "Channel")
Skill = apps.get_model("core... | atados/atados-ovp | api/channels/icn/migrations/0002_remove_skills_and_causes.py | Python | agpl-3.0 | 761 |
from django.apps import AppConfig
class PdsoauthConfig(AppConfig):
name = 'pdsoauth'
| Sunnepah/iupds-appscale | pdsoauth/apps.py | Python | bsd-3-clause | 91 |
#
# Copyright (c) SAS Institute 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 w... | sassoftware/mint | mint/rest/middleware/error.py | Python | apache-2.0 | 3,212 |
#! /usr/bin/env python3
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
if __name__ == "__main__":
width = 5
time_array = np.linspace(-np.pi*width, np.pi*width, 64*width)
sawtooth = signal.sawtooth(time_array*5)
square = signal.square(time_array*4)
sine = 2*n... | ptracton/LearningDSP | DSPLib/waveshapes.py | Python | mit | 1,305 |
"""
Test used to verify PyWavelets Discrete Wavelet Transform computation
accuracy against MathWorks Wavelet Toolbox.
"""
from __future__ import division, print_function, absolute_import
import os
import numpy as np
from numpy.testing import assert_, dec, run_module_suite
import pywt
if 'PYWT_XSLOW' in os.environ:
... | aaren/pywt | pywt/tests/test_matlab_compatibility.py | Python | mit | 4,763 |
"""
Accessors for related objects.
When a field defines a relation between two models, each model class provides
an attribute to access related instances of the other model class (unless the
reverse accessor has been disabled with related_name='+').
Accessors are implemented as descriptors in order to customize acces... | vincepandolfo/django | django/db/models/fields/related_descriptors.py | Python | bsd-3-clause | 47,154 |
"""Utility classes for creating workable pylons controllers for unit
testing.
These classes are used solely by Pylons for unit testing controller
functionality.
"""
import gettext
import pylons
from pylons.configuration import request_defaults, response_defaults
from pylons.controllers.util import Request, Response
... | grepme/CMPUT410Lab01 | virt_env/virt1/lib/python2.7/site-packages/Pylons-1.0.1-py2.7.egg/pylons/testutil.py | Python | apache-2.0 | 3,105 |
import shutil
from distutils.core import setup
import py2exe
setup(console=['export.py'])
shutil.rmtree('build')
| gnu-lorien/puppeteer | compile_exporter.py | Python | agpl-3.0 | 120 |
import os
import sys
import tarfile
if sys.version_info >= (3, 3):
from os import replace
else:
# POSIX rename() is always atomic
from os import rename as replace
with tarfile.open("pyskeleton.tar.gz", "w:gz") as tar:
for name in ["setup.cfg", "LICENSE", "README.md", "requirements.txt",
... | a358003542/skeleton | create_tar.py | Python | mit | 486 |
import sqlite3
class Model():
# Constructor
def __init__(self):
self.setHomeScreenOp(-1)
self.setViewPointer(None)
# Setters
def setViewPointer(self,pointer):
self.viewPointer = pointer
def setHomeScreenOp(self,option):
self.homeScreenOp = option
if(self.getHomeScreenOp() != -1):
if(self.getHomeS... | Chagall/dutch-eng-dictionary | Object Oriented Implementation (current)/Model.py | Python | mit | 3,152 |
# -*- coding: UTF-8 -*-
"""
Lastship Add-on (C) 2019
Credits to Lastship, Placenta and Covenant; our thanks go to their creators
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, e... | lastship/plugin.video.lastship | resources/lib/sources/de/kinoger.py | Python | gpl-3.0 | 9,445 |
#!/usr/bin/env python
import cgi
header = 'Content-Type: text/html\n\n'
formhtml = '''<HTML><HEAD><TITLE>
Friends CGI Demo</TITLE></HEAD>
<BODY><H3>Friends list for: <I>NEW USER</I></H3>
<FORM ACTION="/cgi-bin/friends2.py">
<B>Enter your Name:</B>
<INPUT TYPE=hidden NAME=action VALUE=edit>
<INPUT TYPE=text NAME=pers... | opensvn/test | src/study/python/cpp/ch20/friends2.py | Python | gpl-2.0 | 1,407 |
from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel
from endpoints_proto_datastore.ndb import EndpointsAliasProperty
from protorpc import messages
class ActivityType(EndpointsModel):
_message_fields_schema = ('id', 'tag', 'description', 'group')
_api_key = None
... | GoogleDeveloperExperts/experts-app-backend | models/activity_type.py | Python | apache-2.0 | 1,232 |
# encoding: utf-8
'''
Created on Jul 4, 2017
@author: byhx_lcc
'''
print "Start learn python";
days = ['Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday']
print days[1];
word = 'word'
sentence = "这是一个句子。"
paragraph = """这是一个段落。
包含了多个语句"""
print word; # 这是一个注释
'''
test = 123
'''
# ... | lichaochao503/Python27 | src/Test/20170704py2.py | Python | gpl-3.0 | 757 |
from django.core.management.base import BaseCommand, AppCommand
from django.db import connection, transaction
import os
class Command(BaseCommand):
help = "Installs a cleangeometry function in postgres required for processing incoming geometries."
def handle(self, **options):
path = os.path.abspat... | Alwnikrotikz/marinemap | lingcod/common/management/commands/install_cleangeometry.py | Python | bsd-3-clause | 744 |
from fail2ban.server.action import ActionBase
class TestAction(ActionBase):
def __init__(self, jail, name, opt1, opt2=None):
super(TestAction, self).__init__(jail, name)
self._logSys.debug("%s initialised" % self.__class__.__name__)
self.opt1 = opt1
self.opt2 = opt2
self._... | TonyThompson/fail2ban-patch | fail2ban/tests/files/action.d/action.py | Python | gpl-2.0 | 831 |
"""
Weather information for air and road temperature, provided by Trafikverket.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.trafikverket_weatherstation/
"""
import asyncio
from datetime import timedelta
import logging
import aiohttp
import vo... | jamespcole/home-assistant | homeassistant/components/trafikverket_weatherstation/sensor.py | Python | apache-2.0 | 5,210 |
#
# Copyright (C) 2008, 2013, 2014 Red Hat, Inc.
# Copyright (C) 2008 Cole Robinson <crobinso@redhat.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
# ... | shugaoye/virt-manager | virtManager/createpool.py | Python | gpl-2.0 | 19,376 |
"""templates.unix.system Module"""
import cairn
from cairn import Options
def getSubModuleString(sysdef):
str = "OS; Arch; Machine; Paths; drives; "
if Options.get("command") == "copy":
str = str + "partitions; BootLoader; "
str = str + "Summary; verify"
return str
| redshodan/cairn | src/python/cairn/sysdefs/templates/unix/system/__init__.py | Python | gpl-2.0 | 277 |
from __future__ import absolute_import
import contextlib
import os
import subprocess
import sys
import tempfile
from Qt import QtWidgets, QtCore
Qt = QtCore.Qt
from . import tickets
class Dialog(QtWidgets.QDialog):
def __init__(self, exceptions=None, allow_no_exception=True):
super(Dialog, self).__... | westernx/sgactions | sgactions/ticketui.py | Python | bsd-3-clause | 6,847 |
# -*- coding: utf-8 -*-
import re
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.encoding import force_text
from django.utils.http import urlencode
from django.utils.six.moves.urllib.parse import urlparse
import cms
from cms.utils.conf import get_cms_setting
# checks... | netzkolchose/django-cms | cms/utils/urlutils.py | Python | bsd-3-clause | 2,956 |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 21 16:09:05 2016
@author: alexa
"""
import pandas as pd
from sklearn.cross_validation import train_test_split
from sklearn import preprocessing
from sklearn.svm import LinearSVC
from sklearn.naive_bayes import BernoulliNB
from sklearn.neighbors import KNeighb... | HugoLG/SFCrimeClassification | kaggle.py | Python | mit | 1,844 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | rmcgibbo/psi4public | psi4/driver/constants/physconst.py | Python | lgpl-3.0 | 3,542 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.notifications import email_sender, make_email
from indico.modules.rb.notifications.reserv... | mvidalgarcia/indico | indico/modules/rb/notifications/reservation_occurrences.py | Python | mit | 2,635 |
#!/usr/bin/env python
# (c) 2014, Will Thames <will@thames.id.au>
#
# ansible-inventory-grapher 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... | willthames/ansible-inventory-grapher | lib/ansibleinventorygrapher/__main__.py | Python | gpl-3.0 | 7,083 |
# Copyright 2011 OpenStack LLC.
# Copyright 2011 Nebula, 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/LICENS... | tylertian/Openstack | openstack F/python-keystoneclient/keystoneclient/v3/projects.py | Python | apache-2.0 | 3,101 |
# prog6_9.py
# This program returns a babysitting bill based on start and stop times
# <Chad Hobbs>
def main(): # Main program
bill = 0
flag = 0
while flag != 1:
start = input("Please enter at what time the babysitter started in hh:mm format(ie: 5:15 am) ")
finish = input("... | itsallvoodoo/csci-school | CSCI220/Week 08 - MAR05-09/prog6_9.py | Python | apache-2.0 | 1,432 |
"""Various small utilities that might be useful everywhere"""
import os
import inspect
from enum import Enum as _Enum
from functools import wraps
from operator import attrgetter
from itertools import chain, count
from collections import OrderedDict
import warnings
# Exposed here for convenience. Prefer patching to try... | cheral/orange3 | Orange/util.py | Python | bsd-2-clause | 7,730 |
from PyObjCTools.TestSupport import *
import AppKit
class TestNSPageController (TestCase):
@min_os_level('10.8')
def testConstants10_8(self):
self.assertEqual(AppKit.NSPageControllerTransitionStyleStackHistory, 0)
self.assertEqual(AppKit.NSPageControllerTransitionStyleStackBook, 1)
self... | albertz/music-player | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nspagecontroller.py | Python | bsd-2-clause | 430 |
#-----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
#-----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import psutil
import random
import resource
import select
import signal
im... | trabacus-softapps/openerp-8.0-cc | openerp/service/server.py | Python | agpl-3.0 | 32,015 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('viewflow', '0001_initial'),
]
op... | codingjoe/viewflow | tests/examples/customnode/migrations/0001_initial.py | Python | agpl-3.0 | 1,556 |
# Copyright 2012 IBM Corp.
#
# 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, sof... | luogangyi/bcec-nova | nova/servicegroup/drivers/db.py | Python | apache-2.0 | 4,400 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | hanzorama/magenta | magenta/models/shared/melody_rnn_model.py | Python | apache-2.0 | 3,253 |
# Copyright (C) 2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | stewartsmith/bzr | bzrlib/tests/test_smart_signals.py | Python | gpl-2.0 | 7,754 |
import Adafruit_BBIO.ADC as ADC
import time
import twitter
import settings
import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
filename=settings.LOG_FILE)
# create logger
logger = logging.getLogger('door_alarm')
... | urlgrey/beaglebone_entry_alarm | door_alarm.py | Python | mit | 2,175 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from GestureAgents.Events import Event, EventClient
import GestureAgents.Reactor as Reactor
try:
from classlogger import ClassLogged
except ImportError:
ClassLogged = type
class RecognizerFailedException(Exception):
pass
class Autonamed(object):
__numc... | chaosct/ofxGestureAgents | example/bin/data/GestureAgents/Recognizer.py | Python | mit | 8,055 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# url(r'^admin/', include(admin.site.urls)),
)
| Hackstuff/EliteNotes | EliteNotes/urls.py | Python | mit | 186 |
#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | nuclear-wizard/moose | python/peacock/tests/base/test_PeacockCollapsibleWidget.py | Python | lgpl-2.1 | 1,614 |
# -*- coding: utf-8 -*-
import pytest
import sys
import os
import logging
import itertools
import glob
import subprocess
from flexmock import flexmock
try:
from cStringIO import StringIO
except:
try:
from StringIO import StringIO
except:
from io import StringIO
from devassistant.dapi import ... | hroncok/devassistant | test/dapi/test_dap.py | Python | gpl-2.0 | 21,493 |
from numpy import (linspace, zeros, meshgrid, abs, empty, arange, int32,
unravel_index, dtype)
from multiprocessing import Pool
from ..solvers import solver_dict, get_solver_name
# attempt to import plotting libraries
try:
from matplotlib import pyplot
from mpl_toolkits.mplot3d import axes3... | aebrahim/cobrapy | cobra/flux_analysis/phenotype_phase_plane.py | Python | lgpl-2.1 | 12,258 |
from __future__ import division, absolute_import, print_function
import platform
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import TestCase, run_module_suite, assert_, assert_equal, \
dec
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
... | DailyActie/Surrogate-Model | 01-codes/numpy-master/numpy/core/tests/test_half.py | Python | mit | 18,533 |
# -*- coding: utf-8 -*-
"""
magrathea.utils.singleton
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the RootForum.org team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
class Singleton:
"""
Decorator class to turn any other class into a lazy singleton.
This c... | RootForum/magrathea | magrathea/utils/singleton.py | Python | mit | 3,002 |
# Copyright (c) 2013-2021 khal 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 rights to use, copy, modify, merge, publi... | pimutils/khal | khal/settings/utils.py | Python | mit | 8,737 |
"""
pysd.py
Contains all the code that will be directly accessed by the user in normal operation.
Also contains some private members to facilitate integration, setup, etc.
History
--------
August 15, 2014: created
June 6 2015: Major updates - version 0.2.5
Jan 2016: Rework to handle subscripts
May 2016: Updates to ha... | SimonStrong/pysd | pysd/pysd.py | Python | mit | 1,486 |
"""
Discovery: broadcasts a query, attempting to discover all running RPyC servers
over the local network/specific subnet.
"""
import socket
import select
import struct
__all__ = ["discover_servers"]
UDP_DISCOVERY_PORT = 18813
QUERY_MAGIC = "RPYC_QUERY"
MAX_DGRAM_SIZE = 100
def discover_servers(subne... | deanhiller/databus | webapp/play1.3.x/python/Lib/site-packages/Rpyc/Utils/Discovery.py | Python | mpl-2.0 | 1,000 |
#!/usr/bin/env python
r"""Compute SSP/PCA projections for EOG artifacts.
Examples
--------
.. code-block:: console
$ mne compute_proj_eog -i sample_audvis_raw.fif \
--l-freq 1 --h-freq 35 \
--rej-grad 3000 --rej-mag 4000 --rej-eeg 100
or
.. code-block:: cons... | adykstra/mne-python | mne/commands/mne_compute_proj_eog.py | Python | bsd-3-clause | 8,102 |
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import enum
from sqlalchemy import (Column,
Integer,
DateTime,
ForeignKey,
)
from sqlalchemy.types import Enum
from... | laslabs/Python-Carepoint | carepoint/models/phone_mixin.py | Python | mit | 1,139 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'spellcheck.ui'
#
# Created: Thu Jul 30 01:27:24 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... | lucidlylogicole/scope | plugins/spellcheck/spellcheck_ui.py | Python | gpl-3.0 | 7,193 |
# -*- coding: utf-8 -*-
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# PAWTRAIN
#
# Pet underground railroad
#
#
# Authors: Baron L. Chandler, baron@venturecranial.com
# -----------------------------------------------------------------------
# COPYRIGHT ©2014 Venture Cranial, LLC
#... | VentureCranial/PawTrain | app/pawtrain/settings.py | Python | gpl-2.0 | 6,978 |
"""
Decisionbot - A simple IRC bot to help make "coin flip" decisions.
botname: x or y?
=> x
botname: a or b or c?
=> b
"""
import random
import re
from irclib import nm_to_n
class Decisionbot():
def __init__(self, config, queue):
self.queue = queue
nickname = config.get("main"... | adblockplus/abpbot | decisionbot.py | Python | gpl-2.0 | 1,079 |
# Copyright (c) 2014 The Jgcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-jgcoinrpc to module search path:
import os
import sys
sys.path.append(o... | cptecdfi/jgcoins | qa/rpc-tests/util.py | Python | mit | 5,237 |
"""ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class xcb_util(ShutItModule):
def build(self, shutit):
import sd_util
sd_util.setup_x_environment(shutit)
shutit.send('mkdir -p /tmp/build/xcb_util')
shutit.send('cd /tmp/build/xcb_util')
shutit.send('wget -qO- http://xcb.f... | ianmiell/shutit-distro | xcb_util/xcb_util.py | Python | gpl-2.0 | 1,004 |
import argparse
import subprocess
import os
import textwrap
class Argparser():
def __init__(self, parent):
self.parent = parent
self.args = self.get_args()
if not self.args.availdir:
self.args.availdir = os.path.realpath(
"{}/../conf.avail".format(self.args.arg... | seahawk1986/yavdrctl | yavdrctl/arguments.py | Python | gpl-2.0 | 5,526 |
import re
from . import tokens
from .exceptions import SourceException
from .src_loc import SourceLocation
LEFT_ANGLE_BRACKET = '<'
RIGHT_ANGLE_BRACKET = '>'
TEXT_BACKSLASH_CHARS = {LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET, '[', ']', '\\'}
STRING_LITERAL_BACKSLASH_CHARS = {'"', '\\'}
class LexError(SourceException)... | irskep/computerwords | computerwords/markdown_parser/html_lexer.py | Python | bsd-3-clause | 6,326 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.