repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
wsmith323/staticmodel | refs/heads/master | staticmodel/django/models/__init__.py | 1 | from .fields import StaticModelCharField, StaticModelIntegerField, StaticModelTextField
|
codificat/sos | refs/heads/master | sos/plugins/ssh.py | 5 | # Copyright (C) 2007 Red Hat, Inc., Eugene Teo <eteo@redhat.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 by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Thi... |
MSA-Argentina/recuento_web2py | refs/heads/master | models/app_settings.py | 1 | # coding: utf8
# Configuraciones globales:
TITULO = "Recuento PASO 2013"
SUBTITULO = " - ".join(["Elecciones Nacionales",
"Primarias Abiertas Simultáneas y Obligatorias",
"Argentina", "11 de Agosto 2013"])
# cadena de conexion a base principal:
PG_CNNSTR = "postgres:/... |
lparsons/bioconda-recipes | refs/heads/master | bootstrap.py | 14 | #!/usr/bin/env python
import os
import sys
import subprocess as sp
import argparse
if sys.version_info.major == 3:
PY3 = True
from urllib.request import urlretrieve
else:
PY3 = True
from urllib import urlretrieve
usage = """
The easy way to test recipes is by using `circleci build`. However this doe... |
rwbogl/gbg | refs/heads/master | pycparser/pycparser/ast_transforms.py | 43 | #------------------------------------------------------------------------------
# pycparser: ast_transforms.py
#
# Some utilities used by the parser to create a friendlier AST.
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
from... |
mdworks2016/work_development | refs/heads/master | Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/setuptools/windows_support.py | 1015 | import platform
import ctypes
def windows_only(func):
if platform.system() != 'Windows':
return lambda *args, **kwargs: None
return func
@windows_only
def hide_file(path):
"""
Set the hidden attribute on a file or directory.
From http://stackoverflow.com/questions/19622133/
`path` ... |
andrewyoung1991/abjad | refs/heads/master | abjad/tools/labeltools/test/test_labeltools_label_logical_ties_in_expr_with_logical_tie_durations.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_labeltools_label_logical_ties_in_expr_with_logical_tie_durations_01():
staff = Staff("c'8 c'8 c'8 c'8")
scoretools.FixedDurationTuplet(Duration(2, 8), staff[:3])
tie = spannertools.Tie()
attach(tie, staff.select_leaves()[:2])
tie = spannertoo... |
trafferty/utils | refs/heads/master | python/parseXfdSSLog.py | 1 | #!/usr/bin/env python
import sys
import time
import re
import argparse
import json
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
def parseXfdSSLog(xfdLog, output_path, generic=False):
'''
import re
p = re.compile(ur'2015-..-..\ (?P<start_ts>[0-9:,]*).*?\n2015-..-..\ (?P<end_ts>[... |
harwee/electrum-xvg-tor | refs/heads/master | lib/asn1tinydecoder.py | 15 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... |
supersven/intellij-community | refs/heads/master | python/testData/formatter/continuationIndentForCallInStatementPart.py | 83 | for item in really_long_name_of_the_function_with_a_lot_of_patams(
param1, param2, param3):
pass |
abstract-open-solutions/account-financial-tools | refs/heads/8.0 | account_auto_fy_sequence/__openerp__.py | 13 | # coding=utf-8
##############################################################################
#
# account_auto_fy_sequence module for Odoo
# Copyright (C) 2014 ACSONE SA/NV (<http://acsone.eu>)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# account_auto_fy_sequence is free software:
# you can ... |
BayanGroup/sentry | refs/heads/master | src/sentry/ratelimits/base.py | 25 | from __future__ import absolute_import
class RateLimiter(object):
def validate(self):
"""
Validates the settings for this backend (i.e. such as proper connection
info).
Raise ``InvalidConfiguration`` if there is a configuration error.
"""
def is_limited(self, project,... |
GoogleCloudPlatform/python-docs-samples | refs/heads/master | appengine/standard/ndb/queries/snippets_models.py | 9 | # Copyright 2016 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 by applicable law or a... |
dchud/sentinel | refs/heads/master | canary/ui/__init__.py | 1 | # $Id$
_q_exports = [
'error',
'search',
'record',
'news',
'canary_png',
'advanced_search',
'opensearch',
'unapi',
'about',
'admin',
'edit',
'login',
'logout',
'register',
'verify',
'user',
'assistant',
'reaper',
'resetpass',
]
import cSt... |
robert-sandor/student_management | refs/heads/develop | run.py | 1 | from app import app
app.run(debug=True)
import os
from app import app
# print('http://student-management-robert-sandor-2.c9users.io/')
# app.run(host=os.getenv('IP', '0.0.0.0'), port=int(os.getenv('PORT', 8080)),
# debug=True)
|
pauldeng/nilmtk | refs/heads/master | nilmtk/tests/test_timeframe.py | 5 | #!/usr/bin/python
from __future__ import print_function, division
import unittest
import pandas as pd
from nilmtk.timeframe import TimeFrame, merge_timeframes
class TestTimeFrame(unittest.TestCase):
def test_date_setting(self):
TimeFrame()
TimeFrame("2012-01-01", "2013-01-01")
# test ident... |
betoesquivel/fil2014 | refs/heads/master | build/django/tests/urlpatterns_reverse/urls_error_handlers.py | 79 | # Used by the ErrorHandlerResolutionTests test case.
from django.conf.urls import patterns
urlpatterns = patterns('')
handler400 = 'urlpatterns_reverse.views.empty_view'
handler404 = 'urlpatterns_reverse.views.empty_view'
handler500 = 'urlpatterns_reverse.views.empty_view'
|
bennibaermann/stickandrun | refs/heads/master | config.py | 1 | # -*- coding: utf-8 -*-
# set which part of the game you want to debug, set all for maximum output
# DEBUG = ('init', 'font', 'track', 'path', 'station', 'passenger', 'random' )
DEBUG = ('init','font' )
BLACK = ( 0, 0, 0)
VERYLIGHTGREY= (220, 220, 220)
LIGHTGREY= (200, 200, 200)
WHITE = (255, 255, 255)
BLU... |
polyaxon/polyaxon | refs/heads/master | core/polyaxon/polyflow/joins/__init__.py | 1 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
FrameBenchers/django | refs/heads/master | blog/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
openfisca/openfisca-qt | refs/heads/master | openfisca_qt/scripts/validation/check_num_table.py | 1 | # -*- coding:utf-8 -*-
#
# This file is part of OpenFisca.
# OpenFisca is a socio-fiscal microsimulation software
# Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul
# Licensed under the terms of the GVPLv3 or later license
# (see openfisca/__init__.py for details)
# Script to compute the aggregates for all the refer... |
ashwinirudrappa/zulip | refs/heads/master | zerver/context_processors.py | 126 | from __future__ import absolute_import
from django.conf import settings
import ujson
from zproject.backends import password_auth_enabled, dev_auth_enabled, google_auth_enabled
def add_settings(request):
realm = request.user.realm if hasattr(request.user, "realm") else None
return {
# We use the not_vo... |
jeremyh/eo-datasets | refs/heads/eodatasets3 | versioneer.py | 2 | # Version: 0.18
# flake8: noqa
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
* [![Lat... |
bigown/SOpt | refs/heads/master | Python/ConvertIntToByte.py | 2 | print((65).to_bytes(1, byteorder='big'))
print(bytes([10,20,30,40,50,60,70,80,90,100]))
#https://pt.stackoverflow.com/q/270545/101
|
LS80/script.module.pyrollbar | refs/heads/master | lib/rollbar/logger.py | 1 | """
Hooks for integrating with the python logging framework.
Usage:
import logging
from rollbar.logger import RollbarHandler
rollbar.init('ACCESS_TOKEN', 'ENVIRONMENT')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# report ERROR and above to Rollbar
rollbar_handler... |
thismatters/biometrics-scanner | refs/heads/master | headless.py | 1 | from time import sleep
from daqthread import DAQThread
import sys
import termios
import fcntl
import os
def myGetch():
fd = sys.stdin.fileno()
oldterm = termios.tcgetattr(fd)
newattr = termios.tcgetattr(fd)
newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECHO
termios.tcsetattr(fd, termios.TC... |
adrfer/swift | refs/heads/master | utils/pass-pipeline/src/passes.py | 12 |
from pass_pipeline import Pass
# TODO: This should not be hard coded. Create a tool in the compiler that knows
# how to dump the passes and the pipelines themselves.
AADumper = Pass('AADumper')
ABCOpt = Pass('ABCOpt')
AllocBoxToStack = Pass('AllocBoxToStack')
CFGPrinter = Pass('CFGPrinter')
COWArrayOpts = Pass('COWAr... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/pyasn1-0.1.8/pyasn1/type/namedval.py | 172 | # ASN.1 named integers
from pyasn1 import error
__all__ = [ 'NamedValues' ]
class NamedValues:
def __init__(self, *namedValues):
self.nameToValIdx = {}; self.valToNameIdx = {}
self.namedValues = ()
automaticVal = 1
for namedValue in namedValues:
if isinstance(na... |
dushu1203/chromium.src | refs/heads/nw12 | tools/telemetry/telemetry/timeline/bounds_unittest.py | 95 | # 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 unittest
from telemetry.timeline import bounds
class BoundsTests(unittest.TestCase):
def testGetOverlap(self):
# Non overlap cases.
self.... |
hjanime/VisTrails | refs/heads/master | vistrails/db/versions/v1_0_4/persistence/sql/auto_gen.py | 1 | ###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
malkoto1/just_cook | refs/heads/master | SQLAlchemy-1.0.4/test/orm/test_default_strategies.py | 29 | from test.orm import _fixtures
from sqlalchemy import testing
from sqlalchemy.orm import mapper, relationship, create_session
from sqlalchemy import util
import sqlalchemy as sa
from sqlalchemy.testing import eq_, assert_raises_message
class DefaultStrategyOptionsTest(_fixtures.FixtureTest):
def _assert_fully_loa... |
johankaito/fufuka | refs/heads/master | microblog/flask/venv/lib/python2.7/site-packages/kazoo/recipe/__init__.py | 9480 | #
|
igemsoftware/SYSU-Software2013 | refs/heads/master | project/Python27/Lib/chunk.py | 386 | """Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID is a 4-byte s... |
pepeportela/edx-platform | refs/heads/master | openedx/core/djangoapps/cache_toolbox/templatetags/cache_toolbox.py | 35 | """
Implementation of custom django template tags for
automatically caching template fragments.
"""
from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
from django.template import resolve_variable
register = template.Library() # pylint: disab... |
noironetworks/horizon | refs/heads/master | openstack_dashboard/dashboards/project/overview/urls.py | 14 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
nrwahl2/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_hostgroup.py | 33 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'sta... |
bob123bob/Sick-Beard | refs/heads/development | sickbeard/clients/requests/__init__.py | 56 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('http://python.org')
>>> r.sta... |
o3project/ryu-oe | refs/heads/master | ryu/services/protocols/bgp/utils/__init__.py | 12133432 | |
be-cloud-be/horizon-addons | refs/heads/9.0 | server/addons/l10n_hr/__openerp__.py | 18 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contributions:
# Tomislav Bošnjaković, Storm Computers d.o.o. :
# - ac... |
anudeepsharma/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDate/setup.py | 28 | # 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 ... |
noironetworks/neutron | refs/heads/master | neutron/tests/unit/services/logapi/common/test_sg_callback.py | 2 | # Copyright (c) 2018 Fujitsu Limited
# 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 requi... |
willharris/django | refs/heads/master | tests/utils_tests/test_no_submodule.py | 737 | # Used to test for modules which don't have submodules.
|
alexwlchan/pygmentizr | refs/heads/master | pygmentizr/forms.py | 1 | # -*- encoding: utf-8 -*-
from flask.ext.wtf import Form
from wtforms import SelectField, TextAreaField
from wtforms.validators import DataRequired
from pygmentizr import app
from pygmentizr.renderer import STYLE_OPTIONS
class SnippetForm(Form):
"""
Form for handling code snippets.
"""
language = Se... |
TFenby/python-mode | refs/heads/develop | pymode/libs2/rope/refactor/introduce_factory.py | 19 | import rope.base.exceptions
import rope.base.pyobjects
from rope.base import libutils
from rope.base import taskhandle, evaluate
from rope.base.change import (ChangeSet, ChangeContents)
from rope.refactor import rename, occurrences, sourceutils, importutils
class IntroduceFactory(object):
def __init__(self, proj... |
rec/echomesh | refs/heads/master | code/python/echomesh/util/dict/Setter.py | 1 | from __future__ import absolute_import, division, print_function, unicode_literals
import six
def setter(table, *address):
for part in address[:-1]:
try:
table = table[part]
except:
return None, None
return table, address[-1]
def apply_list(table, function, *addresses... |
dxq-git/zulip | refs/heads/master | api/integrations/trac/zulip_trac.py | 115 | # -*- coding: utf-8 -*-
# Copyright © 2012 Zulip, Inc.
#
# 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, ... |
croach/Flask-Fixtures | refs/heads/master | tests/test_fixtures.py | 1 | """
test_fixtures
~~~~~~~~~~~~~
A set of tests that check the default functionality of Flask-Fixtures.
:copyright: (c) 2015 Christopher Roach <ask.croach@gmail.com>.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import
import unittest
from myapp import app
fr... |
rmmh/skybot | refs/heads/master | plugins/imdb.py | 1 | # IMDb lookup plugin by Ghetto Wizard (2011).
from __future__ import unicode_literals
from util import hook, http
# http://www.omdbapi.com/apikey.aspx
@hook.api_key("omdbapi")
@hook.command
def imdb(inp, api_key=None):
""".imdb <movie> -- gets information about <movie> from IMDb"""
if not api_key:
r... |
vmthunder/virtman | refs/heads/master | virtman/openstack/__init__.py | 12133432 | |
snailwalker/python | refs/heads/master | renzongxian/0023/mysite/guestbook/migrations/__init__.py | 12133432 | |
nimbis/django-central-message | refs/heads/master | central_message/__init__.py | 12133432 | |
spiralsyzygy/cloudbuster | refs/heads/master | inventory/api/__init__.py | 12133432 | |
carl-mastrangelo/grpc | refs/heads/master | test/core/bad_ssl/gen_build_yaml.py | 5 | #!/usr/bin/env python2.7
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
FOSSRIT/Nova | refs/heads/master | controllers/match.py | 1 | # coding: utf8
# try something like
def index():
return dict(message="Welcome to matchmaking!")
def browse():
if request.args(0):
nodeCategory = db(db.matchingCategory.namePlural == request.args(0)).select().first()
if request.args(1):
matchedNodes = db(
... |
jmr0/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_response.py | 109 | import unittest
from types import MethodType
import wptserve
from .base import TestUsingServer
def send_body_as_header(self):
if self._response.add_required_headers:
self.write_default_headers()
self.write("X-Body: ")
self._headers_complete = True
class TestResponse(TestUsingServer):
def tes... |
fhe-odoo/odoo | refs/heads/8.0 | addons/l10n_multilang/account.py | 348 | # -*- 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... |
kdwink/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/AsyncDef.before.py | 54 | async def foo(x):
<selection>y = await x</selection>
return await y
|
Srisai85/scikit-learn | refs/heads/master | examples/ensemble/plot_voting_probas.py | 316 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... |
nguyenkims/satellizer-demo | refs/heads/master | app.py | 1 | """This sample is published as part of the blog article at www.toptal.com/blog
Visit www.toptal.com/blog and subscribe to our newsletter to read great posts
"""
import json
import os
import flask
import jwt
import requests
from datetime import datetime, timedelta
from flask import Flask, jsonify, request
from flask_sq... |
nodegit/node-gyp | refs/heads/master | gyp/pylib/gyp/win_tool.py | 8 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
from __future__... |
sss/calibre-at-bzr | refs/heads/upstream/master | src/calibre/ebooks/pdf/from_comic.py | 24 | from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'Convert a comic in CBR/CBZ format to pdf'
import sys
from functools import partial
from calibre.ebooks.lrf.comic.convert_from import do_convert, option_parser,... |
azureplus/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/prototypes/generation.py | 219 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.prototypes.errcheck import (
check_arg_errcode, check_errcode, check_geom, check_geom_offset,
check_pointer, check_srs, check_str_a... |
shibinp/google_python | refs/heads/master | basic/string2.py | 1 | #!/usr/bin/python2.4 -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/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is a... |
JCBarahona/edX | refs/heads/master | common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py | 114 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.expiration_datetime'
db.add_column('course_modes_coursemode', 'expiration_datetim... |
jasonxmueller/gcc-python-plugin | refs/heads/master | tests/cpychecker/refcounts/ticket-20/script.py | 623 | # -*- coding: utf-8 -*-
# Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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, o... |
tescalada/npyscreen-restructure | refs/heads/master | npyscreen/global_options.py | 1 | # encoding: utf-8
DISABLE_ALL_COLORS = False
# See the safe_string function in widget. At the moment the encoding is not safe
ASCII_ONLY = False |
lsaffre/lino | refs/heads/master | lino/modlib/notify/fixtures/demo2.py | 1 | # Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Emits a notification "The database has been initialized." to every
user.
"""
import datetime
from django.utils import translation
from atelier.utils import i2t
from lino.api import dd, rt, _
from django.conf import settings
from dj... |
frank-tancf/scikit-learn | refs/heads/master | sklearn/utils/graph.py | 289 | """
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD 3 clause
impo... |
loco-odoo/localizacion_co | refs/heads/master | openerp/addons/account/wizard/account_journal_select.py | 385 | # -*- 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... |
qedsoftware/commcare-hq | refs/heads/master | corehq/apps/api/resources/v0_3.py | 1 | from tastypie import fields
from casexml.apps.case.models import CommCareCase
from corehq.apps.api.resources import DomainSpecificResourceMixin
from corehq.apps.api.resources import HqBaseResource
from corehq.apps.api.resources.auth import RequirePermissionAuthentication
from corehq.apps.api.resources.meta import Cust... |
flakey-bit/plugin.audio.spotify | refs/heads/master | resources/playbackservice.py | 1 | # -*- coding: utf8 -*-
from __future__ import print_function, unicode_literals
import os, os.path
import xbmc, xbmcgui
import threading
import weakref
import re
import traceback
from utils import *
load_all_libraries()
from spotify import MainLoop, ConnectionState, ErrorType, Bitrate, link
from spotify import track as ... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/refactoring/changeSignature/classMethod.before.py | 73 | class A:
def fo<caret>o(self, a):
pass
class B(A):
def foo(self, a):
pass
class С(A):
def foo(self, a):
pass
a = A()
a.foo(1)
b = B()
b.foo(2) |
mcdenhoed/redo | refs/heads/master | actor.py | 1 | import pygame
import sys, os
class Actor(pygame.sprite.Sprite):
grav = 25#2.9
maxVel = 120
velDamp = .1
accDamp = .35
accDefault = 3
groundAcc = 30
airAcc = 10
left, right, onGround, onWall = False, False, False, False
def __init__(self, acc):
pygame.sprite.Sprite.__init__(... |
jsteemann/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_profile.py | 51 | """Test suite for the profile module."""
import os
import sys
import pstats
import unittest
from StringIO import StringIO
from test.test_support import run_unittest
import profile
from test.profilee import testfunc, timer
class ProfileTest(unittest.TestCase):
profilerclass = profile.Profile
methodnames = [... |
google/grumpy | refs/heads/master | lib/itertools_test.py | 7 | # Copyright 2016 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 by applicable law or a... |
pierrebeaucamp/Exercism-Python | refs/heads/master | word-count/word_count_test.py | 9 | # -*- coding: utf-8 -*-
import unittest
from wordcount import word_count
# to be backwards compatible with the old Python 2.X
def decode_if_needed(string):
try:
return string.decode('utf-8')
except AttributeError:
return string
class WordCountTests(unittest.TestCase):
def test_count_on... |
damien-dg/horizon | refs/heads/master | tools/install_venv.py | 99 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this... |
highweb-project/highweb-webcl-html5spec | refs/heads/highweb-20160310 | testing/legion/lib/comm_server/base_handler.py | 18 | # Copyright 2016 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 handler class for all category handlers."""
class BaseHandler(object):
"""Sets up default verb handlers for the child class."""
def do_PUT(sel... |
PanDAWMS/panda-bigmon-lsst | refs/heads/wenaus | lsst/admin/views.py | 1 | import logging, re, json, commands, os, copy
from datetime import datetime, timedelta
import time
import json
from django.http import HttpResponse
from django.shortcuts import render_to_response, render, redirect
from django.template import RequestContext, loader
from django.db.models import Count
from django import fo... |
gtoonstra/airflow | refs/heads/master | tests/hooks/test_pig_hook.py | 14 | # -*- 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
#... |
david-abel/simple_rl | refs/heads/master | simple_rl/tasks/maze_1d/Maze1DStateClass.py | 1 | from simple_rl.mdp.StateClass import State
class Maze1DState(State):
''' Class for 1D Maze POMDP States '''
def __init__(self, name):
self.name = name
is_terminal = name == 'goal'
State.__init__(self, data=name, is_terminal=is_terminal)
def __hash__(self):
return hash(tupl... |
manishpatell/erpcustomizationssaiimpex123qwe | refs/heads/master | addons/base_action_rule/base_action_rule.py | 54 | # -*- 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... |
odoomrp/odoomrp-wip | refs/heads/8.0 | mrp_bom_sale_pack/__openerp__.py | 16 | # -*- coding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... |
AngryBork/apex-sigma-plugins | refs/heads/master | fun/jokes/csshumor.py | 3 | import aiohttp
from lxml import html
async def csshumor(cmd, message, args):
url = 'https://csshumor.com/'
async with aiohttp.ClientSession() as session:
async with session.get(url) as data:
data = await data.text()
root = html.fromstring(data)
codeblock = root.cssselect('.crayon-c... |
marctc/django | refs/heads/master | tests/syndication_tests/models.py | 281 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Entry(models.Model):
title = models.CharField(max_length=200)
updated = models.DateTimeField()
published = models.DateTimeField()
class Meta:
ordering = ('updated',)
... |
GUR9000/KerasNeuralFingerprint | refs/heads/master | keras/activations.py | 7 | from __future__ import absolute_import
from . import backend as K
def softmax(x):
ndim = K.ndim(x)
if ndim == 2:
return K.softmax(x)
elif ndim == 3:
e = K.exp(x - K.max(x, axis=-1, keepdims=True))
s = K.sum(e, axis=-1, keepdims=True)
return e / s
else:
raise Exc... |
bop/rango | refs/heads/master | lib/python2.7/site-packages/django/core/management/commands/sqlsequencereset.py | 242 | from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.db import connections, models, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = 'Prints the SQL statements for resetting sequences for the given app name(s).'
option_list... |
SachaMPS/django-cms | refs/heads/develop | cms/management/commands/subcommands/uninstall.py | 61 | # -*- coding: utf-8 -*-
from django.core.management.base import LabelCommand
from django.utils.six.moves import input
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.models import Page
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
class Uninstal... |
StalkR/misc | refs/heads/master | burp/extensions/template_extension.py | 1 | """Burp editor extension template.
The only thing you need to change is CHANGEME in the import line.
It creates a new tab in the proxy tab for some requests and responses, defined
by your criteria. In this tab, you define which text you want displayed. In the
repeater tab, you may edit that text, and the request will... |
JonathanStein/odoo | refs/heads/8.0 | addons/claim_from_delivery/__openerp__.py | 261 | ##############################################################################
#
# 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 Affero General Public L... |
Mappy/pycnikr | refs/heads/master | pycnikr/style_sheets/example2.py | 1 | """
This file is a python style sheet which describes layers and styles for Mapnik.
Describe layers and styles by this way is simple and easy-readable
It is not usable by Mapnik directly, you have to translate it with Pycnik, if
you want to try execute pycnik_sample.py
"""
from pycnik.model import *
# Standard zoom le... |
credativUK/OCB | refs/heads/7.0-local | addons/document_webdav/__init__.py | 58 | # -*- 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... |
hoosteeno/fjord | refs/heads/master | vendor/packages/Babel-2.1.1/babel/plural.py | 136 | # -*- coding: utf-8 -*-
"""
babel.numbers
~~~~~~~~~~~~~
CLDR Plural support. See UTS #35.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
_fallback_tag = 'other'
class PluralRule(... |
Taywee/aix-scripts | refs/heads/master | os400pwgen.py | 1 | #!/usr/bin/python3
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with ... |
Teamxrtc/webrtc-streaming-node | refs/heads/master | third_party/webrtc/src/chromium/src/tools/cygprofile/symbol_extractor_unittest.py | 23 | #!/usr/bin/python
# 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.
import symbol_extractor
import unittest
class TestSymbolInfo(unittest.TestCase):
def testIgnoresBlankLine(self):
symbol_info = symbo... |
aiifabbf/pycairo | refs/heads/master | examples/gtk/png_view.py | 14 | #!/usr/bin/env python
"""Display a png file
"""
import sys
import cairo
import gtk
def expose_event(widget, event, surface):
ctx = widget.window.cairo_create()
ctx.set_source_surface(surface, 0,0)
ctx.paint()
if len(sys.argv) != 2:
raise SystemExit('usage: png_view.py png_file')
filename = sys.ar... |
jgoclawski/django | refs/heads/master | tests/forms_tests/urls.py | 452 | from django.conf.urls import url
from .views import ArticleFormView
urlpatterns = [
url(r'^model_form/(?P<pk>[0-9]+)/$', ArticleFormView.as_view(), name="article_form"),
]
|
IV-GII/SocialCookies | refs/heads/master | ENV1/lib/python2.7/site-packages/django/contrib/flatpages/__init__.py | 12133432 | |
CapstoneGrader/codeta | refs/heads/master | codeta/forms/__init__.py | 12133432 | |
smmribeiro/intellij-community | refs/heads/master | python/helpers/py3only/docutils/languages/de.py | 200 | # $Id: de.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Gunnar Schwant <g.schwant@gmx.de>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.