repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
campaignmonitor/createsend-python | refs/heads/master | test/test_campaign.py | 1 | from six.moves.urllib.parse import quote
import unittest
from createsend.campaign import Campaign
class CampaignTestCase(object):
def test_create(self):
client_id = '87y8d7qyw8d7yq8w7ydwqwd'
c = Campaign()
c.stub_request("campaigns/%s.json" % client_id, "create_campaign.json")
ca... |
pedrobaeza/OpenUpgrade | refs/heads/8.0 | addons/purchase/partner.py | 210 | # -*- 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... |
bendykst/deluge | refs/heads/develop | deluge/plugins/AutoAdd/deluge/plugins/autoadd/webui.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is ... |
youprofit/zato | refs/heads/master | code/zato-web-admin/src/zato/admin/web/views/notif/__init__.py | 138 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals |
iamweilee/pylearn | refs/heads/master | sys-exit-example-1.py | 1 | '''
Ö´ÐÐÖÁÖ÷³ÌÐòµÄĩβʱ,½âÊÍÆ÷»á×Ô¶¯Í˳ö.
µ«ÊÇÈç¹ûÐèÒªÖÐ;Í˳ö³ÌÐò, Äã¿ÉÒÔµ÷Óà sys.exit º¯Êý, Ëü´øÓÐÒ»¸ö¿ÉÑ¡µÄÕûÊý²ÎÊý·µ»Ø¸øµ÷ÓÃËüµÄ³ÌÐò.
'''
import sys
print "hello"
sys.exit(1)
print "there" |
NetApp/manila | refs/heads/master | manila/cmd/all.py | 2 | #!/usr/bin/env python
# Copyright 2011 OpenStack, LLC
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except... |
wweiradio/django | refs/heads/master | django/core/management/commands/migrate.py | 37 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import warnings
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django... |
mhdella/scikit-learn | refs/heads/master | sklearn/datasets/lfw.py | 141 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... |
davidt/reviewboard | refs/heads/master | reviewboard/reviews/evolutions/unique_together_baseline.py | 10 | from __future__ import unicode_literals
from django_evolution.mutations import ChangeMeta
MUTATIONS = [
ChangeMeta('Group', 'unique_together', (('name', 'local_site'),)),
ChangeMeta('ReviewRequest', 'unique_together',
(('commit_id', 'repository'),
('changenum', 'repository'),
... |
VasuAgrawal/tartanHacks2015 | refs/heads/master | site/flask/lib/python2.7/site-packages/whoosh/util/__init__.py | 43 | # Copyright 2007 Matt Chaput. 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 notice,
# this list of conditions and the... |
allenp/odoo | refs/heads/9.0 | addons/portal/portal.py | 47 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
class portal(osv.osv):
""" A portal is simply a group of users with the flag 'is_portal' set to True.
The flag 'is_portal' makes a user group usable as a portal.
"""
... |
Yellowen/Owrang | refs/heads/master | buying/doctype/purchase_receipt_item_supplied/__init__.py | 37694 | from __future__ import unicode_literals
|
JetBrains/intellij-community | refs/heads/master | python/testData/formatter/commentedCodeFragmentIgnored.py | 79 | # This normal comment won't be touched as well
# for a in [1, 2, 3]:
# if a == 1:
# print 'x'
# elif a == 2:
# print 'y' |
twz915/django | refs/heads/master | django/contrib/gis/apps.py | 590 | from django.apps import AppConfig
from django.core import serializers
from django.utils.translation import ugettext_lazy as _
class GISConfig(AppConfig):
name = 'django.contrib.gis'
verbose_name = _("GIS")
def ready(self):
if 'geojson' not in serializers.BUILTIN_SERIALIZERS:
serialize... |
JetBrains/intellij-community | refs/heads/master | python/testData/surround/SurroundNewline.py | 30 | <selection>a = 1
</selection>
a = 2 |
fevxie/odoo | refs/heads/8.0 | addons/product_margin/__init__.py | 444 | # -*- 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... |
hbhdytf/mac2 | refs/heads/master | test/multiThread_del.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import time
'''name = raw_input("Please input the name(for token):")
while not name:
name = raw_input("Please input the name(for token):")
if name == "Admin" or name == "sandy":
content = os.popen("curl -D- -H 'X-Storage-User:%s' -H 'X-Storage-Pass:admin'... |
binghongcha08/pyQMD | refs/heads/master | GWP/QTGB/traj.py | 14 | #!/usr/bin/python
import numpy as np
import pylab as plt
import seaborn as sns
sns.set_context("poster")
#with open("traj.dat") as f:
# data = f.read()
#
# data = data.split('\n')
#
# x = [row.split(' ')[0] for row in data]
# y = [row.split(' ')[1] for row in data]
#
# fig = plt.figure()
#
# ax1 = f... |
N03297857/2017Fall | refs/heads/master | 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... |
bschutze/ALTO-framework-sim | refs/heads/master | pyparsing-2.0.1/examples/ebnftest.py | 6 | print('Importing pyparsing...')
from pyparsing import *
print('Constructing EBNF parser with pyparsing...')
import ebnf
import sets
grammar = '''
syntax = (syntax_rule), {(syntax_rule)};
syntax_rule = meta_identifier, '=', definitions_list, ';';
definitions_list = single_definition, {'|', single_definitio... |
SummerLW/Perf-Insight-Report | refs/heads/test | third_party/gsutil/third_party/boto/boto/sts/credentials.py | 153 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# withou... |
emitrom/integra-openstack-ui | refs/heads/master | providers/utils.py | 1 | import traceback
import time
from time import mktime
from datetime import datetime
from integra.RestTemplate import RestTemplate
from integra.integra import provider
from requests.auth import HTTPBasicAuth
from django.template.defaultfilters import register
from django.utils.translation import ugettext_lazy as _
from... |
akaihola/django | refs/heads/master | tests/regressiontests/utils/module_loading.py | 43 | import os
import sys
import imp
from zipimport import zipimporter
from django.utils import unittest
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
class DefaultLoader(unittest.TestCase):
def setUp(self):
sys.meta_path.insert(0, ProxyFinder())... |
evgeny-boger/root | refs/heads/master | interpreter/llvm/src/bindings/python/llvm/tests/test_object.py | 95 | from .base import TestBase
from ..object import ObjectFile
from ..object import Relocation
from ..object import Section
from ..object import Symbol
class TestObjectFile(TestBase):
def get_object_file(self):
source = self.get_test_binary()
return ObjectFile(filename=source)
def test_create_from... |
GauravSahu/odoo | refs/heads/8.0 | addons/crm_claim/__init__.py | 390 | # -*- 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... |
akrherz/iem | refs/heads/main | htdocs/plotting/auto/autoplot.py | 1 | """Our mod_wsgi frontend to autoplot generation"""
# pylint: disable=abstract-class-instantiated
from collections import OrderedDict
import sys
import os
import tempfile
import importlib.machinery
import importlib.util
import json
import traceback
from io import BytesIO
import numpy as np
import memcache
import pytz
i... |
zhumingliang1209/Ardupilot | refs/heads/master | ardupilot/Tools/LogAnalyzer/tests/TestVCC.py | 218 | from LogAnalyzer import Test,TestResult
import DataflashLog
import collections
class TestVCC(Test):
'''test for VCC within recommendations, or abrupt end to log in flight'''
def __init__(self):
Test.__init__(self)
self.name = "VCC"
def run(self, logdata, verbose):
self.result = ... |
mikrosimage/rez | refs/heads/20160619_master.mikros.1 | src/rez/tests/data/packages/py_packages/unversioned_py/package.py | 8 | name = 'unversioned_py'
# Copyright 2013-2016 Allan Johns.
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
#
... |
j00bar/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_account.py | 39 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... |
yanchen036/tensorflow | refs/heads/master | tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py | 120 | # 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... |
CloudbrainLabs/htm-challenge | refs/heads/master | brainsquared/modules/transformers/SFFT.py | 1 | ## STFT logic needs to live here |
mehdidc/scikit-learn | refs/heads/master | examples/missing_values.py | 233 | """
======================================================
Imputing missing values before building an estimator
======================================================
This example shows that imputing the missing values can give better results
than discarding the samples containing any missing value.
Imputing does not ... |
IlyaSukhanov/moto | refs/heads/master | moto/swf/models/workflow_execution.py | 7 | from __future__ import unicode_literals
import uuid
from moto.core.utils import camelcase_to_underscores, unix_time
from ..constants import (
DECISIONS_FIELDS,
)
from ..exceptions import (
SWFDefaultUndefinedFault,
SWFValidationException,
SWFDecisionValidationException,
)
from ..utils import decapital... |
ActiveState/code | refs/heads/master | recipes/Python/580794_Simple_multicolumn_listbox/recipe-580794.py | 1 | # Version: 2.3
# Author: Miguel Martinez Lopez
# Uncomment the next line to see my email
# print("Author's email: %s"%"61706c69636163696f6e616d656469646140676d61696c2e636f6d".decode("hex"))
try:
from Tkinter import Frame, Label
from Tkconstants import *
from tkFont import Font, nametofont
from ttk impo... |
retomerz/intellij-community | refs/heads/master | python/testData/refactoring/introduceField/inConstructor.after.py | 83 | class B():
def __init__(self):
self.a = "some string"
print(self.a) |
zedr/django | refs/heads/master | tests/force_insert_update/tests.py | 69 | from __future__ import unicode_literals
from django.db import transaction, IntegrityError, DatabaseError
from django.test import TestCase
from .models import (Counter, WithCustomPK, InheritedCounter, ProxyCounter,
SubCounter)
class ForceTests(TestCase):
def test_force_update(self):
... |
Gchorba/Ask | refs/heads/master | lib/python2.7/site-packages/pip/baseparser.py | 149 | """Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... |
zooba/PTVS | refs/heads/master | Python/Tests/TestData/SendToInteractiveWorkspace/ImportWorkspacePackage.py | 4 | import package1
print(package1.PACKAGE_MSG)
|
eerimoq/pumba | refs/heads/master | bin/compile_ino.py | 2 | #!/usr/bin/env python
from __future__ import print_function
import sys
import os
import subprocess
import make_frozen
def main():
ino_cpp = sys.argv[-3]
main_py = os.path.join(os.path.dirname(sys.argv[-3]), "main.py")
# Copy the .ino.cpp to main.py.
with open(main_py, "w") as fout:
with ope... |
mushtaqak/edx-platform | refs/heads/master | lms/djangoapps/ccx/migrations/0001_initial.py | 94 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Cus... |
wscullin/spack | refs/heads/qmcpack | var/spack/repos/builtin/packages/r-diptest/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
katakumpo/urllib3 | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# urllib3 documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 5 13:15:40 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
frvannes16/Cops-Robbers-Coding-Challenge | refs/heads/master | src/competition_code/libs/requests/cookies.py | 109 | # -*- coding: utf-8 -*-
"""
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import calendar
import collections
from ._internal_utils import to_native_string
from .co... |
hoosteeno/kuma | refs/heads/master | vendor/packages/nose/plugins/testid.py | 48 | """
This plugin adds a test id (like #1) to each test name output. After
you've run once to generate test ids, you can re-run individual
tests by activating the plugin and passing the ids (with or
without the # prefix) instead of test names.
For example, if your normal test run looks like::
% nosetests -v
tests.t... |
azoft-dev-team/imagrium | refs/heads/win | src/pages/fb_auth/fb_auth_page.py | 1 | '''
Created on 23.05.2013
@author: Nosov Dmitriy
'''
from src.core.page import Page, ResourceLoader, iOSPage, AndroidPage
from src.core.r import Resource
from src.pages.fb_auth.fb_confirm_page import FbConfirmPage
class FbAuthPage(Page):
"""
This page (web view) appears when a user wants to authorize against... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/encodings/utf_32_le.py | 744 | """
Python 'utf-32-le' Codec
"""
import codecs
### Codec APIs
encode = codecs.utf_32_le_encode
def decode(input, errors='strict'):
return codecs.utf_32_le_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.utf_32_le_en... |
sudheesh001/RFID-DBSync | refs/heads/master | venv/lib/python2.7/site-packages/jinja2/visitor.py | 1401 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... |
fapable/pygameproject2 | refs/heads/master | vierspelers.py | 1 | import math
import pygame
import random
import high_score as H
import input as N
width = 1600
height = 1000
size = (width, height)
screen = pygame.display.set_mode(size)
sp1 = pygame.image.load('suprisekaart1.png')
sp2 = pygame.image.load('suprisekaart2.png')
sp6 = pygame.image.load('suprisekaart6.png')
s... |
dmpiergiacomo/scion | refs/heads/master | python/lib/crypto/certificate_chain.py | 1 | # Copyright 2014 ETH Zurich
#
# 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... |
bmockler/MOSFiT | refs/heads/master | mosfit/modules/utilities/rename.py | 5 | """Definitions for the `Utility` class."""
from collections import OrderedDict
from mosfit.modules.utilities.utility import Utility
# Important: Only define one ``Module`` class per file.
class Rename(Utility):
"""Template class for photosphere Modules."""
def process(self, **kwargs):
"""Process m... |
noslenfa/tdjangorest | refs/heads/master | uw/lib/python2.7/site-packages/django/contrib/gis/tests/distapp/models.py | 221 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SouthTexasCity(models.Model):
"City model on projected coordinate system for South Texas."
name = models.CharField(max_length=30)
point = models.PointField(srid=32140)
... |
curtwagner1984/YAPO | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
from videos import *
import YAPO.settings
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "YAPO.settings")
from videos import apps
from YAPO import pagination
a = apps
a = pagination
print("Static files dir is: {}".format(... |
AltSchool/django | refs/heads/master | tests/admin_scripts/complex_app/models/bar.py | 580 | from django.db import models
class Bar(models.Model):
name = models.CharField(max_length=5)
class Meta:
app_label = 'complex_app'
|
douban/code | refs/heads/master | vilya/views/hub/center/__init__.py | 3 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from vilya.libs.template import st
from vilya.models.center.activity import Activity
from vilya.views.hub.center.activity import ActivitiesUI
_q_exports = ['new', 'activities']
activities = ActivitiesUI()
def _q_index(request):
context = {}
cont... |
ojengwa/grr | refs/heads/master | lib/flows/cron/system_test.py | 2 | #!/usr/bin/env python
"""System cron flows tests."""
import time
# pylint: disable=unused-import, g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import, g-bad-import-order
from grr.endtoend_tests import base
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/site-packages/django/core/management/commands/sqlcustom.py | 313 | from optparse import make_option
from django.core.management.base import AppCommand
from django.core.management.sql import sql_custom
from django.db import connections, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = "Prints the custom table modifying SQL statements for the given app name(s)."
option_list... |
unindented/streamcode | refs/heads/master | client/static/jsrepl/extern/python/reloop-closured/lib/python2.7/symbol.py | 105 | #! /usr/bin/env python
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# python Lib/symbol.py... |
yougov/nisteag | refs/heads/master | tests/scripts/test_checkers.py | 1 | from unittest import TestCase
from mock import patch
from nose.tools import istest
from nisteag.scripts.checkers import check_entropy
class CheckEntropyTest(TestCase):
@istest
@patch('nisteag.scripts.checkers.print')
@patch('nisteag.scripts.checkers.sys')
def checks_entropy(self, mock_sys, mock_prin... |
Riprock/funterface | refs/heads/master | test/test_funterface.py | 1 | """Tests for funterface."""
import pytest
import funterface
@pytest.fixture
def implementation():
"""Make a new funterface implementation."""
@funterface.method('hey')
def new_implementation(wot, hmm):
"""Just return the args as a string."""
return '{0} {1}'.format(wot, hmm)
return n... |
allotria/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/withSuper.before.py | 83 | class Foo(object):
def bar(self):
print "foo"
def foo(self):
print "bar" |
sanguinariojoe/FreeCAD | refs/heads/master | src/Mod/Fem/femobjects/mesh_region.py | 12 | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
CreamyCookie/pgu | refs/heads/master | examples/gui17.py | 12 | """an example a python console"""
import pygame
from pygame.locals import *
# the following line is not needed if pgu is installed
import sys; sys.path.insert(0, "..")
import traceback
from pgu import gui
from pgu import html
class StringStream:
def __init__(self):
self._data = ''
def write(self,da... |
ifduyue/polysh | refs/heads/master | tests/tests/non_interactive.py | 2 | # 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 the hope that it will be useful,
# bu... |
jinyu121/HowOldAreYou | refs/heads/master | HowOldAreYou/urls.py | 1 | # -*- coding: UTF-8 -*-
"""HowOldAreYou URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views... |
agry/NGECore2 | refs/heads/master | scripts/object/installation/turret/gcw/adv_turret_dish_sm_electricity.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/quest/rebel/rtp_wedge_security_terminal.py | 85615 | import sys
def setup(core, object):
return |
skg-net/ansible | refs/heads/devel | docs/docsite/_extensions/pygments_lexer.py | 27 | # -*- coding: utf-8 -*-
# pylint: disable=no-self-argument
#
# Copyright 2006-2017 by the Pygments team, see AUTHORS at
# https://bitbucket.org/birkenfeld/pygments-main/raw/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/AUTHORS
# Copyright by Kirill Simonov (original author of YAML lexer).
#
# Licensed under BSD license:
#
#... |
jasonxmueller/gcc-python-plugin | refs/heads/master | libcpychecker/Py_BuildValue.py | 4 | # Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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) a... |
xiang12835/python_web | refs/heads/master | py2_web2py/web2py/gluon/contrib/google_wallet.py | 43 | from gluon import XML
def button(merchant_id="123456789012345",
products=[dict(name="shoes",
quantity=1,
price=23.5,
currency='USD',
description="running shoes black")]):
t = '<input name="item_%(key)... |
indictranstech/ebuy-now-frappe | refs/heads/develop | frappe/patches/v5_0/fix_email_alert.py | 61 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Email Alert")
for e in frappe.get_all("Email Alert"):
email_alert = frappe.get_doc("Email Alert", e.name)
if email_alert.event == "Date Change":
if email_alert.days_in_advance < 0:
email_alert.event = "Days After"... |
peterlauri/django | refs/heads/master | tests/template_tests/test_smartif.py | 580 | import unittest
from django.template.smartif import IfParser
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many other tests are f... |
napalm-automation/napalm | refs/heads/develop | test/junos/test_getters.py | 5 | """Tests for getters."""
from napalm.base.test.getters import BaseTestGetters
import pytest
@pytest.mark.usefixtures("set_device_parameters")
class TestGetter(BaseTestGetters):
"""Test get_* methods."""
|
ryanobjc/hadoop-cloudera | refs/heads/master | contrib/hod/hodlib/ServiceRegistry/__init__.py | 1638 | #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 use thi... |
emilybache/texttest-runner | refs/heads/master | src/main/python/storytext/lib/storytext/gtktoolkit/describer/treeviews.py | 1 |
"""
Logging TreeViews is complicated because there are several ways to set them up
and little direct support for extracting information from them. So they get their own module.
"""
import gtk, logging
from images import ImageDescriber
from ..treeviewextract import getAllExtractors
class ColourSpecMap(dict):
def ... |
n1cfury/BlackHatPython | refs/heads/master | web_app_map.py | 1 | def banner():
print "[***] pg 63. web app mapper [***]"
import Queue, threading, os, urllib2
threads = 10
target = "http://www.blackhatpython.com"
directory = "/Users/justin/Downloads/joomla-3.1.1"
filters = [".jpg", ".gif", "png", ".css"]
os.chdir(directory)
web_paths = Queue.Queue()
for r, d, f in os.walk("."... |
jbreitbart/fast-lib | refs/heads/master | vendor/mosquitto-1.3.5/test/broker/02-unsubscribe-qos2.py | 18 | #!/usr/bin/env python
# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet.
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.pa... |
socialc0de/germany-says-welcome-backend | refs/heads/master | gsw/backend/exceptions.py | 1 | from rest_framework.exceptions import APIException
class ServiceUnavailable(APIException):
status_code = 503
default_detail = 'Service temporarily unavailable, try again later.' |
CAAD-RWTH/ClockworkForDynamo | refs/heads/master | nodes/2.x/python/Element.ByID.py | 4 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
def ElementById(item, doc):
try:
return doc.GetElem... |
Adai0808/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch04/blei_lda.py | 21 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
from wordcloud import create_cloud
try:
from gensim import co... |
4pr0n/rip | refs/heads/master | sites/site_gonewild.py | 1 | #!/usr/bin/python
from basesite import basesite
from os import path, walk
from shutil import copy2
class gonewild(basesite):
def sanitize_url(self, url):
if not 'gonewild:' in url:
raise Exception('')
user = url[url.rfind(':')+1:]
if len(user) < 3 or not self.valid_username(user):
raise Exception('n... |
KohlsTechnology/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_traffic_group.py | 27 | # -*- 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
import os
import json
import pytest
import sys
from nose.plugins.skip imp... |
jk1/intellij-community | refs/heads/master | python/testData/copyPaste/LineToBegin.dst.py | 83 | p<caret>rint 1
print 3
|
travishathaway/python-ach | refs/heads/master | ach/parser.py | 6 | import json
class Parser(object):
'''
Parser for ACH files
'''
FILE_HEADER = '1'
FILE_CONTROL = '9'
BATCH_HEADER = '5'
BATCH_CONTROL = '8'
ENTRY_DETAIL = '6'
ADDENDA_RECORD = '7'
FILE_HEADER_DEF = [
{
'field': 'record_type_code',
'pos': 0,
... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/testData/completion/noIdentifiersInImport.after.py | 83 | from sys stdo |
manisandro/QGIS | refs/heads/master | tests/src/python/test_authmanager_ogr_postgres.py | 21 | # -*- coding: utf-8 -*-
"""
Tests for auth manager Basic Auth access to postgres.
This is an integration test for QGIS Desktop Auth Manager postgres provider that
checks if QGIS can use a stored auth manager auth configuration to access
a username/password protected postgres.
Configuration from the environment:
... |
classmember/proof_of_concept | refs/heads/master | python/events/lib/python3.4/site-packages/setuptools/extern/__init__.py | 40 | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(v... |
jwhitlock/kuma | refs/heads/master | tests/headless/__init__.py | 1 | import pytest
# Use pytest verbose asserts
# https://stackoverflow.com/questions/41522767/pytest-assert-introspection-in-helper-function
pytest.register_assert_rewrite('utils.urls')
# Untrusted attachments and samples domains that are indexed
INDEXED_ATTACHMENT_DOMAINS = set((
'mdn.mozillademos.org', # ... |
meltwater/proxymatic | refs/heads/master | src/proxymatic/backend/pen.py | 1 | import os
import logging
import signal
from proxymatic import util
class PenBackend(object):
def __init__(self, maxconnections, maxservers, maxclients):
self._maxconnections = maxconnections
self._maxservers = maxservers
self._maxclients = maxclients
self._state = {}
def update... |
acaciovilela/Dartalla | refs/heads/master | cpf/models.py | 10644 | from django.db import models
# Create your models here.
|
IvanGavran/scrapy | refs/heads/master | scrapy/exceptions.py | 183 | """
Scrapy core exceptions
These exceptions are documented in docs/topics/exceptions.rst. Please don't add
new exceptions here without documenting them there.
"""
# Internal
class NotConfigured(Exception):
"""Indicates a missing configuration situation"""
pass
# HTTP and crawling
class IgnoreRequest(Except... |
adityaduggal/erpnext | refs/heads/develop | erpnext/stock/doctype/purchase_receipt/__init__.py | 37694 | from __future__ import unicode_literals
|
nicksergeant/emilyapp | refs/heads/master | emilyapp/manage.py | 963 | #!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized t... |
blink1073/scikit-image | refs/heads/master | doc/examples/transform/plot_swirl.py | 6 | """
=====
Swirl
=====
Image swirling is a non-linear image deformation that creates a whirlpool
effect. This example describes the implementation of this transform in
``skimage``, as well as the underlying warp mechanism.
Image warping
-------------
When applying a geometric transformation on an image, we typically ... |
SummerLW/Perf-Insight-Report | refs/heads/test | third_party/gsutil/third_party/boto/boto/pyami/startup.py | 153 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
perovic/root | refs/heads/master | tutorials/pyroot/fit1.py | 10 | #
# To see the output of this macro, click begin_html <a href="gif/fit1.gif">here</a>. end_html
#
from os import path
from ROOT import TCanvas, TFile, TPaveText
from ROOT import gROOT, gBenchmark
c1 = TCanvas( 'c1', 'The Fit Canvas', 200, 10, 700, 500 )
c1.SetGridx()
c1.SetGridy()
c1.GetFrame().SetFillColor( 21 )
c1.G... |
aaltinisik/OCBAltinkaya | refs/heads/8.0 | addons/account_check_writing/report/__init__.py | 446 | # -*- 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... |
hkariti/mopidy | refs/heads/develop | tests/file/test_lookup.py | 14 | from __future__ import unicode_literals
# TODO Test lookup()
|
codekaki/odoo | refs/heads/7.0 | addons/purchase_requisition/__openerp__.py | 50 | ##############################################################################
#
# 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 Affero General Public L... |
eyalfa/spark | refs/heads/master | python/pyspark/shuffle.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 us... |
nazeehshoura/crawler | refs/heads/master | env/lib/python2.7/site-packages/pip/__main__.py | 558 | import sys
from .runner import run
if __name__ == '__main__':
exit = run()
if exit:
sys.exit(exit)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.