repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
sridevikoushik31/nova | refs/heads/port_id_in_vif_on_devide | nova/cells/filters/__init__.py | 1 | # Copyright (c) 2012 Rackspace Hosting, 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
#
# Unles... |
rakvat/direktkreditverwaltung | refs/heads/main | dkapp/migrations/0001_initial.py | 1 | # Generated by Django 3.0.8 on 2020-07-26 16:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
... |
miguelinux/vbox | refs/heads/master | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py | 1 | ## @file
# This file is used to parse a Module file of .PKG file
#
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full ... |
penkz/python-fundamentals | refs/heads/master | Assignment1/a1_gui.py | 1 | import tkinter
import a1
import time
import math
# The list of expected functions in a student submission.
EXPECTED_FNS = ['hours_difference',
'to_float_hours',
'get_hours',
'get_minutes',
'get_seconds',
'time_to_utc',
'time_from_utc']
# Make fake empty functions for ones that students haven'... |
YuriGural/erpnext | refs/heads/master | erpnext/hr/report/salary_register/salary_register.py | 19 | # 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.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
salary_slips = get_salary_sli... |
doclements/python-rasterstats | refs/heads/master | tests/test_zonal.py | 1 | # test zonal stats
import os
import pytest
import simplejson
import json
import sys
import numpy as np
import rasterio
from rasterstats import zonal_stats, raster_stats
from rasterstats.utils import VALID_STATS
from rasterstats.io import read_featurecollection, read_features
from shapely.geometry import Polygon
from af... |
rodrigc/buildbot | refs/heads/master | master/buildbot/test/unit/changes/test_gerritchangesource.py | 2 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
android-ia/platform_tools_idea | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/posix.py | 91 | # posix.py - Posix utility function implementations for Mercurial
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import encoding
import os, sys... |
erickj/injectjs | refs/heads/master | third-party/closure-library/bin/build/treescan.py | 582 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... |
glwu/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/email/quoprimime.py | 54 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/mover/simpleBlankLines_afterDown.py | 83 | if a:
a = 1
b = 2
c = 3 |
ferhung/kernel_mtk | refs/heads/sprout/lp5.1 | tools/perf/util/setup.py | 2079 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
Zubieta/CPP | refs/heads/master | HackerRank/Algorithms/02_Implementation/09_Utopian_Tree.py | 3 | # https://www.hackerrank.com/challenges/utopian-tree
t = int(raw_input())
for _ in xrange(t):
# An Utopian Tree is planted at the start of spring
# with length 1.
height = 1
# Then it will grow for a certain number of cycles.
cycles = int(raw_input())
for i in xrange(cycles):
# At an odd... |
gennad/www_gennad_org | refs/heads/master | django/contrib/localflavor/us/forms.py | 229 | """
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... |
enclose-io/compiler | refs/heads/master | current/deps/v8/tools/find-commit-for-patch.py | 14 | #!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import print_function
import argparse
import subprocess
import sys
def GetArgs():
pa... |
mlperf/training_results_v0.5 | refs/heads/master | v0.5.0/google/cloud_v2.8/ssd-tpuv2-8/code/ssd/model/tpu/models/experimental/resnet50_keras/resnet_preprocessing.py | 5 | # Copyright 2018 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... |
samthor/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/tryexceptelsefinally.py | 83 | d = dict()
try:
v = d['key']
except KeyError:
print 'element not found'
else:
print 'element value {0}'.format(v)
finally:
print 'excuting finally clause' |
lanyuwen/openthread | refs/heads/master | tools/harness-automation/cases/router_5_3_9.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... |
krakendash/krakendash | refs/heads/master | status/models.py | 10644 | from django.db import models
# Create your models here.
|
KarolBedkowski/kupfer-adds | refs/heads/master | kupfer/plugin/thunar.py | 4 | __kupfer_name__ = _("Thunar")
__kupfer_sources__ = ("ThunarObjects", )
__kupfer_actions__ = (
"Reveal",
"GetInfo",
"SendTo",
"CopyTo",
"LinkTo",
"MoveTo",
)
__description__ = _("File manager Thunar actions")
__version__ = ""
__author__ = "Ulrik Sverdrup <ulrik.sverdrup@gmail.com>"
import os
import dbus
import g... |
MRigal/volunteer_planner | refs/heads/develop | scheduler/migrations/0021_add_shift_users.py | 9 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
('scheduler', '0020_Fix_Working_Hours'),
]
operations = [
migrations.CreateModel(
... |
arximboldi/jpblib | refs/heads/master | jpb/event.py | 1 | # -*- coding: utf-8 -*-
#
# File: event.py
# Author: Juan Pedro Bolívar Puente <raskolnikov@es.gnu.org>
# Date: 2009
# Time-stamp: <2012-01-20 18:52:41 jbo>
#
#
# Copyright (C) 2009, 2012 Juan Pedro Bolívar Puente
#
# This file is part of jpblib.
#
# jpblib is free software: you can redistribute... |
cgarciabarrera/wazztrick | refs/heads/master | src/Yowsup/Media/uploader.py | 21 | from ..Common.Http.warequest import WARequest
from ..Common.Http.waresponseparser import JSONResponseParser
import socket, ssl, mimetypes, os, hashlib, sys
from time import sleep
class MediaUploader(WARequest):
def __init__(self, jid, accountJid, successClbk = None, errorClbk = None, progressCallback = None):
... |
adorsk/django-spotlights | refs/heads/master | spotlights/apps.py | 1 | from django.apps import AppConfig
class SpotlightsConfig(AppConfig):
name = 'spotlights'
|
adoosii/edx-platform | refs/heads/master | common/lib/safe_lxml/setup.py | 212 | """
Setup.py for safe_lxml.
"""
from setuptools import setup
setup(
name="safe_lxml",
version="1.0",
packages=["safe_lxml"],
install_requires=[
"lxml",
"defusedxml"
],
)
|
simula67/Thunar-1.3.0 | refs/heads/simula67 | examples/nautilus-bulk-rename.py | 7 | #!/usr/bin/env python
#
# $Id$
#
# Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
#
# 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)
# an... |
OCA/project-service | refs/heads/8.0 | project_stage_closed/models/task_stage.py | 13 | # -*- coding: utf-8 -*-
# Copyright 2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models
class ProjectTaskType(models.Model):
_inherit = 'project.task.type'
closed = fields.Boolean(
help="Tasks in this sta... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/meatlump/event/meatlump_container_01_04.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/clothing/clothing_bustier_casual_03.py | 85615 | import sys
def setup(core, object):
return |
Cal-CS-61A-Staff/ok-client | refs/heads/master | demo/doctest/hw1.py | 1 | """Demo assignment with separate test files."""
def square(x):
"""
Return x squared.
>>> square(3)
9
Extra tests:
>>> square(1)
1
>>> square(0)
0
>>> square(-4)
16
"""
return x * x
def double(x):
"""Return x doubled.
>>> double(3)
6
>>> double(-4)... |
euri10/zipline | refs/heads/master | tests/risk/test_risk_cumulative.py | 17 | #
# Copyright 2014 Quantopian, 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 in wr... |
pgastinger/bratshop | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bratshop.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... |
gtoonstra/airflow | refs/heads/master | tests/contrib/hooks/test_pinot_hook.py | 18 | # -*- coding: utf-8 -*-
#
# 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
#... |
bodi000/odoo | refs/heads/master | addons/im/__init__.py | 40 |
import im
|
mauidude/webstub | refs/heads/master | config.py | 1 | import os
print 'Reading config...'
env = os.environ.get('FLASK_ENV', 'DEVELOPMENT')
print 'FLASK_ENV = {0}'.format(env)
CSRF_ENABLED=True
SECRET_KEY='622fa765fa110611a164164fa347e941687cb7711c4ad6f1017a448cdd4c8c64'
DEBUG=True
TESTING=True
if env == 'PRODUCTION':
from pymongo.uri_parser import parse_uri
uri ... |
ronkitay/Rons-Tutorials | refs/heads/master | Docker/GettingStartedTutorial/app.py | 2 | from flask import Flask
from redis import Redis, RedisError
import os
import socket
# Connect to Redis
redis = Redis(host="redis", db=0, socket_connect_timeout=2, socket_timeout=2)
app = Flask(__name__)
@app.route("/")
def hello():
try:
visits = redis.incr("counter")
except RedisError:
visits... |
nyalldawson/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/v_net_bridge.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_net_bridge.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************... |
lmprice/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_api_session.py | 46 | #!/usr/bin/python
"""
# Created on Aug 12, 2016
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23
#
# module_check: not supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
"... |
anistark/mozillians | refs/heads/master | vendor-local/lib/python/tablib/packages/openpyxl/style.py | 61 | # file openpyxl/style.py
# Copyright (c) 2010 openpyxl
#
# 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, modify, ... |
ArneBab/pypyjs | refs/heads/master | website/demo/home/rfk/repos/pypy/lib-python/2.7/plat-mac/terminalcommand.py | 73 | """terminalcommand.py -- A minimal interface to Terminal.app.
To run a shell command in a new Terminal.app window:
import terminalcommand
terminalcommand.run("ls -l")
No result is returned; it is purely meant as a quick way to run a script
with a decent input/output window.
"""
#
# This module is a fairly s... |
glyph/cryptography | refs/heads/master | cryptography/hazmat/bindings/openssl/asn1.py | 1 | # 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 under the... |
gangadhar-kadam/mic-erpnext | refs/heads/master | patches/october_2012/remove_old_trial_bal.py | 5 | from __future__ import unicode_literals
from webnotes.model import delete_doc
def execute():
# remove search criteria
delete_doc("Search Criteria", "trial_balance")
|
willusher/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_queue.py | 51 | #!/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... |
chaosim/dao | refs/heads/master | dao/t/builtins/special.py | 1 | from dao.env import ModuleEnvironment
from dao.term import var
from dao.t.builtins.globalenv import global_env, collocet_builtins
from dao.special import *
special = ModuleEnvironment({}, None, 'special')
global_env[var('special')] = special
collocet_builtins(globals(), global_env, special)
|
aptrishu/coala-bears | refs/heads/master | bears/go/__init__.py | 37 | """
Go related bears.
"""
|
google/google-ctf | refs/heads/master | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Demo/parser/test_unparse.py | 6 | import unittest
from test import test_support
import cStringIO
import sys
import os
import tokenize
import ast
import unparse
def read_pyfile(filename):
"""Read and return the contents of a Python source file (as a
string), taking into account the file encoding."""
with open(filename, "r") as p... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/skillMods/expertise_cooldown_line_fs_sweep.py | 1156 | import sys
def add(core, actor, skillMod, value):
return
def deduct(core, actor, skillMod, value):
return
|
sabi0/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_0/_pkg0_1_0_0/_pkg0_1_0_0_1/_mod0_1_0_0_1_2.py | 30 | name0_1_0_0_1_2_0 = None
name0_1_0_0_1_2_1 = None
name0_1_0_0_1_2_2 = None
name0_1_0_0_1_2_3 = None
name0_1_0_0_1_2_4 = None |
famnote/pottocoin | refs/heads/master | contrib/qt_translations.py | 4110 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary bitcoin distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg... |
bcarroll/authmgr | refs/heads/master | python-3.6.2-Win64/Lib/site-packages/pip/_vendor/requests/packages/chardet/escsm.py | 2929 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
lovelysystems/pyjamas | refs/heads/ls-production | library/pyjamas/__init__.py | 6 | #from pyjamas import Window
#from pyjamas import DOM
#from pyjamas import History
#from pyjamas import Location
#from pyjamas import DeferredCommand
#from pyjamas import Cookies
#from pyjamas import Timer
#from pyjamas import JSONParser
#from pyjamas import JSONService
|
Salat-Cx65/python-for-android | refs/heads/master | python-modules/twisted/twisted/persisted/crefutil.py | 61 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility classes for dealing with circular references.
"""
from twisted.python import log, reflect
try:
from new import instancemethod
except:
from org.python.core impo... |
EchO-KID/google-breakpad | refs/heads/master | src/tools/gyp/pylib/gyp/generator/scons.py | 20 | # 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.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
# TODO: remove when we delete the last WriteList() call in this mo... |
betoesquivel/fil2014 | refs/heads/master | build/django/build/lib.linux-x86_64-2.7/django/conf/locale/ta/formats.py | 118 | # -*- 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 = 'j F, Y'
TIME_FORMAT = 'g:i:s A'
#... |
android-ia/platform_external_chromium_org | refs/heads/master | tools/profile_chrome/perf_controller.py | 26 | # 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 logging
import os
import signal
import subprocess
import sys
import tempfile
from profile_chrome import controllers
from profile_chrome import ui
fr... |
sun1991/lvsys | refs/heads/master | lvsys/env_lvsys/Lib/site-packages/pip/_vendor/html5lib/__init__.py | 316 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
cloudify-cosmo/cloudify-system-tests | refs/heads/master | cosmo_tester/test_suites/cli/aio_test.py | 1 | from cosmo_tester.test_suites.cli import (
_cleanup_profile,
LINUX_OSES,
_prepare,
_test_cfy_install,
_test_cfy_logs,
_test_logs_context,
_test_teardown,
_test_upload_and_install,
WINDOWS_OSES,
)
def test_cli_deployment_flow(cli_tester, logger):
for os in LINUX_OSES + WINDOWS_O... |
jiaphuan/models | refs/heads/master | research/tcn/model.py | 5 | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
samtx/whatsmyrankine | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py | 1002 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... |
sklnet/opendroid-enigma2 | refs/heads/master | lib/python/Components/Sources/Config.py | 132 | from Source import Source
class Config(Source):
def __init__(self, config):
Source.__init__(self)
self.__config = config
def getConfig(self):
return self.__config
config = property(getConfig)
def getHTML(self, id):
print "getHTML", self, id
return self.__config.getHTML(id)
def handleCommand(self, cm... |
ThinkOpen-Solutions/odoo | refs/heads/stable | addons/document/report/__init__.py | 444 | # -*- 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... |
NickelMedia/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/http_lock_unittest.py | 124 | # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# 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 co... |
vatlab/SOS | refs/heads/master | src/sos/workflow_engines.py | 2 | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import copy
import os
import stat
import subprocess
import time
from .eval import cfg_interpolate
from .utils import env, textMD5, expand_time, format_durat... |
python-diamond/Diamond | refs/heads/master | src/collectors/memory_docker/test/testmemory_docker.py | 31 | #!/usr/bin/python
# coding=utf-8
##########################################################################
import os
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch
try:
from cStringIO import ... |
nacl-webkit/native_client | refs/heads/master | src/trusted/validator_arm/dgen_add_patterns.py | 12 | #!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Checks (rule) patterns associated with rows in tables, and adds an
additional column to each row (in each table) which cap... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/SQLAlchemy-1.0.6/lib/sqlalchemy/orm/interfaces.py | 8 | # orm/interfaces.py
# Copyright (C) 2005-2015 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
"""
Contains various base classes used throughout the ORM.
Defines some key base... |
aleksandr-bakanov/astropy | refs/heads/master | astropy/nddata/mixins/ndio.py | 4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the I/O mixin to the NDData class.
from astropy.io import registry
__all__ = ['NDIOMixin']
__doctest_skip__ = ['NDDataRead', 'NDDataWrite']
class NDDataRead(registry.UnifiedReadWrite):
"""Read and parse gridded N-dimension... |
karthik339/Agni | refs/heads/master | MainDemo/flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
jcrocholl/pypng | refs/heads/master | test/decode.py | 2 | import sys, png
width, height, pixels = png.read(sys.stdin)
print 'P6 %s %s 255' % (width, height)
pixels.tofile(sys.stdout)
|
bdarnell/tornado | refs/heads/master | tornado/test/escape_test.py | 11 | import unittest
import tornado.escape
from tornado.escape import (
utf8,
xhtml_escape,
xhtml_unescape,
url_escape,
url_unescape,
to_unicode,
json_decode,
json_encode,
squeeze,
recursive_unicode,
)
from tornado.util import unicode_type
from typing import List, Tuple, Union, Dict... |
amites/autokey | refs/heads/master | src/lib/qtui/enginesettings.py | 50 | #!/usr/bin/env python
# coding=UTF-8
#
# Generated by pykdeuic4 from enginesettings.ui on Sun Mar 4 11:39:39 2012
#
# WARNING! All changes to this file will be lost.
from PyKDE4 import kdecore
from PyKDE4 import kdeui
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
... |
tdenniston/Halide | refs/heads/master | python_bindings/tutorial/lesson_05_scheduling_1.py | 13 | #!/usr/bin/python3
# Halide tutorial lesson 5
# This lesson demonstrates how to manipulate the order in which you
# evaluate pixels in a Func, including vectorization,
# parallelization, unrolling, and tiling.
# This lesson can be built by invoking the command:
# make tutorial_lesson_05_scheduling_1
# in a shell w... |
ashwyn/eden-message_parser | refs/heads/master | modules/eden/layouts.py | 2 | # -*- coding: utf-8 -*-
""" Sahana Eden GUI Layouts (HTML Renderers)
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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 Soft... |
diogobaeder/sptrans | refs/heads/master | sptrans/v0.py | 1 | """Module for the v0 version of the `SPTrans API <http://www.sptrans.com.br/desenvolvedores/APIOlhoVivo/Documentacao.aspx?1>`_.
The first thing you have to do, in order to use it, is to instantiate a client and authenticate to the API:
::
from sptrans.v0 import Client
client = Client()
client.authentica... |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | refs/heads/master | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/tkinter/messagebox.py | 19 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from tkinter.messagebox import *
else:
try:
from tkMessageBox import *
except ImportError:
raise ImportError('The tkMessageBox module is missing. Does your Py2 '
'installation include tkin... |
haxwithaxe/couchit | refs/heads/master | couchit/utils/mail.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Django Software Foundation and individual contributors.
#
# adapted for couchit waiting an easier/better system
"""
Tools for sending email.
"""
import mimetypes
import os
import smtplib
import socket
import time
import random
from email import Charset, Encoders
from emai... |
CodeForAfrica/grano | refs/heads/master | grano/alembic/versions/52f4346513a8_add_file_relation.py | 4 | """add file relation
Revision ID: 52f4346513a8
Revises: d7067cd4169
Create Date: 2014-04-02 16:33:16.710455
"""
# revision identifiers, used by Alembic.
revision = '52f4346513a8'
down_revision = 'd7067cd4169'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('grano_file',
s... |
unindented/streamcode | refs/heads/master | client/static/jsrepl/extern/python/unclosured/lib/python2.7/lib2to3/fixer_base.py | 305 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... |
openshift/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/openshift_health_checker/test/rpm_version_test.py | 56 | import pytest
import rpm_version
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
},
}
@pytest.mark.parametrize('pkgs, expect_not_found', [
(
{},
["spam", "eggs"], # none found
),
... |
kharts/music_explorer | refs/heads/master | music_explorer/wsgi.py | 1 | """
WSGI config for music_explorer project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... |
Distrotech/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/ElseBody.before.py | 83 | def foo():
for arg in sys.argv[1:]:
try:
f = open(arg, 'r')
except IOError:
print('cannot open', arg)
else:
<selection>length = len(f.readlines()) #<---extract something from here
print("hi from else")</selection>
#anything else you... |
baigk/compass-core | refs/heads/master | compass/actions/clean.py | 1 | # Copyright 2014 Huawei Technologies Co. Ltd
#
# 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... |
zerin108/videonotes | refs/heads/master | lib/oauth2client/appengine.py | 49 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
ilo10/scikit-learn | refs/heads/master | sklearn/cluster/bicluster.py | 211 | """Spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from . import KMeans, MiniBatchKMeans
from ..base import BaseEstimator, BiclusterMixin
from ..external... |
carljm/ansible-modules-extras | refs/heads/devel | monitoring/zabbix_maintenance.py | 83 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@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 t... |
ToonTownInfiniteRepo/ToontownInfinite | refs/heads/master | toontown/coghq/LawbotOfficeDiamondRoom_Action00.py | 5 | from toontown.coghq.SpecImports import *
GlobalEntities = {1000: {'type': 'levelMgr',
'name': 'LevelMgr',
'comment': '',
'parentEntId': 0,
'cogLevel': 0,
'farPlaneDistance': 1500,
'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone13a',
'wantDoors': 1},
1001: {'ty... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/test/base/interactor.py | 1 | import os
import re
from StringIO import StringIO
from galaxy.tools.parameters import grouping
from galaxy.tools import test
from galaxy import eggs
eggs.require( "requests" )
from galaxy import util
from galaxy.util.odict import odict
import galaxy.model
from galaxy.model.orm import and_, desc
from functional import d... |
mozilla/bedrock | refs/heads/master | bedrock/firefox/firefox_details.py | 4 | # coding=utf-8
import re
from collections import OrderedDict
from operator import itemgetter
from urllib.parse import urlencode
from django.conf import settings
from everett.manager import ListOf
from product_details import ProductDetails
from bedrock.base.waffle import config
# TODO: port this to django-mozilla-... |
npiganeau/odoo | refs/heads/master | addons/website_livechat/__openerp__.py | 297 | {
'name': 'Website Live Support',
'category': 'Website',
'summary': 'Chat With Your Website Visitors',
'version': '1.0',
'description': """
Odoo Website LiveChat
========================
For website built with Odoo CMS, this module include a chat button on your Website, and allow your visitors to ch... |
clody23/ukbb_utilities | refs/heads/master | convert_binary.py | 1 | #!/usr/bin/env python
import sys
import struct
import scipy as sp
if len(sys.argv[1:])< 2:
sys.stderr.write('ERROR:\nArgument missing\nUsage: script.py <file.bin> <file.txt>\n')
sys.exit(1)
## number of lines expected 265 SNPs X 2 X ~400000 samples
n_snps = 265
n_samples = 488377
n_tot = n_snps*2*n_samples
#25... |
mathspace/django | refs/heads/master | django/contrib/gis/forms/fields.py | 504 | from __future__ import unicode_literals
from django import forms
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.utils.translation import ugettext_lazy as _
from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
This is the basic form field for a Geometry. A... |
merutak/python-social-auth | refs/heads/master | examples/flask_example/settings.py | 2 | from os.path import dirname, abspath
SECRET_KEY = 'random-secret-key'
SESSION_COOKIE_NAME = 'psa_session'
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:////%s/test.db' % dirname(abspath(__file__))
DEBUG_TB_INTERCEPT_REDIRECTS = False
SESSION_PROTECTION = 'strong'
SOCIAL_AUTH_LOGIN_URL = '/'
SOCIAL_AUTH_LOGIN_REDIREC... |
armirusco/djangae | refs/heads/master | djangae/utils.py | 10 | import os
import sys
import time
import logging
from socket import socket, SHUT_RDWR
def application_id():
from google.appengine.api import app_identity
try:
result = app_identity.get_application_id()
except AttributeError:
result = None
if not result:
# Apparently we aren't ... |
alonisser/Open-Knesset | refs/heads/master | video/management/commands/sub_commands/UpdateMembersRelatedVideos.py | 14 | # encoding: utf-8
from video.management.commands.sub_commands import SubCommand
from video.utils.youtube import GetYoutubeVideos
from mks.models import Member
from video.utils.parse_dict import validate_dict
from video.utils import get_videos_queryset
from video.models import Video
class UpdateMembersRelatedVideos(Su... |
noelbk/neutron-juniper | refs/heads/master | neutron/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py | 9 | # 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... |
OCA/project-service | refs/heads/8.0 | project_issue_task/project_issue.py | 27 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 - 2013 Daniel Reis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free S... |
hslatman/spiderfoot | refs/heads/master | modules/sfp_yahoosearch.py | 7 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_yahoosearch
# Purpose: Searches Yahoo for content related to the domain in question.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Created: 12/04/2014
# Copyright: ... |
11craft/django-cms | refs/heads/develop | cms/plugins/file/models.py | 1 | from cms.utils.compat.dj import python_2_unicode_compatible
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.files.storage import default_storage
from cms.models import CMSPlugin
import os
from django.conf import settings
@python_2_unicode_compatible
class File(CMS... |
ammaradil/fibonacci | refs/heads/master | Lib/site-packages/django/contrib/gis/db/backends/base/adapter.py | 484 | class WKTAdapter(object):
"""
This provides an adaptor for Geometries sent to the
MySQL and Oracle database backends.
"""
def __init__(self, geom):
self.wkt = geom.wkt
self.srid = geom.srid
def __eq__(self, other):
if not isinstance(other, WKTAdapter):
return... |
prune998/ansible | refs/heads/devel | lib/ansible/modules/files/replace.py | 40 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Evan Kaufman <evan@digitalflophouse.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 t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.