repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
maljac/odoomrp-utils | refs/heads/8.0 | sale_order_line_form_button/__init__.py | 379 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models
|
kenwang815/KodiPlugins | refs/heads/master | script.module.oceanktv/lib/youtube_dl/extractor/cultureunplugged.py | 17 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class CultureUnpluggedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)(?:/(?P<display_id>[^/]+))?'
_TESTS = [{
'url'... |
synasius/django | refs/heads/master | django/contrib/sessions/backends/cache.py | 227 | from django.conf import settings
from django.contrib.sessions.backends.base import CreateError, SessionBase
from django.core.cache import caches
from django.utils.six.moves import range
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
... |
ted-gould/nova | refs/heads/master | nova/compute/monitors/__init__.py | 18 | # Copyright 2013 Intel Corporation.
# 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 requir... |
hastexo/edx-platform | refs/heads/master | lms/djangoapps/discussion/signals/handlers.py | 4 | """
Signal handlers related to discussions.
"""
import logging
from django.dispatch import receiver
from opaque_keys.edx.keys import CourseKey
from django_comment_common import signals
from lms.djangoapps.discussion import tasks
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from open... |
Nonserial/3lingual_voctrainer | refs/heads/master | settingsjson.py | 1 | import json
languages_var = ["Arabic", "English", "French", "German", "Italian", "Kurdish", "Latin", "Romanian", "Russian", "Spanish", "Swedish", "Turkish"]
settings_json = json.dumps([
{"type": "title",
"title": "Languages"},
{"type": "scrolloptions",
"title": "Search-Language: ",
"section": "languages",
"key... |
grap/OCB | refs/heads/7.0 | openerp/report/render/rml2pdf/trml2pdf.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
retomerz/intellij-community | refs/heads/master | python/helpers/pydev/tests_pydevd_python/performance_check.py | 12 | import debugger_unittest
import sys
import re
import os
CHECK_BASELINE, CHECK_REGULAR, CHECK_CYTHON = 'baseline', 'regular', 'cython'
class PerformanceWriterThread(debugger_unittest.AbstractWriterThread):
CHECK = None
debugger_unittest.AbstractWriterThread.get_environ # overrides
def get_environ(self):
... |
jve2kor/machine-learning-nanodegree | refs/heads/master | projects/capstone/open_projects/robot_motion_planning/tester.py | 5 | from maze import Maze
from robot import Robot
import sys
# global dictionaries for robot movement and sensing
dir_sensors = {'u': ['l', 'u', 'r'], 'r': ['u', 'r', 'd'],
'd': ['r', 'd', 'l'], 'l': ['d', 'l', 'u'],
'up': ['l', 'u', 'r'], 'right': ['u', 'r', 'd'],
'down': ['r'... |
shravan-achar/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/extra/get_issues.py | 195 | import json
import py
import textwrap
issues_url = "http://bitbucket.org/api/1.0/repositories/pytest-dev/pytest/issues"
import requests
def get_issues():
chunksize = 50
start = 0
issues = []
while 1:
post_data = {"accountname": "pytest-dev",
"repo_slug": "pytest",
... |
amaas-fintech/amaas-core-sdk-python | refs/heads/master | amaascore/parties/asset_manager.py | 1 | from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.parties.company import Company
class AssetManager(Company):
"""
This represents a Company engaged in Asset Management activity.
"""
def __init__(self, asset_manager_id, party_id, base_currency=None, dis... |
Mozta/pagina-diagnostijuego | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/humanize/templatetags/humanize.py | 526 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... |
benschmaus/catapult | refs/heads/master | trace_processor/trace_uploader/appengine_config.py | 3 | # Copyright 2015 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.
"""App Engine config.
This module is loaded before others and can be used to set up the
App Engine environment. See:
https://cloud.google.com/appengine/do... |
jeremiahmarks/sl4a | refs/heads/master | python/src/Lib/distutils/bcppcompiler.py | 53 | """distutils.bcppcompiler
Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
"""
# This implementation by Lyle Johnson, based on the original msvccompiler.py
# module and using the directions originally published by Gordon Williams.
# XXX looks like there's a L... |
cpyou/odoo | refs/heads/master | addons/hr_timesheet_invoice/report/account_analytic_profit.py | 281 | # -*- 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... |
Essk/FreeCodeCamp-Projects | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/setup.py | 2462 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from setuptools import setup
setup(
name='gyp',
version='0.1',
description='Generate Your Projects',
author='Chromium Authors',
a... |
ya7lelkom/googleads-adsensehost-examples | refs/heads/master | python/v4.x/update_ad_unit_on_publisher.py | 2 | #!/usr/bin/python
#
# Copyright 2012 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... |
chudaol/edx-platform | refs/heads/master | cms/tests/test_startup.py | 154 | """
Test cms startup
"""
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from cms.startup import run, enable_theme
class StartupTestCase(TestCase):
"""
Test cms startup
"""
def setUp(self):
super(Start... |
mach0/QGIS | refs/heads/master | tests/src/python/test_qgsprocessingalgrunner.py | 30 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for Processing algorithm runner(s).
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later... |
gangadhar-kadam/prjlib | refs/heads/master | core/__init__.py | 107 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals |
mattnenterprise/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-nocookie-worker.py | 158 | import time
def main(request, response):
# no-cache itself to ensure the user agent finds a new version for each update.
headers = [('Cache-Control', 'no-cache, must-revalidate'),
('Pragma', 'no-cache')]
# Set a normal mimetype.
content_type = 'application/javascript'
headers.appen... |
LohithBlaze/scikit-learn | refs/heads/master | examples/cross_decomposition/plot_compare_cross_decomposition.py | 142 | """
===================================
Compare cross decomposition methods
===================================
Simple usage of various cross decomposition algorithms:
- PLSCanonical
- PLSRegression, with multivariate response, a.k.a. PLS2
- PLSRegression, with univariate response, a.k.a. PLS1
- CCA
Given 2 multivari... |
leafclick/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/IterateOverDictValueWhenItsTypeIsUnion.py | 25 | KWARGS = {
"do_stuff": True,
"little_list": ['WORLD_RET_BP_IMPALA_AB.Control', 'WORLD_RET_BP_IMPALA_AB.Impala_WS'],
}
for element in KWARGS["little_list"]:
print(element) |
waytai/django | refs/heads/master | tests/shortcuts/views.py | 252 | import os.path
from django.shortcuts import render, render_to_response
from django.template import Context, RequestContext
from django.utils._os import upath
dirs = (os.path.join(os.path.dirname(upath(__file__)), 'other_templates'),)
def render_to_response_view(request):
return render_to_response('shortcuts/ren... |
narantech/linux-rpi2 | refs/heads/master | tools/perf/util/setup.py | 989 | #!/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... |
ericholscher/pip-1 | refs/heads/develop | tests/packages/LineEndings/setup.py | 72 | from distutils.core import setup
setup()
|
Fruit-Snacks/aima-python | refs/heads/master | submissions/Miles/puzzles.py | 18 | import search
from math import (cos, pi)
alabama_map = search.UndirectedGraph(dict(
Birmingham=dict(Tuscaloosa=45, Auburn=120, Montgomery=86, Huntsville=90, Mobile=219, Dothan=197),
Tuscaloosa=dict(Birmingham=45, Auburn=160, Montgomery=110, Huntsville=140, Mobile=211, Dothan=227),
Auburn=dict(Birmingham=12... |
IFGHou/honeyd | refs/heads/master | regress/regress.py | 2 | #!/usr/bin/env python
#
# Copyright (c) 2004 Niels Provos <[email protected]>
# All rights reserved.
#
# Honeyd Regression Framework Class
#
import os
import sys
import getopt
import popen2
import time
import fcntl
import string
import re
import dpkt
import pcap
import dnet
import tempfile # Note, we use mkstemp wh... |
vipulkanade/EventbriteDjango | refs/heads/master | lib/python2.7/site-packages/django/core/files/locks.py | 725 | """
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... |
jcorrius/go-oo-mingw32-soc | refs/heads/master | scratch/mso-dumper/ppt-dump.py | 1 | #!/usr/bin/env python
########################################################################
#
# OpenOffice.org - a multi-platform office productivity suite
#
# Author:
# Kohei Yoshida <[email protected]>
# Thorsten Behrens <[email protected]>
#
# The Contents of this file are made available s... |
Supersuuu/python | refs/heads/master | NKUCodingCat/0001/0001.py | 40 | #coding=utf-8
import os,time,random,hashlib
def md5(str):
m = hashlib.md5()
m.update(str)
return m.hexdigest()
def salt():
return "%s"*5%tuple([random.randint(10000000,99999999) for i in range(5)])
res = [md5(salt()+str(time.time())) for i in range(200)]
path = os.path.split(os.path.realpath(__file__))[0]+"/"
f ... |
QGB/shadowsocks | refs/heads/master | shadowsocks/crypto/util.py | 1032 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
DONIKAN/django | refs/heads/master | tests/template_tests/filter_tests/test_yesno.py | 430 | from django.template.defaultfilters import yesno
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_true(self):
self.assertEqual(yesno(True), 'yes')
def test_false(self):
self.assertEqual(yesno(False), 'no')
def test_none(self):
self.assertEqual... |
bhupennewalkar1337/erpnext | refs/heads/develop | erpnext/hub_node/doctype/hub_settings/hub_settings.py | 29 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, requests, json
from frappe.model.document import Document
from frappe.utils import cint, expand_relative_urls
from frappe import... |
kostaspl/SpiderMonkey38 | refs/heads/tmpbr | testing/mozbase/mozprofile/mozprofile/diff.py | 7 | #!/usr/bin/env python
"""
diff two profile summaries
"""
import difflib
import profile
import optparse
import os
import sys
__all__ = ['diff', 'diff_profiles']
def diff(profile1, profile2, diff_function=difflib.unified_diff):
profiles = (profile1, profile2)
parts = {}
parts_dict = {}
for index in (... |
alexdglover/shill-isms | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## 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... |
jeremiah-c-leary/vhdl-style-guide | refs/heads/master | vsg/tests/block/test_rule_202.py | 1 |
import os
import unittest
from vsg.rules import block
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_202_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir, 'r... |
j3ffhubb/neoteric | refs/heads/master | neoteric/resource/tracker.py | 2 | """
"""
from neoteric.util.debug import get_stack
class DuplicateResourceError(Exception):
pass
class ResourceTracker:
""" Each resource type should implement this class as a global
variable to prevent duplicate resource definitions.
To override properties of an existing object, retrieve it... |
nikolas/lettuce | refs/heads/master | tests/functional/output_features/writes_to_console/writes_to_console_steps.py | 18 | import sys
from lettuce import step
@step('When I write to stdout')
def write_stdout(step):
print >> sys.stdout, "Badger"
@step('When I write to stderr')
def write_stderr(step):
print >> sys.stderr, "Mushroom"
@step('Then I am happy')
def happy(step):
pass
|
meghana1995/sympy | refs/heads/master | sympy/core/tests/test_complex.py | 69 | from sympy import (S, Symbol, sqrt, I, Integer, Rational, cos, sin, im, re, Abs,
exp, sinh, cosh, tan, tanh, conjugate, sign, cot, coth, pi, symbols,
expand_complex)
def test_complex():
a = Symbol("a", real=True)
b = Symbol("b", real=True)
e = (a + I*b)*(a - I*b)
assert e.expand() == a... |
kjoconnor/mongo-aws-backup | refs/heads/master | delete_snapshots.py | 1 | import sys
from boto.ec2 import connect_to_region
from datetime import datetime, timedelta
try:
days = int(sys.argv[1])
except IndexError:
days = 30
delete_time = datetime.utcnow() - timedelta(days=days)
filters = {
'tag-key': 'uselesssnapshots'
}
print 'Deleting any snapshots older than {days} days'.format(day... |
wimac/home | refs/heads/master | Dropbox/skel/bin/sick-beard/lib/hachoir_parser/game/spider_man_video.py | 90 | """
Parser for an obscure FMV file format: bin files from the game
"The Amazing Spider-Man vs. The Kingpin" (Sega CD)
Author: Mike Melanson
Creation date: 2006-09-30
File samples: http://samples.mplayerhq.hu/game-formats/spiderman-segacd-bin/
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field impor... |
RJHsiao/paiza_poh5 | refs/heads/master | Mission_2.py | 1 | #! /bin/env python3
if __name__ == '__main__':
n = int(input())
sums = [0,0,0,0,0,0,0]
for i in range(n):
sums[i % 7] += int(input())
for s in sums:
print(s) |
nklulupeterpan/Comedy | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/setup.py | 2462 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from setuptools import setup
setup(
name='gyp',
version='0.1',
description='Generate Your Projects',
author='Chromium Authors',
a... |
wakashige/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes-master/unit_tests/test_install.py | 145 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
neutronimaging/imagingsuite | refs/heads/master | external/src/pybind11/2.2.3/tests/test_constants_and_functions.py | 31 | from pybind11_tests import constants_and_functions as m
def test_constants():
assert m.some_constant == 14
def test_function_overloading():
assert m.test_function() == "test_function()"
assert m.test_function(7) == "test_function(7)"
assert m.test_function(m.MyEnum.EFirstEntry) == "test_function(enu... |
ohmini/thaifoodapi | refs/heads/master | lib/django/db/backends/sqlite3/features.py | 194 | from __future__ import unicode_literals
from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils import six
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFe... |
ganeshgore/myremolab | refs/heads/master | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment70/server_config.py | 242 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... |
tejesh95/Zubio.in | refs/heads/master | zubio/gym/migrations/0002_auto_20150313_1638.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('gym', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='document',
name='address',
... |
maljac/odoo-addons | refs/heads/8.0 | evaluation/__openerp__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
Kefkius/electrum-frc | refs/heads/master | gui/qt/receiving_widget.py | 1 | from PyQt4.QtGui import *
from PyQt4.QtCore import *
from electrum_frc.i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = True
self.... |
swjtuacmer/Ranker | refs/heads/master | Ranker/venv/lib/python2.7/site-packages/pip/exceptions.py | 344 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/buffs/of_stimulator_1.py | 2 | import sys
def setup(core, actor, buff):
return
def add(core, actor, buff):
return
def remove(core, actor, buff):
return |
jkburges/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/config.py | 126 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
RoboJackets/robocup-software | refs/heads/staging | soccer/gameplay/plays/restarts/their_kickoff.py | 1 | import standard_play
import behavior
import tactics.positions.defender
import tactics.stopped.circle_on_center
import skills.mark
import main
import robocup
import constants
import planning_priority
class TheirKickoff(standard_play.StandardPlay):
# Distance from the center line we should mark from (the mark targ... |
sdague/home-assistant | refs/heads/dev | tests/components/numato/common.py | 21 | """Definitions shared by all numato tests."""
from numato_gpio import NumatoGpioError
NUMATO_CFG = {
"numato": {
"discover": ["/ttyACM0", "/ttyACM1"],
"devices": [
{
"id": 0,
"binary_sensors": {
"invert_logic": False,
... |
PaulFranklin/python_koans | refs/heads/master | python3/libs/colorama/win32.py | 451 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
from ctypes import wintypes
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Str... |
amitaekbote/dcos | refs/heads/master | packages/bootstrap/extra/dcos_internal_utils/exhibitor.py | 4 | import logging
import os
import sys
import requests
from dcos_internal_utils import utils
from pkgpanda.util import load_string, write_string
log = logging.getLogger(__name__)
EXHIBITOR_STATUS_URL = 'http://127.0.0.1:8181/exhibitor/v1/cluster/status'
zk_pid_path = "/var/lib/dcos/exhibitor/zk.pid"
stash_zk_pid_sta... |
tal-nino/ansible | refs/heads/devel | lib/ansible/plugins/action/include_vars.py | 82 | # (c) 2013-2014, Benno Joy <[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) any later vers... |
genome21/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes/hooks/kubernetes_installer.py | 213 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
Letractively/spiff | refs/heads/master | src/installer/CheckRequirements.py | 1 | # Copyright (C) 2006 Samuel Abels, http://debain.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOU... |
mozilla/firefox-flicks | refs/heads/master | vendor-local/lib/python/factory/containers.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2010 Mark Sandstrom
# Copyright (c) 2011-2013 Raphaël Barrois
#
# 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 ... |
qiankunshe/sky_engine | refs/heads/master | sky/tools/webkitpy/layout_tests/controllers/test_result_writer_unittest.py | 11 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
davidvon/pipa-pay-server | refs/heads/master | site-packages/flask_admin/contrib/appengine/view.py | 5 | import logging
from flask.ext.admin.model import BaseModelView
from wtforms_appengine import db as wt_db
from wtforms_appengine import ndb as wt_ndb
from google.appengine.ext import db
from google.appengine.ext import ndb
class NdbModelView(BaseModelView):
"""
AppEngine NDB model scaffolding.
"""
def get_pk_val... |
jandrest2018/TWJ-2017-A | refs/heads/master | 04 Angular/C-Web/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
jkbits1/backend | refs/heads/master | db/test/test_02_submit_rider.py | 3 | import pytest
import pgdb
@pytest.fixture
def pgdbConn(dbhost, db, frontenduser):
return pgdb.connect(dbhost + ':' + db + ':' + frontenduser)
def generic_rider_insert(conn, args):
cursor=conn.cursor()
cursor.execute("""
SELECT * from carpoolvote.submit_new_rider (
%(IPAddress)s,... |
kikokubo/Sick-Beard-TPB | refs/heads/ThePirateBay | lib/hachoir_parser/__init__.py | 90 | from lib.hachoir_parser.version import __version__
from lib.hachoir_parser.parser import ValidateError, HachoirParser, Parser
from lib.hachoir_parser.parser_list import ParserList, HachoirParserList
from lib.hachoir_parser.guess import (QueryParser, guessParser, createParser)
from lib.hachoir_parser import (archive, au... |
talib570/catalog | refs/heads/master | project.py | 1 | from flask import Flask, render_template, jsonify, url_for, flash
from flask import session as login_session
from flask import make_response, request, redirect
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Game, Player, Team, User
import helper
fro... |
afandria/mojo | refs/heads/master | build/android/pylib/base/base_setup.py | 33 | # 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.
"""Base script for doing test setup."""
import logging
import os
from pylib import constants
from pylib import valgrind_tools
from pylib.utils import i... |
brunogamacatao/portalsaladeaula | refs/heads/master | django/contrib/gis/gdal/__init__.py | 397 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... |
hbrunn/OpenUpgrade | refs/heads/master | addons/google_drive/google_drive.py | 41 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... |
S-Bahrasemani/hhana | refs/heads/master | mva/__init__.py | 4 | import os
import sys
# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PubComPlotStyle#ATLAS_labels
# https://twiki.cern.ch/twiki/pub/AtlasProtected/AtlasPolicyDocuments/Physics_Policy.pdf
ATLAS_LABEL = os.getenv('ATLAS_LABEL', 'Internal').strip()
BASE_DIR = os.getenv('HIGGSTAUTAU_MVA_DIR')
if not BASE_DIR:
... |
henriquegemignani/randovania | refs/heads/master | randovania/gui/online_game_list_window.py | 1 | import datetime
from typing import List
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QPushButton, QDialogButtonBox, QDialog, QTableWidgetItem, QInputDialog, QLineEdit
from qasync import asyncSlot
from randovania.gui.generated.game_session_browser_dialog_ui import Ui_GameSessionBrowserDialog
from randov... |
juniper-project/modelling-mongodb | refs/heads/master | src/main/conf/res/scripts/createCollection.py | 1 | #
# Copyright 2014 Modeliosoft
#
# 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, so... |
xogeny/recon | refs/heads/master | recon/util.py | 1 | import struct
import bz2
def write_len(fp, l):
"""
A frequently used utility function to write an integer
to a given stream.
"""
fp.write(struct.pack('!L', l))
def conv_len(bytes):
"""
This takes some bytes and converts them to an integer following
the same conventions used by the othe... |
seem-sky/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/cp863.py | 272 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
Br3nda/docvert | refs/heads/master | core/pipeline_type/loop.py | 1 | # -*- coding: utf-8 -*-
import os
import lxml.etree
import StringIO
import pipeline_item
import core.docvert_exception
class Loop(pipeline_item.pipeline_stage):
def stage(self, pipeline_value):
return pipeline_value
|
ngoix/OCRF | refs/heads/master | sklearn/decomposition/truncated_svd.py | 3 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck
# Olivier Grisel <[email protected]>
# Michael Becker <[email protected]>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
try:
from scipy.sparse.linalg import svd... |
zhjunlang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_asyncio/echo2.py | 121 | import os
if __name__ == '__main__':
buf = os.read(0, 1024)
os.write(1, b'OUT:'+buf)
os.write(2, b'ERR:'+buf)
|
vup1120/oq-risklib | refs/heads/master | docs/my_calculators/hello.py | 2 | import os
from openquake.commonlib.calculators import base
@base.calculators.add('hello')
class HelloCalculator(base.BaseCalculator):
def pre_execute(self):
pass
def execute(self):
return 'hello world'
def post_execute(self, result):
fname = os.path.join(self.oqparam.export_dir, ... |
boneknuckleskin/libforensics | refs/heads/master | code/lf/apps/msoffice/word/metadata.py | 13 | # Copyright 2009 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 License, or
# (at your option) any later ver... |
mapbased/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py | 122 | # Copyright (C) 2010 Apple Inc. All rights reserved.
# Copyright (C) 2011 Patrick Gansterer <[email protected]>
#
# 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 abov... |
nuxeh/keystone | refs/heads/master | keystone/tests/unit/backend/core_sql.py | 10 | # 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 t... |
UDST/synthpop | refs/heads/master | synthpop/recipes/starter2.py | 1 | import numpy as np
import pandas as pd
from .. import categorizer as cat
from ..census_helpers import Census
# TODO DOCSTRINGS!!
class Starter:
"""
This is a recipe for getting the marginals and joint distributions to use
to pass to the synthesizer using simple categories - population, age,
race, and... |
sdague/home-assistant | refs/heads/dev | homeassistant/components/amcrest/const.py | 21 | """Constants for amcrest component."""
DOMAIN = "amcrest"
DATA_AMCREST = DOMAIN
CAMERAS = "cameras"
DEVICES = "devices"
BINARY_SENSOR_SCAN_INTERVAL_SECS = 5
CAMERA_WEB_SESSION_TIMEOUT = 10
COMM_RETRIES = 1
COMM_TIMEOUT = 6.05
SENSOR_SCAN_INTERVAL_SECS = 10
SNAPSHOT_TIMEOUT = 20
SERVICE_EVENT = "event"
SERVICE_UPDATE ... |
lento/tagger | refs/heads/master | tagger/lib/base.py | 1 | # -*- coding: utf-8 -*-
"""The base Controller API."""
from tg import TGController, tmpl_context, config, i18n, url, app_globals as G
from tg.render import render
from tg import request
from pylons.i18n import _, ungettext, N_
from tw.api import WidgetBunch, JSLink
from tagger.model import DBSession, Language, Catego... |
happyspace/flask | refs/heads/master | examples/persona/persona.py | 159 | from flask import Flask, render_template, session, request, abort, g
import requests
app = Flask(__name__)
app.config.update(
DEBUG=True,
SECRET_KEY='my development key',
PERSONA_JS='https://login.persona.org/include.js',
PERSONA_VERIFIER='https://verifier.login.persona.org/verify',
)
app.config.from... |
undoware/neutron-drive | refs/heads/master | neutron-drive/django/bin/unique-messages.py | 454 | #!/usr/bin/env python
import os
import sys
def unique_messages():
basedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
basedir = os.path.abspath(os.path.join('conf', 'locale'))
elif os.path.isdir('locale'):
basedir = os.path.abspath('locale')
else:
print "this scri... |
nurhandipa/python | refs/heads/master | codecademy/bringing_it_all_together.py | 1 | //codecademy course answer
#written by pranantyo
monty = True
python = 1.234
monty_python = python * python
|
jackjennings/Mechanic | refs/heads/master | Mechanic.roboFontExt/lib/site-packages/requests/compat.py | 134 | # -*- coding: utf-8 -*-
"""
requests.compat
~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and
Python 3.
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_p... |
ADMau/JFBenitez | refs/heads/master | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | #Copyright (c) 2010 Fabien Potencier
#
#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, merge, publish, distrib... |
jlcarmic/producthunt_simulator | refs/heads/master | venv/lib/python2.7/site-packages/numpy/linalg/setup.py | 129 | from __future__ import division, print_function
import os
import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg', parent_package, top_path)
config.add_data_dir(... |
sunils34/buffer-django-nonrel | refs/heads/master | django/dispatch/__init__.py | 571 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver |
Titan-C/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_base.py | 83 | # Author: Alexandre Gramfort <[email protected]>
# Fabian Pedregosa <[email protected]>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from itertools import product
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils... |
ReanGD/web-work-fitnesse | refs/heads/master | fitnesse/correct_model.py | 1 | # -*- coding: utf-8 -*-
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "root.settings")
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if BASE_DIR not in sys.path:
sys.path.append(BASE_DIR)
os.chdir(BASE_DIR)
from fitnesse.models import Job, Build, KeyBuildA... |
tschinz/iPython_Workspace | refs/heads/master | 02_WP/Wavedrom/nbwavedrom/__init__.py | 2 | """ nbwavedrom - wavedrom timing diagrams for jupyter notebook """
import json
import os
import subprocess
import IPython.display
def _get_js_path(jsfile):
base = os.path.dirname(os.path.realpath(__file__))
return os.path.join(base, 'js', jsfile)
def _draw_wavedrom_javascript(data, width):
style = ""
... |
tellesnobrega/sahara | refs/heads/master | sahara/service/edp/binary_retrievers/sahara_db.py | 19 | # Copyright (c) 2013 Mirantis 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... |
ioram7/keystone-federado-pgid2013 | refs/heads/master | build/sqlalchemy/test/aaa_profiling/test_compiler.py | 1 | from sqlalchemy import *
from test.lib import *
from sqlalchemy.engine import default
class CompileTest(fixtures.TestBase, AssertsExecutionResults):
__requires__ = 'cpython',
@classmethod
def setup_class(cls):
global t1, t2, metadata
metadata = MetaData()
t1 = Table('t1', metadata... |
bvanapriya/androguard | refs/heads/master | androguard/core/binaries/idawrapper.py | 38 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... |
Medigate/cutiuta-server | refs/heads/master | cutiuta-server/env/lib/python3.4/site-packages/django/contrib/gis/geos/base.py | 437 | from ctypes import c_void_p
from django.contrib.gis.geos.error import GEOSException
class GEOSBase(object):
"""
Base object for GEOS objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_ptr = None
# Default all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.