repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
saurabh6790/med_new_app | refs/heads/develop | hr/utils.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
@webnotes.whitelist()
def get_leave_approver_list():
roles = [r[0] for r in webnotes.conn.sql("""select dist... |
brendan-ward/rasterio | refs/heads/master | tests/test_indexing.py | 1 | """Test windows and indexing"""
# TODO: break up multi-assertion tests.
import numpy as np
import pytest
import rasterio
from rasterio.errors import WindowError
from rasterio import windows
DATA_WINDOW = ((3, 5), (2, 6))
def assert_window_almost_equals(a, b, precision=3):
for pair_outer in zip(a, b):
... |
snyderek/floating_temple | refs/heads/master | third_party/gmock-1.7.0/scripts/generator/cpp/gmock_class.py | 268 | #!/usr/bin/env python
#
# Copyright 2008 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 requi... |
gymnasium/edx-platform | refs/heads/open-release/hawthorn.master | common/lib/xmodule/xmodule/modulestore/tests/test_store_utilities.py | 9 | """
Tests for store_utilities.py
"""
import unittest
from mock import Mock
import ddt
from xmodule.modulestore.store_utilities import (
get_draft_subtree_roots, draft_node_constructor
)
@ddt.ddt
class TestUtils(unittest.TestCase):
"""
Tests for store_utilities
ASCII trees for ONLY_ROOTS and SOME_TRE... |
kaspermunch/CoalhmmPipeline | refs/heads/master | CoalhmmPipeline/Masking.py | 1 | import re, sys
from MAF import *
from array import array
class Masking(object):
def __init__(self, annotation):
self.annotation = annotation
# # get overlapping intervals (assumes sorted and collapsed annotation)
# # read in annotation and build Bisection index for each chromosom... |
Yannig/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_bgp.py | 27 | #!/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... |
LoHChina/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/281_placeholder.py | 830 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Kagami/kisa | refs/heads/master | lib/twisted/lore/test/test_lint.py | 11 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.lore.lint}.
"""
import sys
from xml.dom import minidom
from cStringIO import StringIO
from twisted.trial.unittest import TestCase
from twisted.lore.lint import getDefaultChecker
from twisted.lore.process import Processing... |
sugarguo/Flask_Blog | refs/heads/master | ext_lib/sqlalchemy/orm/query.py | 20 | # orm/query.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Defines the :class:`.Query` class, the central
constru... |
rvmoura96/projeto-almoxarifado | refs/heads/master | myvenv/Lib/site-packages/astroid/tests/testdata/python2/data/invalid_encoding.py | 12 | # -*- coding: lala -*- |
erdincay/youtube-dl | refs/heads/master | youtube_dl/extractor/daum.py | 118 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class DaumIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)'
IE_NAME = 'daum.net'
_TESTS = [{
... |
beblount/Steer-Clear-Backend-Web | refs/heads/web | env/Lib/site-packages/requests/packages/chardet/charsetgroupprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... |
lertech/extra-addons | refs/heads/master | project_sla/tests/__init__.py | 21 | from . import test_compute_sla_date
fast_suite = [
test_compute_sla_date,
]
|
JCBarahona/edX | refs/heads/master | cms/djangoapps/contentstore/courseware_index.py | 4 | """ Code to allow module store to interface with courseware index """
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from datetime import timedelta
import logging
import re
from six import add_metaclass
from django.conf import settings
from django.utils.translation import ugettext as _
... |
hackerkid/zulip | refs/heads/master | zerver/tests/test_signup.py | 1 | import datetime
import re
import smtplib
import time
import urllib
from typing import Any, List, Optional, Sequence
from unittest.mock import MagicMock, patch
from urllib.parse import urlencode
import orjson
from django.conf import settings
from django.contrib.auth.views import PasswordResetConfirmView
from django.con... |
snasoft/QtCreatorPluginsPack | refs/heads/master | Bin/3rdParty/vera/bin/lib/email/feedparser.py | 114 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... |
jmesteve/medical | refs/heads/master | history/migrate/4.0.0-4.2.0/pre.py | 52 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
Laurawly/tvm-1 | refs/heads/master | tests/python/topi/python/test_topi_batch_matmul.py | 1 | # 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 u... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/python2.7/mimify.py | 304 | #! /usr/bin/env python
"""Mimification and unmimification of mail messages.
Decode quoted-printable parts of a mail message or encode using
quoted-printable.
Usage:
mimify(input, output)
unmimify(input, output, decode_base64 = 0)
to encode and decode respectively. Input and output may be the name
of... |
fe11x/pythondotorg | refs/heads/master | community/tests/test_views.py | 10 | from pydotorg.tests.test_classes import TemplateTestCase
from ..models import Post
class CommunityTagsTest(TemplateTestCase):
def test_render_template_for(self):
obj = Post.objects.create(
content='text post',
media_type=Post.MEDIA_TEXT,
status=Post.STATUS_PRIVATE
... |
jorik041/paramiko | refs/heads/master | paramiko/config.py | 33 | # Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
# Copyright (C) 2012 Olle Lundberg <geek@nerd.sh>
#
# This file is part of paramiko.
#
# Paramiko 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 F... |
CartesianCo/argentum-control | refs/heads/develop | src/ship.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Argentum Control GUI
Copyright (C) 2013 Isabella Stevens
Copyright (C) 2014 Michael Shiel
Copyright (C) 2015 Trent Waddington
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... |
jinankjain/zamboni | refs/heads/master | migrations/600-theme-description.py | 23 | #!/usr/bin/env python
from addons.models import Addon
import amo
def run():
"""
Migrate summary to description field for a handful of themes after
getpersonas migration.
"""
addons = Addon.objects.filter(
type=amo.ADDON_PERSONA, description__isnull=True,
summary__isnull=False)
... |
tseaver/google-cloud-python | refs/heads/master | vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py | 573 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
|
vmora/QGIS | refs/heads/master | python/PyQt/PyQt5/QtWidgets.py | 17 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QtWidgets.py
---------------------
Date : November 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
************************... |
mewbak/idc | refs/heads/master | aterm/build.py | 1 | '''Term building from patterns.'''
from aterm.factory import factory
from aterm import exception
from aterm import convert
from aterm import parser
class Build(object):
'''Build context.'''
def __init__(self, args, kargs):
self.args = args
self.kargs = kargs
class Builder(object):
'''Base class for all te... |
ARL-UTEP-OC/emubox | refs/heads/master | workshop-creator/bin/src/gui/widgets/DownloadTreeWidget.py | 1 | import logging
import gi; gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from src.gui_constants import PADDING
class DownloadTreeWidget(Gtk.Grid):
def __init__(self):
logging.debug("Creating DownloadTreeWidget")
super(DownloadTreeWidget, self).__init__()
self.set_border_w... |
sander76/home-assistant | refs/heads/dev | tests/components/zwave/__init__.py | 72 | """Tests for the Z-Wave component."""
|
BMJHayward/django | refs/heads/master | django/contrib/gis/geos/prototypes/geom.py | 288 | from ctypes import POINTER, c_char_p, c_int, c_size_t, c_ubyte
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero,
)
# This is the return type used by bina... |
TeachAtTUM/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/management/commands/saml.py | 25 | # -*- coding: utf-8 -*-
"""
Management commands for third_party_auth
"""
from django.core.management.base import BaseCommand, CommandError
import logging
from third_party_auth.tasks import fetch_saml_metadata
class Command(BaseCommand):
""" manage.py commands to manage SAML/Shibboleth SSO """
help = '''Config... |
erwilan/ansible | refs/heads/devel | lib/ansible/modules/monitoring/honeybadger_deployment.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Benjamin Curtis <benjamin.curtis@gmail.com>
#
# 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 versi... |
BTCGPU/BTCGPU | refs/heads/master | test/functional/wallet_importprunedfunds.py | 15 | #!/usr/bin/env python3
# Copyright (c) 2014-2018 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 the importprunedfunds and removeprunedfunds RPCs."""
from decimal import Decimal
from test_framew... |
garimakhulbe/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyString/autorestswaggerbatservice/operations/enum_operations.py | 3 | # 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 ... |
bopo/PopClip-Extensions | refs/heads/master | source/InstantTranslate/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
jeasoft/odoo | refs/heads/marcos-8.0 | comunity_modules/account_journal_security/account.py | 5 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class account_journal(osv.osv):
_name = 'account.journal'
_inherit = 'account.journal'
_columns = {
'user_ids': fields.many2many('res.users', 'journal_security_journal_users', 'journal_id',
'user_id', string='Restricted to User... |
oasis-open/cti-stix-elevator | refs/heads/master | stix2elevator/cli.py | 1 | #!/usr/bin/env python
"""The stix2-elevator is a work-in-progress. It should be used to explore how
existing STIX 1.x would potentially be represented in STIX 2.0. Using the
current version of the stix2-elevator will provide insight to issues that might
need to be mitigated to convert your STIX 1.x content.
"""
# Sta... |
comino/superJump | refs/heads/master | node_modules/mosca/node_modules/leveldown/node_modules/prebuild/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... |
arth-co/saleor | refs/heads/master | saleor/product/templatetags/discount.py | 27 | from django import template
register = template.Library()
@register.filter
def discounted_price(item, discounts):
return item.get_price(discounts=discounts)
@register.filter
def discounted_price_range(item, discounts):
return item.get_price_range(discounts=discounts)
@register.filter
def price_difference... |
manuts/gr-ldpc | refs/heads/master | python/test_bsc.py | 1 | from gnuradio import gr, digital, blocks, analog
import ldpc
import numpy as np
import random, array, copy
class my_tb(gr.top_block):
def __init__(self, fname, epsilon, max_iterations):
gr.top_block.__init__(self)
self.src = blocks.vector_source_b(())
print "initializing encoder"
se... |
rahushen/ansible | refs/heads/devel | lib/ansible/modules/database/mysql/mysql_variables.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Balazs Pocze <banyek@gawker.com>
# Certain parts are taken from Mark Theunissen's mysqldb module
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metac... |
Cojacfar/Maker | refs/heads/master | comm/lib/python2.7/site-packages/django/core/serializers/xml_serializer.py | 113 | """
XML serializer.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.serializers import base
from django.db import models, DEFAULT_DB_ALIAS
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import smart_text
from xml.dom import pulldom
from x... |
Dziolas/invenio | refs/heads/scoap3 | modules/miscutil/lib/upgrades/invenio_2013_09_02_new_bibARXIVPDF.py | 18 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... |
mach6/selenium | refs/heads/master | py/test/selenium/webdriver/common/api_example_tests.py | 13 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
ronyfadel/iTerm2 | refs/heads/master | tools/ply/ply-3.4/ply/ctokens.py | 363 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... |
roadmapper/ansible | refs/heads/devel | lib/ansible/modules/database/postgresql/postgresql_slot.py | 6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, John Scalia (@jscalia), Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... |
ESS-LLP/erpnext | refs/heads/develop | erpnext/patches/v11_0/rename_overproduction_percent_field.py | 18 | # Copyright (c) 2018, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe.model.utils.rename_field import rename_field
import frappe
def execute():
frappe.reload_doc('manufacturing', 'doctype', 'manufacturing_settings')
rename_field('... |
xxsergzzxx/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/utils/__init__.py | 409 | """Toolkit for crypto and other stuff."""
__all__ = ["AES",
"ASN1Parser",
"cipherfactory",
"codec",
"Cryptlib_AES",
"Cryptlib_RC4",
"Cryptlib_TripleDES",
"cryptomath: cryptomath module",
"dateFuncs",
"hmac",
"... |
bsmedberg/socorro | refs/heads/master | minidump-stackwalk/jsoncpp-src-0.5.0/test/rununittests.py | 249 | import sys
import os
import os.path
import subprocess
from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes'
class TestProxy(object):
def __init__( self, test_exe_path, use_valgrind=False ):
self.test_exe_path = os.path.normpath( os.path.a... |
75651/kbengine_cloud | refs/heads/master | kbe/src/lib/python/Tools/pynche/__init__.py | 2547 | # Dummy file to make this directory a package.
|
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/scripts/fixcid.py | 36 | #! /usr/bin/env python
# Perform massive identifier substitution on C source files.
# This actually tokenizes the files (to some extent) so it can
# avoid making substitutions inside strings or comments.
# Inside strings, substitutions are never made; inside comments,
# it is a user option (off by default).
#
# The su... |
Debian/openjfx | refs/heads/master | modules/web/src/main/native/Tools/Scripts/webkitpy/style/checkers/common.py | 8 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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
# notice, this list of conditions and... |
sakuraba001/android_kernel_samsung_tblte | refs/heads/cm-13.0 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
roots/trellis | refs/heads/master | lib/trellis/plugins/vars/version.py | 4 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import __version__
from ansible.errors import AnsibleError
from distutils.version import LooseVersion
from operator import eq, ge, gt
from sys import version_info
try:
from __main__ ... |
JetBrains/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/help.py | 91 | # help.py - help data for mercurial
#
# Copyright 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import gettext, _
import itertools, sys, os, error
import extensions, revset, fileset,... |
Rudloff/youtube-dl | refs/heads/master | youtube_dl/extractor/azubu.py | 10 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
sanitized_Request,
)
class AzubuIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)'
_TESTS = [
{
'ur... |
thnkloud9/verifiedpixel | refs/heads/master | server/vpp/archive/ingest_io.py | 3 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... |
krux/adspygoogle | refs/heads/master | examples/adspygoogle/dfp/v201206/get_teams_by_statement.py | 2 | #!/usr/bin/python
#
# Copyright 2012 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 b... |
kazuoteramoto/alot | refs/heads/master | alot/crypto.py | 2 | # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import re
from email.generator import Generator
from cStringIO import StringIO
from alot.errors import GPGProblem
from email.mime.mult... |
Millyn/Pytools | refs/heads/master | jhm_mysql.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mllyn
# @Date: 2014-12-31 15:26:59
# @Last Modified by: mllyn
# @Last Modified time: 2014-12-31 15:54:28
import random
import MySQLdb
db = MySQLdb.connect("localhost", "root", "123456", "Python")
cursor = db.cursor()
cursor.execute("DROP TABLE IF EXISTS JHM... |
adoosii/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/tests/test_models.py | 15 | """
Unit tests for bulk-email-related models.
"""
from django.test import TestCase
from django.core.management import call_command
from django.conf import settings
from student.tests.factories import UserFactory
from mock import patch, Mock
from nose.plugins.attrib import attr
from bulk_email.models import CourseEma... |
Kalashnikitty/ville-kernel | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
zaja1kun/local-chat | refs/heads/master | chat/cli/commands.py | 1 | import cmd
import urwid
class CommandDispatcherBase(cmd.Cmd):
"""Base class for mapping app command names to command functionality.
If you want to add a new command to app just add new method like
do_<command_name>(self, line). Line contains string with command arguments.
Note that command n... |
quantmind/pulsar-queue | refs/heads/master | tests/test_msgpack.py | 1 | """Tests task execution with MsgPack serialiser"""
import unittest
try:
import msgpack
except ImportError:
msgpack = None
from tests import app
@unittest.skipUnless(msgpack, "Requires msgpack library")
class TestMsgPackQueue(app.TaskQueueApp, unittest.TestCase):
message_serializer = 'msgpack'
|
kevincwright/quagmire | refs/heads/master | atomic/Na23.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 21 10:42:26 2016
@author: Kevin
"""
#******************************************************************************
'Na23' : { # Primary data source: Daniel A. Steck http://steck.us/alkalidata
'species': '^{23}Na',
# Electronic configuration
'co... |
zimmermant/dlvo_lammps | refs/heads/master | tools/moltemplate/src/nbody_alternate_symmetry/nbody_Impropers_Icenter_swapJK.py | 35 | from nbody_graph_search import Ugraph
# To find 4-body "improper" interactions,
# (by default, most of the time), we would use this subgraph:
# 3
# * 1st bond connects atoms 0 and 1
# | => 2nd bond connects atoms 0 and 2
# _.*._ ... |
jasonseminara/OpenSourceFinal | refs/heads/master | myvenv/lib/python3.5/site-packages/pip/commands/uninstall.py | 798 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... |
mosdef-hub/foyer | refs/heads/master | foyer/forcefields/forcefields.py | 1 | """Support user-created forcefield XML files."""
import glob
import os
import warnings
from pkg_resources import resource_filename
from foyer import Forcefield
from foyer.validator import ValidationWarning
def get_ff_path():
"""Return path to forcefield locations."""
return [resource_filename("foyer", "forc... |
vastin/sumatrapdf | refs/heads/master | scripts/SquareTree.py | 23 | """
This is a helper library for parsing SquareTree files into a Python tree
for data extraction and for reserializing such data trees. See
../src/utils/SquareTreeParser.cpp for the full specification of the format.
Usage:
import SquareTree
root = SquareTree.Parse(data)
print root.GetValue("key") # returns ... |
jjbrin/trading-with-python | refs/heads/master | spreadApp/makeDist.py | 77 | from distutils.core import setup
import py2exe
manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="5.0.0.0"
processorArchitecture="x86"
name="%(prog)s"
type="win32"... |
khchine5/lino-welfare | refs/heads/master | lino_welfare/modlib/debts/fixtures/demo.py | 1 | # -*- coding: UTF-8 -*-
# Copyright 2012-2015 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at y... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/loot/loot_schematic/shared_death_watch_pistol_de10_schematic.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/loot/loot_schematic/shared_death_watch_pistol_de10_schematic.iff"
r... |
ai-ku/langvis | refs/heads/master | jython-2.1/Lib/dbexts.py | 2 | # $Id: dbexts.py,v 1.5 2002/01/07 04:59:50 bzimmer Exp $
"""
This script provides platform independence by wrapping Python
Database API 2.0 compatible drivers to allow seamless database
usage across implementations.
In order to use the C version, you need mxODBC and mxDateTime.
In order to use the Java version, you n... |
v-iam/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health.py | 2 | # 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 ... |
alivecor/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/ctc_loss_op_test.py | 64 | # 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... |
giordi91/python_misc | refs/heads/master | math/maya_curve/resample_demo.py | 1 | import sys
sys.path.append("G:\dev\python_misc\math\maya_curve")
sys.path.append("G:\dev\python_misc\widgets")
from plotWidget.plot_widget import PlotWidget
from maya_curve import AnimCurve
path = r"C:\Users\mgiordano\Desktop\test.anim"
class DrawableFunction(object):
def __init__(self):
self.color = [25... |
nuncjo/odoo | refs/heads/8.0 | addons/base_import_module/models/__init__.py | 411 | # -*- coding: utf-8 -*-
import ir_module
import base_import_module
|
drewlindsey/denovoprediction | refs/heads/master | src/score/Score.py | 1 | from abc import ABCMeta, abstractmethod
import subprocess as sp
import re
class BaseScore(object):
__metaclass__ = ABCMeta
"""An abstract class template for the RMSD and TM_Score Functions
Attributes:
options: the options for the score functions (if any)
"""
@abstractmethod
def __ini... |
crakensio/django_training | refs/heads/master | lib/python2.7/site-packages/pip/baseparser.py | 329 | """Base option parser setup"""
import sys
import optparse
import os
import textwrap
from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types
from pip.locations import default_config_file
from pip.util import get_terminal_size, get_prog
from pip._vendor import pkg_resources
clas... |
datalogics/scons | refs/heads/master | test/SideEffect/parallel.py | 2 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
sudosurootdev/external_skia | refs/heads/L5 | platform_tools/android/gyp_gen/tool_makefile_writer.py | 63 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code for generating Android.mk for a tool."""
import android_framework_gyp
import gypd_parser
import makefile_writer
import os
import vars_dict_lib
def write_to... |
jaesivsm/JARR | refs/heads/master | jarr/lib/url_cleaners.py | 1 | import logging
from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
from bs4 import BeautifulSoup
from jarr.bootstrap import is_secure_served
HTTPS_IFRAME_DOMAINS = ('vimeo.com', 'youtube.com', 'youtu.be')
logger = logging.getLogger(__name__)
def __fix_addr(to_fix, reference, scheme=None... |
ActiveState/code | refs/heads/master | recipes/Python/578057_Recursive_defaultdict/recipe-578057.py | 1 | from collections import defaultdict
f = lambda: defaultdict(f)
recursive_defaultdict = defauldict(f)
|
zepto/musio-python2 | refs/heads/master | utils/convh.py | 2 | import sys
import re
from optparse import OptionParser
if __name__ == '__main__':
opts = OptionParser("usage: %prog [options]")
opts.add_option("-i", "--input", action="store", type="string", dest="input",
help="Input File")
opts.add_option("-n", "--name", action="store", type="string", dest="... |
mattcaldwell/boto | refs/heads/develop | boto/manage/volume.py | 70 | # Copyright (c) 2006-2009 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... |
delitamakanda/socialite | refs/heads/master | migrations/env.py | 605 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
Teagan42/home-assistant | refs/heads/dev | homeassistant/components/history_graph/__init__.py | 2 | """Support to graphs card in the UI."""
import logging
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID, CONF_ENTITIES, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityCompone... |
inspyration/odoo | refs/heads/master | addons/sales_team/__init__.py | 365 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
Hellowlol/HTPC-Manager | refs/heads/master2 | libs/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2359 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... |
tesidroni/mp | refs/heads/master | Lib/site-packages/numpy/distutils/tests/test_npy_pkg_config.py | 54 | import sys
import os
from tempfile import mkstemp
from numpy.testing import *
from numpy.distutils.npy_pkg_config import read_config, parse_flags
simple = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1
[default]
cflags = -I/usr/include
libs = -L/usr/lib
"""
simple_d = {'cflags': '-I/usr/include', 'libfla... |
zamattiac/osf.io | refs/heads/develop | website/templates/__init__.py | 88 | __author__ = 'johannacohoon'
|
OpenHydrology/OH-Auto-Statistical-REST-API | refs/heads/master | tasks.py | 1 | from core import celery, db
import autostatisticalweb
from floodestimation import parsers
from floodestimation import entities
from floodestimation import loaders
import os.path
import requests
import tempfile
import zipfile
import logging
logger = logging.getLogger(__name__)
@celery.task(bind=True)
def do_analysis... |
jj0hns0n/geonode | refs/heads/master | geonode/contrib/geosites/site_template/wsgi.py | 24 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_qkview.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
jar3b/py-phias | refs/heads/master | aore/updater/dbhandler.py | 1 | import logging
import psycopg2
from bottle import template
from aore.config import DatabaseConfig
from aore.dbutils.dbimpl import DBImpl
from aore.dbutils.dbschemas import db_shemas
from aore.updater.aoxmltableentry import AoXmlTableEntry
class DbHandler:
def __init__(self):
self.db = DBImpl(psycopg2, Da... |
smharper/openmc | refs/heads/develop | openmc/data/laboratory.py | 8 | from collections.abc import Iterable
from numbers import Real, Integral
import numpy as np
import openmc.checkvalue as cv
from openmc.stats import Tabular, Univariate
from .angle_energy import AngleEnergy
from .endf import get_tab2_record, get_tab1_record
class LaboratoryAngleEnergy(AngleEnergy):
"""Laboratory ... |
vacoj/MINDBODY-Django | refs/heads/master | helpers/mbosoap/BasicRequestHelper.py | 2 | """This is where most universal code for the Python examples of API implementation exist.
Much of the abstracted logic such as filling out credential objects and arrays
resides in this class."""
from mboapi_djangodemo.SECRETS import SITEIDs, SOURCENAME, SOURCEPASS, USERNAME, USERPASS
def BuildWsdlUrl(serviceNa... |
paramsingh/codechef-solutions | refs/heads/master | src/practice/onp.py | 2 | ops = ['+', '-', '*', '/', '^']
for _ in range(int(raw_input())):
exp = raw_input()
var = []
op = []
ans = []
for ch in exp:
if ch == '(':
continue
elif ch == ')':
x = var.pop()
y = var.pop()
o = op.pop()
var.append(y+x+o)
... |
zbqf109/goodo | refs/heads/master | openerp/addons/mail/models/mail_channel.py | 2 | # -*- coding: utf-8 -*-
import datetime
import time
import uuid
from openerp import _, api, fields, models, modules, tools
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.exceptions import UserError
from openerp.addons.bus.models.bus_presence import AWAY_TIMER
class ChannelPartner(models... |
infobloxopen/infoblox-netmri | refs/heads/master | infoblox_netmri/api/broker/v3_5_0/route_admin_distance_broker.py | 13 | from ..broker import Broker
class RouteAdminDistanceBroker(Broker):
controller = "route_admin_distances"
def index(self, **kwargs):
"""Lists the available route admin distances. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query list... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/testData/completion/percentStringDictFuncKeys.py | 31 | print("Other string %(<caret>)d" % {str(4): int('4')}) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.