repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
rudolfmleziva/AdministratorTeritorial | refs/heads/master | cocos2d/plugin/tools/pluginx-bindings-generator/genbindings-lua.py | 19 | #!/usr/bin/python
# This script is used to generate luabinding glue codes.
# Android ndk version must be ndk-r9b.
import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager
import shutil
import yaml
import tempfile
def _check_ndk_root_env():
... |
Asana/boto | refs/heads/develop | boto/ec2/keypair.py | 150 | # Copyright (c) 2006,2007 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... |
GoogleCloudPlatform/k8s-multicluster-ingress | refs/heads/master | vendor/k8s.io/kubernetes/hack/update_owners.py | 150 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... |
pradeepbn/googletest | refs/heads/master | scripts/fuse_gtest_files.py | 2577 | #!/usr/bin/env python
#
# Copyright 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... |
redhat-openstack/django | refs/heads/epel7-patches | tests/admin_scripts/complex_app/models/bar.py | 153 | from __future__ import absolute_import
from django.db import models
from ..admin import foo
class Bar(models.Model):
name = models.CharField(max_length=5)
class Meta:
app_label = 'complex_app'
|
A-deLuna/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/server.py | 41 | import BaseHTTPServer
import errno
import os
import re
import socket
from SocketServer import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import types
import urlparse
import routes as default_routes
from logger import get_logger
from request import Server, Request
from response i... |
hugobowne/scikit-learn | refs/heads/master | sklearn/datasets/covtype.py | 46 | """Forest covertype dataset.
A classic dataset for classification benchmarks, featuring categorical and
real-valued features.
The dataset page is available from UCI Machine Learning Repository
http://archive.ics.uci.edu/ml/datasets/Covertype
Courtesy of Jock A. Blackard and Colorado State University.
"""
# Aut... |
joernhees/scikit-learn | refs/heads/master | doc/tutorial/statistical_inference/unsupervised_learning_fixture.py | 71 | """Fixture module to skip the unsupervised_learning.rst doctest for
versions of SciPy earlier than 0.12.0.
"""
from sklearn.utils.testing import SkipTest
from sklearn.utils.fixes import sp_version
def setup_module(module):
if sp_version < (0, 12):
raise SkipTest("Skipping because SciPy version earlier th... |
vvv1559/intellij-community | refs/heads/master | python/testData/editing/enterDocStringStubInStaticMethodWithSelf.py | 53 | class C:
@staticmethod
def m(self, x):
"""<caret>
pass |
jamslevy/gsoc | refs/heads/master | app/django/contrib/localflavor/ar/ar_provinces.py | 436 | # -*- coding: utf-8 -*-
"""
A list of Argentinean provinces and autonomous cities as `choices` in a
formfield. From
http://www.argentina.gov.ar/argentina/portal/paginas.dhtml?pagina=425
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
PROVINCE_CHOICES = (
('B'... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/south/v2.py | 94 | """
API versioning file; we can tell what kind of migrations things are
by what class they inherit from (if none, it's a v1).
"""
from south.utils import ask_for_it_by_name
class BaseMigration(object):
def gf(self, field_name):
"Gets a field by absolute reference."
field = ask_for_it_by_name(... |
elba7r/lite-system | refs/heads/master | erpnext/accounts/report/budget_variance_report/budget_variance_report.py | 20 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
from frappe.utils import formatdate
from erpnext.controllers.trends import get_period_da... |
voodka/ghostbakup | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/compiled.py | 198 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... |
CentroGeo/geonode | refs/heads/master | geonode/social/urls.py | 13 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2016 OSGeo
#
# 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 progra... |
wiseodd/hipsternet | refs/heads/master | hipsternet/solver.py | 2 | import numpy as np
import hipsternet.utils as util
import hipsternet.constant as c
import copy
from sklearn.utils import shuffle as skshuffle
def get_minibatch(X, y, minibatch_size, shuffle=True):
minibatches = []
if shuffle:
X, y = skshuffle(X, y)
for i in range(0, X.shape[0], minibatch_size):
... |
Nata-Fox-2016/-Nata-KPK | refs/heads/master | catch_the_ball/ball.py | 1 | import tkinter
def button1_command():
print('Button 1 default command')
def print_hello(event):
print(event.num)
print(event.x, event.y)
#print(event.x_root, event.y_root)
me = event.widget
# shto mojno delati s me?
if me == button1:
print('Hello!')
elif me == button2:
... |
acreations/rockit-server | refs/heads/master | rockit/plugins/razberry/migrations/0004_auto_20150202_2115.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('razberry', '0003_auto_20150202_2057'),
]
operations = [
migrations.CreateModel(
name='ActionThen',
f... |
xianyo/git-repo | refs/heads/stable-hack | subcmds/abandon.py | 82 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... |
RO-ny9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_descr.py | 46 | import builtins
import sys
import types
import math
import unittest
from copy import deepcopy
from test import support
class OperatorsTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.binops = {
'add': '+',
... |
jtattermusch/grpc | refs/heads/master | src/python/grpcio/support.py | 10 | # Copyright 2016 gRPC 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 writing... |
StackStorm/st2 | refs/heads/master | st2common/st2common/constants/api.py | 3 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
mathspace/django | refs/heads/master | django/db/backends/utils.py | 66 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(object... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters.py | 1 | # 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 ... |
thatgibbyguy/kube | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/ordered_dict.py | 2354 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... |
akash1808/nova | refs/heads/master | nova/virt/libvirt/compat.py | 67 | # 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 writing, software
# distributed u... |
mifl/android_kernel_pantech_ef63-common | refs/heads/ef63/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
jostep/tensorflow | refs/heads/master | tensorflow/python/estimator/estimator.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... |
apdavison/python-neo | refs/heads/master | neo/core/channelindex.py | 1 | '''
This module defines :class:`ChannelIndex`, a container for multiple
data channels.
:class:`ChannelIndex` derives from :class:`Container`,
from :module:`neo.core.container`.
'''
import numpy as np
import quantities as pq
from neo.core.container import Container
class ChannelIndex(Container):
'''
A conta... |
Jgarcia-IAS/ReporsitorioVacioOdoo | refs/heads/master | openerp/addons/product/wizard/product_price.py | 380 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
xyuanmu/XX-Net | refs/heads/master | python3.8.2/Lib/email/__init__.py | 56 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""A package for parsing, handling, and generating email messages."""
__all__ = [
'base64mime',
'charset',
'encoders',
'errors',
'feedparser',
'generator',
'header',
'iterators',... |
denny820909/builder | refs/heads/master | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/db/state.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... |
irwinlove/django | refs/heads/master | tests/model_options/test_tablespaces.py | 337 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .models.tablespaces import (
Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef,
)
def ... |
NaturalHistoryMuseum/ckanext-doi | refs/heads/main | ckanext/doi/cli.py | 1 | import click
from ckan import model
from ckan.model import Session
from ckan.plugins import toolkit
from datacite.errors import DataCiteError
from ckanext.doi.lib.api import DataciteClient
from ckanext.doi.lib.metadata import build_metadata_dict, build_xml_dict
from ckanext.doi.model import doi as doi_model
from ckane... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/ChangeSignatureAddKeywordOnlyParameter_after.py | 27 | def func(x, *args, foo=None, bar='spam'):
pass
func(1, 2, 3, bar='spam') |
feanil/ansible | refs/heads/devel | test/units/parsing/test_data_loader.py | 58 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
moses-rolston/err | refs/heads/master | errbot/backends/hipchat.py | 1 | import logging
import sys
try:
import hypchat
except ImportError:
logging.exception("Could not start the HipChat backend")
logging.fatal(
"You need to install the hypchat package in order to use the HipChat "
"back-end. You should be able to install this package using: "
"pip instal... |
codemac/servo | refs/heads/master | tests/wpt/harness/wptrunner/browsers/__init__.py | 134 | # 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/.
"""Subpackage where each product is defined. Each product is created by adding a
a .py file containing a __wptrunner__ v... |
dcruzsteven/DataScienceFromScratch | refs/heads/master | code/nearest_neighbors.py | 57 | from __future__ import division
from collections import Counter
from linear_algebra import distance
from statistics import mean
import math, random
import matplotlib.pyplot as plt
def raw_majority_vote(labels):
votes = Counter(labels)
winner, _ = votes.most_common(1)[0]
return winner
def majority_vote(lab... |
loic/django | refs/heads/master | tests/validation/test_validators.py | 38 | from __future__ import unicode_literals
from . import ValidationTestCase
from .models import ModelToValidate
class TestModelsWithValidators(ValidationTestCase):
def test_custom_validator_passes_for_correct_value(self):
mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=42,
... |
vwvww/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/metafunc.py | 13 | # -*- coding: utf-8 -*-
import re
import sys
import _pytest._code
import py
import pytest
from _pytest import python, fixtures
import hypothesis
from hypothesis import strategies
PY3 = sys.version_info >= (3, 0)
class TestMetafunc(object):
def Metafunc(self, func):
# the unit tests of this class check ... |
aslamplr/shorts | refs/heads/master | lib/jinja2/nodes.py | 623 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... |
cfg2015/EPT-2015-2 | refs/heads/master | addons/website_event_sale/models/__init__.py | 428 | import product
import website
import sale_order
|
daviddeneroff/daviddeneroff.github.io | refs/heads/master | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/cmake.py | 148 | # Copyright (c) 2013 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... |
filias/django | refs/heads/master | tests/template_tests/syntax_tests/test_for.py | 51 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class ForTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'for-tag01': '{% for val in values %}{{ val }}{% endfor %}'})
def test_for_tag01(self):... |
kerr-huang/SL4A | refs/heads/master | python/src/Tools/scripts/texi2html.py | 54 | #! /usr/bin/env python
# Convert GNU texinfo files into HTML, one file per node.
# Based on Texinfo 2.14.
# Usage: texi2html [-d] [-d] [-c] inputfile outputdirectory
# The input file must be a complete texinfo file, e.g. emacs.texi.
# This creates many files (one per info node) in the output directory,
# overwriting e... |
stescholz/survey | refs/heads/master | config.py | 1 | from survey.question import *
directory = "Scans"
csv_fn = "results.csv"
# old headline coordinates: header = (575, 260, 1145, 330)
header = (230, 330, 1510, 470)
off_x = 0
off_y = -4
lower = 120
upper = 210
questions = [
YesNoQuestion("Erstsemester", [(996, 498), (1081, 498)]),
Question("Mathematikkurs", ... |
pranner/CMPUT410-Lab6-Django | refs/heads/master | v1/lib/python2.7/site-packages/django/utils/_os.py | 70 | import os
import stat
import sys
import tempfile
from os.path import join, normcase, normpath, abspath, isabs, sep, dirname
from django.utils.encoding import force_text
from django.utils import six
try:
WindowsError = WindowsError
except NameError:
class WindowsError(Exception):
pass
if six.PY2:
... |
felixfontein/ansible | refs/heads/devel | test/units/module_utils/basic/test_atomic_move.py | 22 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (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
... |
jordanemedlock/psychtruths | refs/heads/master | temboo/Library/Yahoo/Weather/GetWeatherByCoordinates.py | 4 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetWeatherByCoordinates
# Retrieves the Yahoo Weather RSS Feed for any specified location by geo-coordinates.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache Licen... |
gladsonvm/haystackdemo | refs/heads/master | lib/python2.7/site-packages/django/contrib/localflavor/us/us_states.py | 355 | """
A mapping of state misspellings/abbreviations to normalized
abbreviations, and alphabetical lists of US states, territories,
military mail regions and non-US states to which the US provides
postal service.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
# The... |
kernow/ansible-modules-core | refs/heads/devel | network/nxos/nxos_facts.py | 15 | #!/usr/bin/python
#
# 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 distribut... |
disruptek/boto | refs/heads/develop | tests/unit/cloudsearch2/__init__.py | 114 | DEMO_DOMAIN_DATA = {
"SearchInstanceType": None,
"DomainId": "1234567890/demo",
"DomainName": "demo",
"Deleted": False,
"SearchInstanceCount": 0,
"Created": True,
"SearchService": {
"Endpoint": "search-demo.us-east-1.cloudsearch.amazonaws.com"
},
"RequiresIndexDocuments": Fal... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/altgraph/altgraph_tests/test_object_graph.py | 25 | import unittest
import sys
from altgraph.ObjectGraph import ObjectGraph
from altgraph.Graph import Graph
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class Node (object):
def __init__(self, graphident):
self.graphident = graphident
class SubNode (Node):
pass... |
Solanar/CMPUT410-Project | refs/heads/master | DisSoNet/middleware/RESTMiddleware.py | 1 | # https://gist.github.com/g00fy-/1161423
from django.http import QueryDict
from django.http.multipartparser import MultiValueDict
class RESTMiddleware(object):
def process_request(self, request):
request.PUT = QueryDict('')
request.DELETE = QueryDict('')
method = request.META.get('REQUEST... |
pcarrier-packaging/deb-phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/lib/TestCmd.py | 137 | """
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing
of executable commands and scripts (in any language, not just Python),
especially commands and scripts that require file system interaction.
In addition to running tests and evaluating... |
simonwydooghe/ansible | refs/heads/devel | lib/ansible/modules/cloud/hcloud/hcloud_server_info.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# 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 = {
"met... |
PatrickOReilly/scikit-learn | refs/heads/monotonic-trees | sklearn/linear_model/omp.py | 39 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... |
hansent/kivy | refs/heads/master | examples/guide/firstwidget/2_print_touch.py | 16 | from kivy.app import App
from kivy.uix.widget import Widget
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
print(touch)
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
if __name__ == '__main__':
MyPaintApp().run()
|
webmasterraj/FogOrNot | refs/heads/master | flask/lib/python2.7/site-packages/werkzeug/contrib/lint.py | 295 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... |
visualputty/Landing-Lights | refs/heads/master | django/db/backends/creation.py | 79 | import sys
import time
from django.conf import settings
from django.utils.datastructures import DictWrapper
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific d... |
zhangjunfang/eclipse-dir | refs/heads/master | eCardCity2.0/foundation-springMVC/src/main/resources/views/scripts/lib/fckeditor/editor/filemanager/connectors/py/upload.py | 53 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... |
smuser90/Stream-Framework | refs/heads/master | stream_framework/storage/cassandra/connection.py | 5 | from cassandra.cqlengine import connection
from stream_framework import settings
def setup_connection():
connection.setup(
hosts=settings.STREAM_CASSANDRA_HOSTS,
consistency=settings.STREAM_CASSANDRA_CONSISTENCY_LEVEL,
default_keyspace=settings.STREAM_DEFAULT_KEYSPACE,
**settings.C... |
cris-b/oma-welcome | refs/heads/master | usr/share/oma-welcome/bbv/ui/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Wilson Pinto Júnior <wilson@openlanhouse.org>
# Copyright (C) 2011 Thomaz de Oliveira dos Reis <thor27@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 publ... |
sanjeevtripurari/hue | refs/heads/master | desktop/core/ext-py/simplejson/simplejson/tests/test_unicode.py | 123 | from unittest import TestCase
import simplejson as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = en... |
Timmmm/mbed | refs/heads/master | workspace_tools/compliance/ioper_base.py | 106 | """
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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 wr... |
Biospore/biospore.pythonanywhere.com | refs/heads/master | flask_app.py | 1 | #!/usr/bin/python3
from flask import Flask, render_template, request, make_response
from os import walk
import bleach
from marshaller import Storage, Storage2, Storage3
import jinja2
app = Flask(__name__)
unique_visitors = Storage()
comments2 = Storage2()
imgs = Storage3()
def get_all_imgs(folder):
files = [... |
sachinkum/Bal-Aveksha | refs/heads/master | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/contrib/gis/db/backends/oracle/operations.py | 52 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... |
Nitaco/ansible | refs/heads/devel | test/units/modules/packaging/os/test_apt.py | 119 | import collections
import os
import sys
from ansible.compat.tests import mock
from ansible.compat.tests import unittest
try:
from ansible.modules.packaging.os.apt import (
expand_pkgspec_from_fnmatches,
)
except:
# Need some more module_utils work (porting urls.py) before we can test
# modules... |
joone/chromium-crosswalk | refs/heads/2016.04.css-round-display-edtior-draft-1 | tools/telemetry/telemetry/internal/backends/chrome/desktop_browser_backend.py | 7 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import glob
import heapq
import logging
import os
import os.path
import random
import re
import shutil
import subprocess as subprocess
import... |
Yannig/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/portinstall.py | 29 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, berenddeboer
# Written by berenddeboer <berend@pobox.com>
# Based on pkgng module written by bleader <bleader at ratonland.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, d... |
c24b/thingscoop | refs/heads/master | thingscoop/query.py | 7 | import re
from pypeg2 import *
from pattern.en import wordnet
from .utils import get_hypernyms
class NoSuchLabelError(Exception):
pass
class Q(object):
def evaluate(self, labels):
return self.content.evaluate(labels)
class Label(object):
grammar = attr("name", re.compile(r"[A-z][A-z\- ]+[A-z]"))... |
fcurella/python-packager | refs/heads/master | pypackager/extractor.py | 1 | from fnmatch import fnmatch
import os
import shutil
from tarfile import TarFile
from zipfile import ZipFile
from .base import BasePackager
from .downloader import Downloader
# Standard Library is not very standard.
class ArchiveFileWrapper(object):
blacklist = ('.DS_Store', "*.pyc", "__MACOSX/*")
def __init... |
jeffh/YACS | refs/heads/master | courses_viz/models.py | 10644 | from django.db import models
# Create your models here.
|
mach0/QGIS | refs/heads/master | tests/src/python/test_qgsmapthemecollection.py | 30 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapThemeCollection.
.. note:: 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.... |
markYoungH/chromium.src | refs/heads/nw12 | tools/telemetry/telemetry/util/external_modules.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 importlib
from distutils import version
MODULES = {
'cv2': (version.StrictVersion('2.4.8'), version.StrictVersion('3.0.0')),
'numpy': (version.S... |
RydrDojo/Ridr_app | refs/heads/master | pylotVenv/lib/python2.7/site-packages/alembic/util/pyfiles.py | 25 | import sys
import os
import re
from .compat import load_module_py, load_module_pyc
from mako.template import Template
from mako import exceptions
import tempfile
from .exc import CommandError
def template_to_file(template_file, dest, output_encoding, **kw):
template = Template(filename=template_file)
try:
... |
nhr/origin | refs/heads/master | vendor/github.com/google/certificate-transparency/python/ct/crypto/asn1/x509_common.py | 35 | """ASN.1 X509 base components."""
from ct.crypto.asn1 import oid
from ct.crypto.asn1 import print_util
from ct.crypto.asn1 import types
class Version(types.Integer):
def _encode_value(self):
return types.encode_int(self._value - 1)
@classmethod
def _convert_value(cls, value):
return int(... |
cherusk/ansible | refs/heads/devel | lib/ansible/module_utils/api.py | 106 | #
# (c) 2015 Brian Ccoa, <bcoca@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 versio... |
nandub/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 100 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... |
romanvm/python-web-pdb | refs/heads/master | tests/tests.py | 1 | # coding: utf-8
# Created on: 13.09.2016
# Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua)
#
# Copyright (c) 2016 Roman Miroshnychenko
#
# 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... |
alexcrichton/gyp | refs/heads/master | test/rules-dirname/src/subdir/printvars.py | 350 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Prints interesting vars
"""
import sys;
out = open(sys.argv[2], 'w')
out.write(sys.argv[1]);
|
mwx1993/TACTIC | refs/heads/master | src/pyasm/prod/web/asset_filter_wdg.py | 6 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
oVirt/ovirt-hosted-engine-setup | refs/heads/master | src/plugins/gr-he-common/network/__init__.py | 1 | #
# ovirt-hosted-engine-setup -- ovirt hosted engine setup
# Copyright (C) 2013-2017 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, o... |
Aloja/aloja | refs/heads/master | shell/job_history.py | 3 | #!/usr/bin/python2.7
#
# Originally from https://github.com/lila/hadoop-jobanalyzer
#TODO CHECK BOUNDARIES ERROR
import re
import sys
import argparse
import collections
import datetime
parser = argparse.ArgumentParser(description='Parse Hadoop Job History')
parser.add_argument("-t", metavar='tasks_file', help="Outpu... |
roxyboy/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/plotting_patch_single.py | 63 | from bokeh.plotting import figure, output_file, show
output_file("patch.html")
p = figure(plot_width=400, plot_height=400)
# add a patch renderer with an alpha an line width
p.patch([1, 2, 3, 4, 5], [6, 7, 8, 7, 3], alpha=0.5, line_width=2)
show(p)
|
prakritish/ansible | refs/heads/devel | lib/ansible/modules/network/ios/ios_system.py | 77 | #!/usr/bin/python
#
# 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 distribut... |
asposewords/Aspose_Words_Cloud | refs/heads/master | SDKs/Aspose.Words-Cloud-SDK-for-Python/asposewordscloud/models/SectionResponse.py | 4 | #!/usr/bin/env python
class SectionResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type... |
apache/airflow | refs/heads/main | airflow/providers/apache/hdfs/hooks/__init__.py | 5130 | #
# 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... |
bikong2/django | refs/heads/master | django/template/library.py | 348 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... |
mrfuxi/django | refs/heads/master | tests/admin_scripts/management/commands/custom_startproject.py | 378 | from django.core.management.commands.startproject import Command as BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
parser.add_argument('--extra',
help='An arbitrary extra value passed to the context')
|
Sonnbc/modelCheckingCassandra | refs/heads/timestampBased | pylib/cqlshlib/tfactory.py | 38 | # 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... |
CatsAndDogsbvba/odoo | refs/heads/8.0 | openerp/addons/test_documentation_examples/extension.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Extension0(models.Model):
_name = 'extension.0'
name = fields.Char(default="A")
class Extension1(models.Model):
_inherit = 'extension.0'
description = fields.Char(default="Extended")
|
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | toontown/cogdominium/CogdoFlyingGame.py | 1 | from direct.showbase.DirectObject import DirectObject
from direct.task.Task import Task
from direct.showbase.RandomNumGen import RandomNumGen
from direct.interval.FunctionInterval import Wait
from direct.interval.IntervalGlobal import Func
from direct.interval.MetaInterval import Sequence, Parallel
from toontown.battle... |
ns950/calibre | refs/heads/master | src/calibre/ebooks/pdf/outline_writer.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... |
thecubed/android_kernel_lge_geefhd | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
delftrobotics/keras-retinanet | refs/heads/master | keras_retinanet/utils/image.py | 1 | """
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 w... |
gkotton/neutron | refs/heads/master | neutron/plugins/nuage/plugin.py | 5 | # Copyright 2014 Alcatel-Lucent USA 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 l... |
xiaoguoai/ec-dev-swift | refs/heads/dev | test/unit/common/middleware/test_except.py | 3 | # Copyright (c) 2010-2012 OpenStack 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.0
#
# Unless required by applicable law or agree... |
neumerance/deploy | refs/heads/master | openstack_dashboard/dashboards/admin/resource_rates/models.py | 979 | """
Stub file to work around django bug: https://code.djangoproject.com/ticket/7198
"""
|
vveerava/Openstack | refs/heads/master | tools/i18n_cfg.py | 65 | import compiler
import re
def is_log_callfunc(n):
"""LOG.xxx('hello %s' % xyz) and LOG('hello')"""
if isinstance(n.parent, compiler.ast.Mod):
n = n.parent
if isinstance(n.parent, compiler.ast.CallFunc):
if isinstance(n.parent.node, compiler.ast.Getattr):
if isinstance(n.parent.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.