repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
EssaAlshammri/django-by-example | refs/heads/master | online-shop/myshop/payment/views.py | 1 | from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render
from django.views.decorators.csrf import csrf_exempt
from paypal.standard.forms import PayPalPaymentsForm
from orders.models import Order
def payment_proce... |
40223236/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/suite.py | 748 | """TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
def __init__(se... |
kmcallister/rust | refs/heads/master | src/etc/ziggurat_tables.py | 4 | #!/usr/bin/env python
# xfail-license
# This creates the tables used for distributions implemented using the
# ziggurat algorithm in `core::rand::distributions;`. They are
# (basically) the tables as used in the ZIGNOR variant (Doornik 2005).
# They are changed rarely, so the generated file should be checked in
# to g... |
xfournet/intellij-community | refs/heads/master | python/testData/mover/lastComment.py | 83 | def f():
if True:
a = 1
else:
a = 2
#comment <caret>
|
lache/RacingKingLee | refs/heads/master | monitor/engine.win64/2.74/python/lib/encodings/mac_romanian.py | 272 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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_table)
def decode(self,inp... |
AccelAI/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
gautam1858/tensorflow | refs/heads/master | tensorflow/python/keras/engine/feature_columns_integration_test.py | 8 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
yanchen036/tensorflow | refs/heads/master | tensorflow/tools/test/run_and_gather_logs_lib.py | 48 | # 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... |
Dingmatt/AMSA | refs/heads/master | Plug-ins/Amsa.bundle/Contents/Libraries/Shared/unidecode/x0bd.py | 253 | data = (
'bols', # 0x00
'bolt', # 0x01
'bolp', # 0x02
'bolh', # 0x03
'bom', # 0x04
'bob', # 0x05
'bobs', # 0x06
'bos', # 0x07
'boss', # 0x08
'bong', # 0x09
'boj', # 0x0a
'boc', # 0x0b
'bok', # 0x0c
'bot', # 0x0d
'bop', # 0x0e
'boh', # 0x0f
'bwa', # 0x10
'bwag', # 0x... |
frdb194/django | refs/heads/master | django/contrib/messages/context_processors.py | 705 | from django.contrib.messages.api import get_messages
from django.contrib.messages.constants import DEFAULT_LEVELS
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {
'messages': get_messages(request),
'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS,
}
|
polymer-spain/DeusCoNWeT | refs/heads/master | src/api_handlers/lib/bson/int64.py | 69 | # Copyright 2014-2015 MongoDB, 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 writin... |
xiandiancloud/ji | refs/heads/master | lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py | 58 | # -*- 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 'Order.refunded_time'
db.add_column('shoppingcart_order', 'refunded_time',
... |
Sult/daf | refs/heads/master | apps/static/urls.py | 3 | from django.conf.urls import patterns, url
from apps.static import views
urlpatterns = patterns('',
url(r'^library/skilltree/$', views.tree, name='tree'),
url(r'^library/skilltree/(?P<pk>\d+)/$', views.skilltree, name='skilltree'),
)
|
ettm2012/MissionPlanner | refs/heads/master | Lib/lib2to3/pytree.py | 61 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
""... |
amagdas/superdesk | refs/heads/master | server/apps/macros/macro_register_tests.py | 8 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .macro_regist... |
zhangpf/lanchow | refs/heads/master | lanchow/openstack/common/__init__.py | 22 | import six
six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox'))
|
pharos3d/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/__init__.py | 178 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DEBUG)
version = options.get('... |
jvacca/Danvic | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | # Copyright (c) 2013 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 shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... |
janocat/odoo | refs/heads/8.0 | addons/hr_expense/tests/test_journal_entries.py | 251 | from openerp.tests.common import TransactionCase
from openerp import netsvc, workflow
class TestCheckJournalEntry(TransactionCase):
"""
Check journal entries when the expense product is having tax which is tax included.
"""
def setUp(self):
super(TestCheckJournalEntry, self).setUp()
... |
indradhanush/filesync-server | refs/heads/master | src/backends/filesync/utilities/make_test_data.py | 6 | #!/usr/bin/env python
# Copyright 2008-2015 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This... |
impowski/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py | 276 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface OneNullableInUnion {
void foo((object? or DOMString?) arg);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Two ... |
Stanford-Online/edx-platform | refs/heads/master | common/lib/calc/calc/preview.py | 24 | """
Provide a `latex_preview` method similar in syntax to `evaluator`.
That is, given a math string, parse it and render each branch of the result,
always returning valid latex.
Because intermediate values of the render contain more data than simply the
string of latex, store it in a custom class `LatexRendered`.
"""... |
baldurk/renderdoc | refs/heads/v1.x | util/test/tests/Vulkan/VK_Extended_Dynamic_State.py | 2 | import renderdoc as rd
import rdtest
class VK_Extended_Dynamic_State(rdtest.TestCase):
demos_test_name = 'VK_Extended_Dynamic_State'
def check_capture(self):
draw: rd.DrawcallDescription = self.find_draw("Draw")
self.controller.SetFrameEvent(draw.eventId, True)
vsin_ref = {
... |
DasIch/django | refs/heads/master | tests/migrations/migrations_test_apps/conflicting_app_with_dependencies/migrations/0002_conflicting_second.py | 241 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("conflicting_app_with_dependencies", "0001_initial"),
]
operations = [
migrations.CreateModel(
"Something",
... |
anbangleo/NlsdeWeb | refs/heads/master | Python-3.6.0/Lib/test/test_syslog.py | 19 |
from test import support
syslog = support.import_module("syslog") #skip if not supported
import unittest
# XXX(nnorwitz): This test sucks. I don't know of a platform independent way
# to verify that the messages were really logged.
# The only purpose of this test is to verify the code doesn't crash or leak.
class T... |
pombredanne/VirtualBox-OSE | refs/heads/master | src/libs/libxml2-2.6.31/python/setup.py | 19 | #!/usr/bin/python -u
#
# Setup script for libxml2 and libxslt if found
#
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/usr'
# Thre... |
tjsavage/sfcsdatabase | refs/heads/master | django/conf/locale/tr/formats.py | 80 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'd F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'd F'
SHORT_DATE_FORMAT = 'd M Y'
SHORT_DATETIME_FORMAT = 'd M Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # P... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/battle_droid_greeter.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/simple_kit/wiring.py | 85615 | import sys
def setup(core, object):
return |
eviljeff/app-validator | refs/heads/master | appvalidator/testcases/javascript/instanceproperties.py | 5 | import re
import types
from appvalidator.constants import BUGZILLA_BUG
from appvalidator.csp import warn
import jstypes
EVENT_ASSIGNMENT = re.compile("<.+ on[a-z]+=")
JS_URL = re.compile("href=[\'\"]javascript:")
def set_innerHTML(new_value, traverser):
"""Tests that values being assigned to innerHTML are not ... |
panosl/django-currencies | refs/heads/master | currencies/management/commands/_currencyiso.py | 2 | # -*- coding: utf-8 -*-
import sys, os
import logging
from xml.etree import ElementTree as ET
from requests import get, exceptions
from datetime import datetime
from ._currencyhandler import BaseHandler
if sys.version_info.major == 2:
FileNotFoundError = IOError
class CurrencyHandler(BaseHandler):
"""
C... |
dustymabe/ci-example | refs/heads/master | jjb/run.py | 2 | #!/usr/bin/python
import json, urllib, subprocess, sys, os
# We will interface with Duffy to request machines:
# Duffy documentation at https://wiki.centos.org/QaWiki/CI/Duffy
# Formulate the url to request nodes
url_base = "http://admin.ci.centos.org:8080"
api_key = os.environ['API_KEY']
count = os.environ['MACH... |
Zakru/vidme.py | refs/heads/master | vidme/users.py | 1 | """
MIT License
Copyright (c) 2017 Zakru
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... |
lgandx/Responder | refs/heads/master | servers/MSSQL.py | 2 | #!/usr/bin/env python
# This file is part of Responder, a network take-over set of tools
# created and maintained by Laurent Gaffie.
# email: laurent.gaffie@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 by
# the Free... |
google/pigweed | refs/heads/main | pw_arduino_build/py/builder_test.py | 1 | # Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
jyri78/PyUnitConverter | refs/heads/master | PyUnitConverter.py | 1 | #! /usr/bin/env python
# -*- python -*-
# -*- coding: utf-8 -*-
__version__ = '1.1.0'
__author__ = 'Jüri Kormik'
from locale import getdefaultlocale
import puc
# Load settings if exists or set default
if puc.exists(puc.settings_file):
puc.settings = puc.read_data(puc.settings_file, puc.SM_JSON)
else:
puc... |
Adria331/WaifuFM | refs/heads/master | waifufmapp/forms.py | 1 | from django.forms import ModelForm
from models import Artist, Album, AlbumReview
class ArtistForm(ModelForm):
class Meta:
model = Artist
exclude = ('user', 'date',)
class AlbumForm(ModelForm):
class Meta:
model = Album
exclude = ('user', 'date',)
class AlbumReviewForm(ModelForm):
class Meta:
model = Alb... |
zaffra/Inquire | refs/heads/master | GAE/django/contrib/sitemaps/management/commands/ping_google.py | 72 | from django.core.management.base import BaseCommand
from django.contrib.sitemaps import ping_google
class Command(BaseCommand):
help = "Ping google with an updated sitemap, pass optional url of sitemap"
def execute(self, *args, **options):
if len(args) == 1:
sitemap_url = args[0]
... |
vinco/django-socialregistration | refs/heads/master | socialregistration/contrib/linkedin/views.py | 10 | from django.core.urlresolvers import reverse
from socialregistration.contrib.linkedin.client import LinkedIn
from socialregistration.contrib.linkedin.models import LinkedInProfile
from socialregistration.views import OAuthRedirect, OAuthCallback, SetupCallback
class LinkedInRedirect(OAuthRedirect):
client = Linked... |
iuliat/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_server_actions.py | 13 | # Copyright 2011 OpenStack Foundation
# 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 requ... |
gnieboer/gnuradio | refs/heads/android | docs/doxygen/doxyxml/doxyindex.py | 47 | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
PierreBubu/site_web | refs/heads/master | node-v4.4.7-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py | 2687 | #!/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.
""" Unit tests for the msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
import StringIO
class TestSequenceFunctions(uni... |
2014c2g19/2014c2g19 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/pulldom.py | 850 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... |
songmonit/CTTMSONLINE | refs/heads/master | addons/analytic/__openerp__.py | 302 | # -*- 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... |
abramhindle/UnnaturalCodeFork | refs/heads/master | python/testdata/launchpad/lib/lp/registry/interfaces/sharingjob.py | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Interfaces for sharing jobs."""
__metaclass__ = type
__all__ = [
'IRemoveArtifactSubscriptionsJob',
'IRemoveArtifactSubscriptionsJobSource',
'ISharingJob',
'IS... |
versatica/mediasoup | refs/heads/v3 | worker/deps/gyp/test/win/gyptest-cl-disable-specific-warnings.py | 242 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Make sure disable specific warnings is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp... |
NeostreamTechnology/Microservices | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.py | 536 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class LinkLockFile(LockBase):
"""Lock access to a file using atomic property of link(2).
>>> lock = LinkLockFile('somefile')
>>> lock = Link... |
tawsifkhan/scikit-learn | refs/heads/master | examples/manifold/plot_mds.py | 261 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... |
jeffery-do/Vizdoombot | refs/heads/master | doom/lib/python3.5/site-packages/networkx/utils/contextmanagers.py | 63 | from __future__ import absolute_import
from contextlib import contextmanager
__all__ = [
'reversed',
]
@contextmanager
def reversed(G):
"""A context manager for temporarily reversing a directed graph in place.
This is a no-op for undirected graphs.
Parameters
----------
G : graph
A ... |
robosafe/testbench_vRAL_hydro | refs/heads/master | bert2_simulator/scripts/object.py | 2 | #!/usr/bin/env python
"""
This script draws a cylindrical object in Gazebo, and keeps a node with the location of its mass center in x,y,z coordinates (absolute from an origin at the base of the robot. The node is updated via a state machine.
Written by Dejanira Araiza-Illan, March 2015.
"""
import rospy
import sma... |
oliverychen/oliverychen.github.io | refs/heads/master | vendor/cache/ruby/2.1.0/gems/pygments.rb-0.6.2/vendor/simplejson/simplejson/tests/test_decode.py | 93 | import decimal
from unittest import TestCase
from StringIO import StringIO
import simplejson as json
from simplejson import OrderedDict
class TestDecode(TestCase):
if not hasattr(TestCase, 'assertIs'):
def assertIs(self, a, b):
self.assertTrue(a is b, '%r is %r' % (a, b))
def test_decimal... |
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/setup.py | 93 | #!/usr/bin/env python
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 t... |
bdyetton/prettychart | refs/heads/feature/pretty_charts | framework/analytics/piwik.py | 42 | # -*- coding: utf-8 -*-
import json
import uuid
from hashlib import md5
from urllib import urlencode
import requests
from website import settings
class PiwikException(Exception):
pass
def _create_user(user):
""" Given an OSF user, creates a Piwik user.
"""
login = 'osf.' + user._id
pw = str(u... |
opennode/nodeconductor-assembly-waldur | refs/heads/develop | src/waldur_zabbix/apps.py | 1 | from django.apps import AppConfig
from django.db.models import signals
from django_fsm import signals as fsm_signals
class ZabbixConfig(AppConfig):
name = 'waldur_zabbix'
verbose_name = 'Waldur Zabbix'
service_name = 'Zabbix'
def ready(self):
from waldur_core.structure import SupportedService... |
ubc/edx-platform | refs/heads/release | cms/djangoapps/contentstore/views/access.py | 122 | """ Helper methods for determining user access permissions in Studio """
from student.roles import CourseInstructorRole
from student import auth
def get_user_role(user, course_id):
"""
What type of access: staff or instructor does this user have in Studio?
No code should use this for access control, onl... |
wfxiang08/django190 | refs/heads/master | django/conf/locale/da/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... |
patacca/nyx | refs/heads/master | test/__init__.py | 1 | """
Unit tests for nyx.
"""
import collections
import inspect
import time
import unittest
import nyx.curses
from nyx import expand_path, join, uses_settings
from mock import patch, Mock
__all__ = [
'arguments',
'expand_path',
'installation',
'log',
'tracker',
]
OUR_SCREEN_SIZE = None
TEST_SCREEN_SIZE = n... |
JavaRabbit/CS496_capstone | refs/heads/master | pubsub/cloud-client/quickstart_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... |
jacquesd/indico | refs/heads/master | indico/modules/attachments/controllers/display/event.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
irwinlove/django | refs/heads/master | django/core/files/utils.py | 395 | from django.utils import six
class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
... |
t3dev/odoo | refs/heads/master | addons/crm/controllers/__init__.py | 88 | # -*- coding: utf-8 -*
from . import main
|
dianlujitao/android_kernel_zte_msm8994 | refs/heads/cm-13.0 | tools/perf/util/setup.py | 2079 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
knossos-project/PythonQt | refs/heads/master | examples/NicePyConsole/pygments/lexers/compiled.py | 77 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Just export lexer classes previously contained in this module.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexers.jvm import JavaLexer, Sc... |
MirkoRossini/django-altauth | refs/heads/master | src/main/python/altauth/utils/__main__.py | 1 | import argparse
import sys
from altauth.utils.utils import (decrypt_token_rsa_using_file)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Decrypt utils.')
parser.add_argument('command',
help='The command you want to execute',
choices=['d... |
Moshiasri/learning | refs/heads/master | Python_dataCamp/dict_pandas_seriesdataframe_method.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 28 09:13:15 2016
@author: Mohtashim
"""
# Import cars data
import pandas as pd
cars = pd.read_csv('cars.csv', index_col = 0)
# Print out country column as Pandas Series
print(cars['country'])
# Print out country column as Pandas DataFrame
print(cars[['country']])
# Pr... |
StefanRijnhart/odoomrp-wip | refs/heads/8.0 | quality_control/models/qc_trigger.py | 5 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class QcTrigger(models... |
huggingface/pytorch-transformers | refs/heads/master | examples/pytorch/question-answering/run_qa.py | 1 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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-... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/lair/durni/lair_durni_mountain.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/component/weapon/new_weapon/enhancement_ranged_slot_one_s16.py | 85615 | import sys
def setup(core, object):
return |
fogleman/pg | refs/heads/master | pg/core.py | 2 | from ctypes import *
from OpenGL.GL import *
from PIL import Image
from math import copysign
from .matrix import Matrix
from . import glfw
from . import util
import cPickle as pickle
import os
import Queue
import threading
import time
def delete_all(obj):
'''Calls `delete()` on all members of `obj` that are recogn... |
Godiyos/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_pkg.py | 55 | # Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
from test import support
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir... |
eseraygun/python-alignment | refs/heads/master | alignment/profile.py | 1 | from six import iteritems
from six import itervalues
from six import text_type
from six.moves import builtins
import operator
from .sequence import Sequence
# Profile ---------------------------------------------------------------------
class SoftElement(object):
def __init__(self, weights):
self.__we... |
mlperf/training_results_v0.5 | refs/heads/master | v0.5.0/google/cloud_v2.8/gnmt-tpuv2-8/code/gnmt/model/t2t/tensor2tensor/data_generators/wiki_revision_utils.py | 3 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
robhudson/zamboni | refs/heads/master | lib/crypto/tests.py | 2 | # -*- coding: utf-8 -*-
import json
import os
import shutil
import zipfile
from django.conf import settings # For mocking.
from django.core.files.storage import default_storage as storage
import jwt
import mock
from nose.tools import eq_, raises
import amo.tests
from lib.crypto import packaged
from lib.crypto.recei... |
zyq001/ryu | refs/heads/master | ryu/services/protocols/bgp/api/operator.py | 36 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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
#
# Unless required by appli... |
orgito/ansible | refs/heads/devel | test/legacy/cleanup_ec2.py | 149 | '''
Find and delete AWS resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete you're *ENTIRE* EC2 infrastructure.
'''
import boto
import boto.ec2.elb
import optparse
import os
import os.path
impor... |
tombstone/models | refs/heads/master | research/seq2species/build_model.py | 4 | # Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
HITpyDevs/website | refs/heads/master | db_repository/versions/004_migration.py | 581 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind
# migrate_engine to your metadata
pre_meta.bind = migrate_engine
post_meta.bin... |
junhuac/MQUIC | refs/heads/master | src/build/android/emma_coverage_stats.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.
"""Generates incremental code coverage reports for Java code in Chromium.
Usage:
build/android/emma_coverage_stats.py -v --out <output ... |
ravibhure/ansible | refs/heads/devel | lib/ansible/playbook/block.py | 11 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
ImaginationForPeople/alembic | refs/heads/master | alembic/script/base.py | 1 | import datetime
import os
import re
import shutil
from .. import util
from ..util import compat
from . import revision
from ..runtime import migration
from contextlib import contextmanager
_sourceless_rev_file = re.compile(r'(?!__init__)(.*\.py)(c|o)?$')
_only_source_rev_file = re.compile(r'(?!__init__)(.*\.py)$')
_l... |
JeffHoogland/weathertrek | refs/heads/master | Compiled-Packages/weathertrek/opt/weathertrek/gmaps/elevation.py | 14224 | # -*- coding: utf-8 -*-
|
HuaweiSwitch/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_project_facts.py | 49 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
#
# This module 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 ve... |
da1z/intellij-community | refs/heads/master | python/testData/resolve/ClassAttrInDeclaration.py | 35 | class A:
my_attr = 17
print(my_attr)
# <ref> |
tigeorgia/fixmystreet | refs/heads/master | apps/mainapp/views/contact.py | 1 | from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from apps.mainapp.forms import ContactForm
def thanks(request):
return render_to_response("contact/thanks.html", {},
... |
itsjeyd/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/tests/test_models.py | 13 | """
Unit tests for bulk-email-related models.
"""
from django.test import TestCase
from django.core.management import call_command
from student.tests.factories import UserFactory
from mock import patch, Mock
from nose.plugins.attrib import attr
from bulk_email.models import (
CourseEmail,
SEND_TO_COHORT,
... |
mobarski/sandbox | refs/heads/master | nlp/tests/nlp_test5.py | 1 | import sys; sys.path.append('..')
from time import time
import re
from nlp import *
from frame import *
from tsv import *
from cache import *
from multiprocessing import Pool
if 1:
# dict
def load_lem_dict():
global lem_dict
t0=time()
lem_dict = marshal.load(open('../data/lem_dict.mrl','rb'))
#print('lem_... |
markpasc/giraffe | refs/heads/master | giraffe/aggregator/models.py | 1 | import hashlib
from django.db import models
from giraffe.aggregator import tasks
class Subscription(models.Model):
display_name = models.CharField(max_length=75, null=True, blank=True)
topic_url = models.CharField(max_length=255)
topic_url_hash = models.CharField(max_length=40, db_index=True, blank=Tru... |
dparshin/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/copies-link/gyptest-copies-link.py | 153 | #!/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.
"""
Verifies file copies using the build tool default.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('copies-link.gyp', chdir=... |
Curious72/sympy | refs/heads/master | sympy/physics/quantum/density.py | 82 | from __future__ import print_function, division
from itertools import product
from sympy import Tuple, Add, Mul, Matrix, log, expand, Rational
from sympy.core.trace import Tr
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.operator imp... |
Protoneer/fadecandy | refs/heads/master | examples/python/strobe.py | 16 | #!/usr/bin/env python
# Open Pixel Control client: All lights to solid white
import opc, time
numLEDs = 512
client = opc.Client('localhost:7890')
black = [ (0,0,0) ] * numLEDs
white = [ (255,255,255) ] * numLEDs
while True:
client.put_pixels(white)
time.sleep(0.05)
client.put_pixels(black)
time.sl... |
venmo/ansible | refs/heads/devel | contrib/inventory/ovirt.py | 65 | #!/usr/bin/env python
# Copyright 2015 IIX 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 version 3 of the License, or
# (at your option) any later ver... |
KyleJamesWalker/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_evpn_vni.py | 3 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
MITLibraries/flask-mitoauth2 | refs/heads/master | setup.py | 1 | """
Flask-MITOAuth2
---------------
Flask extension for authenticating users against MIT OAuth2
service.
"""
import io
from setuptools import setup, find_packages
with io.open('LICENSE') as f:
license = f.read()
setup(
name='Flask-MITOAuth2',
version='0.0.1',
url='http://github.com/MITLibraries/flas... |
rbo7nik/haxor | refs/heads/master | tests/test_get_item.py | 3 | #!/usr/bin/env python
"""
Tests get_item()
@author avinash sajjanshetty
@email a@sajjanshetty.com
"""
import unittest
from hackernews import HackerNews
from hackernews import Item
class TestGetItem(unittest.TestCase):
def setUp(self):
self.hn = HackerNews()
def test_get_item(self):
item ... |
jmankoff/idata | refs/heads/master | install_scripts/jupyter_notebook_config.py | 1 | # Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging f... |
duduniao85/fundbi | refs/heads/master | PythonBasic/helper/property05.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#copyRight by heibanke
class Car(object):
country = u'中国'
__slots__=('length','width','height','owner','__dict__')
def __init__(self, length, width, height, owner=None):
self.owner = owner
self.length = length
self.width = width
... |
anntzer/scipy | refs/heads/master | scipy/_lib/doccer.py | 12 | ''' Utilities to allow inserting docstring fragments for common
parameters into function and method docstrings'''
import sys
__all__ = ['docformat', 'inherit_docstring_from', 'indentcount_lines',
'filldoc', 'unindent_dict', 'unindent_string', 'doc_replace']
def docformat(docstring, docdict=None):
'''... |
kadamski/certmaster | refs/heads/master | certmaster/SSLCommon.py | 5 | # 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 useful,
# bu... |
gymnasium/edx-platform | refs/heads/open-release/hawthorn.master | openedx/features/enterprise_support/utils.py | 9 | from __future__ import unicode_literals
import hashlib
import six
from django.conf import settings
from django.utils.translation import ugettext as _
import third_party_auth
from third_party_auth import pipeline
from student.cookies import set_experiments_is_enterprise_cookie
from openedx.core.djangoapps.site_confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.