repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
krahman/rethinkdb
refs/heads/next
lib/vcoptparse/vcoptparse.py
12
# Copyright 2010-2012 RethinkDB, all rights reserved. """ vcoptparse is short for Value-Centric Option Parser. It's a tiny argument parsing library. It has less features than optparse or argparse, but it kicks more ass. optparse and argparse allow the client to specify the flags that should be parsed, and as an aftert...
bixbydev/Bixby
refs/heads/master
google/gdata-2.0.18/samples/apps/marketplace_sample/gdata/apps/emailsettings/data.py
23
#!/usr/bin/python # # Copyright 2010 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 ...
amarzavery/AutoRest
refs/heads/master
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureResource/fixtures/acceptancetestsazureresource/models/__init__.py
31
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
crr0004/taiga-back
refs/heads/master
taiga/projects/wiki/serializers.py
10
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program 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 F...
apache/tinkerpop
refs/heads/master
gremlin-python/src/main/python/tests/structure/io/test_graphsonV2d0.py
2
# # 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...
mcgachey/edx-platform
refs/heads/master
openedx/core/lib/api/permissions.py
12
""" API library for Django REST Framework permissions-oriented workflows """ from django.conf import settings from rest_framework import permissions from django.http import Http404 from student.roles import CourseStaffRole class ApiKeyHeaderPermission(permissions.BasePermission): """ Django REST Framework p...
morogoku/MoRoKernel-G935F-601
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
SoyM/Jiang
refs/heads/master
pytesser.py
6
"""OCR in Python using the Tesseract engine from Google http://code.google.com/p/pytesser/ by Michael J.T. O'Kelly V 0.0.1, 3/10/07""" import Image import subprocess import util import errors tesseract_exe_name = 'tesseract' # Name of executable to be called at command line scratch_image_name = "temp.bmp" # This fil...
ubgarbage/gae-blog
refs/heads/master
django/contrib/localflavor/se/utils.py
202
import re import datetime def id_number_checksum(gd): """ Calculates a Swedish ID number checksum, using the "Luhn"-algoritm """ n = s = 0 for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']): tmp = ((n % 2) and 1 or 2) * int(c) if tmp > 9: tmp = sum([int(...
ProfessionalIT/professionalit-webiste
refs/heads/master
sdk/google_appengine/lib/cherrypy/cherrypy/lib/caching.py
88
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
ovresko/erpnext
refs/heads/master
erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py
12
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals from erpnext.setup.utils import get_exchange_rate from frappe.utils import flt, cint import frappe def execute(filters=None): qty_list = get_quantity_list(fil...
numerigraphe/odoomrp-wip
refs/heads/8.0
mrp_bom_catch_product_code/models/__init__.py
29
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
Luxapodular/processing.py
refs/heads/master
examples.py/Basics/Shape/ScaleShape.py
7
""" Scale Shape. Illustration by George Brower. (Rewritten in Python by Jonathan Feinberg.) Move the mouse left and right to zoom the SVG file. This shows how, unlike an imported image, the lines remain smooth at any size. """ # The file "bot1.svg" must be in the data folder # of the current sketch to load suc...
saurabh6790/tru_lib_back
refs/heads/master
core/doctype/doctype/__init__.py
2292
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals
tomchristie/django
refs/heads/master
tests/flatpages_tests/test_csrf.py
130
from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import Client, TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES @modify_settings(INSTALLED_APPS={'append': 'django.contr...
starrify/scrapy
refs/heads/master
tests/test_stats.py
7
from datetime import datetime import unittest from unittest import mock from scrapy.extensions.corestats import CoreStats from scrapy.spiders import Spider from scrapy.statscollectors import StatsCollector, DummyStatsCollector from scrapy.utils.test import get_crawler class CoreStatsExtensionTest(unittest.TestCase):...
mdrio/pydoop
refs/heads/develop
pydoop/mapreduce/pipes.py
3
# BEGIN_COPYRIGHT # # Copyright 2009-2015 CRS4. # # 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 ...
hryamzik/ansible
refs/heads/devel
lib/ansible/plugins/action/vyos_config.py
51
# # Copyright 2015 Peter Sprygada <psprygada@ansible.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) any...
nikhilgahlawat/ThinkStats2
refs/heads/master
code/nsfg2.py
74
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import thinkstats2 def MakeFrames(): """Reads pregnancy data...
libicocco/poser-hand-generator
refs/heads/master
setCamAZEL.py
1
# setCamAZEL.py # # Copyright (c) 2009 Javier Romero # # Author: Javier Romero <jrgn@kth.se> # # 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...
cchurch/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_nitro_request.py
31
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
mohanprasath/Course-Work
refs/heads/master
data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part04-e07_subsetting_with_loc/tmc/points.py
91
from inspect import isclass, isfunction from collections import defaultdict point_register = {'suite': defaultdict(list), 'test': defaultdict(list)} def qualifier(test): return "%s.%s" % (test.__module__, test.__qualname__) def save_points(o, points, dst): q = qualifier(o) dst[q] += filter(lambda point...
marscher/cython
refs/heads/master
pyximport/pyximport.py
100
""" Import hooks; when installed with the install() function, these hooks allow importing .pyx files as if they were Python modules. If you want the hook installed every time you run Python you can add it to your Python version by adding these lines to sitecustomize.py (which you can create from scratch in site-packa...
RapidApplicationDevelopment/tensorflow
refs/heads/master
tensorflow/python/lib/io/python_io.py
29
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Lamelos/django-allauth-office365
refs/heads/master
allauth_office365/models.py
4209
# Create your models here.
Maspear/odoo
refs/heads/8.0
addons/sale_margin/__openerp__.py
261
############################################################################## # # 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 GNU Affero General Public L...
nikhilRP/bioDiscover
refs/heads/master
src/indexer/indexer.py
1
from pyelasticsearch import ElasticSearch from pyelasticsearch import IndexAlreadyExistsError import json import re from glob import glob es = ElasticSearch('http://localhost:9200/') def index_wikipathways(): ''' Index wiki pathways in elasticsearch ''' doc_type = 'wikipathways' counter = 0 documen...
DESHRAJ/fjord
refs/heads/master
vendor/packages/requests/requests/packages/chardet/big5freq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
40423240/2016fallcadp_hw
refs/heads/gh-pages
plugin/liquid_tags/diag.py
270
""" Blockdiag Tag --------- This tag implements a liquid style tag for blockdiag [1]. You can use different diagram types like blockdiag, seqdiag, packetdiag etc. [1] [1] http://blockdiag.com/en/blockdiag/ Syntax ------ {% blockdiag { <diagramm type> { <CODE> } } %} Examples -------...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/draft_schematic/item/quest_item/attunement_grid.py
85615
import sys def setup(core, object): return
dennis-sheil/commandergenius
refs/heads/sdl_android
project/jni/python/src/Lib/ctypes/test/test_pointers.py
51
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, long, int, long, long, long, float, float] class Point...
Amechi101/concepteur-market-app
refs/heads/master
venv/lib/python2.7/site-packages/PIL/WalImageFile.py
14
# -*- coding: iso-8859-1 -*- # # The Python Imaging Library. # $Id$ # # WAL file handling # # History: # 2003-04-23 fl created # # Copyright (c) 2003 by Fredrik Lundh. # # See the README file for information on usage and redistribution. # # NOTE: This format cannot be automatically recognized, so the reader # is not...
golden1232004/webrtc_new
refs/heads/master
chromium/src/build/android/gyp/insert_chromium_version.py
77
#!/usr/bin/env python # # Copyright 2014 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. """Insert a version string into a library as a section '.chromium.version'. """ import optparse import os import sys import tempfile...
Microsoft/PTVS
refs/heads/master
Python/Tests/TestData/DebuggerProject/BreakpointFilenames.py
7
import A import A.module1 A.do_something() A.module1.do_something()
DavidWhittingham/arcpyext
refs/heads/develop
arcpyext/conversion/_ToCsvBase.py
1
# coding=utf-8 """Class for commonalities in the conversion process.""" # Python 2/3 compatibility # pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins.disabled import ...
pombredanne/http-repo.gem5.org-gem5-
refs/heads/master
util/cpt_upgraders/arm-miscreg-teehbr.py
29
# Add the ARM MISCREG TEEHBR def upgrader(cpt): if cpt.get('root','isa') == 'arm': for sec in cpt.sections(): import re # Search for all ISA sections if re.search('.*sys.*\.cpu.*\.isa$', sec): mr = cpt.get(sec, 'miscRegs').split() if len(mr...
andim27/magiccamp
refs/heads/master
django/views/defaults.py
34
from django import http from django.template import Context, RequestContext, loader def page_not_found(request, template_name='404.html'): """ Default 404 handler. Templates: `404.html` Context: request_path The path of the requested URL (e.g., '/app/pages/bad_page/') """ t...
AunShiLord/sympy
refs/heads/master
sympy/physics/__init__.py
117
""" A module that helps solving problems in physics """ from . import units from .matrices import mgamma, msigma, minkowski_tensor, mdft
dimaspivak/docker-py
refs/heads/master
tests/unit/api_container_test.py
3
# -*- coding: utf-8 -*- import datetime import json import signal import docker import pytest import six from . import fake_api from ..helpers import requires_api_version from .api_test import ( BaseAPIClientTest, url_prefix, fake_request, DEFAULT_TIMEOUT_SECONDS, fake_inspect_container ) try: from unit...
benbahrenburg/titanium_mobile
refs/heads/master
support/iphone/logger.py
36
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Tail an application log file running in the iPhone Simulator # import os, sys, subprocess, time, signal, run, filetail def find_file(folder, fname): for root, dirs, files in os.walk(folder): for file in files: # make search case insensitive ...
apieum/eventize
refs/heads/master
eventize/tests/typing/testStack.py
1
# -*- coding: utf8 -*- from .. import TestCase, Mock from eventize.typing import CheckedStack return_true = lambda item: True class CheckedStackTest(TestCase): def test_push_appends_items_from_left(self): item1, item2 = Mock(), Mock() stack = CheckedStack(check=return_true) stack.push(item...
JoseALermaIII/python-tutorials
refs/heads/master
pythontutorials/books/CrackingCodes/Ch22/primeNum.py
1
"""Prime Number Sieve Implements a series of functions that determine if a given number is prime. Attributes: LOW_PRIMES (list): List containing prime numbers <= 100 (aka 'low primes'). Note: * https://www.nostarch.com/crackingcodes/ (BSD Licensed) """ import math, random def isPrimeTrialDiv(num: int) ->...
N6UDP/cslbot
refs/heads/master
cslbot/commands/blame.py
2
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
MatthewWilkes/django
refs/heads/master
tests/gis_tests/geo3d/tests.py
199
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.db.models import Extent3D, Union from django.contrib.gis.db.models.functions import ( AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate, ) from django.contrib.gis.gdal import HAS_GDAL from djang...
abtreece/ansible
refs/heads/stable-2.2
lib/ansible/plugins/callback/logentries.py
69
""" (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.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 o...
MikkCZ/kitsune
refs/heads/master
kitsune/customercare/tasks.py
21
from datetime import date from celery import task from kitsune.customercare.models import Reply from kitsune.kbadge.utils import get_or_create_badge from kitsune.sumo.decorators import timeit @task() @timeit def maybe_award_badge(badge_template, year, user): """Award the specific badge to the user if they've ea...
xujb/odoo
refs/heads/8.0
addons/account/installer.py
381
# -*- 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 GNU...
shellderp/sublime-robot-plugin
refs/heads/master
lib/robot/model/itemlist.py
4
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
2014cdag2/w17x1
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/importlib/basehook.py
608
from javascript import JSObject from browser import window import urllib.request class TempMod: def __init__(self, name): self.name=name #define my custom import hook (just to see if it get called etc). class BaseHook: def __init__(self, fullname=None, path=None): self._fullname=fullname self._p...
ericholscher/django
refs/heads/master
tests/signing/tests.py
1
from __future__ import unicode_literals import time from django.core import signing from django.test import TestCase from django.utils.encoding import force_str from django.utils import six class TestSigner(TestCase): def test_signature(self): "signature() method should generate a signature" si...
daenamkim/ansible
refs/heads/devel
test/units/module_utils/basic/test_run_command.py
86
# -*- coding: utf-8 -*- # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import errno from itertools import product from io import Byt...
asimshankar/tensorflow
refs/heads/master
tensorflow/python/autograph/utils/tensors.py
23
# Copyright 2017 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...
cstipkovic/spidermonkey-research
refs/heads/master
testing/mozbase/mozrunner/mozrunner/utils.py
1
#!/usr/bin/env python # 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/. """Utility functions for mozrunner""" __all__ = ['findInPath', 'get_metadata_from_egg', 'uses_ma...
fmartinelli/libqif
refs/heads/master
lib/gtest-1.7.0/scripts/pump.py
2471
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
neudesk/neucloud
refs/heads/master
openstack_dashboard/dashboards/project/access_and_security/floating_ips/urls.py
9
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
assad2012/shadowsocks
refs/heads/master
utils/autoban.py
1033
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
qedi-r/home-assistant
refs/heads/dev
homeassistant/components/xiaomi_miio/switch.py
2
"""Support for Xiaomi Smart WiFi Socket and Smart Power Strip.""" import asyncio from functools import partial import logging from miio import ( # pylint: disable=import-error AirConditioningCompanionV3, ChuangmiPlug, Device, DeviceException, PowerStrip, ) from miio.powerstrip import PowerMode # ...
Jumpscale/web
refs/heads/master
pythonlib/mongoengine/queryset/field_list.py
15
__all__ = ('QueryFieldList',) class QueryFieldList(object): """Object that handles combinations of .only() and .exclude() calls""" ONLY = 1 EXCLUDE = 0 def __init__(self, fields=None, value=ONLY, always_include=None, _only_called=False): """The QueryFieldList builder :param fields: ...
torchbox/django-modelcluster
refs/heads/master
modelcluster/models.py
1
from __future__ import unicode_literals import json import datetime from django.db import models from django.db.models.fields.related import ForeignObjectRel from django.db.models.fields import FieldDoesNotExist from django.utils.encoding import is_protected_type from django.core.serializers.json import DjangoJSONEnc...
mahadi123/hello-world
refs/heads/master
gcj_renew_login.py
21
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
StormyApps/Toontown-Testing
refs/heads/master
main.py
1
from sys import argv from direct.directbase.DirectStart import * from direct.task import Task from direct.actor.Actor import Actor from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.showbase.InputStateGlobal import inputState from direct.control...
perdona/titanium_mobile
refs/heads/master
support/iphone/poorjson.py
37
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Jeff's poor man python JSON encoder # import os,types class PoorJSON(object): def array(self,v): list = [] for x in v: list.append(self.get(x)) return '[%s]' % (','.join(list)) def string(self,v): return '"%s"' % v def unicode(self,v): return u'"%s"...
nnethercote/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/attrs/src/attr/_make.py
41
from __future__ import absolute_import, division, print_function import hashlib import linecache import sys import threading import warnings from operator import itemgetter from . import _config from ._compat import ( PY2, isclass, iteritems, metadata_proxy, ordered_dict, set_closure_cell ) from .exceptions impo...
bgris/ODL_bgris
refs/heads/master
lib/python3.5/site-packages/odl/phantom/misc_phantoms.py
1
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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. ...
denny820909/builder
refs/heads/master
lib/python2.7/site-packages/buildbot_slave-0.8.8-py2.7.egg/buildslave/monkeypatches/testcase_assert.py
4
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
edx/edx-platform
refs/heads/master
lms/djangoapps/certificates/tests/test_utils.py
3
""" Tests for Certificates app utility functions """ from unittest.mock import patch from django.test import TestCase from lms.djangoapps.certificates.utils import has_html_certificates_enabled from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory class CertificateUtilit...
zsulocal/pycoin
refs/heads/master
pycoin/tools/bitcoind_disk.py
2
import logging import platform import struct import os from pycoin.block import Block from pycoin.blockchain.BlockChain import BlockChain from pycoin.serialize import h2b logger = logging.getLogger(__file__) class Blockfiles(object): def __init__(self, base_dir=None, start_info=(0, 0)): if base_dir is ...
guiniol/py3status
refs/heads/master
py3status/screenshots.py
2
# -*- coding: utf-8 -*- """ This file is used for the generation of screenshots for py3status documentation. outside of pythons standard library there are the following requirements: Pillow==3.4.2 fonttools PIL may work if installed but is not supported. """ from __future__ import division import ast impor...
Omegaphora/external_chromium_org_tools_grit
refs/heads/lp5.1
grit/tool/postprocess_interface.py
62
#!/usr/bin/env python # 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. ''' Base class for postprocessing of RC files. ''' class PostProcessor(object): ''' Base class for postprocessing of the RC fil...
aromanovich/kozmic-ci
refs/heads/master
kozmic/auth/__init__.py
3
# coding: utf-8 """ kozmic.auth ~~~~~~~~~~~ .. attribute:: bp :class:`flask.Blueprint` that implements an authentication through GitHub. """ import certifi from flask import Blueprint, redirect, url_for from flask.ext.oauth import OAuth from flask.ext.login import current_user from flask.ext.principal import Anon...
seomoz/s3po
refs/heads/master
s3po/util.py
1
'''Various utilities''' import time from six.moves import xrange # Logging import logging logger = logging.getLogger('s3po') formatter = logging.Formatter('[%(asctime)s] %(levelname)s in %(module)s:%(funcName)s@%(lineno)s => %(message)s') handler = logging.StreamHandler() handler.setLevel(logging.WARNING) handler.set...
vitorio/bite-project
refs/heads/master
deps/gdata-python-client/samples/apps/marketplace_sample/gdata/apps/organization/service.py
133
#!/usr/bin/python # # Copyright (C) 2008 Google, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
econchick/heroku-buildpack-python
refs/heads/master
vendor/distribute-0.6.34/setuptools/command/saveopts.py
167
import distutils, os from setuptools import Command from setuptools.command.setopt import edit_config, option_base class saveopts(option_base): """Save command-line options to a file""" description = "save supplied options to setup.cfg or other config file" def run(self): dist = self.distribution...
Nuevosmedios/django-badger
refs/heads/master
badger/migrations/0003_auto__add_field_award_claim_code__chg_field_deferredaward_claim_code.py
10
# -*- 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 'Award.claim_code' db.add_column('badger_award', 'claim_code', self.gf(...
Nebucatnetzer/tamagotchi
refs/heads/master
pygame/lib/python3.4/site-packages/faker/providers/person/lv_LV/__init__.py
19
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{last_name}}, {{first_name}}' ) first_names = ( 'Ādams',...
apophys/ipaqe-dyndir
refs/heads/master
tests/test_inventory_core.py
1
# coding: utf-8 # Author: Milan Kubik from ipaqe_dyndir.inventory import Inventory from .util import get_test_data def test_empty_inventory_data(): inventory = Inventory({}) assert inventory.data == {} def test_empty_inventory_metadata(): inventory = Inventory({}) assert inventory.metadata == {} ...
rolandgeider/wger
refs/heads/master
wger/manager/__init__.py
1
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager 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 option) any ...
Theb-1/home-assistant
refs/heads/dev
homeassistant/components/light/rfxtrx.py
2
""" homeassistant.components.light.rfxtrx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for RFXtrx lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.rfxtrx/ """ import logging import homeassistant.components.rfxtrx as rfxtrx from homeassistan...
krazybean/randomaas
refs/heads/master
lib/python2.6/site-packages/requests/packages/urllib3/fields.py
294
# urllib3/fields.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import email.utils import mimetypes from .packages import six def guess_content_type(filename...
jaruba/chromium.src
refs/heads/nw12
tools/perf/measurements/smoothness_controller.py
9
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys from measurements import smooth_gesture_util from telemetry.core.platform import tracing_category_filter from telemetry.core.platform import traci...
Louis31415/opugStore
refs/heads/master
Store/Store/urls.py
1
"""Store URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
lamblin/pylearn2
refs/heads/master
pylearn2/testing/prereqs.py
44
""" Objects to be used as Monitor prereqs during testing. """ class ReadVerifyPrereq(object): """ Part of tests/test_monitor.py. Just put here so it be serialized. Parameters ---------- counter_idx : WRITEME counter : WRITEME """ def __init__(self, counter_idx, counter): self....
mferenca/HMS-ecommerce
refs/heads/HMSecommerce
ecommerce/extensions/payment/tests/mixins.py
1
import json import os from urlparse import urljoin from django.conf import settings import httpretty import mock from oscar.core.loading import get_model from oscar.test import newfactories from suds.sudsobject import Factory from ecommerce.extensions.payment.constants import CARD_TYPES from ecommerce.extensions.paym...
duoduo369/python-social-auth
refs/heads/master
social/backends/soundcloud.py
83
""" Soundcloud OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/soundcloud.html """ from social.p3 import urlencode from social.backends.oauth import BaseOAuth2 class SoundcloudOAuth2(BaseOAuth2): """Soundcloud OAuth authentication backend""" name = 'soundcloud' AUTHORIZATION_URL = ...
guewen/odoo
refs/heads/master
openerp/addons/base/tests/test_uninstall.py
175
# -*- coding: utf-8 -*- # This assumes an existing but uninitialized database. import unittest2 import openerp from openerp import SUPERUSER_ID import common DB = common.DB ADMIN_USER_ID = common.ADMIN_USER_ID def registry(model): return openerp.modules.registry.RegistryManager.get(DB)[model] def cursor(): ...
ThunderGemios10/The-Super-Duper-Script-Editor
refs/heads/master
keyword_highlighter.py
1
################################################################################ ### Copyright © 2012-2013 BlackDragonHunt ### ### This file is part of the Super Duper Script Editor. ### ### The Super Duper Script Editor is free software: you can redistribute it ### and/or modify it under the terms of the GNU Genera...
benabraham/cz.pycon.org-2017
refs/heads/master
pyconcz_2017/speakers/migrations/0004_speaker_email.py
3
# -*- coding: utf-8 -*- # Generated by Django 1.9.3 on 2016-09-26 20:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('speakers', '0003_auto_20160926_2240'), ] operations = [ migrations.AddField(...
kaplun/ops
refs/heads/prod
modules/webstyle/lib/goto_webinterface.py
24
## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Inv...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
parallel/test_cases/27NodeBrick/cantilever_different_Poisson/NumberOfDivision2/PoissonRatio0.15/compare_txt.py
637
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
PumpGroupCoin/PumpGroupCoin
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...
virneo/nupic
refs/heads/master
examples/sp/hello_sp.py
25
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
ah-anssi/SecuML
refs/heads/master
SecuML/experiments/__init__.py
1
# SecuML # Copyright (C) 2018 ANSSI # # SecuML 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. # # SecuML is distributed in the hope t...
bsdlp/ipsetgen
refs/heads/master
ipsetgen/__init__.py
2
from warnings import warn import ipaddress import subprocess class IPSet(object): def __init__(self, role, ipset_cmd=None): if ipset_cmd is None: self.ipset_cmd = 'ipset' else: self.ipset_cmd = ipset_cmd subprocess.check_output((ipset_cmd, '-v'), ...
KwadroNaut/bitmask_client
refs/heads/develop
src/leap/bitmask/gui/eip_status.py
2
# -*- coding: utf-8 -*- # eip_status.py # Copyright (C) 2013 LEAP # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
adsznzhang/learntosolveit
refs/heads/version1
languages/python/networking_email1.py
7
# Import smtplib for the actual sending function import smtplib # Import the email modules we'll need from email.mime.text import MIMEText # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. fp = open('content.txt', 'rb') # Create a text/plain message m...
blancltd/django-haystack
refs/heads/master
test_haystack/test_indexes.py
13
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import datetime import time from threading import Thread from django.test import TestCase from django.utils.six.moves import queue from test_haystack.core.models import AFifthMockModel, AThirdMockModel, MockModel fr...
zerothi/sids
refs/heads/master
sisl/io/siesta/tests/test_eig.py
1
import pytest import os.path as osp import sisl from sisl.io.siesta.fdf import * from sisl.io.siesta.eig import * import numpy as np pytestmark = [pytest.mark.io, pytest.mark.siesta] _dir = osp.join('sisl', 'io', 'siesta') def test_si_pdos_kgrid_eig(sisl_files): f = sisl_files(_dir, 'si_pdos_kgrid.EIG') eig ...
srmagura/aqua-emblem
refs/heads/master
util/ploc.py
1
import sys import os from collections import OrderedDict def get_extension(fname): return fname.split('.')[-1] ROOT = sys.path[0] + '/../' languages = OrderedDict(( ('coffee', 'CoffeeScript'), ('css', 'CSS'), ('html', 'HTML'), ('py', 'Python'), )) exclude = {'index.html'} counts = {key: 0 for ...
Diapolo/bitcoin
refs/heads/master
qa/rpc-tests/bip65-cltv.py
46
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic # from test_framework.test_framework import Bit...
boompieman/iim_project
refs/heads/master
project_python2/lib/python2.7/site-packages/IPython/config.py
13
""" Shim to maintain backwards compatibility with old IPython.config imports. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys from warnings import warn from IPython.utils.shimmodule import ShimModule, ShimWarning warn("The `IPython.config` package h...