repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Twisted/twisted/words/tap.py | 54 | # -*- test-case-name: twisted.words.test.test_tap -*-
# Copyright (c) 2001-2005 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Shiny new words service maker
"""
import sys, socket
from twisted.application import strports
from twisted.application.service import MultiService
from twisted.python import usag... |
ctlajoie/ansible-modules-core | refs/heads/devel | utilities/logic/set_fact.py | 115 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <[email protected]>
#
# 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 Lice... |
msmolens/VTK | refs/heads/slicer-v6.3.0-2015-07-21-426987d | Examples/Rendering/Python/TPlane.py | 42 | #!/usr/bin/env python
# This simple example shows how to do basic texture mapping.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Load in the texture map. A texture is any unsigned char image. If it
# is not of this type, you will have to map it through a lookup table
# or by ... |
mayank-johri/LearnSeleniumUsingPython | refs/heads/master | Section 2 - Advance Python/Chapter S2.11 Multiprocessing and Threading/code/1_threading.py | 2 | import threading
def worker():
"""thread worker function"""
print ('> Worker')
return
threads = []
for i in range(5):
t = threading.Thread(target=worker)
threads.append(t)
t.start() |
shermanng10/superathletebuilder | refs/heads/master | env/lib/python2.7/site-packages/django/conf/locale/bg/formats.py | 619 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
# DATE... |
shams169/pythonProject | refs/heads/master | env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py | 1775 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
ciraxwe/cherrypy-app-engine | refs/heads/master | cherrypy/test/test_sessionauthenticate.py | 22 | import cherrypy
from cherrypy.test import helper
class SessionAuthenticateTest(helper.CPWebCase):
def setup_server():
def check(username, password):
# Dummy check_username_and_password function
if username != 'test' or password != 'password':
return 'Wrong login/p... |
40223112/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/_sre.py | 622 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... |
Queuer/queue-vision | refs/heads/master | recognition/utils/rect.py | 1 | class Rect(object):
def __init__(self, cx, cy, width, height, confidence):
self.cx = cx
self.cy = cy
self.width = width
self.height = height
self.confidence = confidence
self.true_confidence = confidence
def overlaps(self, other):
if abs(self.cx - other.c... |
mrkm4ntr/incubator-airflow | refs/heads/master | airflow/providers/google/cloud/example_dags/example_cloud_sql_query.py | 10 | #
# 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... |
FabioRosado/opsdroid | refs/heads/master | opsdroid/testing/const.py | 3 | """Constants for use in testing."""
MINIMAL_CONFIG = {
"connectors": {
"mock": {"module": "opsdroid.testing.mockmodules.connectors.mocked"}
},
"skills": {"hello": {"module": "opsdroid.testing.mockmodules.skills.hello"}},
}
|
kater169/libcloud | refs/heads/trunk | docs/examples/compute/cloudwatt/create_volume.py | 55 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
Cloudwatt = get_driver(Provider.CLOUDWATT)
driver = Cloudwatt('your_email', 'your_password', 'your_tenant_id',
tenant_name='your_tenant_name')
node = driver.list_nodes()[0]
volume = driver.create_volume(10,... |
duducosmos/pgs4a | refs/heads/master | python-install/lib/python2.7/test/test_StringIO.py | 14 | # Tests StringIO and cStringIO
import unittest
import StringIO
import cStringIO
import types
from test import test_support
class TestGenericStringIO(unittest.TestCase):
# use a class variable MODULE to define which module is being tested
# Line of data to test as string
_line = 'abcdefghijklmnopqrstuvwx... |
leorochael/odoo | refs/heads/8.0 | addons/web_api/__openerp__.py | 384 | {
'name': 'OpenERP Web API',
'category': 'Hidden',
'description': """
Openerp Web API.
================
""",
'version': '2.0',
'depends': ['web'],
'installable': True,
'auto_install': False,
}
|
gdgellatly/OCB1 | refs/heads/7.0 | addons/hr_attendance/__init__.py | 434 | # -*- 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... |
slank/ansible | refs/heads/devel | test/sanity/validate-modules/test_validate_modules_regex.py | 19 | #!/usr/bin/env python
# This is a standalone test for the regex inside validate-modules
# It is not suitable to add to the make tests target because the
# file under test is outside the test's sys.path AND has a hyphen
# in the name making it unimportable.
#
# To execute this by hand:
# 1) cd <checkoutdir>
# 2) so... |
cainmatt/django | refs/heads/master | django/core/management/sql.py | 399 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
"""
Returns a list of the SQL statements used to flush the database.
If only_django is True, then only table n... |
Tomtomgo/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py | 119 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2011 Code Aurora Forum. 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 t... |
walterreade/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_omp.py | 272 | # Author: Vlad Niculae
# Licence: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equa... |
nthiep/global-ssh-server | refs/heads/master | lib/python2.7/site-packages/django/db/backends/mysql/creation.py | 210 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict_... |
fighterlyt/bite-project | refs/heads/master | deps/gdata-python-client/tests/gdata_tests/contentforshopping_test.py | 39 | #!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
jrrembert/django | refs/heads/master | django/contrib/admin/templatetags/log.py | 499 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... |
nitzmahone/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/lambda.py | 12 | #!/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 distributed... |
allenlavoie/tensorflow | refs/heads/master | tensorflow/python/ops/sparse_grad.py | 7 | # 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... |
DeveloperJose/Vision-Rat-Brain | refs/heads/master | feature_matching_v2/asift.py | 1 | # -*- coding: utf-8 -*-
# Affine SIFT (ASIFT)
# http://www.ipol.im/pub/algo/my_affine_sift/
# Currently unused in program
import numpy as np
import cv2
import sift
from multiprocessing.pool import ThreadPool
def extract_asift(img, mask=None, cpus=4, start=0, end=180, inc=72.0):
'''
affine_detect(detector, img,... |
tklovett/MaudeMiner | refs/heads/master | MaudeMiner/querier/__init__.py | 1 | from MaudeMiner import interactive
from MaudeMiner.querier import keyword_search
from MaudeMiner.querier import sql
def run(args):
interactive.start("querier", 1, commands)
commands = {
"keywords": keyword_search.run,
"sql": sql.run,
} |
robbinfan/thirdparty | refs/heads/master | gmock-1.7.0/scripts/generator/cpp/ast.py | 268 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 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... |
rburgoyne/repos-search | refs/heads/master | hook/changehandler.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class ReposSearchChangeHandler(object):
'''
Interface for indexing handlers, based on "svnlook changed" change log.
'''
def onRevisionBegin(self, rev):
pass
def onRevisionComplete(self, rev):
pass
def onBatchComplete(self):
'''
Called when ... |
raajitr/django_hangman | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/adapter.py | 273 | from cx_Oracle import CLOB
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.geos import GeometryCollection, Polygon
from django.utils.six.moves import range
class OracleSpatialAdapter(WKTAdapter):
input_size = CLOB
def __init__(self, geom):
"""
Oracl... |
HyperloopTeam/FullOpenMDAO | refs/heads/master | lib/python2.7/site-packages/pycrypto-2.3-py2.7-macosx-10.10-x86_64.egg/Crypto/Random/OSRNG/rng_base.py | 11 | #
# Random/OSRNG/rng_base.py : Base class for OSRNG
#
# Written in 2008 by Dwayne C. Litzenberger <[email protected]>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not availa... |
chinmaygarde/depot_tools | refs/heads/master | third_party/protobuf26/internal/cpp_message.py | 26 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
aleontiev/dj | refs/heads/master | djay/blueprints/command/templates/{{app}}/management/commands/{{name}}.py | 2 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "{{doc}}"
def handle(self, **options):
self.stdout.write("{{name}} called")
|
CMU-Robotics-Club/roboticsclub.org | refs/heads/master | robocrm/migrations/0046_auto_20150311_1727.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('robocrm', '0045_machine_toolbox_id'),
]
operations = [
migrations.AlterField(
model_name='machine',
... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/routes_operations.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 ... |
MartijnRas/cherrymusic | refs/heads/devel | cherrymusicserver/api/v1/users.py | 3 | # -*- coding: utf-8 -*- #
#
# CherryMusic - a standalone music server
# Copyright (c) 2012-2015 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT license) http://www.jplayer.o... |
dfolch/pysal | refs/heads/master | pysal/core/IOHandlers/geobugs_txt.py | 15 | import pysal
import os.path
import pysal.core.FileIO as FileIO
from pysal.weights import W
from warnings import warn
__author__ = "Myunghwa Hwang <[email protected]>"
__all__ = ["GeoBUGSTextIO"]
class GeoBUGSTextIO(FileIO.FileIO):
"""
Opens, reads, and writes weights file objects in the text format
used ... |
PeterWangIntel/chromium-crosswalk | refs/heads/master | chrome/test/chromedriver/test/run_all_tests.py | 7 | #!/usr/bin/env python
# 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.
"""Runs all ChromeDriver end to end tests."""
import optparse
import os
import platform
import shutil
import sys
import tempfile
impor... |
mlavin/django | refs/heads/master | django/contrib/gis/gdal/raster/band.py | 12 | from ctypes import byref, c_double, c_int, c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.gdal.raster.base import GDALRasterBase
from django.contrib.gis.shortcuts import numpy
from django.utils.encoding import force... |
belltailjp/scikit-learn | refs/heads/master | examples/datasets/plot_random_dataset.py | 348 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... |
nimholz/course-exercises | refs/heads/master | script.py | 1 | print('everything is awesome!!')
import test
print('circumference is', test.circumfer(1))
print('area is', test.area(1)) |
Mariaanisimova/pythonintask | refs/heads/master | BITs/2014/Shmireychik_S_V/task_6_17.py | 1 | #Задача №6. Вариант 17
#Программа в которой компьютер загадывает название одного из пяти космических челноков проекта Спейс шаттл, а игрок должен его угадать.
#Шмирейчик С.В.
#21.03.2016
import random
SpaceShuttles=('Колумбия','Челленджер','Дискавери','Атлантис','Индевор')
SpaceShuttle=random.randint(0,4)
r... |
ocefpaf/paegan-transport | refs/heads/master | tests/test_diel.py | 2 | import unittest
from paegan.location4d import Location4D
from paegan.transport.models.behaviors.diel import Diel
from datetime import datetime, timedelta
from paegan.transport.utils.asasuncycles import SunCycles
import pytz
import os
import json
class DielTest(unittest.TestCase):
def test_cycle_object_from_json(... |
sangheestyle/elasticsearch-dsl-py | refs/heads/master | test_elasticsearch_dsl/test_analysis.py | 10 | # coding: utf-8
from elasticsearch_dsl import analysis
def test_analyzer_serializes_as_name():
a = analysis.Analyzer('my_analyzer')
assert 'my_analyzer' == a.to_dict()
def test_analyzer_has_definition():
a = analysis.CustomAnalyzer(
'my_analyzer',
tokenizer='keyword',
filter=['low... |
Fusion-Devices/android_kernel_mediatek_sprout | refs/heads/cm-12.1 | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
2013Commons/hue | refs/heads/master | desktop/core/ext-py/requests-2.0.0/requests/models.py | 2 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import logging
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/boto-2.46.1/boto/dynamodb2/exceptions.py | 164 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
MaStanford/PingPongOpenCV | refs/heads/master | shapes/Circles.py | 1 | __author__ = 'm.stanford'
import cv2
import cv2.cv as cv
import numpy as np
class Circles():
accumulator_threshold = 75
minCircleDist = 100
maxCannyThresh = 175
minRadius = 10
maxRadius = 0
def __init__(self):
pass
def getCircles(self, img):
smoothed = cv2.medianBlur(im... |
Rawtechio/oscar | refs/heads/master | oscar/collection/views.py | 1 | # -*- coding: utf-8 -*-
# Created on 21 Apr 2016 at 11:25
from __future__ import unicode_literals, absolute_import
from django.views.generic import ListView
from django.views.generic.edit import CreateView
from .models import Missed
from .forms import MissedBinForm
class MissedListView(ListView):
model = Missed
... |
adedayo/intellij-community | refs/heads/master | python/testData/resolve/multiFile/modulePackageCollision/ModulePackageCollision.py | 83 | from smname import module1
# <ref> |
TeamEOS/kernel_oppo_r5 | refs/heads/lp5.1 | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
cloudbau/keystone | refs/heads/master | keystone/contrib/oauth1/migrate_repo/__init__.py | 24 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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
#
# Unle... |
solarwinds/orionsdk-python | refs/heads/master | samples/nta_enable_disable_alert.py | 1 | from __future__ import print_function
import re
import requests
import pprint
from orionsdk import SwisClient
def main():
# Connect to SWIS
server = 'localhost'
username = 'admin'
password = ''
swis = SwisClient(server, username, password)
alert_name = 'NTA Alert on machine-hostname'
query... |
xiaoyaozi5566/DynamicCache | refs/heads/master | ext/ply/test/yacc_badargs.py | 174 | # -----------------------------------------------------------------------------
# yacc_badargs.py
#
# Rules with wrong # args
# -----------------------------------------------------------------------------
import sys
sys.tracebacklimit = 0
sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# P... |
chromium/chromium | refs/heads/master | testing/merge_scripts/standard_isolated_script_merge.py | 8 | #!/usr/bin/env python
# Copyright 2017 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 argparse
import json
import os
import sys
import merge_api
import results_merger
def StandardIsolatedScriptMerge(output_json,... |
shawnsilva/steamwebapi | refs/heads/devel | steamwebapi/test/test_utils.py | 1 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Copyright (C) 2013-2015 Shawn Silva
# ------------------------------------
# This file is part of steamwebapi.
#
# steamwebapi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... |
boneyao/sentry | refs/heads/master | tests/functional/test_imports.py | 24 | from __future__ import absolute_import
import fnmatch
import os
from subprocess import call
ROOT = os.path.normpath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'src'))
def _find_files(root, pattern='*'):
matches = []
for root, _, filenames in os.walk(root):
for filename in f... |
dhruvsrivastava/OJ | refs/heads/master | python/lib/python2.7/site-packages/pip/req/req_file.py | 239 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... |
40223226/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/decimal.py | 623 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... |
onurhunce/AutoAlbumCreator | refs/heads/master | Assignment/AlbumCreator/urls.py | 1 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.get_all_images_from_database, name='all_photos'),
url(r'^popular/$', views.show_popular_photos, name='popular'),
url(r'^export/$', views.post_photos_to_facebook, name='popular'),
url(r'^fetch/$', views.fetch_photos_m... |
andrewmoses/ssquiz | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/analysis/morph.py | 93 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
Mercador/python-keystoneclient | refs/heads/master | keystoneclient/v3/services.py | 6 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/testData/intentions/replaceListComprehension2_after.py | 83 | t = []
for j in range(7):
t.append([3 for i in range(5)])
|
raoulbq/scipy | refs/heads/master | scipy/io/mmio.py | 15 | """
Matrix Market I/O in Python.
"""
#
# Author: Pearu Peterson <[email protected]>
# Created: October, 2004
#
# References:
# http://math.nist.gov/MatrixMarket/
#
from __future__ import division, print_function, absolute_import
import os
import sys
from numpy import asarray, real, imag, conj, zeros, ndarray, conc... |
eonpatapon/contrail-controller | refs/heads/master | src/config/fabric-ansible/job_manager/job_messages.py | 1 | class MsgBundle(object):
JOB_TEMPLATE_MISSING = 1,
JOB_EXECUTION_ID_MISSING = 2,
JOB_SUMMARY_MESSAGE_HDR = 3,
JOB_RESULT_STATUS_NONE = 4,
JOB_MULTI_DEVICE_FAILED_MESSAGE_HDR = 5,
JOB_SINGLE_DEVICE_FAILED_MESSAGE_HDR = 6,
PLAYBOOK_RESULTS_MESSAGE = 7,
PLAYBOOK_EXIT_WITH_ERROR = 8,
PL... |
edx/ansible | refs/heads/stable-1.9-plus-edx | v2/ansible/parsing/utils/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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... |
enthought/etsproxy | refs/heads/master | enthought/tvtk/pyface/ui/wx/init.py | 1 | # proxy module
from __future__ import absolute_import
from tvtk.pyface.ui.wx.init import *
|
kvar/ansible | refs/heads/seas_master_2.9.5 | lib/ansible/modules/cloud/vmware/vmware_host_datastore.py | 23 | #!/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',
'... |
PsYear/scrapy_example | refs/heads/master | xiaobaihe/xiaobaihe/settings.py | 5 | # -*- coding: utf-8 -*-
# Scrapy settings for xiaobaihe project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'xiaobaihe'
SPIDER_MODULES = ['xiaobaihe.spiders'... |
mcanthony/supercollider | refs/heads/master | editors/sced/sced/util.py | 44 | # sced (SuperCollider mode for gedit)
# Copyright 2009 Artem Popov and other contributors (see AUTHORS)
#
# sced 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, ... |
alimony/django | refs/heads/master | django/contrib/sessions/backends/db.py | 27 | import logging
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.exceptions import SuspiciousOperation
from django.db import DatabaseError, IntegrityError, router, transaction
from django.utils import timezone
from django.utils.functional import cached_pr... |
Panda3D-google-code-repositories/naith | refs/heads/master | game/plugins/particlemanager/particlemanager.py | 1 | # -*- coding: utf-8 -*-
# Copyright Tom SF Haines
#
# 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 ag... |
RCAD/ringling-render-tools | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
from pkg_resources import Requirement, resource_filename
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),'src')))
import rrt
setup(
name = "ringling_render_tools",
version = rrt.__version__,
author = "Owen Nelson, S... |
TimYi/django | refs/heads/master | django/contrib/postgres/forms/ranges.py | 393 | from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
from django import forms
from django.core import exceptions
from django.forms.widgets import MultiWidget
from django.utils.translation import ugettext_lazy as _
__all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField... |
mbauskar/Das_frappe | refs/heads/develop | frappe/email/receive.py | 10 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import time
import _socket, poplib
import frappe
from frappe import _
from frappe.utils import extract_email_id, convert_utc_to_user_timezone, now, cint, cstr, strip
from frappe.u... |
grandquista/rethinkdb | refs/heads/next | drivers/python/rethinkdb/handshake.py | 10 | import base64
import binascii
import hashlib
import hmac
import random
import struct
import sys
import threading
from . import ql2_pb2
from .errors import *
try:
xrange
except NameError:
xrange = range
class HandshakeV0_4(object):
VERSION = ql2_pb2.VersionDummy.Version.V0_4
PROTOCOL = ql2_pb2.Version... |
damiansoriano/odoo | refs/heads/master | openerp/conf/__init__.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
katiewsimon/JP-Morgan-Hackathon-Project | refs/heads/master | jp_server/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... |
megaumi/django | refs/heads/master | tests/inspectdb/tests.py | 108 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from unittest import skipUnless
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.six import PY3, StringIO
from .models import ColumnTypes... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/account/wizard/account_period_close.py | 341 | # -*- 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... |
edry/edx-platform | refs/heads/master | common/djangoapps/course_modes/models.py | 10 | """
Add and create new modes for running courses on this particular LMS
"""
import pytz
from datetime import datetime
from django.core.exceptions import ValidationError
from django.db import models
from collections import namedtuple, defaultdict
from django.utils.translation import ugettext_lazy as _
from django.db.mo... |
banditlev/meangarden | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 1869 | # Copyright 2014 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... |
be-cloud-be/horizon-addons | refs/heads/9.0 | server/openerp/modules/db.py | 49 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import openerp.modules
import logging
_logger = logging.getLogger(__name__)
def is_initialized(cr):
""" Check if a database has been initialized for the ORM.
The database can be initialized with the 'initializ... |
UCC-Organism/crosswalk-odroid-ucc | refs/heads/master | scripts/gyp/finalize_apk.py | 1 | #!/usr/bin/env python
#
# 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.
# pylint: disable=F0401
"""Signs and zipaligns APK.
"""
import optparse
import os
import shutil
import sys
from util import build_ut... |
rooshilp/CMPUT410Lab4 | refs/heads/master | env-lab4/lib/python2.7/site-packages/werkzeug/contrib/sessions.py | 295 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... |
FRidh/Sea | refs/heads/master | Sea/actions/__init__.py | 2 | """
A module with actions related to :mod:`Sea.adapter` instances.
"""
import factory
import document
import system
import component
import connection |
8l/beri | refs/heads/master | cheritest/trunk/tests/alu/test_mul_div_loop.py | 1 | #-
# Copyright (c) 2011 Jonathan Woodruff
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed ... |
0k/odoo | refs/heads/master | addons/base_gengo/wizard/__init__.py | 434 | # -*- 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... |
srinia6/RackHD | refs/heads/master | test/tests/rackhd11/test_rackhd11_api_workflows.py | 12 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Local methods
MON_NODES = fit_common.node_select()
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(api_1_1=True)
class rack... |
allotria/intellij-community | refs/heads/master | python/testData/postfix/while/function.py | 39 | def f(a):
a.while<caret> |
tfroehlich82/erpnext | refs/heads/develop | erpnext/demo/domains.py | 7 | from __future__ import unicode_literals
data = {
'Manufacturing': {
'company_name': 'Wind Power LLC'
},
'Retail': {
'company_name': 'Annapurna Dairy Shop',
},
'Distribution': {
'company_name': 'Soltice Hardware',
},
'Services': {
'company_name': 'Acme Consulting'
},
'Education': {
'company_name': 'W... |
kimjaejoong/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/294_add_service_heartbeat.py | 72 | # Copyright (c) 2015 Wind River Systems 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 agreed to ... |
DevangS/CoralNet | refs/heads/master | images/migrations/0023_change_percentage_annotation_area_format.py | 1 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
print (
"-----\n"
"This migration changes the format of percentage annotation areas,\n"
"s... |
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8 | refs/heads/master | lib/python2.7/sqlite3/test/dbapi.py | 69 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages... |
gonboy/sl4a | refs/heads/master | python/src/Lib/xml/dom/minidom.py | 60 | """\
minidom.py -- a lightweight DOM implementation.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
interface
* SAX 2 namespaces
"""
import xml.dom... |
oasiswork/odoo | refs/heads/8.0 | addons/stock_picking_wave/__init__.py | 374 | # -*- 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... |
assad2012/ggplot | refs/heads/master | ggplot/stats/stat_bar.py | 12 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pandas as pd
from .stat import stat
_MSG_LABELS = """There are more than 30 unique values mapped to x.
If you want a histogram instead, use 'geom_histogram()'.
"""
class stat_bar(stat):
REQUIRE... |
ansible/ansible | refs/heads/devel | lib/ansible/collections/list.py | 22 | # (c) 2019 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
import os
from collections import defaultdict
from ansible.errors import AnsibleError
from ansible.collectio... |
chunyang-wen/dynet | refs/heads/master | examples/tensorboard/rnnlm-batch.py | 6 | import dynet as dy
import time
import random
from pycrayon import CrayonClient
LAYERS = 2
INPUT_DIM = 256 #50 #256
HIDDEN_DIM = 256 # 50 #1024
VOCAB_SIZE = 0
MB_SIZE = 50 # mini batch size
import argparse
from collections import defaultdict
from itertools import count
import sys
import util
class RNNLanguageMode... |
odoomrp/odoomrp-wip | refs/heads/8.0 | mrp_subcontracting/models/procurement_order.py | 25 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class Procurement... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/Django/django/http/__init__.py | 48 | import datetime
import os
import re
import time
from pprint import pformat
from urllib import urlencode, quote
from urlparse import urljoin
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
# The mod_python version is more efficient, so try importing it first.
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.