repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
StrellaGroup/erpnext
refs/heads/develop
erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
12
from __future__ import unicode_literals from frappe import _ def get_data(): return { 'docstatus': 1, 'fieldname': 'request_for_quotation', 'transactions': [ { 'items': ['Supplier Quotation'] }, ] }
michaelhowden/eden
refs/heads/master
modules/geojson/mapping.py
50
GEO_INTERFACE_MARKER = "__geo_interface__" def is_mapping(ob): return hasattr(ob, "__getitem__") def to_mapping(ob): if hasattr(ob, GEO_INTERFACE_MARKER): candidate = ob.__geo_interface__ candidate = to_mapping(candidate) else: candidate = ob if not is_mapping(candidate): ...
wuyuewen/libcloud
refs/heads/trunk
libcloud/test/compute/test_cloudsigma_v1_0.py
46
# 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 ...
rentongzhang/servo
refs/heads/master
tests/wpt/harness/wptrunner/wptmanifest/tests/test_tokenizer.py
195
# 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/. import sys import os import unittest sys.path.insert(0, os.path.abspath("..")) from cStringIO import StringIO from .. ...
esPass/pretix-espass
refs/heads/master
pretix_espass/__init__.py
1
from django.apps import AppConfig from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from pretix.base.plugins import PluginType class EspassApp(AppConfig): name = 'pretix_espass' verbose_name = "esPass tickets" class PretixPluginMeta: type ...
erock2112/python-adb
refs/heads/master
fastboot_test.py
1
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
nicky-ji/edx-nicky
refs/heads/master
common/lib/xmodule/xmodule/video_module/video_xfields.py
21
""" XFields for video module. """ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings _ = lambda text: text class VideoFields(object): """Fields for `VideoModule` and `VideoDescriptor`.""" di...
geekaia/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/urls.py
86
from django.conf.urls.defaults import url, patterns, include urlpatterns = patterns('', # nopep8 url(r'forum/?', include('django_comment_client.forum.urls')), url(r'', include('django_comment_client.base.urls')), )
mhbu50/erpnext
refs/heads/develop
erpnext/patches/v7_2/rename_att_date_attendance.py
9
import frappe from frappe.model.utils.rename_field import update_reports, update_users_report_view_settings, update_property_setters def execute(): if "att_date" not in frappe.db.get_table_columns("Attendance"): return frappe.reload_doc("hr", "doctype", "attendance") frappe.db.sql("""update `tabAttendance` s...
rawodb/bitcoin
refs/heads/master
contrib/verify-commits/verify-commits.py
16
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Verify commits against a trusted keys list.""" import argparse import hashlib import os import subprocess im...
kunaltyagi/nsiqcppstyle
refs/heads/master
rules/RULE_6_5_B_do_not_use_lowercase_for_macro_constants.py
1
""" Do not use lower case letters for the macro constant. However, it's ok to write a macro function using lower case letters. == Violation == #define Kk 1 <== Violation. The lower case 'k' is used in macro name. #define tT "sds" <== Violation. The lower case 't' is used in macro name. == Good == ...
mahendra-r/edx-platform
refs/heads/master
common/djangoapps/util/testing.py
91
import sys from mock import patch from django.conf import settings from django.core.urlresolvers import clear_url_caches, resolve class UrlResetMixin(object): """Mixin to reset urls.py before and after a test Django memoizes the function that reads the urls module (whatever module urlconf names). The m...
40223119/-2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/linecache.py
785
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os import tokenize __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globa...
Maccimo/intellij-community
refs/heads/master
python/testData/completion/keywordArgumentsForImplicitCall.after.py
83
class C: def xyzzy(self, shazam): pass def foo(param): param.xyzzy(shazam=)
rtucker-mozilla/inventory
refs/heads/master
vendor-local/src/django-piston/examples/blogserver/blog/views.py
6
from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from blogserver.blog.models import Blogpost def posts(request): posts = Blogpost.object...
drexly/openhgsenti
refs/heads/master
lib/django/core/checks/compatibility/django_1_8_0.py
286
from __future__ import unicode_literals from django.conf import global_settings, settings from .. import Tags, Warning, register @register(Tags.compatibility) def check_duplicate_template_settings(app_configs, **kwargs): if settings.TEMPLATES: values = [ 'TEMPLATE_DIRS', 'ALLOWED...
gjtorikian/readthedocs.org
refs/heads/master
readthedocs/builds/models.py
4
import logging import re import os.path from shutil import rmtree from django.core.urlresolvers import reverse from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext from guardian.shortcuts import assign from taggit.managers import TaggableManag...
DirtyPiece/dancestudio
refs/heads/master
Build/Tools/Python27/Lib/test/test_ftplib.py
14
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase, SkipTest, skipUnl...
lwiecek/django
refs/heads/master
django/contrib/admindocs/urls.py
574
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
banmoy/ns3
refs/heads/master
src/olsr/bindings/modulegen__gcc_ILP32.py
34
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
opensourcechipspark/platform_external_chromium_org
refs/heads/master
third_party/ply/lex.py
482
# ----------------------------------------------------------------------------- # ply: lex.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ar...
resmo/ansible
refs/heads/devel
lib/ansible/plugins/action/cnos.py
38
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
mancoast/CPythonPyc_test
refs/heads/master
fail/301_test_bz2.py
3
#!/usr/bin/python from test import support from test.support import TESTFN import unittest from io import BytesIO import os import subprocess import sys import bz2 from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx") class BaseTest(unittest.TestCase):...
shownomercy/django
refs/heads/master
tests/inline_formsets/models.py
147
# -*- coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible class School(models.Model): name = models.CharField(max_length=100) class Parent(models.Model): name = models.CharField(max_length=100) class Child(models.Model): mother = models.ForeignK...
jasonbot/django
refs/heads/master
tests/test_runner_deprecation_app/tests.py
377
import warnings from django.test import TestCase from django.utils.deprecation import RemovedInNextVersionWarning warnings.warn("module-level warning from deprecation_app", RemovedInNextVersionWarning) class DummyTest(TestCase): def test_warn(self): warnings.warn("warning from test", RemovedInNextVersio...
navaneethrameshan/PMU-burst
refs/heads/master
simple_ratios.py
1
# # Simple 5 event top level model # # Constants PipelineWidth = 4 def CLKS(EV): return EV("CPU_CLK_UNHALTED.THREAD", 1) def SLOTS(EV): return PipelineWidth * CLKS(EV) class FrontendBound: name = "Frontend Bound" domain = "Slots" desc = """ This category reflects slots where the Frontend of the...
Magicking/pycoin
refs/heads/master
pycoin/scripts/tx.py
9
#!/usr/bin/env python from __future__ import print_function import argparse import calendar import codecs import datetime import io import os.path import re import subprocess import sys from pycoin.convention import tx_fee, satoshi_to_mbtc from pycoin.encoding import hash160 from pycoin.key import Key from pycoin.ke...
c0defreak/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/getpass.py
50
"""Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the passw...
biospi/seamass-windeps
refs/heads/master
src/boost_1_57_0/libs/python/test/newtest.py
46
# Copyright David Abrahams 2004. 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 m1 import * >>> from m2 import * Prove that we get an appropriate error from trying to return a type for which we h...
geoffkilpin/pombola
refs/heads/master
pombola/tasks/models.py
5
import datetime from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db.models import signals from django.dispatch import receiver class TaskCategory(models.Model): slug = models.SlugField(max_length=100, unique=T...
JackDanger/sentry
refs/heads/master
src/sentry/monkey.py
3
from __future__ import absolute_import def register_scheme(name): try: import urlparse # NOQA except ImportError: from urllib import parse as urlparse # NOQA uses = urlparse.uses_netloc, urlparse.uses_query, urlparse.uses_relative, urlparse.uses_fragment for use in uses: if n...
yoyojacky/upm
refs/heads/master
examples/python/rgb-lcd.py
16
#!/usr/bin/python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, includin...
sherazkasi/SabreSoftware
refs/heads/master
Lib/site-packages/scipy/misc/tests/test_pilutil.py
53
import os.path import numpy as np from numpy.testing import assert_, assert_equal, \ dec, decorate_methods, TestCase, run_module_suite try: import PIL.Image except ImportError: _have_PIL = False else: _have_PIL = True import scipy.misc.pilutil as pilutil # Function / method decorator for skip...
castelao/CoTeDe
refs/heads/master
tests/qctests/test_qc_rate_of_change.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Verify Rate of Change QC test """ import numpy as np from numpy import ma from cotede.qctests import RateOfChange, rate_of_change from ..data import DummyData from .compare import compare_feature_input_types, compare_input_types def test_rate_of_change(): """Ba...
letouriste001/SmartForest_2.0
refs/heads/master
python3.4Smartforest/lib/python3.4/site-packages/django/conf/locale/et/formats.py
1
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'G:i' # DATE...
narogon/linuxcnc
refs/heads/add-hal-ethercat
tests/remap/fail/prolog/remap.py
28
import emccanon import interpreter def failingprolog(self,*args, **words): emccanon.MESSAGE("failingprolog returning INTERP_ERROR") self.set_errormsg("A failed Python prolog returning INTERP_ERROR") return interpreter.INTERP_ERROR
hansey/youtube-dl
refs/heads/master
youtube_dl/extractor/vrt.py
139
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import float_or_none class VRTIE(InfoExtractor): _VALID_URL = r'https?://(?:deredactie|sporza|cobra)\.be/cm/(?:[^/]+/)+(?P<id>[^/]+)/*' _TESTS = [ # deredactie.be { 'u...
JorisKok/frappantchinees
refs/heads/master
app/book/urls.py
2
from django.urls import path from . import views urlpatterns = [ path('', views.index), ]
intermezzo-fr/rockstar
refs/heads/master
examples/html_rockstar.py
22
from rockstar import RockStar html_code = "<h1>Hello World!</h1>" rock_it_bro = RockStar(days=400, file_name='helloWorld.html', code=html_code) rock_it_bro.make_me_a_rockstar()
jsirois/pex
refs/heads/master
pex/util.py
2
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import contextlib import os import sys import tempfile from hashlib import sha1 from site import makepath # type: ignore[attr-defined] from zipfile...
dmwu/sparrow
refs/heads/master
deploy/third_party/boto-2.1.1/boto/ec2/autoscale/__init__.py
4
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ # Copyright (c) 2011 Jann Kleen # # 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 limitat...
ahmedbodi/vertcoin
refs/heads/master
test/functional/rpc_invalidateblock.py
2
#!/usr/bin/env python3 # Copyright (c) 2014-2019 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 invalidateblock RPC.""" from test_framework.test_framework import BitcoinTestFramework from t...
kennethjiang/donkey
refs/heads/master
donkeycar/parts/controllers/pid.py
3
import time class PIDController: """ Performs a PID computation and returns a control value. This is based on the elapsed time (dt) and the current value of the process variable (i.e. the thing we're measuring and trying to change). https://github.com/chrisspen/pid_controller/blob/master/p...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/xml/sax/__init__.py
237
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
Boardcoin/BOARD
refs/heads/master
share/qt/make_spinner.py
4415
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
def-/commandergenius
refs/heads/sdl_android
project/jni/python/src/Demo/turtle/tdemo_penrose.py
32
#!/usr/bin/python """ xturtle-example-suite: xtx_kites_and_darts.py Constructs two aperiodic penrose-tilings, consisting of kites and darts, by the method of inflation in six steps. Starting points are the patterns "sun" consisting of five kites and "star" consisting of five darts. For more informat...
endlessm/chromium-browser
refs/heads/master
third_party/catapult/third_party/webapp2/tests/resources/i18n.py
24
from webapp2_extras import config from webapp2_extras import i18n default_config = { 'locale': 'en_US', 'timezone': 'America/Chicago', 'required': config.REQUIRED_VALUE, } def locale_selector(store, request): return i18n.get_store().default_locale def timezone_selector(store, request): return i18...
anushbmx/kitsune
refs/heads/master
kitsune/notifications/urls_api.py
19
from rest_framework import routers from kitsune.notifications import api router = routers.SimpleRouter() router.register(r'pushnotification', api.PushNotificationRegistrationViewSet) router.register(r'notification', api.NotificationViewSet) router.register(r'realtime', api.RealtimeRegistrationViewSet) urlpatterns = r...
barbarubra/Don-t-know-What-i-m-doing.
refs/heads/master
python/src/Lib/test/test_ast.py
53
import sys, itertools, unittest from test import test_support import ast def to_tuple(t): if t is None or isinstance(t, (basestring, int, long, complex)): return t elif isinstance(t, list): return [to_tuple(e) for e in t] result = [t.__class__.__name__] if hasattr(t, 'lineno') and hasat...
jmontoyam/mne-python
refs/heads/master
mne/gui/tests/test_fiducials_gui.py
3
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os from numpy.testing import assert_array_equal from nose.tools import assert_true, assert_false, assert_equal from mne.datasets import testing from mne.utils import _TempDir, requires_traits sample_path = testing.data_path...
Lx37/seaborn
refs/heads/master
examples/facets_with_custom_projection.py
26
""" FacetGrid with custom projection ================================ _thumb: .33, .5 """ import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns sns.set() # Generate an example radial datast r = np.linspace(0, 10, num=100) df = pd.DataFrame({'r': r, 'slow': r, 'medium': 2 * r, ...
UrusTeam/android_ndk_toolchain_cross
refs/heads/master
lib/python2.7/encodings/mac_roman.py
593
""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.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,err...
simonwydooghe/ansible
refs/heads/devel
lib/ansible/modules/network/check_point/cp_mgmt_dns_domain.py
20
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
zephyrplugins/zephyr
refs/heads/master
zephyr.plugin.jython/jython2.5.2rc3/Lib/encodings/mac_croatian.py
593
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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,inp...
semonte/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/dateformat.py
234
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print df.format('jS F Y H:i') 7th October 2003 11:39 >>> """ import re import time import calendar from django.utils.dates import MONTHS, MONTHS_3, ...
LinkHS/incubator-mxnet
refs/heads/master
example/ssd/dataset/yolo_format.py
55
# 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...
kronicz/ecommerce-2
refs/heads/master
lib/python2.7/site-packages/setuptools/py27compat.py
958
""" Compatibility Support for Python 2.7 and earlier """ import sys def get_all_headers(message, key): """ Given an HTTPMessage, return all headers matching a given key. """ return message.get_all(key) if sys.version_info < (3,): def get_all_headers(message, key): return message.getheaders(key)
boyuegame/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/distutils/tests/test_bdist_dumb.py
103
"""Tests for distutils.command.bdist_dumb.""" import os import sys import zipfile import unittest from test.support import run_unittest from distutils.core import Distribution from distutils.command.bdist_dumb import bdist_dumb from distutils.tests import support SETUP_PY = """\ from distutils.core import setup impo...
elopezga/ErrorRate
refs/heads/master
ivi/agilent/agilent8594Q.py
6
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2014 Alex Forencich 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...
hyperized/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_gtm_pool_member.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gfrubi/FM2
refs/heads/master
figuras-editables/fig-Legendre-serie-Delta.py
1
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np from scipy.special import * from math import factorial def sn_delta(m,x): """ Implementación escalar de la serie truncada hasta orden $n$ de la serie de Fourier de la función delta de dirac con período $T$. """ sn_delta=0....
was4444/chromium.src
refs/heads/nw15
third_party/google_input_tools/third_party/closure_library/closure/bin/build/jscompiler.py
63
#!/usr/bin/env python # Copyright 2010 The Closure Library 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 # ...
rbiswas4/FluctuationsInCosmology
refs/heads/master
utils/ioutils.py
1
#!/usr/bin/env python #Module for IO functionality that is relatively general. The functions in #this module are tested versions of ioutilst.py in sntools. #R. Biswas, Thu Jan 30 19:42:19 CST 2014 def tokenizeline (line , delimstrings = "" , ignorestrings = ["#"]): """splits the string line into two substrings ...
mihaip/NewsBlur
refs/heads/master
apps/rss_feeds/migrations/0072_search_indexed.py
17
# -*- coding: utf-8 -*- 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 field 'Feed.search_indexed' db.add_column('feeds', 'search_indexed', self.gf(...
masamichi/bite-project
refs/heads/master
deps/gdata-python-client/src/gdata/tlslite/utils/PyCrypto_TripleDES.py
359
"""PyCrypto 3DES implementation.""" from cryptomath import * from TripleDES import * if pycryptoLoaded: import Crypto.Cipher.DES3 def new(key, mode, IV): return PyCrypto_TripleDES(key, mode, IV) class PyCrypto_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDE...
jimstorch/tokp
refs/heads/master
tokp_lib/zones.py
1
#------------------------------------------------------------------------------ # File: zones.py # Purpose: loads raid zone related lookups from text files # Author: Jim Storch # Revised: # License: GPLv3 see LICENSE.TXT #--------------------------------------------------------------------...
moyamo/transwhat
refs/heads/yowsup-2
yowsupwrapper.py
1
import logging from yowsup import env from yowsup.stacks import YowStack from yowsup.common import YowConstants from yowsup.layers import YowLayerEvent, YowParallelLayer from yowsup.layers.auth import AuthError # Layers from yowsup.layers.axolotl import YowAxolotlLayer from yowsup.layers.auth import Yo...
frouty/odoo_oph
refs/heads/dev_70
addons/resource/faces/plocale.py
433
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
okwow123/djangol2
refs/heads/master
example/env/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
168
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
shashisp/blumix-webpy
refs/heads/master
app/gluon/tests/test_cache.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for gluon.cache """ import os import unittest from fix_path import fix_sys_path fix_sys_path(__file__) from storage import Storage from cache import CacheInRam, CacheOnDisk, Cache oldcwd = None def setUpModule(): global oldcwd if oldcwd is ...
crazy-canux/django
refs/heads/master
tests/model_forms/tests.py
44
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from djang...
livepy/scrapy
refs/heads/master
scrapy/utils/sitemap.py
146
""" Module for processing Sitemaps. Note: The main purpose of this module is to provide support for the SitemapSpider, its API is subject to change without notice. """ import lxml.etree class Sitemap(object): """Class to parse Sitemap (type=urlset) and Sitemap Index (type=sitemapindex) files""" def __in...
Fatman13/gta_swarm
refs/heads/master
hc_pool.py
1
#!/usr/bin/env python # coding=utf-8 import pprint import csv import click import requests import datetime as datetime from bs4 import BeautifulSoup # from splinter import Browser import time import re import copy import os import json from selenium import webdriver from selenium.webdriver.common.by i...
liikGit/MissionPlanner
refs/heads/master
Lib/stat.py
60
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8...
openai/cleverhans
refs/heads/master
examples/nips17_adversarial_competition/dev_toolkit/sample_defenses/ens_adv_inception_resnet_v2/defense.py
2
"""Implementation of sample defense. This defense loads inception resnet v2 checkpoint and classifies all images using loaded checkpoint. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from scipy.misc import imread impor...
pselle/calibre
refs/heads/master
src/calibre/db/tests/profiling.py
14
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, cProfile from tempfile import gettempdir from calibre.db.legacy ...
chrisrico/python-trezor
refs/heads/master
tests/test_msg_getaddress_show.py
3
import unittest import common import trezorlib.ckd_public as bip32 import trezorlib.types_pb2 as proto_types import binascii class TestMsgGetaddress(common.TrezorTest): def test_show(self): self.setup_mnemonic_nopin_nopassphrase() self.assertEqual(self.client.get_address('Bitcoin', [1], show_displ...
paran0ids0ul/infernal-twin
refs/heads/master
build/pillow/build/lib.linux-i686-2.7/PIL/JpegImagePlugin.py
25
# # The Python Imaging Library. # $Id$ # # JPEG (JFIF) file handling # # See "Digital Compression and Coding of Continuous-Tone Still Images, # Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1) # # History: # 1995-09-09 fl Created # 1995-09-13 fl Added full parser # 1996-03-25 fl Added hack to use t...
tlatzko/spmcluster
refs/heads/master
.tox/docs/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py
427
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). """ from __future__ import unicode_literals import codecs from email...
MTG/acousticbrainz-client
refs/heads/master
abz/vendor/requests/packages/urllib3/util/connection.py
319
from socket import error as SocketError try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dr...
jhunkeler/hstcal
refs/heads/master
tests/wfc3/test_ir_12asn.py
1
import subprocess import pytest from ..helpers import BaseWFC3 @pytest.mark.slow class TestIR12ASN(BaseWFC3): """Tests for WFC3/IR.""" detector = 'ir' def test_ir_12asn(self): """Ported from ``calwf3_ir_12``.""" asn_file = 'ibh719010_asn.fits' # Prepare input file. self.g...
QudevETH/PycQED_py3
refs/heads/qudev_master
pycqed/measurement/benchmarking/randomized_benchmarking.py
1
import numpy as np import traceback from copy import deepcopy from pycqed.analysis_v3.processing_pipeline import ProcessingPipeline from pycqed.measurement.calibration.two_qubit_gates import MultiTaskingExperiment from pycqed.measurement.sweep_points import SweepPoints from pycqed.measurement.randomized_benchmarking im...
mmnelemane/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_lock_server.py
35
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
TNick/pyl2extra
refs/heads/master
pyl2extra/utils/npy.py
1
""" Helper functions related to numpy. """ __authors__ = "Nicu Tofan" __copyright__ = "Copyright 2015, Nicu Tofan" __credits__ = ["Nicu Tofan"] __license__ = "3-clause BSD" __maintainer__ = "Nicu Tofan" __email__ = "nicu.tofan@gmail.com" from copy import copy import numpy def _slice(array, outlen, address=None): ...
inhuszar/histreg
refs/heads/master
quadratic-ortho-reslice.py
1
#!/Users/inhuszar/MND_HistReg/MND_HistReg_Python/bin/python # 2017-Jun-07 First release. # Description: fits a plane and a special type of quadric surface onto given # points in xyz. Loads MR volume, slices along the surface and projects it # orthogonally onto the plane. Parallel sclices are gathered while translating...
rduivenvoorde/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/VectorLayerScatterplot.py
30
# -*- coding: utf-8 -*- """ *************************************************************************** EquivalentNumField.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *******************...
xshotD/pyglet
refs/heads/master
contrib/wydget/wydget/widgets/label.py
29
import operator import xml.sax.saxutils from xml.etree import ElementTree from pyglet.gl import * import pyglet.image from wydget import element, event, loadxml, util, data, style TOP = 'top' BOTTOM = 'bottom' LEFT = 'left' RIGHT = 'right' CENTER = 'center' class ImageCommon(element.Element): image = None bl...
pybuilder/pybuilder
refs/heads/master
src/main/python/pybuilder/_vendor/colorama/ansi.py
640
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set...
facebook/fbthrift
refs/heads/master
thrift/compiler/test/fixtures/py-reserved/gen-py/__init__.py
146
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated #
josanvel/BazarPapeleriaLulita
refs/heads/master
CodigoBazarLulita/Modificar.py
1
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'modificar.ui' # # Created: Sun Mar 15 12:31:41 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attr...
github4ry/python-goose
refs/heads/develop
goose/extractors/title.py
10
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
qedi-r/home-assistant
refs/heads/dev
tests/components/upnp/__init__.py
42
"""Tests for the IGD component."""
Ircam-Web/mezzanine-organization
refs/heads/master
organization/network/management/commands/import-ircam-timesheet-xls.py
1
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
meghana1995/sympy
refs/heads/master
sympy/printing/jscode.py
61
""" Javascript code printer The JavascriptCodePrinter converts single sympy expressions into single Javascript expressions, using the functions defined in the Javascript Math object where possible. """ from __future__ import print_function, division from sympy.core import S from sympy.printing.codeprinter import Co...
koparasy/faultinjection-gem5
refs/heads/master
ext/ply/test/yacc_badrule.py
174
# ----------------------------------------------------------------------------- # yacc_badrule.py # # Syntax problems in the rule strings # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex imp...
vbannai/neutron
refs/heads/master
neutron/plugins/hyperv/agent/security_groups_driver.py
11
#Copyright 2014 Cloudbase Solutions SRL #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 req...
iedparis8/django-crispy-forms
refs/heads/dev
crispy_forms/tests/utils.py
25
__all__ = ('override_settings',) try: from django.test.utils import override_settings except ImportError: # we are in Django 1.3 from django.conf import settings, UserSettingsHolder from django.utils.functional import wraps class override_settings(object): """ Acts as either a dec...
BT-aestebanez/l10n-switzerland
refs/heads/9.0
l10n_ch_pain_direct_debit/models/account_payment_method.py
2
# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api class AccountPaymentMethod(models.Model): _inherit = 'account.payment.method' pain_version = fields.Selecti...
indictranstech/trufil-frappe
refs/heads/develop
frappe/core/doctype/report/boilerplate/controller.py
103
# Copyright (c) 2013, {app_publisher} and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe def execute(filters=None): columns, data = [], [] return columns, data
Jeebeevee/DouweBot
refs/heads/master
plugins_org/util/urlnorm.py
27
""" URI Normalization function: * Always provide the URI scheme in lowercase characters. * Always provide the host, if any, in lowercase characters. * Only perform percent-encoding where it is essential. * Always use uppercase A-through-F characters when percent-encoding. * Prevent dot-segments appearing in non-re...