repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
betoesquivel/fil2014 | refs/heads/master | build/django/build/lib.linux-x86_64-2.7/django/db/backends/mysql/validation.py | 190 | from django.db.backends import BaseDatabaseValidation
class DatabaseValidation(BaseDatabaseValidation):
def validate_field(self, errors, opts, f):
"""
MySQL has the following field length restriction:
No character (varchar) fields can have a length exceeding 255
characters if they h... |
Verber/FrameworkBenchmarks | refs/heads/master | frameworks/CSharp/aspnet/setup_iis.py | 65 | import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
if os.name != 'nt':
return 1
try:
setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
subprocess.check_call("powershell -Command .\\setup_iis.ps1 start", cwd="aspnet", stderr=err... |
icyflame/batman | refs/heads/master | scripts/revertbot.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used for reverting certain edits.
The following command line parameters are supported:
¶ms;
-username Edits of which user need to be reverted.
-rollback Rollback edits instead of reverting them.
Note that in roll... |
Microsoft/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py | 228 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pkg_resources.e... |
liangjg/openmc | refs/heads/develop | openmc/cell.py | 8 | from collections import OrderedDict
from collections.abc import Iterable
from copy import deepcopy
from math import cos, sin, pi
from numbers import Real
from xml.etree import ElementTree as ET
import numpy as np
from uncertainties import UFloat
import openmc
import openmc.checkvalue as cv
from ._xml import get_text
... |
ingenioustechie/zamboni | refs/heads/master | lib/video/__init__.py | 44 | from django.conf import settings
from django.utils.importlib import import_module
_library = None
def get_library():
"""Find a suitable lib."""
for lib in settings.VIDEO_LIBRARIES:
mod = import_module(lib)
if mod.Video.library_available():
return mod.Video
if _library is None:
... |
netscaler/neutron | refs/heads/master | neutron/plugins/cisco/extensions/n1kv_profile.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cisco 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... |
dean99dean/ghostblog | refs/heads/master | node_modules/pg/node_modules/generic-pool/fabfile.py | 926 | #
# dependencies:
# fabric (apt-get install fabric)
# node-jslint (http://github.com/reid/node-jslint)
# expresso (or replace with whatever node.js test tool you're using)
#
from fabric.api import local
import os, os.path
def test():
local('expresso -I lib test/*', capture=False)
def jslint():
... |
abhiQmar/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/trie/_base.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from collections import Mapping
class Trie(Mapping):
"""Abstract base class for tries"""
def keys(self, prefix=None):
keys = super().keys()
if prefix is None:
return set(keys)
# Python 2.6: no set compre... |
doomsterinc/odoo | refs/heads/8.0 | addons/sale_order_dates/sale_order_dates.py | 223 | # -*- 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... |
supertom/ansible-modules-core | refs/heads/devel | network/dellos9/dellos9_command.py | 5 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... |
bqbn/addons-server | refs/heads/master | src/olympia/ratings/migrations/0001_initial.py | 7 | # Generated by Django 2.2.5 on 2019-09-12 13:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django.utils.timezone
import olympia.amo.fields
import olympia.amo.models
class Migration(migrations.Migration):
initi... |
snnn/tensorflow | refs/heads/master | tensorflow/python/estimator/inputs/queues/feeding_functions.py | 20 | # 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... |
andyliuliming/azure-linux-extensions | refs/heads/master | VMBackup/main/guestsnapshotter.py | 1 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
almeidapaulopt/frappe | refs/heads/develop | frappe/integrations/doctype/oauth_bearer_token/test_oauth_bearer_token.py | 23 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('OAuth Bearer Token')
class TestOAuthBearerToken(unittest.TestCase):
pass
|
40223136/w17test1 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/difflib.py | 737 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... |
pozetroninc/micropython | refs/heads/stable | ports/stm32/boards/pllvalues.py | 10 | """
This is an auxiliary script that is used to compute valid PLL values to set
the CPU frequency to a given value. The algorithm here appears as C code
for the machine.freq() function.
"""
from __future__ import print_function
import re
class MCU:
def __init__(
self, range_sysclk, range_m, range_n, ran... |
agry/NGECore2 | refs/heads/master | scripts/object/static/structure/general/cave_stalagmite_tato_s01_small.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/quest/survey_data_04.py | 85615 | import sys
def setup(core, object):
return |
ImageEngine/gaffer | refs/heads/master | python/GafferVDBTest/__init__.py | 7 | ##########################################################################
#
# Copyright (c) 2017, Image Engine Design 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:
#
# * Redistrib... |
daweim0/Just-some-image-features | refs/heads/master | lib/triplet_loss/triplet_loss_op_grad.py | 1 | import tensorflow as tf
from tensorflow.python.framework import ops
import triplet_loss_op
@ops.RegisterGradient("TripletFlow")
def _triplet_grad(op, grad, _):
diff = op.outputs[1]
margin = op.get_attr('margin')
# compute gradient
data_left_grad, data_right_grad = triplet_loss_op.triplet_loss_grad(diff, gra... |
tkwon/dj-stripe | refs/heads/tk | tests/test_event_processing_exception.py | 1 | """
.. module:: dj-stripe.tests.test_event_processing_exception
:synopsis: dj-stripe EventProcessingException Model Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
"""
from copy import deepcopy
from django.test import TestCase
from djstripe.models import EventProcessingException, Event
class TestEventProces... |
fredrikw/scipy | refs/heads/master | scipy/io/tests/test_netcdf.py | 57 | ''' Tests for netcdf '''
from __future__ import division, print_function, absolute_import
import os
from os.path import join as pjoin, dirname
import shutil
import tempfile
import warnings
from io import BytesIO
from glob import glob
from contextlib import contextmanager
import numpy as np
from numpy.testing import a... |
rawg/levis | refs/heads/master | levis/mutation.py | 1 | """Functions for mutation operations.
Contents
--------
Mutation operators are implemented as functions. The available operators and
their suitability to encoding types is listed below.
========= ====== ==== ===========
Operation Binary List Permutation
========= ====== ==== ===========
point No ... |
kapouer/mapnik | refs/heads/master | scons/scons-local-2.3.0/SCons/Tool/qt.py | 11 |
"""SCons.Tool.qt
Tool-specific initialization for Qt.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons... |
flh/odoo | refs/heads/master | addons/base_setup/__init__.py | 439 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
v1bri/gnuradio | refs/heads/master | gr-pager/apps/usrp_rx_flex.py | 58 | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: USRP FLEX Pager Receiver (Single Channel)
# Generated: Thu Oct 29 11:03:16 2009
##################################################
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio impor... |
chjw8016/GreenOdoo7-haibao | refs/heads/master | openerp/addons/account_asset/wizard/wizard_asset_compute.py | 48 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
dreamsxin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/imp.py | 97 | """This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/quickFixes/PyMoveAttributeToInitQuickFixTest/addSuperCallOldStyle.py | 83 | __author__ = 'ktisha'
class Base:
def __init__(self):
self.param = 2
class Child(Base):
def f(self):
self.<caret>my = 2 |
40223211/cadb_g7_w18test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/copyreg.py | 749 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... |
kalaspuff/tomodachi | refs/heads/master | tomodachi/invoker/base.py | 1 | import functools
import types
from typing import Any, Callable, Dict, Tuple, cast
FUNCTION_ATTRIBUTE = "_tomodachi_function_is_invoker_function"
START_ATTRIBUTE = "_tomodachi_deprecated_invoker_function_start_marker"
INVOKER_TASK_START_KEYWORD = "_tomodachi_invoker_task_start_keyword"
class Invoker(object):
cont... |
ElteHupkes/sdf-builder | refs/heads/master | sdfbuilder/math/__init__.py | 1 | """
Vector, Quaternion and RotationMatrix classes written as
wrappers over `transformations.py` (see that file for license/origin).
"""
from .classes import Vector3, Quaternion, RotationMatrix |
goodwillcoding/RIDE | refs/heads/master | src/robotide/lib/robot/model/itemlist.py | 5 | # Copyright 2008-2014 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
cvLabBonn-studentLabs/lab2307_WS1314_aras | refs/heads/master | libsvm-3.17/tools/checkdata.py | 144 | #!/usr/bin/env python
#
# A format checker for LIBSVM
#
#
# Copyright (c) 2007, Rong-En Fan
#
# All rights reserved.
#
# This program is distributed under the same license of the LIBSVM package.
#
from sys import argv, exit
import os.path
def err(line_no, msg):
print("line {0}: {1}".format(line_no, msg))
# works... |
quchunguang/test | refs/heads/master | testpy2exe/simpledemo/hello.py | 124 | print "Hello World!"
|
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/ad-block/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/logilab/astroid/__init__.py | 66 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... |
druuu/django | refs/heads/master | tests/gis_tests/test_geoforms.py | 292 | from unittest import skipUnless
from django.contrib.gis import forms
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
from django.test import SimpleTestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.html imp... |
onepas/kodi-addons | refs/heads/master | plugin.video.vietmediaplay/simplejson/ordered_dict.py | 1039 | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... |
billy-inn/scikit-learn | refs/heads/master | sklearn/feature_selection/tests/test_rfe.py | 209 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... |
kool79/intellij-community | refs/heads/master | python/testData/completion/noIdentifiersInImport.py | 83 | from sys stdo<caret> |
collex100/odoo | refs/heads/8.0 | addons/anonymization/anonymization.py | 25 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
kerneltask/micropython | refs/heads/master | tests/basics/for2.py | 118 | i = 'init'
for i in range(0):
pass
print(i) # should not have been modified
for i in range(10):
pass
print(i) # should be last successful value of loop
|
margaret/python-datamuse | refs/heads/master | datamuse/datamuse.py | 1 | import json
import requests
WORD_PARAMS = [
'ml',
'sl',
'sp',
'rel_jja',
'rel_jjb',
'rel_syn',
'rel_trg',
'rel_ant',
'rel_spc',
'rel_gen',
'rel_com',
'rel_par',
'rel_bga',
'rel_bgb',
'rel_rhy',
'rel_nry',
'rel_hom',
'rel_cns',
'v',
'topic... |
nylas/nylas-python | refs/heads/main | nylas/utils.py | 1 | from __future__ import division
from datetime import datetime, timedelta
def timestamp_from_dt(dt, epoch=datetime(1970, 1, 1)):
"""
Convert a datetime to a timestamp.
https://stackoverflow.com/a/8778548/141395
"""
# For offset-aware datetime objects, convert them first before performing delta
... |
a113n/bcbio-nextgen | refs/heads/master | bcbio/heterogeneity/loh.py | 2 | """Summarize amplification and loss of heterozygosity (LOH) from heterogeneity callers.
Provides high level summaries of calls in regions of interest.
"""
import csv
import collections
import os
import decimal
import uuid
import pandas as pd
import six
from six import StringIO
import toolz as tz
import yaml
from bcb... |
amirouche/python-earley-parser | refs/heads/master | earleyparser/parse_tools.py | 1 | from __future__ import print_function
red = bold = yellow = lambda x: x
class ParseItem:
def __init__(self, start, end, symbole):
self.start = start
self.end = end
self.symbole = symbole
def __cmp__(self, o):
if self.start != o.start:
return 1
if self.en... |
lahwaacz/wiki-scripts | refs/heads/master | ws/db/migrations/versions/c82c483221d6_add_namespace_ns_protection.py | 2 | """add namespace.ns_protection
Revision ID: c82c483221d6
Revises: 2d3b166fe612
Create Date: 2020-03-07 08:14:53.643467
"""
from alembic import op
import sqlalchemy as sa
# add our project root into the path so that we can import the "ws" module
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file... |
dstockwell/blink | refs/heads/master | LayoutTests/http/tests/websocket/unmasked-frames_wsh.py | 42 | from mod_pywebsocket import common
from mod_pywebsocket import handshake
from mod_pywebsocket import stream
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
# pywebsocket does not mask message by default. We need to build a frame man... |
jriehl/numba | refs/heads/master | numba/npyufunc/__init__.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from .decorators import Vectorize, GUVectorize, vectorize, guvectorize
from ._internal import PyUFunc_None, PyUFunc_Zero, PyUFunc_One
from . import _internal, array_exprs, parfor
from .parallel import threading_layer
if hasattr(_i... |
trippysalmon/bitcoin | refs/heads/b15-rpc-plotter | test/functional/preciousblock.py | 8 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the preciousblock RPC."""
from test_framework.test_framework import BitcoinTestFramework
from tes... |
ThiagoGarciaAlves/three.js | refs/heads/master | utils/converters/msgpack/msgpack/fallback.py | 641 | """Fallback pure Python implementation of msgpack"""
import sys
import array
import struct
if sys.version_info[0] == 3:
PY3 = True
int_types = int
Unicode = str
xrange = range
def dict_iteritems(d):
return d.items()
else:
PY3 = False
int_types = (int, long)
Unicode = unicode
... |
turbinenreiter/micropython | refs/heads/master | tests/basics/ifcond.py | 111 | # test if conditions which are optimised by the compiler
if 0:
print(5)
else:
print(6)
if 1:
print(7)
if 2:
print(8)
if -1:
print(9)
elif 1:
print(10)
if 0:
print(11)
else:
print(12)
if 0:
print(13)
elif 1:
print(14)
if 0:
print(15)
elif 0:
print(16)
else:
prin... |
lmazuel/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/auto_rest_complex_test_service/models/goblinshark.py | 16 | # 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 ... |
DaanHoogland/cloudstack | refs/heads/patch-2 | test/integration/component/test_storage_motion.py | 6 | # 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... |
vrutkovs/mailnag | refs/heads/master | Mailnag/common/utils.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# mails.py
#
# Copyright 2011, 2012 Patrick Ulbrich <zulu99@gmx.net>
# Copyright 2007 Marco Ferragina <marco.ferragina@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... |
niisan-tokyo/music_generator | refs/heads/master | src/use.py | 1 | import wave
import struct
from scipy import fromstring, int16
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Dense, LSTM
# parameter set
wavfile = '/data/input/battle2.wav'
wr = wave.open(wavfile, "rb")
ch = wr.getnchannels()
width = wr.getsampwidth()
fr = wr.getframerate(... |
alexpark07/KISS | refs/heads/master | shellcode/ARM/shellcodes/thumb/open_file.py | 2 | # open a file
def generate(filepath='./secret', flags=00, mode=None):
"""open a file for reading/writing/sending to you in thumb mode
Args:
filepath (str) : filename to read with flags/mode
flags (int/str): The argument flags must include one of the following access modes: O_RDONLY, O_WRONLY, ... |
salguarnieri/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/LocalVarDefinedBeforeModifiedInside.after.py | 79 | def main(indices):
foo = True
for i in indices:
foo, need_break = bar(foo, i)
if need_break:
break
return foo
def bar(foo_new, i_new):
need_break = False
if i_new > 2:
foo_new = False
need_break = True
return foo_new, need_break |
ssgeejr/glances | refs/heads/master | glances/core/glances_client_browser.py | 11 | # -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-jsonpointer/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyJsonpointer(PythonPackage):
"""Library to resolve JSON Pointers according to RFC 6901"""... |
andrewleech/script.module.pycurl | refs/heads/master | lib/pycurl/pycurl-7.19.5.1-cp27-none-linux_i686/share/doc/pycurl/examples/basicfirst.py | 8 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import sys
import pycurl
class Test:
def __init__(self):
self.contents = ''
def body_callback(self, buf):
self.contents = self.contents + buf
sys.stderr.write("Testing %s\n" % pycurl.version)
t = Test()
c = pycurl.Curl()
c.setopt(c... |
binhex/moviegrabber | refs/heads/master | lib/site-packages/Cheetah/convertTmplPathToModuleName.py | 15 | import os.path
import string
letters = None
try:
letters = string.ascii_letters
except AttributeError:
letters = string.letters
l = ['_'] * 256
for c in string.digits + letters:
l[ord(c)] = c
_pathNameTransChars = ''.join(l)
del l, c
def convertTmplPathToModuleName(tmplPath,
... |
Innovahn/cybex | refs/heads/master | addons/note_pad/note_pad.py | 441 | # -*- 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... |
bodi000/odoo | refs/heads/master | addons/l10n_ro/res_partner.py | 38 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 (<http://www.erpsystems.ro>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
wanghongjuan/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_self_frame_blocked-manual.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self'")
response.headers.set("X... |
robbiet480/home-assistant | refs/heads/dev | homeassistant/components/rainforest_eagle/sensor.py | 17 | """Support for the Rainforest Eagle-200 energy monitor."""
from datetime import timedelta
import logging
from eagle200_reader import EagleReader
from requests.exceptions import ConnectionError as ConnectError, HTTPError, Timeout
from uEagle import Eagle as LegacyReader
import voluptuous as vol
from homeassistant.comp... |
DaveTCode/CreatureRogue | refs/heads/master | CreatureRogue/models/battle_creature.py | 1 | from CreatureRogue.models.creature import Creature
from CreatureRogue.data_layer.data import StaticGameData, HP_STAT
from CreatureRogue.data_layer.pokeball import Pokeball
from CreatureRogue.data_layer.stat import Stat
class BattleCreature:
"""
When in battle a creature can have stat adjustments and other val... |
xlk521/cloudguantou | refs/heads/master | django/db/models/sql/query.py | 22 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... |
0jpq0/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/sqlite3/test/dbapi.py | 89 | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# 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... |
ravibhure/ansible | refs/heads/devel | test/units/executor/module_common/test_module_common.py | 83 | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/src/Demo/tkinter/matt/packer-simple.py | 47 | from Tkinter import *
class Test(Frame):
def printit(self):
print self.hi_there["command"]
def createWidgets(self):
# a hello button
self.QUIT = Button(self, text='QUIT', foreground='red',
command=self.quit)
self.QUIT.pack(side=LEFT, fill=BOTH)
... |
baldengineers/easytf2_mapper | refs/heads/master | prefabs/spike_prefab.py | 1 | import os
def createTile(posx, posy, id_num, world_id_num):
looplist = '1'
values=[]#Values are all of the lines of a prefab that have the vertex coords
f = open('prefab_template/spike_prefab.txt', 'r+')
lines = f.readlines() #gathers each line of the prefab and puts numbers them
x1 = posx*512
... |
howiworkdaily/scofield-project | refs/heads/master | scofield/manufacturer/urls.py | 1 | from django.conf.urls.defaults import *
urlpatterns = patterns('manufacturer.views',
url(r'^(?P<manufacturer_slug>[-\w]+)/$', 'get_manufacturer', {}, 'scofield_manufacturer'),
)
|
ford-prefect/cerbero | refs/heads/openwebrtc | cerbero/hacks.py | 18 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
EiNSTeiN-/deluge-gtk3 | refs/heads/master | deluge/plugins/webui/webui/gtkui.py | 3 | #
# gtkui.py
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms... |
streettraffic/streettraffic | refs/heads/develop | streettraffic/server.py | 1 | import asyncio
import websockets
import json
import asyncio
import threading
import datetime as dt
from dateutil import parser
import http.server
import socketserver
import os
from typing import Dict, List
import urllib
import posixpath
## import our modules
from .database import TrafficData
from .map_resource.utility... |
zzzirk/boto | refs/heads/master | tests/integration/sqs/test_cert_verification.py | 126 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... |
Pexego/odoo | refs/heads/master | addons/sale_crm/__init__.py | 353 | # -*- 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... |
pridemusvaire/youtube-dl | refs/heads/master | youtube_dl/extractor/tapely.py | 124 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
clean_html,
ExtractorError,
float_or_none,
parse_iso8601,
)
class TapelyIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\... |
MarilynDafa/Bulllord-Engine | refs/heads/master | code/externals/freetype2/src/tools/chktrcmp.py | 284 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009, 2013
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freet... |
CptLemming/libsaas | refs/heads/master | test/test_recurly.py | 4 | import unittest
from datetime import date
from libsaas import http, xml
from libsaas.executors import test_executor
from libsaas.services import recurly
class RecurlyTestCase(unittest.TestCase):
def setUp(self):
self.executor = test_executor.use()
self.executor.set_response(
b'<?xml... |
lukeKuzmish/google-python-exercises | refs/heads/master | basic/solution/mimic.py | 208 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... |
LeslieW/or-tools | refs/heads/master | examples/python/nonogram_table.py | 34 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ... |
sabi0/intellij-community | refs/heads/master | python/testData/hierarchy/call/Static/Inheritance/main.py | 80 |
class A(object):
def target_func(self):
pass
class B(A):
pass
class C(object):
def func(self, a):
a.target_func()
def foo1(b):
f = b.target_func
def foo2(b):
b.target_func()
def bar1(*args):
pass
def bar2(*args):
pass
b = B()
foo1(b)
foo2(b)
bar1(b.target_<care... |
mxOBS/deb-pkg_trusty_chromium-browser | refs/heads/master | third_party/trace-viewer/hooks/install.py | 2 | #!/usr/bin/env python
# Copyright (c) 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 sys
import os
_TOP_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..'))
class Link(object):
def __i... |
glwu/python-for-android | refs/heads/master | python-modules/twisted/twisted/runner/procmon.py | 49 | # -*- test-case-name: twisted.runner.test.test_procmon -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for starting, monitoring, and restarting child process.
"""
import warnings
from twisted.python import log
from twisted.internet import error, protocol, reactor as _... |
ChinaMassClouds/copenstack-server | refs/heads/master | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/admin/datacenter/panel.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
# d... |
dchabot/bluesky | refs/heads/master | bluesky/spec_api.py | 2 | """
Make instances of Scans and give them names matching SPEC.
"""
import bluesky.simple_scans as bss
# Instantiate scans that imitate SPEC API.
ct = count = bss.Count()
ascan = bss.AbsScan()
mesh = bss.OuterProductAbsScan()
a2scan = a3scan = bss.InnerProductAbsScan()
dscan = lup = bss.DeltaScan()
d2scan = d3scan = b... |
sarthfrey/sentimizer | refs/heads/master | lib/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py | 794 | from flask import Blueprint, render_template
admin = Blueprint('admin', __name__, url_prefix='/admin',
template_folder='templates',
static_folder='static')
@admin.route('/')
def index():
return render_template('admin/index.html')
@admin.route('/index2')
def index2():
ret... |
fgesora/odoo | refs/heads/8.0 | addons/website_sale/__init__.py | 3964 | import controllers
import models
|
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/wiffi/wiffi_strings.py | 21 | """Definition of string used in wiffi json telegrams."""
# units of measurement
WIFFI_UOM_TEMP_CELSIUS = "gradC"
WIFFI_UOM_DEGREE = "grad"
WIFFI_UOM_PERCENT = "%"
WIFFI_UOM_MILLI_BAR = "mb"
WIFFI_UOM_LUX = "lux"
|
qstokkink/py-ipv8 | refs/heads/master | ipv8/test/peerdiscovery/test_edge_discovery.py | 1 | from ..base import TestBase
from ..mocking.community import MockCommunity
from ...community import _DEFAULT_ADDRESSES
from ...peerdiscovery.discovery import EdgeWalk
class TestEdgeWalk(TestBase):
def setUp(self):
super(TestEdgeWalk, self).setUp()
while _DEFAULT_ADDRESSES:
_DEFAULT_ADD... |
mpiannucci/crosswynds-promo | refs/heads/master | views/admin.py | 1 | import web
import models
from google.appengine.api import users
render = web.render
class Admin:
''' The handler for the admin page '''
def GET(self):
user = users.get_current_user()
if user and users.is_current_user_admin():
count = models.get_user_count()
return ren... |
fisadev/choppycamp | refs/heads/master | bots/party_bot.py | 1 | import constants
from bots.base_bot import BaseBot
import utils
class PartyBot(BaseBot):
def act(self, map_):
if self.id == constants.PLAYER_X:
other = constants.PLAYER_Y
else:
other = constants.PLAYER_X
my_position = utils.find_thing(map_, self.id)
other_p... |
kmee/stock-logistics-warehouse | refs/heads/8.0 | stock_mts_mto_rule/model/procurement.py | 1 | # -*- coding: utf-8 -*-
###############################################################################
#
# Module for OpenERP
# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved
# @author Florian DA COSTA <florian.dacosta@akretion.com>
#
# This program is free software: you can red... |
dariemp/odoo | refs/heads/8.0 | addons/account_bank_statement_extensions/wizard/__init__.py | 442 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
gaufung/PythonStandardLibrary | refs/heads/master | FileSystem/fnmatch/fnmatch_filter.py | 1 | import fnmatch
import os
import pprint
pattern = 'fnmatch_*.py'
print('Pattern :', pattern)
files = os.listdir('.')
print('\nFiles :')
pprint.pprint(files)
print('\nMatches :')
pprint.pprint(fnmatch.filter(files, pattern))
|
PabloTunnon/pykka-deb | refs/heads/master | tests/__main__.py | 2 | import nose
import yappi
try:
yappi.start()
nose.main()
finally:
yappi.print_stats()
|
sharkerz/deluge-yarss-plugin | refs/heads/master | yarss2/rssfeed_scheduler.py | 1 | #
# rssfeed_scheduler.py
#
# Copyright (C) 2012 Bro
#
# Deluge is free software.
#
# You may 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.
#
# deluge is distr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.