repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
yamt/tempest | refs/heads/master | tempest/api/compute/servers/test_server_rescue_negative.py | 11 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://... |
jcoady9/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/docs_test.py | 89 | #!/usr/bin/python
#
# Copyright (C) 2006 Google 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 ... |
google/makani | refs/heads/master | analysis/util/validate_flight.py | 1 | #!/usr/bin/python
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
jvkops/django | refs/heads/master | django/contrib/sessions/management/commands/clearsessions.py | 729 | from importlib import import_module
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = (
"Can be run as a cronjob or directly to clean out expired sessions "
"(only with the database backend at the moment)."
)
def handl... |
rujiali/cooking4 | refs/heads/master | core/vendor/guzzlehttp/guzzle/docs/conf.py | 100 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
# -- General configuration -----------------------------------------------------... |
ancafarcas/liveblog | refs/heads/master | server/liveblog/items/items.py | 2 | from bson.objectid import ObjectId
from eve.utils import ParsedRequest
from superdesk.notification import push_notification
from superdesk.utc import utcnow
from superdesk.resource import Resource
from liveblog.common import get_user, update_dates_for
from apps.archive.archive import ArchiveResource, ArchiveService, A... |
wpgallih/servo | refs/heads/master | python/mach/mach/test/test_logger.py | 128 | # 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 absolute_import, unicode_literals
import logging
import time
import unittest
from mach.logging ... |
cosmiclattes/TPBviz | refs/heads/master | torrent/lib/python2.7/site-packages/django/contrib/admin/filters.py | 101 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... |
amenonsen/ansible | refs/heads/devel | test/units/plugins/inventory/test_inventory.py | 49 | # Copyright 2015 Abhijit Menon-Sen <[email protected]>
#
# 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 ... |
angstwad/ansible | refs/heads/devel | test/units/parsing/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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) an... |
mhue/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_voting_classifier.py | 37 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestCl... |
crissmoldovan/tisip | refs/heads/master | iphone/pjsip/src/tests/pjsua/scripts-sendto/410_fmtp_amrnb_offer_octet_align.py | 42 | # $Id: 410_fmtp_amrnb_offer_octet_align.py 3664 2011-07-19 03:42:28Z nanang $
import inc_sip as sip
import inc_sdp as sdp
# Answer for codec AMR should contain fmtp octet-align=1
sdp = \
"""
v=0
o=- 3428650655 3428650655 IN IP4 192.168.1.9
s=pjmedia
c=IN IP4 192.168.1.9
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 99 101
a=r... |
kuri65536/python-for-android | refs/heads/master | python-build/python-libs/xmpppy/xmpp/protocol.py | 199 | ## protocol.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later versio... |
numerigraphe/odoo | refs/heads/8.0 | addons/stock_dropshipping/stock_dropshipping.py | 46 | # coding: utf-8
from openerp import models, api, _
from openerp.exceptions import Warning
class sale_order_line(models.Model):
_inherit = 'sale.order.line'
@api.multi
def _check_routing(self, product, warehouse):
""" skip stock verification if the route goes from supplier to customer
... |
nmrugg/youtube-dl | refs/heads/master | youtube_dl/extractor/footyroom.py | 104 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class FootyRoomIE(InfoExtractor):
_VALID_URL = r'http://footyroom\.com/(?P<id>[^/]+)'
_TESTS = [{
'url': 'http://footyroom.com/schalke-04-0-2-real-madrid-2015-02/',
'info_dict': {
'id': 'scha... |
jobovy/tact | refs/heads/master | aa/genfunc/const_energy_surface.py | 1 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from matplotlib.ticker import MaxNLocator
import matplotlib.cm as cm
from genfunc_3d import find_actions, check_angle_solution
from scipy.optimize import brentq
import test_potentials as pot
import solver
# For plot used YMax = 18, ... |
kevenli/scrapydd | refs/heads/master | tests/handlers/test_webui.py | 1 | from os import path
from io import BytesIO
from six.moves.urllib.parse import urlencode
from scrapydd.storage import ProjectStorage
from scrapydd.models import session_scope, Project, Spider
from scrapydd.poster.encode import multipart_encode
from scrapydd.schedule import JOB_STATUS_SUCCESS
from ..base import Ap... |
Phoenix-CJ23/stockkernel | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
AmrThabet/CouchPotatoServer | refs/heads/master | libs/xmpp/dispatcher.py | 200 | ## transports.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later versi... |
DBMandrake/osmc | refs/heads/master | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x07d.py | 253 | data = (
'Ji ', # 0x00
'Cha ', # 0x01
'Zhou ', # 0x02
'Xun ', # 0x03
'Yue ', # 0x04
'Hong ', # 0x05
'Yu ', # 0x06
'He ', # 0x07
'Wan ', # 0x08
'Ren ', # 0x09
'Wen ', # 0x0a
'Wen ', # 0x0b
'Qiu ', # 0x0c
'Na ', # 0x0d
'Zi ', # 0x0e
'Tou ', # 0x0f
'Niu ', # 0x10
'Fou ', ... |
ActiveState/code | refs/heads/master | recipes/Python/128243_Numerical_inversiLaplace_transforms_using_FFT/recipe-128243.py | 1 | #################################################################
# Function InvLap(t,omega,sigma,nint), numerically inverts a #
# Laplace transform F(s) into f(t) using the Fast Fourier #
# Transform (FFT) algorithm for a specific time "t", an #
# upper frequency limit "omega", a real parameter "sig... |
atosatto/ansible-minio | refs/heads/master | molecule/default/tests/test_minio_default.py | 1 | import os
import yaml
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.fixture()
def AnsibleDefaults():
with open('../../defaults/main.yml', 'r') as stream:
return yaml.... |
allotria/intellij-community | refs/heads/master | python/testData/postfix/isNotNone/nonApplicable.py | 39 | a = 1.ifnn<caret> |
Denisolt/Tensorflow_Chat_Bot | refs/heads/master | local/lib/python2.7/site-packages/tensorflow/python/ops/embedding_ops.py | 4 | # Copyright 2015 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... |
StoicLoofah/sc2reader | refs/heads/master | sc2reader/events/__init__.py | 4 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals, division
# Export all events of all types to the package interface
from sc2reader.events import base, game, message, tracker
from sc2reader.events.base import *
from sc2reader.events.game import *
from sc2reader.events.me... |
stackforge/networking-mlnx | refs/heads/master | networking_mlnx/plugins/ml2/drivers/mlnx/agent/config.py | 2 | # Copyright 2013 Mellanox Technologies, Ltd
#
# 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 t... |
markmc/rhevm-api | refs/heads/master | python/lib/rhev/test/test_error.py | 1 | #
# This file is part of python-rhev. python-rhev is free software that is
# made available under the MIT license. Consult the file "LICENSE" that
# is distributed together with this file for the exact licensing terms.
#
# python-rhev is copyright (c) 2010 by the python-rhev authors. See the
# file "AUTHORS" for a comp... |
scott-abt/junos-interface-utilization | refs/heads/master | example_creds.py | 1 | #!/usr/bin/env python3
'''
Copy this file to mycreds.py and change the details to something that works for
your environment.
'''
default = {"root": "password",}
the_creds = [default, ]
|
ivanbusthomi/inasafe | refs/heads/develop | safe/definitions/metadata.py | 8 | # coding=utf-8
"""Metadata Constants."""
import os
from safe.metadata.property import (
CharacterStringProperty,
DateProperty,
UrlProperty,
DictionaryProperty,
IntegerProperty,
BooleanProperty,
FloatProperty,
ListProperty,
)
__copyright__ = "Copyright 2017, The InaSAFE Project"
__lic... |
Deepakpatle/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/TestResultServer/model/datastorefile.py | 144 | # Copyright (C) 2010 Google 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 and the ... |
robertjacobs/zuros | refs/heads/master | zuros_control/zuros_emergency_stop/src/emergency_stop.py | 1 | #!/usr/bin/env python
# Copyright (c) 2013-2014 ZUYD Research
# 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 li... |
mheap/ansible | refs/heads/devel | test/integration/targets/wait_for/files/testserver.py | 222 | import sys
if __name__ == '__main__':
if sys.version_info[0] >= 3:
import http.server
import socketserver
PORT = int(sys.argv[1])
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
httpd.serve_forever()
else:
... |
niktre/espressopp | refs/heads/master | contrib/mpi4py/mpi4py-2.0.0/demo/wrap-swig/test.py | 54 | from mpi4py import MPI
import helloworld as hw
null = MPI.COMM_NULL
hw.sayhello(null)
comm = MPI.COMM_WORLD
hw.sayhello(comm)
try:
hw.sayhello(list())
except:
pass
else:
assert 0, "exception not raised"
|
tvtsoft/odoo8 | refs/heads/master | addons/account/models/account_payment.py | 1 | # -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import UserError, ValidationError
MAP_INVOICE_TYPE_PARTNER_TYPE = {
'out_invoice': 'customer',
'out_refund': 'customer',
'in_invoice': 'supplier',
'in_refund': 'supplier',
}
# Since invoice amounts are unsigned,... |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/django/contrib/messages/tests/base.py | 152 | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import Messag... |
restorando/avro | refs/heads/trunk | lang/py/src/avro/schema.py | 14 | # 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... |
itsvetkov/pyqtgraph | refs/heads/develop | pyqtgraph/util/mutex.py | 39 | # -*- coding: utf-8 -*-
from ..Qt import QtCore
import traceback
class Mutex(QtCore.QMutex):
"""
Subclass of QMutex that provides useful debugging information during
deadlocks--tracebacks are printed for both the code location that is
attempting to lock the mutex as well as the location that has alrea... |
luci/luci-py | refs/heads/master | client/third_party/google/protobuf/test_messages_proto2_pb2.py | 4 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/test_messages_proto2.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impor... |
AOSPU/external_chromium_org | refs/heads/android-5.0/py3 | tools/telemetry/telemetry/core/__init__.py | 115 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
|
bhaskar24/ns_3_dev_RARED | refs/heads/master | src/dsr/bindings/modulegen__gcc_ILP32.py | 14 | null |
Ingenico-ePayments/connect-sdk-python2 | refs/heads/master | ingenico/connect/sdk/domain/payment/payment_error_response.py | 2 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.errors.definitions.api_error import APIError
from ingenico.connect.sdk.domain.pa... |
bacher09/gentoo-packages | refs/heads/master | gpackages/apps/packages/management/commands/scanusedesc.py | 1 | from django.core.management.base import BaseCommand, CommandError
from packages.scan import Scanner
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-g','--no-globals',
action='store_false',
dest='scan_global_use',
... |
andreif/django | refs/heads/master | tests/template_tests/templatetags/bad_tag.py | 513 | from django import template
register = template.Library()
@register.tag
def badtag(parser, token):
raise RuntimeError("I am a bad tag")
@register.simple_tag
def badsimpletag():
raise RuntimeError("I am a bad simpletag")
|
hisaharu/ryu | refs/heads/master | ryu/tests/integrated/test_of_config.py | 19 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... |
inares/edx-platform | refs/heads/inares_sass | common/djangoapps/cors_csrf/helpers.py | 162 | """Helper methods for CORS and CSRF checks. """
import logging
import urlparse
import contextlib
from django.conf import settings
log = logging.getLogger(__name__)
def is_cross_domain_request_allowed(request):
"""Check whether we should allow the cross-domain request.
We allow a cross-domain request only i... |
AndreasMadsen/tensorflow | refs/heads/master | tensorflow/tools/dist_test/python/mnist_replica.py | 57 | # 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... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_robe_casual_05.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 = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_robe_casual_05.iff"
result.attrib... |
normtown/SickRage | refs/heads/master | lib/github/tests/Commit.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <[email protected]> #
# Copyright 2012 Zearin <[email protected]> ... |
takeflight/wagtail | refs/heads/master | wagtail/users/views/groups.py | 2 | from django.contrib.auth.models import Group
from django.urls import re_path
from django.utils.translation import gettext as _
from wagtail.admin.views import generic, mixins
from wagtail.admin.viewsets.model import ModelViewSet
from wagtail.core import hooks
from wagtail.users.forms import GroupForm, GroupPagePermiss... |
milinbhakta/flaskmaterialdesign | refs/heads/bug123 | venv/Lib/encodings/iso8859_10.py | 272 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
SnowWalkerJ/quantlib | refs/heads/master | quant/data/wind/tables/aindexeodprices.py | 1 | from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class AIndexEODPrices(BaseModel):
"""
4.84 中国A股指数日行情
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Wind代码
... |
crackerhead/nemio | refs/heads/master | lib/python2.7/site-packages/werkzeug/datastructures.py | 148 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... |
darmaa/odoo | refs/heads/master | openerp/tools/func.py | 49 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010, 2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you c... |
sloshedpuppie/LetsGoRetro | refs/heads/master | lib/gtest/test/gtest_break_on_failure_unittest.py | 2140 | #!/usr/bin/env python
#
# Copyright 2006, Google 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... |
ryandougherty/mwa-capstone | refs/heads/heroku | MWA_Tools/build/matplotlib/doc/mpl_examples/pylab_examples/contour_demo.py | 3 | #!/usr/bin/env python
"""
Illustrate simple contour plotting, contours on an image with
a colorbar for the contours, and labelled contours.
See also contour_image.py.
"""
import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
matplotlib.rcParams[... |
QianBIG/odoo | refs/heads/8.0 | addons/stock_account/res_config.py | 315 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
honeynet/beeswarm | refs/heads/master | beeswarm/drones/honeypot/capabilities/vnc.py | 1 | # Copyright (C) 2013 Aniket Panse <[email protected]>
#
# 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 pro... |
cxong/Slappa | refs/heads/master | point.py | 1 | import math
class Point(object):
def __init__(self, x=0, y=0):
self.x = float(x)
self.y = float(y)
def add(self, other):
self.x += other.x
self.y += other.y
return self
def subtract(self, other):
self.x -= other.x
self.y -= other.y
return s... |
abelboldu/nagpy-pushover | refs/heads/master | nagpy/emailNotify.py | 1 | #
# Copyright (c) 2006 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... |
ex1usive-m4d/TemplateDocx | refs/heads/master | controllers/phpdocx/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/compiler/transformer.py | 7 | """Parse tree transformation module.
Transforms Python source code into an abstract syntax tree (AST)
defined in the ast module.
The simplest ways to invoke this module are via parse and parseFile.
parse(buf) -> AST
parseFile(path) -> AST
"""
# Original version written by Greg Stein ([email protected])
# ... |
vicalloy/django-lbattachment | refs/heads/master | lbattachment/admin.py | 1 | from django.contrib import admin
from .models import LBAttachment
class LBAttachmentAdmin(admin.ModelAdmin):
search_fields = ('created_by__username', 'filename', 'act_members_param', 'notice_members_param', 'share_members_param')
list_display = ('created_by', 'filename', 'is_img', 'num_downloads', 'is_active... |
xuxiao19910803/edx-platform | refs/heads/master | pavelib/utils/envs.py | 39 | """
Helper functions for loading environment settings.
"""
from __future__ import print_function
import os
import sys
import json
from lazy import lazy
from path import path
import memcache
class Env(object):
"""
Load information about the execution environment.
"""
# Root of the git repository (edx-... |
midma101/AndIWasJustGoingToBed | refs/heads/master | .venv/lib/python2.7/site-packages/wtforms/ext/sqlalchemy/fields.py | 54 | """
Useful form fields for use with SQLAlchemy ORM.
"""
from __future__ import unicode_literals
import operator
from wtforms import widgets
from wtforms.compat import text_type, string_types
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
try:
from sqlalchemy.orm.util im... |
jalonsob/Informes | refs/heads/master | build/lib.linux-x86_64-2.7/vizgrimoire/metrics/irc_metrics.py | 4 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Bitergia
#
# 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 progr... |
www220/esp-idf | refs/heads/master | docs/gen-toolchain-links.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This script generates toolchain download links and toolchain unpacking
# code snippets based on information found in $IDF_PATH/tools/toolchain_versions.mk
#
from __future__ import print_function
import sys
import os
def main():
if len(sys.argv) != 4:
prin... |
zimmermegan/smarda | refs/heads/master | nltk-3.0.3/nltk/tag/brill.py | 7 | # -*- coding: utf-8 -*-
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Marcus Uneson <[email protected]>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL: <http://nltk.org/>
# For license information, see... |
chen0510566/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/fftpack/_fftpack.py | 53 | import sys
if sys.platform == 'cli':
import clr
clr.AddReference("_fftpack")
from scipy__fftpack___fftpack import *
|
2013Commons/hue | refs/heads/master | desktop/core/src/desktop/lib/paths.py | 31 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
Bachaco-ve/odoo | refs/heads/8.0 | addons/point_of_sale/report/__init__.py | 381 | # -*- 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... |
saurabh6790/omnit-app | refs/heads/master | setup/doctype/backup_manager/backup_googledrive.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# SETUP:
# install pip install --upgrade google-api-python-client
#
# In Google API
# - create new API project
# - create new oauth2 client (create installed app type as google \
# does no... |
sserrot/champion_relationships | refs/heads/master | venv/Lib/site-packages/setuptools/dep_util.py | 20 | from distutils.dep_util import newer_group
# yes, this is was almost entirely copy-pasted from
# 'newer_pairwise()', this is just another convenience
# function.
def newer_pairwise_group(sources_groups, targets):
"""Walk both arguments in parallel, testing if each source group is newer
than its corresponding ... |
devurandom/portage | refs/heads/master | pym/portage/util/_eventloop/EventLoop.py | 1 | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import errno
import fcntl
import logging
import os
import select
import signal
import time
from portage.util import writemsg_level
from ..SlotObject import SlotObject
from .PollConstants import PollConstants
fro... |
emmuchira/kps_erp | refs/heads/develop | erpnext/patches/v7_2/stock_uom_in_selling.py | 34 | import frappe
def execute():
frappe.reload_doctype('Sales Order')
frappe.reload_doctype('Sales Invoice')
frappe.reload_doctype('Quotation')
frappe.reload_doctype('Delivery Note')
doctype_list = ['Sales Order Item', 'Delivery Note Item', 'Quotation Item', 'Sales Invoice Item']
for doctype in doctype_list:
fra... |
dkentw/robotframework | refs/heads/master | src/robot/model/keyword.py | 12 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... |
blesscoin/blesscoin | refs/heads/master | contrib/wallettools/walletunlock.py | 782 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
|
mesosphere/storm | refs/heads/master | storm-core/src/py/storm/ttypes.py | 28 | #
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
cla... |
thorkd1t/lurkbot | refs/heads/master | lurkbotclass.py | 1 | # -*- coding: utf_8 -*-
import socket
import ssl
import time
import re
import random
from threading import *
import sqlite3
import string
import joinlist
import os.path
from subprocess import Popen, CREATE_NEW_CONSOLE
import shutil
from itertools import count
class LurkBot(object):
_ids = cou... |
ankanaan/chimera | refs/heads/master | src/chimera/instruments/faketelescope.py | 1 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# chimera - observatory automation system
# Copyright (C) 2006-2007 P. Henrique Silva <[email protected]>
# 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 S... |
freudFlintstone/pjbank-python-sdk | refs/heads/master | tests/test_recebimentos.py | 1 | # the inclusion of the tests module is not meant to offer best practices for
# testing in general, but rather to support the `find_packages` example in
# setup.py that excludes installing the "tests" package
import unittest
import pickle
import datetime
import random
from pjbank import Boleto
from dados import dado... |
nylas/sync-engine | refs/heads/master | tests/general/test_concurrency.py | 3 | import time
import pytest
from gevent import GreenletExit
from gevent import socket
from inbox.util.concurrency import retry_with_logging
class MockLogger(object):
def __init__(self):
self.call_count = 0
def error(self, *args, **kwargs):
self.call_count += 1
class FailingFunction(object)... |
sharph/lifx-python | refs/heads/master | lifx/lifx.py | 1 |
from . import network
from . import packetcodec
import socket
from time import clock
from binascii import hexlify, unhexlify
from datetime import datetime
import struct
lights = {}
def inttohex(n):
return str(hexlify(struct.pack('>H', n)), encoding='utf-8')
class LIFXBulb:
def __init__(self, lightstatus):
... |
mhotwagner/abackend | refs/heads/master | abackend-env/lib/python3.5/site-packages/django/contrib/gis/geos/prototypes/geom.py | 103 | 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
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero,
)
from django.contrib.gis.geos.prototypes.threadsafe impor... |
beni55/sympy | refs/heads/master | sympy/utilities/misc.py | 24 | """Miscellaneous stuff that doesn't really fit anywhere else."""
from __future__ import print_function, division
import sys
import os
from textwrap import fill, dedent
from sympy.core.compatibility import get_function_name
# if you use
# filldedent('''
# the text''')
# a space will be put before the firs... |
alirizakeles/tendenci | refs/heads/master | tendenci/apps/profiles/tests.py | 1940 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
invisiblek/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/ssh/filetransfer.py | 60 | # -*- test-case-name: twisted.conch.test.test_filetransfer -*-
#
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import struct, errno
from twisted.internet import defer, protocol
from twisted.python import failure, log
from common import NS, getNS
from twisted.conch.interfaces impo... |
r4vi/open-ihm | refs/heads/master | src/openihm/includes/mysql/connector/errors.py | 4 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright 2009 Sun Microsystems, Inc. All rights reserved
# Use is subject to license terms. (See COPYING)
# 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 Fre... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | tools/telemetry/telemetry/core/extension_unittest.py | 23 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import shutil
import tempfile
import unittest
from telemetry.core import browser_finder
from telemetry.core import extension_to... |
npuichigo/ttsflow | refs/heads/master | third_party/tensorflow/tensorflow/contrib/learn/python/learn/estimators/run_config.py | 9 | # 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... |
Seek/ValueTrackerQT | refs/heads/master | hearthstone/objects.py | 1 | import sqlalchemy
from .enums import CardClass, CardSet, CardType, Rarity
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
from sqlalchemy import Column, Integer, String, Enum, DateTime, Boolean
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.associationproxy import... |
richardcornish/richlearnspythonthehardway | refs/heads/master | exercises/ex02.py | 2 | # Exercise 2
# https://learnpythonthehardway.org/book/ex2.html
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# prin... |
dasseclab/dasseclab | refs/heads/master | clones/routersploit/tests/creds/cameras/dlink/test_ssh_default_creds.py | 1 | from routersploit.modules.creds.cameras.dlink.ssh_default_creds import Exploit
def test_check_success(target):
""" Test scenario - testing against SSH server """
exploit = Exploit()
assert exploit.target == ""
assert exploit.port == 22
assert exploit.threads == 1
assert exploit.defaults == ["... |
Aravind-Sundararajan/kongcoin | refs/heads/master | test/functional/wallet-dump.py | 23 | #!/usr/bin/env python3
# Copyright (c) 2016 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 dumpwallet RPC."""
import os
from test_framework.test_framework import BitcoinTestFramework
from ... |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | refs/heads/master | esstoolkit/external/pyqtgraph/util/garbage_collector.py | 33 | import gc
from ..Qt import QtCore
class GarbageCollector(object):
'''
Disable automatic garbage collection and instead collect manually
on a timer.
This is done to ensure that garbage collection only happens in the GUI
thread, as otherwise Qt can crash.
Credit: Erik Janssens
Source: ht... |
blademainer/intellij-community | refs/heads/master | python/testData/inspections/PyMethodMayBeStaticInspection/empty.py | 83 | __author__ = 'ktisha'
class Child(Base):
def f(self):
pass |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/sqs_queue.py | 17 | #!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['stableinterf... |
PiscesDream/Ideas | refs/heads/master | ML/guess_next/ann.py | 1 | '''
update:
2014/09/03:
softmax in the last layer
'''
import theano
import theano.tensor as T
import gzip
import cPickle
import numpy
import time
class HiddenLayer(object):
def __init__(self, rng, input, n_in, n_out, W=None, b=None,
activation=T.tanh):
self.input =... |
michaelpacer/linkchecker | refs/heads/master | third_party/dnspython/dns/rdtypes/__init__.py | 109 | # Copyright (C) 2003-2007, 2009-2011 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 "... |
ashray/VTK-EVM | refs/heads/yiq | ThirdParty/Twisted/twisted/conch/test/test_knownhosts.py | 30 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.client.knownhosts}.
"""
import os
from binascii import Error as BinasciiError, b2a_base64, a2b_base64
try:
import Crypto
import pyasn1
except ImportError:
skip = "PyCrypto and PyASN1 required for twisted... |
tuzhaopeng/NMT-Coverage | refs/heads/master | build/lib/experiments/nmt/data_state.py | 2 | dict(
source=["/home/zptu/research/nmt.coverage/data/fbis/binarized_text.zh.h5"],
target=["/home/zptu/research/nmt.coverage/data/fbis/binarized_text.en.h5"],
indx_word="/home/zptu/research/nmt.coverage/data/fbis/ivocab.zh.pkl",
indx_word_target="/home/zptu/research/nmt.coverage/data/fbis/ivocab.en.pkl",
word_indx="/hom... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_methodattrs.py | 203 | """Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes
# Local imports
from .. import fixer_base
from ..fixer_util import Name
MAP = {
"im_func" : "__func__",
"im_self" : "__self__",
"im_class" : "__self__.__class__"
}
class FixMethodattrs(fixer_base.BaseFix):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.