repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
syci/OCB
refs/heads/9.0
addons/pos_mercury/models/pos_mercury.py
19
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import sets from openerp import models, fields, api _logger = logging.getLogger(__name__) class barcode_rule(models.Model): _inherit = 'barcode.rule' def _get_type_selection(self): type...
seaotterman/tensorflow
refs/heads/master
tensorflow/contrib/slim/python/slim/data/data_decoder.py
146
# 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...
TheTypoMaster/chromium-crosswalk
refs/heads/master
chrome/test/data/extensions/api_test/activity_log_private/PRESUBMIT.py
40
# 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. """Run the Chrome WebUI presubmit scripts on our test javascript. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more d...
jagguli/intellij-community
refs/heads/master
python/lib/Lib/string.py
92
"""A collection of string operations (most are no longer used). Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop is n...
FATruden/boto
refs/heads/master
tests/unit/ec2/test_volume.py
3
import mock from tests.unit import unittest from boto.ec2.snapshot import Snapshot from boto.ec2.tag import Tag, TagSet from boto.ec2.volume import Volume, AttachmentSet, VolumeAttribute class VolumeTests(unittest.TestCase): def setUp(self): self.attach_data = AttachmentSet() self.attach_data.id ...
e-koch/pyspeckit
refs/heads/master
examples/fit_nh3_cube.py
5
""" Fit NH3 Cube ============ Example script to fit all pixels in an NH3 data cube. This is a bit of a mess, and fairly complicated (intrinsically), but if you have matched 1-1 + 2-2 + ... NH3 cubes, you should be able to modify this example and get something useful out. .. WARNING:: Cube fitting, particularly with ...
aehlke/manabi
refs/heads/master
manabi/apps/flashcards/models/next_cards_for_review.py
1
import pytz from datetime import datetime from manabi.apps.flashcards.models import ( Card, ) from manabi.apps.flashcards.models.new_cards_limit import ( NewCardsLimit, ) class ReviewInterstitial: def __init__( self, user, deck=None, new_cards_per_day_limit_override=None, ...
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/gdata/src/gdata/tlslite/__init__.py
409
""" TLS Lite is a free python library that implements SSL v3, TLS v1, and TLS v1.1. TLS Lite supports non-traditional authentication methods such as SRP, shared keys, and cryptoIDs, in addition to X.509 certificates. TLS Lite is pure python, however it can access OpenSSL, cryptlib, pycrypto, and GMPY for faster crypt...
xforce/diorama-native-modding
refs/heads/master
tools/gyp/test/msvs/multiple_actions_error_handling/action_fail.py
124
# Copyright (c) 2014 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. import sys sys.exit(1)
whs/django
refs/heads/master
tests/admin_views/admin.py
17
import os import tempfile from io import StringIO from wsgiref.util import FileWrapper from django import forms from django.conf.urls import url from django.contrib import admin from django.contrib.admin import BooleanFieldListFilter from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin...
demon-ru/iml-crm
refs/heads/master
addons/l10n_fr_rib/__openerp__.py
425
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
daineseh/kodi-plugin.video.ted-talks-chinese
refs/heads/master
youtube_dl/extractor/escapist.py
44
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( determine_ext, clean_html, int_or_none, float_or_none, sanitized_Request, ) def _decrypt_config(key, string): a = '' i = '' r = '' while len(a) < (len(string) / 2): ...
pratikmallya/hue
refs/heads/master
desktop/core/ext-py/ndg_httpsclient-0.4.0/ndg/httpsclient/ssl_peer_verification.py
71
"""ndg_httpsclient - module containing SSL peer verification class. """ __author__ = "P J Kershaw (STFC)" __date__ = "09/12/11" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = '$Id...
rohitwaghchaure/digitales_erpnext
refs/heads/develop
erpnext/setup/doctype/global_defaults/global_defaults.py
34
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals """Global Defaults""" import frappe import frappe.defaults from frappe.utils import cint from frappe.core.doctype.property_setter.property_setter imp...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/gcloud/sdktools/components/update.py
11
# Copyright 2013 Google Inc. All Rights Reserved. """The command to install/update gcloud components.""" import argparse import textwrap from googlecloudsdk.calliope import base class Update(base.Command): """Update or install one or more Cloud SDK components or packages. Ensure that the latest version of eac...
CS-SI/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/HypsometricCurves.py
5
# -*- coding: utf-8 -*- """ *************************************************************************** HypsometricCurves.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
asfaltboy/GitSavvy
refs/heads/master
core/commands/pull.py
1
import sublime from sublime_plugin import WindowCommand from ..git_command import GitCommand from ...common import util class GsPullCommand(WindowCommand, GitCommand): """ Through a series of panels, allow the user to pull from a remote branch. """ def run(self): sublime.set_timeout_async(s...
arbrandes/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/course_info/urls.py
5
""" URLs for course_info API """ from django.conf import settings from django.conf.urls import url from .views import CourseHandoutsList, CourseUpdatesList urlpatterns = [ url( fr'^{settings.COURSE_ID_PATTERN}/handouts$', CourseHandoutsList.as_view(), name='course-handouts-list' ), ...
garnaat/boto
refs/heads/develop
tests/integration/cognito/sync/__init__.py
473
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
moijes12/oh-mainline
refs/heads/master
vendor/packages/Django/tests/regressiontests/comment_tests/tests/comment_utils_moderators_tests.py
92
from __future__ import absolute_import from django.contrib.comments.models import Comment from django.contrib.comments.moderation import (moderator, CommentModerator, AlreadyModerated) from django.core import mail from . import CommentTestCase from ..models import Entry class EntryModerator1(CommentModerator): ...
Omegaphora/external_chromium_org_tools_gyp
refs/heads/lp5.1
test/ninja/use-console/gyptest-use-console.py
120
#!/usr/bin/env python # Copyright (c) 2014 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. """ Make sure 'ninja_use_console' is supported in actions and rules. """ import TestGyp test = TestGyp.TestGyp(formats=['ninja']) test.ru...
cmorgan/pybrain
refs/heads/master
pybrain/tools/benchmark.py
31
__author__ = 'Justin Bayer, bayerj@in.tum.de' from pybrain.datasets.dataset import DataSet class BenchmarkDataSet(DataSet): def __init__(self): super(BenchmarkDataSet, self).__init__() self.addField('Average Reward', 1) self.addField('Episode Length', 1) self.linkFields(['Averag...
nitzmahone/ansible-modules-extras
refs/heads/devel
monitoring/pagerduty.py
132
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
TheTypoMaster/evennia
refs/heads/master
evennia/server/portal/rss.py
4
""" RSS parser for Evennia This connects an RSS feed to an in-game Evennia channel, sending messages to the channel whenever the feed updates. """ from twisted.internet import task, threads from django.conf import settings from evennia.server.session import Session from evennia.utils import logger RSS_ENABLED = set...
spatialdev/onadata
refs/heads/master
onadata/settings/default_settings.py
11
# this system uses structured settings.py as defined in # http://www.slideshare.net/jacobian/the-best-and-worst-of-django # # this third-level staging file overrides some definitions in staging.py # You may wish to alter it to agree with your local environment # # get most settings from staging_example.py (which in tu...
mbayon/TFG-MachineLearning
refs/heads/master
venv/lib/python3.6/site-packages/numpy/distutils/command/develop.py
264
""" Override the develop command from setuptools so we can ensure that our generated files (from build_src or build_scripts) are properly converted to real files with filenames. """ from __future__ import division, absolute_import, print_function from setuptools.command.develop import develop as old_develop class de...
koppen/PrettyCode
refs/heads/master
lib/js-beautify/python/jsbeautifier/__init__.py
1
import sys import getopt import re import string # # Originally written by Einar Lielmanis et al., # Conversion to python by Einar Lielmanis, einar@jsbeautifier.org, # MIT licence, enjoy. # # Python is not my native language, feel free to push things around. # # Use either from command line (script displays its usage ...
ihsanudin/odoo
refs/heads/8.0
openerp/service/security.py
211
# -*- 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...
pombredanne/erpnext
refs/heads/develop
erpnext/setup/doctype/global_defaults/global_defaults.py
55
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals """Global Defaults""" import frappe import frappe.defaults from frappe.utils import cint from frappe.custom.doctype.property_setter.property_setter impo...
40223243/40223243w17
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/logging/config.py
739
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
vityagi/azure-linux-extensions
refs/heads/master
OSPatching/patch/centosPatching.py
8
#!/usr/bin/python # # Copyright 2014 Microsoft Corporation # # 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...
irinabov/debian-qpid-python
refs/heads/master
qpid_tests/broker_0_10/qmf_events.py
3
# # 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...
ethanyoung/shadowsocks
refs/heads/master
tests/graceful_cli.py
977
#!/usr/bin/python import socks import time SERVER_IP = '127.0.0.1' SERVER_PORT = 8001 if __name__ == '__main__': s = socks.socksocket() s.set_proxy(socks.SOCKS5, SERVER_IP, 1081) s.connect((SERVER_IP, SERVER_PORT)) s.send(b'test') time.sleep(30) s.close()
neharejanjeva/techstitution
refs/heads/master
app/logs/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2942
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
40223220/2015cc
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementInclude.py
784
# # ElementTree # $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
ernstp/kivy
refs/heads/master
kivy/uix/layout.py
24
''' Layout ====== Layouts are used to calculate and assign widget positions. The :class:`Layout` class itself cannot be used directly. You should use one of the following layout classes: - Anchor layout: :class:`kivy.uix.anchorlayout.AnchorLayout` - Box layout: :class:`kivy.uix.boxlayout.BoxLayout` - Float layout: :...
kimt33/pydocstring
refs/heads/master
pydocstring/test/test_numpy_docstring.py
1
from nose.tools import assert_raises from pydocstring.numpy_docstring import parse_numpy def test_parse_numpy(): """Tests pydocstring.numpy_docstring.parse_numpy.""" # summary docstring = 'summary' assert parse_numpy(docstring) == {'summary': 'summary'} docstring = 'summary\n' assert parse_num...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/ship/shared_hutt_heavy_s02_tier4.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 = Ship() result.template = "object/ship/shared_hutt_heavy_s02_tier4.iff" result.attribute_template_id = -1 result....
frankrousseau/weboob
refs/heads/master
modules/aum/optim/visibility.py
7
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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 your...
yuanagain/seniorthesis
refs/heads/master
venv/lib/python2.7/site-packages/numpy/lib/shape_base.py
26
from __future__ import division, absolute_import, print_function import warnings import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, zeros, outer, concatenate, isscalar, array, asanyarray ) from numpy.core.fromnumeric import product, reshape from numpy.core import vstack, atleast_3d _...
pexip/os-gyp
refs/heads/master
test/sanitize-rule-names/gyptest-sanitize-rule-names.py
344
#!/usr/bin/env python # 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. """ Make sure rule names with non-"normal" characters in them don't cause broken build files. This test was originally causing broken .ninja...
jade-cheng/Jocx
refs/heads/master
tests/ziphmm/test_matrix.py
1
import unittest from ziphmm import Matrix from _internal import seq_to_string from _internal import format_matrix class TestMatrix(unittest.TestCase): def test_compute_sum(self): m = Matrix(2, 3) m[0, 0] = 1 m[0, 1] = 2 m[0, 2] = 3 m[1, 0] = 4 m[1, 1] = 5 ...
geopython/QGIS
refs/heads/master
python/PyQt/PyQt5/QtCore.py
17
# -*- coding: utf-8 -*- """ *************************************************************************** QtCore.py --------------------- Date : November 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch ***************************...
nwspeete-ibm/openwhisk
refs/heads/master
core/javaAction/run.py
1
import os import sys import json import requests import codecs HOST=os.environ["CONTAINER"] if HOST == "": HOST = "localhost" DEST="http://%s:8080/run" % HOST def content_from_args(args): if len(args) == 0: return {} if len(args) == 1 and os.path.exists(args[0]): with open(args[0]) as fp...
mailhexu/pyDFTutils
refs/heads/master
build/lib/pyDFTutils/perovskite/cubic_perovskite.py
1
#!/usr/bin/env python from pyDFTutils.perovskite.lattice_factory import PerovskiteCubic from pyDFTutils.ase_utils import my_write_vasp,normalize, vesta_view, set_element_mag from ase.io.vasp import read_vasp from ase.atoms import string2symbols import numpy as np from ase.build import make_supercell def gen222(name=No...
verycumbersome/the-blue-alliance
refs/heads/master
tests/test_award_manipulator.py
3
import json import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.award_type import AwardType from consts.event_type import EventType from helpers.award_manipulator import AwardManipulator from models.award import Award from models.event import Event from models.te...
teeple/pns_server
refs/heads/master
work/install/Python-2.7.4/Lib/multiprocessing/sharedctypes.py
131
# # Module which supports allocation of ctypes objects from shared memory # # multiprocessing/sharedctypes.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are me...
schlueter/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_cluster.py
47
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # 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', ...
dscdac/Proyecto-IV-modulo2
refs/heads/master
lib/python2.7/site-packages/setuptools/command/install_lib.py
454
from distutils.command.install_lib import install_lib as _install_lib import os class install_lib(_install_lib): """Don't add compiled flags to filenames of non-Python files""" def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if not py_...
betoesquivel/fil2014
refs/heads/master
build/django/build/lib.linux-x86_64-2.7/django/http/utils.py
134
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fiddly to ...
efortuna/AndroidSDKClone
refs/heads/master
ndk/prebuilt/linux-x86_64/lib/python2.7/unittest/test/test_setups.py
153
import sys from cStringIO import StringIO import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=StringIO()) def ru...
nishizhen/p2pool
refs/heads/master
wstools/tests/test_wsdl.py
289
#!/usr/bin/env python ############################################################################ # Joshua R. Boverhof, David W. Robertson, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import sys, unittest import ConfigParser import os fro...
2014cdbg13/cdbg13
refs/heads/master
wsgi/static/Brython2.1.0-20140419-113919/Lib/re.py
54
# # Copyright (c) 2014 Olemis Lang. All rights reserved. # # Choose either Javascript (faster) or Python engine based on regex complexity # with a noticeable preference for the former. # r"""Support for regular expressions (RE). This module provides regular expression matching operations similar to those found in Pe...
andykimpe/chromium-test-npapi
refs/heads/master
chrome/test/chromedriver/test/unittest_util.py
134
# Copyright 2013 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. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
jbking/demo-appengine-django-golang
refs/heads/master
myproject/django/test/simple.py
78
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases...
lmallin/coverage_test
refs/heads/master
python_venv/lib/python2.7/site-packages/pandas/tests/series/test_missing.py
3
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytz import pytest from datetime import timedelta, datetime from distutils.version import LooseVersion from numpy import nan import numpy as np import pandas as pd from pandas import (Series, DataFrame, isnull, date_range, MultiIndex, Index...
slisson/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/hgext/inotify/__init__.py
92
# __init__.py - inotify-based status acceleration for Linux # # Copyright 2006, 2007, 2008 Bryan O'Sullivan <bos@serpentine.com> # Copyright 2007, 2008 Brendan Cully <brendan@kublai.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later versi...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-3.5.0/Lib/idlelib/AutoComplete.py
82
"""AutoComplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. """ import os import sys import string from idlelib.configHandler import idleConf # This string inclu...
dbbhattacharya/kitsune
refs/heads/master
vendor/packages/South/south/tests/circular_a/migrations/0001_first.py
174
from south.db import db from django.db import models class Migration: depends_on = [('circular_b', '0001_first')] def forwards(self): pass def backwards(self): pass
proversity-org/edx-platform
refs/heads/master
common/test/acceptance/tests/studio/test_studio_course_team.py
20
""" Acceptance tests for course in studio """ from nose.plugins.attrib import attr from common.test.acceptance.pages.common.auto_auth import AutoAuthPage from common.test.acceptance.pages.studio.index import DashboardPage from common.test.acceptance.pages.studio.users import CourseTeamPage from common.test.acceptance....
kingsdigitallab/kdl-django
refs/heads/master
cms/migrations/0021_imagelistblock.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-04 11:39 from __future__ import unicode_literals import cms.models.streamfield from django.db import migrations import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields import wagtail.wagtaildocs.blocks import wagtail.wagtailembeds.blocks impor...
dahlstrom-g/intellij-community
refs/heads/master
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsAlternativeQuoteOfMultilineHost_after.py
31
f'''{d['"']}'''
arcz/ansible-modules-core
refs/heads/devel
cloud/openstack/_quantum_floating_ip.py
146
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 ...
bgxavier/nova
refs/heads/master
nova/api/openstack/compute/schemas/v3/disk_config.py
81
# 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
guiraldelli/MSc
refs/heads/master
data_analyzer/data_analyzer.py
1
import pyparsing import os.path import logging logging.basicConfig() nodes_count = "Nodes: " + pyparsing.Word(pyparsing.nums) edges_count = "Edges: " + pyparsing.Word(pyparsing.nums) weigthed_edge = "(('" + pyparsing.Word(pyparsing.alphanums + "-_. ") + "', '" + pyparsing.Word(pyparsing.alphanums + "-_. ") + "'), " +...
fxfitz/ansible
refs/heads/devel
lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
51
#!/usr/bin/python # # (c) Quentin Stafford-Fraser and Andy Baker 2015 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Create webfaction mailbox using Ansible and the Webfaction API from __future__ import absolute_import, division, print_function __metaclass__ = type A...
venzozhang/GProject
refs/heads/master
src/core/examples/sample-rng-plot.py
188
# -*- Mode:Python; -*- # /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRA...
jenalgit/django
refs/heads/master
django/contrib/gis/db/models/fields.py
310
from django.contrib.gis import forms from django.contrib.gis.db.models.lookups import gis_lookups from django.contrib.gis.db.models.proxy import SpatialProxy from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geometry.backend import Geometry, GeometryException from django.core.exceptions import Improp...
lucafavatella/intellij-community
refs/heads/cli-wip
python/lib/Lib/site-packages/django/shortcuts/__init__.py
71
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespon...
Wingless-Archangel/OWASP-ZSC
refs/heads/master
core/obfuscate.py
4
#!/usr/bin/env python ''' OWASP ZSC https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project https://github.com/zscproject/OWASP-ZSC http://api.z3r0d4y.com/ https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ] ''' from core.alert import * from core.compatible import version def obf_code(lan...
KAsante95/osf.io
refs/heads/develop
tests/test_oauth.py
14
from datetime import datetime import httplib as http import logging import json import time import urlparse import httpretty from nose.tools import * # noqa from framework.auth import authenticate from framework.exceptions import PermissionsError, HTTPError from framework.sessions import session from website.oauth.m...
cbgaindia/parsers
refs/heads/master
keywords_extractor.py
1
'Class for extracting keywords for PDF Documents in a directory' import csv import glob,os import logging from logging.config import fileConfig from lxml import etree import re import time DOC_DIR = "union_budgets/2015-16/Expenditure Budget/Volume II/" OUT_FILE = "union_budgets/2015-16/expenditure_budget_keywords_map...
joegomes/deepchem
refs/heads/master
examples/delaney/delaney_datasets.py
2
""" Delaney dataset loader. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import numpy as np import shutil import deepchem as dc def load_delaney(featurizer='ECFP', split='index'): """Load delaney datasets.""" # Featurize Delaney datase...
tima/beets
refs/heads/master
beetsplug/duplicates.py
14
# This file is part of beets. # Copyright 2015, Pedro Silva. # # 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, mod...
jiadaizhao/LeetCode
refs/heads/master
1301-1400/1392-Longest Happy Prefix/1392-Longest Happy Prefix.py
1
class Solution: def longestPrefix(self, s: str) -> str: lps = [0] * len(s) l = 0 i = 1 while i < len(s): if s[i] == s[l]: lps[i] = l + 1 i += 1 l += 1 elif l != 0: l = lps[l - 1] else:...
openhatch/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/internet/iocpreactor/const.py
84
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Windows constants for IOCP """ # this stuff should really be gotten from Windows headers via pyrex, but it # probably is not going to change ERROR_PORT_UNREACHABLE = 1234 ERROR_NETWORK_UNREACHABLE = 1231 ERROR_CONNECTION_REFUSED = 1225 ERR...
allotria/intellij-community
refs/heads/master
python/testData/quickFixes/PyAddImportQuickFixTest/fullFromImportSourceNameInSuggestion/main_after.py
18
from foo.bar.baz import ClassA, ClassB print(ClassA, ClassB)
azumimuo/family-xbmc-addon
refs/heads/master
plugin.video.bubbles/resources/lib/externals/hachoir/hachoir_parser/program/exe.py
1
""" Microsoft Windows Portable Executable (PE) file parser. Informations: - Microsoft Portable Executable and Common Object File Format Specification: http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx Author: Victor Stinner Creation date: 2006-08-13 """ from resources.lib.externals.hachoir.hachoir...
gijzelaerr/djonet
refs/heads/master
tests/testapp/models.py
2
# Copyright (c) 2009 - 2010, Mark Bucciarelli <mkbucc@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS...
ZazieTheBeast/oscar
refs/heads/master
src/oscar/core/logging/formatters.py
30
import re from logging import Formatter class PciFormatter(Formatter): """ Strip card numbers out of log messages to avoid leaving sensitive information in the logs. """ def format(self, record): s = Formatter.format(self, record) return re.sub(r'\d[ \d-]{15,22}', 'XXXX-XXXX-XXXX-...
bckwltn/SickRage
refs/heads/master
sickbeard/clients/deluge.py
2
# Author: Mr_Orange <mr_orange@hotmail.it> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 Lic...
egroise/uxtest
refs/heads/master
tests/selftest.sikuli/selftest.py
1
# uxtst library sys.path.append("../../..") import uxtst reload(uxtst) from uxtst import * startTest("uxtest Selftest") commentTest("Selftesting takeScreenshot") takeScreenshot() takeScreenshot("Named screenshot") commentTest("Selftesting assertions (3 sucess, 3 failures)") visible("present.png","Should succeed"...
Gybes/pyNES
refs/heads/0.1.x
pynes/tests/sei_test.py
28
# -*- coding: utf-8 -*- import unittest from pynes.compiler import lexical, syntax, semantic class SeiTest(unittest.TestCase): def test_sei_sngl(self): tokens = list(lexical('SEI')) self.assertEquals(1, len(tokens)) self.assertEquals('T_INSTRUCTION', tokens[0]['type']) ast = syn...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source - Copy/Lib/site-packages/idna/__init__.py
230
from .package_data import __version__ from .core import *
isandlaTech/cohorte-demos
refs/heads/dev
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141209.234423-41-python-distribution/repo/sleekxmpp/xmlstream/filesocket.py
11
# -*- coding: utf-8 -*- """ sleekxmpp.xmlstream.filesocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is a shim for correcting deficiencies in the file socket implementation of Python2.6. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :license: MIT, see ...
cvicentiu/mariadb-10.0
refs/heads/master
storage/tokudb/mysql-test/tokudb/locks-blocking-row-locks-testgen.py
39
# 9/23/2011 Generate blocking row lock tests import datetime # generate sql write queries def mysqlgen_select_for_update(k, kv, c, cv): print "select * from t where %s=%s for update;" % (k, kv) def mysqlgen_select_for_update_range(k, c, where): print "select * from t where %s%s for update;" % (k, where) def my...
proxysh/Safejumper-for-Mac
refs/heads/master
buildlinux/env32/local/lib/python2.7/encodings/gb18030.py
816
# # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb18030') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteInc...
dex4er/mamba
refs/heads/master
spec/refactoring_goodies_spec.py
5
from expects import * RETURN_VALUE = '42' with description('Refactoring goodies'): def a_method(self, return_value=RETURN_VALUE): return return_value with it('uses methods defined inside its context'): expect(self.a_method()).to(equal(RETURN_VALUE)) with context('when using nested cont...
johnkeepmoving/oss-ftp
refs/heads/master
python27/win32/Lib/test/test_scope.py
115
import unittest from test.test_support import check_syntax_error, check_py3k_warnings, \ check_warnings, run_unittest class ScopeTests(unittest.TestCase): def testSimpleNesting(self): def make_adder(x): def adder(y): return x + y retu...
lekanovic/pycoin
refs/heads/master
tests/tx_test.py
5
#!/usr/bin/env python import binascii import unittest from pycoin.serialize import b2h, h2b_rev from pycoin.tx.Tx import Tx TX_E1A18B843FC420734DEEB68FF6DF041A2585E1A0D7DBF3B82AAB98291A6D9952_HEX = ( "0100000001a8f57056b016d7d243fc0fc2a73f9146e7e4c7766ec6033b5ac4cb89c" "64e19d0000000008a4730440220251acb534ba...
ameistad/django-template
refs/heads/master
{{cookiecutter.repo_name}}/config/settings/development.py
3
# -*- coding: utf-8 -*- # Development settings from .base import * # noqa DEBUG = True ALLOWED_HOSTS = [] # Development specific django packages. INSTALLED_APPS += ('django_extensions', ) # Email backend that writes messages to console instead of sending them. EMAIL_PORT = 1025 EMAIL_HOST = 'localhost' EMAIL_BACK...
codervince/flashingredlight
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
PuchatekwSzortach/convolutional_network
refs/heads/master
tests/net/test_layers.py
1
""" Tests for net.layers module """ import pytest import numpy as np import net.layers class TestInput: """ Tests for Input layer class """ def test_build_sample_shape_is_a_list(self): input = net.layers.Input(sample_shape=[2, 3, 4]) input.build(input_shape=None) assert (...
GPCsolutions/mod-webui
refs/heads/master
module/plugins/eue/test.py
3
from pymongo.connection import Connection id="GLPI" records = [] con = Connection('localhost') db = con.shinken app = None # app is not otherwise eueid = "" parts = eueid.split(".") parts.pop(0) id = ".".join(parts) records=[] for feature in db.eue.find({'key': { '$regex': id } }).sort("start_time",1).limit(100): ...
gavioto/tapiriik
refs/heads/master
tapiriik/services/RideWithGPS/rwgps.py
9
import os from datetime import datetime, timedelta import dateutil.parser import pytz from dateutil.tz import tzutc import requests from django.core.urlresolvers import reverse from tapiriik.settings import WEB_ROOT, RWGPS_APIKEY from tapiriik.services.service_base import ServiceAuthenticationType, ServiceB...
biospi/mzmlb
refs/heads/master
pwiz/libraries/boost-build/tools/types/asm.py
26
# Copyright Craig Rodrigues 2005. # Copyright (c) 2008 Steven Watanabe # # Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from b2.build import type as type_ from b2.manager import get_manager from b2.tools.cast impor...
kcompher/thunder
refs/heads/master
thunder/factorization/svd.py
8
""" Class for performing Singular Value Decomposition """ from numpy import zeros, shape from thunder.utils.common import checkParams from thunder.rdds.series import Series from thunder.rdds.matrices import RowMatrix class SVD(object): """ Singular value decomposition on a distributed matrix. Parameter...
gangadhar-kadam/sms-erpnext
refs/heads/master
selling/doctype/sales_order_item/sales_order_item.py
483
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
Marco57/gsb
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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. ...
amir343/ansible
refs/heads/devel
lib/ansible/inventory/script.py
80
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License, or # (at your option) an...