repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
heeraj123/oh-mainline | refs/heads/master | mysite/search/migrations/0029_change_name_of_gnome_general.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 License, or
# (at your option) any later v... |
alexus37/AugmentedRealityChess | refs/heads/master | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GLES1/OES/depth24.py | 8 | '''OpenGL extension OES.depth24
This module customises the behaviour of the
OpenGL.raw.GLES1.OES.depth24 to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/OES/depth24.txt
'''
from OpenGL import platform, constant, arrays
from Open... |
plastboks/Pulpy | refs/heads/develop | pulpy/forms/meta.py | 1 | from datetime import timedelta
from wtforms.ext.csrf.session import SessionSecureForm
strip_filter = lambda x: x.strip() if x else None
class BaseForm(SessionSecureForm):
"""
Base class for all the forms in the app.
This base class sets secret key for csrf and timelimit.
"""
SECRET_KEY = 'WAFaf3... |
dhocker/ahps_web | refs/heads/master | runserver.py | 1 | #
# AHPS Web - web server for managing an AtHomePowerlineServer instance
# Copyright (C) 2014, 2015 Dave Hocker (email: AtHomeX10@gmail.com)
#
# 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, ve... |
Robpol86/libnl | refs/heads/master | libnl/netlink_private/__init__.py | 4 | """Code not usually available to C libnl user applications but used by libnl itself."""
|
Nekroze/quickdial | refs/heads/master | quickdial/quickdial.py | 1 | """
Quick Dial
Usage:
quickdial
quickdial -h | --help
quickdial -v | --version
-h --help show this
-v --version show version
"""
from nekrobox.docdecs import params
from . import gateaddr
from . import pathing
from . import __version__
@params(origin=(int, "Point of origin symbol"),
length=(i... |
s3rvac/talks | refs/heads/master | 2020-03-02-Introduction-to-Python/examples/23-methods.py | 5 | class A:
def method(self):
print(self)
@classmethod
def class_method(cls):
print(cls)
@staticmethod
def static_method():
print('static_method')
a = A()
a.method() # <__main__.A object at 0x7f7f62d47a20>
A.class_method() # <class '__main__.A'>
A.static_method() #
|
makdharma/grpc | refs/heads/master | src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py | 7 | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
Chiroptera/ThesisWriting | refs/heads/master | high_res_results_isabella_pc/experiments/cuda/benchmark_K_Means.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 9 00:59:23 2015
@author: Diogo Silva
Testbench for K_Means
# TODO:
"""
import numpy as np
import K_Means3
from K_Means3 import *
from sklearn import datasets # generate gaussian mixture
from timeit import default_timer as timer # timing
import sys
# Setup logging... |
hakanozadam/bal | refs/heads/master | bal/umass_cluster/lsf/PartitionFastqJobGroup.py | 1 | #!/bin/env python3
# AUTHOR:
# Hakan Ozadam
# Moore Laboratory
# UMASS Medical School / HHMI
# RNA Therapeutics Institute
# Albert Sherman Center, ASC4-1009
# 368 Plantation Street
# Worcester, MA 01605
# USA
#
####################################################... |
elemel/project-euler | refs/heads/master | src/35.py | 1 | from util import sieve
primes = set(sieve(1000000))
def rotations(i):
result = []
s = str(i)
for j in xrange(len(s)):
result.append(int(s[j:] + s[:j]))
return result
def circular(prime):
r = set(rotations(prime))
return len(r) == len(r & primes)
def solve():
retur... |
yqm/sl4a | refs/heads/master | python/gdata/src/gdata/__init__.py | 136 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
InAnimaTe/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/test_assertutil.py | 106 | #!/usr/bin/env python
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# portions Copyright (c) 2001 Autonomous Zone Industries
# This file is part of pyutil; see README.rst for licensing terms.
# Python Standard Library modules
import unittest
from pyutil import assertutil
class Testy(unittest.TestCase):
def ... |
tremby/deluge-yarss-plugin | refs/heads/master | yarss2/lib/requests/compat.py | 49 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 = (is_py3 and _ver[1] == 1)
#:... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/boto-2.46.1/boto/cloudfront/logging.py | 219 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
follow99/django | refs/heads/master | django/contrib/auth/signals.py | 865 | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['request', 'user'])
user_login_failed = Signal(providing_args=['credentials'])
user_logged_out = Signal(providing_args=['request', 'user'])
|
jeffluppes/kanomap | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 426 | # 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... |
kdmurray91/scikit-bio | refs/heads/master | skbio/metadata/tests/__init__.py | 178 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
dnlm92/chokoretto | refs/heads/master | temp/venv/lib/python2.7/site-packages/pip/commands/search.py | 323 | from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.download import PipXmlrpcTransport
from pip.index import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from pip.exceptions import CommandError
... |
PopCap/GameIdea | refs/heads/master | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/encodings/iso8859_2.py | 593 | """ Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... |
rasmadeus/iyoume | refs/heads/master | iyoume/room/migrations/0003_auto__del_field_room__content_rendered__chg_field_room_content.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Room._content_rendered'
db.delete_column(u'room_room', ... |
kobejean/tensorflow | refs/heads/master | tensorflow/python/autograph/operators/data_structures.py | 7 | # 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... |
rousseab/pymatgen | refs/heads/master | pymatgen/core/tests/__init__.py | 37694 | from __future__ import unicode_literals
|
Zlash65/erpnext | refs/heads/develop | erpnext/patches/v6_10/__init__.py | 37694 | from __future__ import unicode_literals
|
gsdlab/claferMooStandalone | refs/heads/master | 2012-models-clafermultiobjective-data-generator/spl_datagenerator/tests/spl_claferanalyizer.py | 1 | '''
Created on Aug 28, 2012
@author: rafaelolaechea
'''
import unittest
import subprocess
from spl_datagenerator.spl_claferanalyzer import SPL_ClaferAnalyzer
from spl_datagenerator.ExpandSumOperator import expand_feature_types_sum
from spl_datagenerator.AppendPartialInstanceAndGoals import generate_and_append_partial_... |
naresh21/synergetics-edx-platform | refs/heads/oxa/master.fic | lms/envs/content.py | 168 | """
These are debug machines used for content creators, so they're kind of a cross
between dev machines and AWS machines.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .aws im... |
avara1986/gozokia | refs/heads/master | gozokia/__main__.py | 1 | # encoding: utf-8
import sys
import os
from gozokia import Gozokia
os.environ.setdefault("GOZOKIA_SETTINGS_MODULE", "settings")
goz = Gozokia()
goz.initialize()
goz.set_io(input_type="terminal_txt", output_type="terminal_txt")
goz.console()
|
adamtiger/tensorflow | refs/heads/master | tensorflow/python/framework/sparse_tensor_test.py | 45 | # 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... |
yatish27/mase | refs/heads/master | python101/code/lumpy_diag05.py | 14 | #!/usr/bin/python
"""
Code for use with Think Python: An Introduction to Software Design
Copyright 2010 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
"""
from swampy.TurtleWorld import Turtle
import Lumpy
# create a Lumpy object and capture reference state
lumpy = L... |
alexbruy/QGIS | refs/heads/master | python/plugins/db_manager/layer_preview.py | 6 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
bswartz/cinder | refs/heads/master | cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py | 1 | # (c) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
# 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/lic... |
rtucker/sycamore | refs/heads/master | Sycamore/wikidicts.py | 2 | # -*- coding: utf-8 -*-
"""
Sycamore Dictionary / Group Functions
@copyright: 2003 by Thomas Waldmann, http://linuxwiki.de/ThomasWaldmann
@copyright: 2003 by Gustavo Niemeyer,
http://moin.conectiva.com.br/GustavoNiemeyer
@license: GNU GPL, see COPYING for details.
"""
# Imports
import time
imp... |
inessadl/kinect-2-libras | refs/heads/master | Kinect2Libras/KinectFingerTracking/Lib/multiprocessing/dummy/__init__.py | 52 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.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 met:
... |
frewsxcv/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Taskmaster.py | 19 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
victorbjorklund/flask-bootstrap | refs/heads/master | tests/test_sample_app.py | 16 | import pytest
@pytest.fixture
def app():
import sys
sys.path.append('.')
from sample_app import create_app
app = create_app()
app.debug = True
app.testing = True
# manually add flask-debug
from flask_debug import Debug
Debug(app)
return app
@pytest.fixture
def client(app)... |
jambus/wechat-analysis | refs/heads/master | main.py | 1 | #!/usr/bin/env python3
import sys
import argparse
from classes.wechatSqliteUtil import WechatSqliteUtil
from classes.wechatMessageAnalysisProcessor import WechatMessageAnalysisProcessor
from classes.analysiscomponents.wechatAnalysisCounter import WechatAnalysisCounter
from classes.analysiscomponents.wechatAnalysisR... |
lbeltrame/letsencrypt | refs/heads/master | letsencrypt/tests/cli_test.py | 5 | """Tests for letsencrypt.cli."""
import argparse
import itertools
import os
import shutil
import StringIO
import traceback
import tempfile
import unittest
import mock
from acme import jose
from letsencrypt import account
from letsencrypt import cli
from letsencrypt import configuration
from letsencrypt import crypto... |
furious-luke/django-qunit-tests | refs/heads/master | qunit_tests/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
nuagenetworks/vspk-python | refs/heads/master | vspk/v6/fetchers/nunsporttemplates_fetcher.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... |
seanwestfall/django | refs/heads/master | django/template/defaultfilters.py | 224 | """Default variable filters."""
from __future__ import unicode_literals
import random as random_module
import re
import warnings
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from pprint import pformat
from django.conf import settings
from django.utils import format... |
axbaretto/beam | refs/heads/master | venv/lib/python2.7/site-packages/wheel/archive.py | 233 | """
Archive tools for wheel.
"""
import os
import time
import logging
import os.path
import zipfile
log = logging.getLogger("wheel")
def archive_wheelfile(base_name, base_dir):
'''Archive all files under `base_dir` in a whl file and name it like
`base_name`.
'''
olddir = os.path.abspath(os.curdir)
... |
arista-eosplus/ansible | refs/heads/devel | test/units/modules/cloud/docker/test_docker.py | 77 | import collections
import os
import unittest
from ansible.modules.cloud.docker._docker import get_split_image_tag
class DockerSplitImageTagTestCase(unittest.TestCase):
def test_trivial(self):
self.assertEqual(get_split_image_tag('test'), ('test', 'latest'))
def test_with_org_name(self):
sel... |
vitmod/enigma2 | refs/heads/wetek | lib/python/Plugins/Extensions/DVDBurn/Project.py | 49 | from Tools.Directories import fileExists
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, ConfigSequence, ConfigSubList
import Title
import xml.dom.minidom
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS
class ConfigColor(ConfigSequence):
de... |
cnluzon/prophtools | refs/heads/master | prophtools/common/method.py | 1 | # -*- coding: UTF-8 -*-
"""
Prophtools: Tools for heterogenoeus network prioritization.
Copyright (C) 2016 C. Navarro Luzón, V. Martínez Gómez
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 Foundatio... |
brianwoo/django-tutorial | refs/heads/master | ENV/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py | 449 | import logging
from django.contrib.gis.gdal import GDALException
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Textarea
from django.template import loader
from django.utils import six, translation
# Creating a template context that contains Django settings
# values n... |
severb/flowy-website | refs/heads/master | js/Lib/browser/slideshow.py | 49 | from browser import doc,markdown,html
def keydown(ev,path,zone,page):
if ev.keyCode in [39,40]: # key right or down : next page
show(path,zone,page+1)
ev.preventDefault()
elif ev.keyCode in [37,38]: #key left or up: previous page
show(path,zone,page-1)
ev.preventDefault()
d... |
beepaste/beepaste | refs/heads/master | beepaste/views/about/views.py | 1 | from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='about', renderer='templates/about.jinja2')
def aboutus(request):
title = 'about us' + " - " + request.registry.settings['beepaste.siteName']
return {'title': title}
|
marctc/wagtail | refs/heads/master | wagtail/project_template/project_name/wsgi.py | 680 | """
WSGI config for {{ project_name }} project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.enviro... |
danmergens/mi-instrument | refs/heads/master | mi/dataset/driver/cg_cpm_eng/cpm/__init__.py | 40 | __author__ = 'mworden'
|
kingvuplus/b-p | refs/heads/master | tools/host_tools/FormatConverter/lamedb2satxml.py | 40 | #!/usr/bin/python
from datasource import genericdatasource
from satxml import satxml
from lamedb import lamedb
import sys
if len(sys.argv) != 3:
print "usage: %s <lamedb> <satellites.xml>" % sys.argv[0]
sys.exit()
gen = genericdatasource()
db = lamedb(sys.argv[1])
xml = satxml(sys.argv[2])
db.read()
gen.source = ... |
VenturaDelMonte/staticwebanalyzer | refs/heads/master | SDK/dnspython-1.11.1/dns/rdtypes/mxbase.py | 100 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
fake-name/ReadableWebProxy | refs/heads/master | amqpstorm/management/virtual_host.py | 3 | from amqpstorm.compatibility import quote
from amqpstorm.management.base import ManagementHandler
API_VIRTUAL_HOST = 'vhosts/%s'
API_VIRTUAL_HOSTS = 'vhosts'
API_VIRTUAL_HOSTS_PERMISSION = 'vhosts/%s/permissions'
class VirtualHost(ManagementHandler):
def get(self, virtual_host):
"""Get Virtual Host detai... |
stefan-jonasson/home-assistant | refs/heads/dev | homeassistant/components/sensor/zwave.py | 14 | """
Interfaces with Z-Wave sensors.
For more details about this platform, please refer to the documentation
at https://home-assistant.io/components/sensor.zwave/
"""
import logging
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from homeassistant.components.sensor import DOMAIN
from homeass... |
chiemseesurfer/thumbor-mogilefs-loader | refs/heads/master | loaders/mogilefs_loader_http_fallback.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Max Oberberger (max@oberbergers.de)
#
# 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... |
tony/coreclr | refs/heads/master | src/scripts/genXplatLttng.py | 3 | ##
## Copyright (c) Microsoft. All rights reserved.
## Licensed under the MIT license. See LICENSE file in the project root for full license information.
##
## Sample LTTng Instrumentation code that is generated:
##
## HEADER:
## #define GCFinalizersEnd_TRACEPOINT_ARGS \
##TP_ARGS(\
## const unsigned int ,Count... |
seppi91/CouchPotatoServer | refs/heads/develop | libs/requests/packages/urllib3/contrib/ntlmpool.py | 1009 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... |
napkindrawing/ansible | refs/heads/devel | lib/ansible/playbook/role/definition.py | 62 | # (c) 2014 Michael DeHaan, <michael@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 later ve... |
M-R-Houghton/euroscipy_2015 | refs/heads/master | bokeh/bokeh/models/callbacks.py | 7 | """ Client-side interactivity. """
from __future__ import absolute_import
from warnings import warn
from ..plot_object import PlotObject
from ..properties import Dict, Instance, String
class Callback(PlotObject):
""" Base class for interactive callback. ``Callback`` is generally
not useful to instantiate o... |
BaladiDogGames/baladidoggames.github.io | refs/heads/master | mingw/bin/lib/compiler/syntax.py | 369 | """Check for errs in the AST.
The Python parser does not catch all syntax errors. Others, like
assignments with invalid targets, are caught in the code generation
phase.
The compiler package catches some errors in the transformer module.
But it seems clearer to write checkers that use the AST to detect
errors.
"""
... |
thinkAmi/dj_ringo_tabetter | refs/heads/master | apps/tweets/tests/test_commands.py | 1 | from collections import namedtuple
from datetime import datetime
import pytest
from django.core.management import call_command
from unittest.mock import Mock, patch
from apps.tweets.tests.factories import LastSearchFactory
Status = namedtuple('Status', ('id', 'text', 'created_at'))
@pytest.fixture
def cultivars():... |
taedori81/shoop | refs/heads/master | shoop/utils/http.py | 6 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import time
import requests
def retry_request(n_retries=5, **kwargs):
... |
MKTCloud/MKTCloud | refs/heads/master | openstack_dashboard/dashboards/project/overview/panel.py | 1 | # 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... |
pubudu538/product-private-paas | refs/heads/master | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/transport/THttpClient.py | 19 | #
# 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... |
trudikampfschaf/flask-microblog | refs/heads/master | flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/resources.py | 191 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... |
sursum/buckanjaren | refs/heads/master | buckanjaren/lib/python3.5/site-packages/setuptools/command/build_ext.py | 193 | import os
import sys
import itertools
import imp
from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler, get_config_var
from distutils.errors import DistutilsError
from d... |
sultanqasim/android_kernel_htc_msm8996 | refs/heads/cm-13.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
morepath/morepath | refs/heads/master | morepath/tests/fixtures/pkg/someerror.py | 3 | import morepath
class app(morepath.App):
pass
1 / 0
|
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/domain_category.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
seecr/meresco-oai | refs/heads/master | meresco/oai/tools/removesetsfromoai.py | 1 | ## begin license ##
#
# "Meresco Oai" are components to build Oai repositories, based on
# "Meresco Core" and "Meresco Components".
#
# Copyright (C) 2015 Koninklijke Bibliotheek (KB) http://www.kb.nl
# Copyright (C) 2015, 2017-2018, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2017 SURFmarket h... |
larsyencken/collar | refs/heads/master | collar/filters.py | 1 | # -*- coding: utf-8 -*-
#
# filters.py
# collar
#
"""
Basic key-value filtering.
"""
from . import errors
def compile(criteria):
filters = [compile_spec(s) for s in criteria]
return lambda i: all(f(i) for f in filters)
class InvalidCriteria(errors.UserError):
pass
def compile_spec(spec):
try:
... |
m8se/pism_refined | refs/heads/mesh_refine_clean | util/fill_missing.py | 1 | #!/usr/bin/env python
## @package fill_missing
# \brief This script solves the Laplace equation as a method of filling holes in map-plane data.
#
# \details The script is an implementation of the SOR method with Chebyshev
# acceleration for the Laplace equation, as described in 'Numerical Recipes in
# Fortran: the art... |
mattvick/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/recentstatus.py | 143 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... |
sunbc0120/three.js | refs/heads/master | utils/exporters/blender/modules/msgpack/fallback.py | 641 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... |
devs1991/test_edx_docmode | refs/heads/master | openedx/core/lib/api/fields.py | 53 | """Fields useful for edX API implementations."""
from rest_framework.serializers import Field, URLField
class ExpandableField(Field):
"""Field that can dynamically use a more detailed serializer based on a user-provided "expand" parameter.
Kwargs:
collapsed_serializer (Serializer): the serializer to us... |
AbhiAgarwal/blaze | refs/heads/master | blaze/io/__init__.py | 9 | from .storage import open, drop, Storage
|
dermoth/gramps | refs/heads/master | gramps/test/__init__.py | 11 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your... |
MercenaryLogic/contour | refs/heads/master | contour/ontology/elements/subjects/classes.py | 12 | __author__ = 'conrad'
|
onshape-public/onshape-clients | refs/heads/master | python/onshape_client/oas/models/bt_global_tree_node_list_response.py | 1 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... |
renhaoqi/gem5-stable | refs/heads/master | src/arch/x86/isa/insts/general_purpose/compare_and_test/bounds.py | 50 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
uDeviceX/uDeviceX | refs/heads/master | post/rbc/lib/setup.py | 2 | from distutils.core import setup
setup(name='rbc', version="1.0", py_modules=['plyfile', 'efit'])
|
manthansharma/kivy | refs/heads/master | kivy/effects/scroll.py | 21 | '''
Scroll effect
=============
.. versionadded:: 1.7.0
Based on the :class:`~kivy.effects.kinetic` effect, the :class:`ScrollEffect`
will limit the movement to bounds determined by its :attr:`~ScrollEffect.min`
and :attr:`~ScrollEffect.max` properties. If the movement exceeds these
bounds, it will calculate the amou... |
mlavin/django | refs/heads/master | tests/template_tests/alternate_urls.py | 452 | from django.conf.urls import url
from . import views
urlpatterns = [
# View returning a template response
url(r'^template_response_view/$', views.template_response_view),
# A view that can be hard to find...
url(r'^snark/', views.snark, name='snark'),
]
|
wolfmanstout/dragonfly | refs/heads/master | dragonfly/engines/base/timer.py | 2 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the L... |
tension9000/e2openplugin-CrossEPG | refs/heads/master | src/enigma2/python/crossepg_about.py | 1 | from enigma import getDesktop
from Screens.Screen import Screen
from Components.Label import Label
from Components.Button import Button
from Components.Pixmap import Pixmap
from Components.ActionMap import ActionMap
from Tools.LoadPixmap import LoadPixmap
from crossepglib import *
from crossepg_locale import _
imp... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_chest_plate.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 = Tangible()
result.template = "object/tangible/wearables/armor/ithorian_defender/shared_ith_armor_s01_chest_plate.i... |
mitya57/debian-buildbot | refs/heads/master | buildbot/status/tinderbox.py | 2 | # 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... |
ofekd/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/testing/io_/test_capture.py | 163 | from __future__ import with_statement
import os, sys
import py
needsdup = py.test.mark.skipif("not hasattr(os, 'dup')")
from py.builtin import print_
if sys.version_info >= (3,0):
def tobytes(obj):
if isinstance(obj, str):
obj = obj.encode('UTF-8')
assert isinstance(obj, bytes)
... |
EmadMokhtar/Django | refs/heads/master | tests/utils_tests/test_module/child_module/grandchild_module.py | 106 | content = 'Grandchild Module'
|
agusmakmun/Python-ZIP-Cracker | refs/heads/master | zipCracker.py | 1 |
import os, time, sys
import itertools, string
import zipfile
class zipCrack:
def _checkRoot(self):
if os.getuid() != 0:
print "[-] Please Access as root..!"
sys.exit()
else:
pass
def _createWordlist(self, min_length, max_length):
min_length = min_... |
pixbuffer/django-cms | refs/heads/pixbuffer | cms/plugin_base.py | 4 | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
import re
from cms.utils import get_cms_setting
from cms.exceptions import SubClassNeededError, Deprecated
from cms.models import CMSPlugin
import django
from django import forms
from django.core.urlresolvers import reverse
from django.conf import sett... |
marcelovilaca/DIRAC | refs/heads/integration | ResourceStatusSystem/Policy/SpaceTokenOccupancyPolicy.py | 3 | """ SpaceTokenOccupancyPolicy
SpaceTokenOccupancyPolicy.__bases__:
DIRAC.ResourceStatusSystem.PolicySystem.PolicyBase.PolicyBase
"""
from DIRAC import S_OK
from DIRAC.ResourceStatusSystem.PolicySystem.PolicyBase import PolicyBase
__RCSID__ = '$Id$'
class Space... |
donkirkby/django | refs/heads/master | tests/auth_tests/test_validators.py | 229 | from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_val... |
naokimiyasaka/sublime-text | refs/heads/master | Backup/20130813102457/Package Control/package_control/cmd.py | 9 | import os
import subprocess
import re
if os.name == 'nt':
from ctypes import windll, create_unicode_buffer
from .console_write import console_write
from .unicode import unicode_from_os
from .show_error import show_error
try:
# Python 2
str_cls = unicode
except (NameError):
# Python 3
str_cls = st... |
hanlind/nova | refs/heads/master | nova/objects/dns_domain.py | 20 | # Copyright (C) 2014, Red Hat, 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 or... |
home-assistant/home-assistant | refs/heads/dev | tests/components/local_ip/test_config_flow.py | 15 | """Tests for the local_ip config_flow."""
from homeassistant import data_entry_flow
from homeassistant.components.local_ip.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from tests.common import MockConfigEntry
async def test_config_flow(hass):
"""Test we can finish a config flow."""
... |
UnionEvoRobo/evofab | refs/heads/master | src/genetic_algorithms.py | 1 | from ann import *
import ann_io
import random
from multiprocessing import Process, Queue
class Hat(object):
"""A hat that is used to select members for fitness-proportional breeding. Members with higher fitness will be pulled from the hat more often"""
def __init__(self, population):
self.population =... |
40223149/w16b_test | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/multiprocessing/dummy/connection.py | 707 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.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 conditi... |
gistnetserv-uah/eTorii | refs/heads/master | eGA3/py2cairo/examples/cairo_snippets/snippets/gradient.py | 15 | snippet_normalize (cr, width, height)
pat = cairo.LinearGradient (0.0, 0.0, 0.0, 1.0)
pat.add_color_stop_rgba (1, 0, 0, 0, 1)
pat.add_color_stop_rgba (0, 1, 1, 1, 1)
cr.rectangle (0,0,1,1)
cr.set_source (pat)
cr.fill ()
pat = cairo.RadialGradient (0.45, 0.4, 0.1,
0.4, 0.4, 0.5)
pat.add_c... |
The-Compiler/pytest | refs/heads/master | scripts/append_codecov_token.py | 14 | """
Appends the codecov token to the 'codecov.yml' file at the root of the repository.
This is done by CI during PRs and builds on the pytest-dev repository so we can upload coverage, at least
until codecov grows some native integration like it has with Travis and AppVeyor.
See discussion in https://github.com/pytest... |
ashaarunkumar/spark-tk | refs/heads/master | regression-tests/sparktkregtests/testcases/frames/entropy_test.py | 14 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.