repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
thomasgilgenast/spqr-nonrel
refs/heads/master
filetransfers/backends/delegate.py
29
from django.conf import settings from filetransfers.api import prepare_upload as delegate def prepare_upload(*args, **kwargs): """Delegates uploads to other backends based on private=False or True""" if kwargs['private']: kwargs['backend'] = settings.PRIVATE_PREPARE_UPLOAD_BACKEND else: kw...
mightbejosh/dj-braintree
refs/heads/transactions
tests/test_middleware.py
1
# import datetime # import decimal # # from django.contrib.auth import get_user_model # from django.contrib.auth.models import AnonymousUser # from django.test import TestCase # from django.test.client import RequestFactory # from django.test.utils import override_settings # from django.utils import timezone # # from d...
MiLk/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_instance_facts.py
20
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
syaiful6/django
refs/heads/master
django/middleware/cache.py
372
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
johnkit/vtk-dev
refs/heads/master
ThirdParty/Twisted/twisted/plugins/twisted_telnet.py
71
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.application.service import ServiceMaker TwistedTelnet = ServiceMaker( "Twisted Telnet Shell Server", "twisted.tap.telnet", "A simple, telnet-based remote debugging service.", "telnet")
klen/sailplay
refs/heads/develop
setup.py
1
#!/usr/bin/env python import re import sys from os import path as op from setuptools import setup from setuptools.command.test import test as TestCommand def _read(fname): try: return open(op.join(op.dirname(__file__), fname)).read() except IOError: return '' _meta = _read('sailplay.py') _l...
ashokrajbathu/boabrock
refs/heads/master
frappe/patches/v4_0/fix_attach_field_file_url.py
32
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe def execute(): attach_fields = (frappe.db.sql("""select parent, fieldname from `tabDocField` where fieldtype='Attach'""") + frappe.db.sql("""select dt, fieldname...
taoyunxing/trafficserver
refs/heads/master
tests/tools/traffic-replay/RandomReplay.py
5
#!/bin/env python3 ''' ''' # 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 ...
rizumu/django
refs/heads/master
tests/migrations/test_migrations_conflict/0002_second.py
564
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("migrations", "0001_initial")] operations = [ migrations.DeleteModel("Tribble"), migrations.RemoveField("Author", "silly_field")...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/cryptography-0.9.3/src/cryptography/hazmat/bindings/openssl/cmac.py
15
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #if OPENSSL_VERSION_NUMBER >= 0x10001000L #include <openss...
GoogleCloudPlatform/functions-framework-python
refs/heads/master
tests/test_cli.py
1
# Copyright 2020 Google LLC # # 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, ...
RicardoJohann/um
refs/heads/master
erpnext/setup/doctype/sales_email_settings/sales_email_settings.py
41
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cint from frappe.model.document impor...
atsolakid/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/tests/test_utils.py
5
# -*- coding: utf-8 -*- import datetime import json import mock from nose.plugins.attrib import attr from pytz import UTC from django.utils.timezone import UTC as django_utc from django.core.urlresolvers import reverse from django.test import TestCase, RequestFactory from edxmako import add_lookup from django_comment...
LearningProgress/LearningProgress
refs/heads/master
tests/test_home.py
2
from django.test import TestCase from django.test.client import Client class Home(TestCase): """ Tests home view. """ def test_get(self): response = Client().get('/') self.assertEqual(response.status_code, 200)
moylop260/odoo-dev
refs/heads/master
addons/google_calendar/__init__.py
436
import res_config import google_calendar import controllers
will-iam/Variant
refs/heads/master
casepy/eulerRuO2/nSedov128x128/chars.py
2
import sys, os sys.path.insert(1, os.path.join(sys.path[0], '../../../')) import script.rio as io import script.initial_condition.sedov as sedov # Domain properties lx = 1.2 ly = 1.2 Nx = 128 Ny = 128 # Scheme execution options T = 1.0 CFL = 0.5 gamma = 1.4 BClayer = 1 quantityList = ['rho', 'rhou_x', 'rhou_y', 'r...
kosz85/django
refs/heads/master
tests/string_lookup/__init__.py
12133432
t0n15/final-project
refs/heads/master
tailbone/static/__init__.py
12133432
mancoast/CPythonPyc_test
refs/heads/master
fail/332_test_types.py
28
# Python test set -- part 6, built-in types from test.support import run_unittest, run_with_locale import collections import locale import sys import types import unittest class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is true instead of false') if 0: s...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source - Copy/Lib/tkinter/test/test_tkinter/test_font.py
10
import unittest import tkinter from tkinter import font from test.support import requires, run_unittest, gc_collect from tkinter.test.support import AbstractTkTest requires('gui') fontname = "TkDefaultFont" class FontTest(AbstractTkTest, unittest.TestCase): @classmethod def setUpClass(cls): Abstract...
mojeto/django
refs/heads/master
django/db/models/fields/related_descriptors.py
19
""" Accessors for related objects. When a field defines a relation between two models, each model class provides an attribute to access related instances of the other model class (unless the reverse accessor has been disabled with related_name='+'). Accessors are implemented as descriptors in order to customize acces...
tudorvio/nova
refs/heads/master
nova/virt/xenapi/vm_utils.py
20
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
Chapna/EnerWat
refs/heads/master
EnerWat/user/migrations/0005_auto_20150730_0257.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('user', '0004_auto_20150730_0229'), ] ...
jacky-young/crosswalk-test-suite
refs/heads/master
misc/webdriver-w3c-tests/element_state/method_test.py
5
# -*- mode: python; fill-column: 100; comment-column: 100; -*- import os import sys import unittest sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import base_test class GetElementAttributeTest(base_test.WebDriverBaseTest): def test_get_element_attribute(self): ...
wallnerryan/quantum_migrate
refs/heads/master
quantum/tests/unit/nec/test_agent_scheduler.py
4
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NEC 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/LICE...
maxamillion/ansible-modules-extras
refs/heads/devel
network/f5/bigip_sys_db.py
23
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks 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 # ...
40023154/final0627
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/traceback.py
492
import sys def print_exc(file=sys.stderr): exc = __BRYTHON__.exception_stack[-1] file.write(exc.info) if isinstance(exc, SyntaxError): offset = exc.args[1][2] file.write('\n '+offset*' '+'^') file.write('\n'+exc.__name__) if exc.args: file.write(': '+exc.args[0]) file.wr...
ddico/odoo
refs/heads/master
addons/stock_account/wizard/stock_valuation_layer_revaluation.py
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import _, api, fields, models from odoo.exceptions import UserError from odoo.tools import float_is_zero class StockValuationLayerRevaluation(models.TransientModel): _name = 'stock.valuation.layer.revalua...
SPKian/Testing2
refs/heads/master
erpnext/patches/v5_1/default_bom.py
103
from __future__ import unicode_literals import frappe def execute(): frappe.db.sql("""Update `tabItem` as item set default_bom = NULL where not exists(select name from `tabBOM` as bom where item.default_bom = bom.name and bom.docstatus =1 )""")
aszlig/LastWatch
refs/heads/master
setup.py
1
#!/usr/bin/env python import sys import subprocess from distutils.core import setup, Command class Test(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, 'tests.py']) ...
ravibhure/ansible
refs/heads/devel
lib/ansible/plugins/action/sros_config.py
79
# # Copyright 2016 Peter Sprygada <psprygada@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
elelianghh/sqlalchemy
refs/heads/master
test/sql/test_insert.py
8
#! coding:utf-8 from sqlalchemy import Column, Integer, MetaData, String, Table,\ bindparam, exc, func, insert, select, column, text from sqlalchemy.dialects import mysql, postgresql from sqlalchemy.engine import default from sqlalchemy.testing import AssertsCompiledSQL,\ assert_raises_message, fixtures, eq_ f...
devs1991/test_edx_docmode
refs/heads/master
common/djangoapps/util/memcache.py
251
""" This module provides a KEY_FUNCTION suitable for use with a memcache backend so that we can cache any keys, not just ones that memcache would ordinarily accept """ from django.utils.encoding import smart_str import hashlib import urllib def fasthash(string): """ Hashes `string` into a string representatio...
lj2007331/lnmp
refs/heads/master
include/check_port.py
7
#!/usr/bin/env python import sys,os,socket def IsOpen(ip,port): socket.setdefaulttimeout(5) s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) try: s.connect((ip,int(port))) s.shutdown(2) print True except: print False if __name__ == '__main__': IsOpen(sys.argv[1],int(sys.argv[2]))
gmr/apiary
refs/heads/master
apiary/mappers/__init__.py
1
""" Mappers are SQLAlchemy Data Objects """ from sqlalchemy.ext.declarative import declarative_base Base = declarative_base()
femmerling/DirMaker
refs/heads/master
box/lib/python2.7/site-packages/migrate/versioning/util/__init__.py
58
#!/usr/bin/env python # -*- coding: utf-8 -*- """.. currentmodule:: migrate.versioning.util""" import warnings import logging from decorator import decorator from pkg_resources import EntryPoint from sqlalchemy import create_engine from sqlalchemy.engine import Engine from sqlalchemy.pool import StaticPool from migr...
xczswt1993/redis-py
refs/heads/master
docs/conf.py
48
# -*- coding: utf-8 -*- # # redis-py documentation build configuration file, created by # sphinx-quickstart on Fri Feb 8 00:47:08 2013. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
vvuk/angle
refs/heads/master
src/tests/deqp_support/generate_case_lists.py
4
#!/usr/bin/python # # Copyright 2015 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # generate_case_lists.py: # Helper script for updating the dEQP case list files, stored in the repo. # Generally only used when...
SravanthiSinha/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/library_tools.py
154
""" XBlock runtime services for LibraryContentModule """ from django.core.exceptions import PermissionDenied from opaque_keys.edx.locator import LibraryLocator, LibraryUsageLocator from search.search_engine_base import SearchEngine from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE from xmodule.modulestore ...
prakxys/flask
refs/heads/master
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/testsuite/test_apps/lib/python2.5/site-packages/site_package/__init__.py
1799
import flask app = flask.Flask(__name__)
EternalDeiwos/Hivemind
refs/heads/master
settings.py
2
""" Django settings for Hivemind project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
Acidburn0zzz/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/h2/test/test_config.py
39
# -*- coding: utf-8 -*- """ test_config ~~~~~~~~~~~ Test the configuration object. """ import logging import pytest import h2.config class TestH2Config(object): """ Tests of the H2 config object. """ def test_defaults(self): """ The default values of the HTTP/2 config object are sens...
mwgamera/u413
refs/heads/master
login.py
2
'''u413 - an open-source BBS/terminal/PI-themed forum Copyright (C) 2012 PiMaster Copyright (C) 2012 EnKrypt 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 Licens...
with-git/tensorflow
refs/heads/master
tensorflow/python/util/deprecation_test.py
21
# 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...
srvg/ansible
refs/heads/devel
test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/action/net_base.py
47
# Copyright: (c) 2015, Ansible 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 import copy from ansible.errors import AnsibleError from ansible.plugins.action import ActionBase fro...
ingydotnet/pyyaml-mirror
refs/heads/master
lib/yaml/events.py
986
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
gandarez/wakatime
refs/heads/master
wakatime/projects/__init__.py
12133432
mattray/stackalytics
refs/heads/master
tests/__init__.py
12133432
olemke/pyatmlab
refs/heads/master
tests/__init__.py
12133432
noushadali/androguard
refs/heads/master
androguard/decompiler/dad/dataflow.py
34
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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://...
aminghadersohi/airflow
refs/heads/master
airflow/ti_deps/__init__.py
1049
# -*- coding: utf-8 -*- # # 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 ...
molebot/brython
refs/heads/master
www/src/Lib/test/test_range.py
7
# Python test set -- built-in functions import unittest from test import support import sys import pickle import itertools # pure Python implementations (3 args only), for comparison def pyrange(start, stop, step): if (start - stop) // step < 0: # replace stop with next element in the sequence of integer...
nacc/cobbler
refs/heads/master
cobbler/action_acl.py
2
""" Configures acls for various users/groups so they can access the cobbler command line as non-root. Now that CLI is largely remoted (XMLRPC) this is largely just useful for not having to log in (access to shared-secret) file but also grants access to hand-edit various config files and other useful things. Copyright...
redhat-openstack/glance
refs/heads/f22-patches
glance/db/metadata.py
1
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2013 OpenStack Foundation # Copyright 2013 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not ...
GuessWhatGame/guesswhat
refs/heads/master
src/guesswhat/data_provider/oracle_batchifier.py
1
import numpy as np import collections from PIL import Image from generic.data_provider.batchifier import AbstractBatchifier from generic.data_provider.image_preprocessors import get_spatial_feat, resize_image from generic.data_provider.nlp_utils import padder answer_dict = \ {'Yes': np.array([1, 0, 0], dtype=np....
synicalsyntax/zulip
refs/heads/master
zerver/webhooks/updown/__init__.py
12133432
jalavik/invenio
refs/heads/master
invenio/modules/accounts/upgrades/__init__.py
12133432
oinopion/django
refs/heads/master
tests/test_client_regress/__init__.py
12133432
webmasterraj/GaSiProMo
refs/heads/master
flask/lib/python2.7/site-packages/gunicorn/management/__init__.py
12133432
xiangel/hue
refs/heads/master
desktop/core/src/desktop/require_login_test.py
37
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
dennisobrien/bokeh
refs/heads/master
scripts/issues.py
4
#!/usr/bin/env python from __future__ import print_function import argparse import datetime import dateutil.parser import dateutil.tz import gzip import json import logging import os import pickle import sys from collections import OrderedDict from functools import partial from itertools import count, groupby from s...
vipulkanade/EventbriteDjango
refs/heads/master
lib/python2.7/site-packages/django/contrib/syndication/__init__.py
808
default_app_config = 'django.contrib.syndication.apps.SyndicationConfig'
Venturi/cms
refs/heads/master
env/lib/python2.7/site-packages/djangocms_video/south_migrations/0001_initial.py
6
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, connection class Migration(SchemaMigration): def forwards(self, orm): table_names = connection.introspection.table_names() if 'cmsplugin_video' in table_names: ...
acshan/odoo
refs/heads/8.0
addons/project/wizard/__init__.py
381
# -*- 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...
sloria/osf.io
refs/heads/develop
api/nodes/utils.py
4
# -*- coding: utf-8 -*- from django.db.models import Q from rest_framework.exceptions import PermissionDenied, NotFound from rest_framework.status import is_server_error import requests from addons.osfstorage.models import OsfStorageFile, OsfStorageFolder from api.base.exceptions import ServiceUnavailableError from a...
prior/webinars
refs/heads/master
webinars_web/webinars/models/snapshots/hubspot_registrant.py
1
from django.db import models from sanetime.dj import SaneTimeField class HubSpotRegistrantSnapshot(models.Model): class Meta: app_label = 'webinars' event = models.ForeignKey('Event') hashcode = models.IntegerField(null=False) email = models.CharField(max_length=64, null=False) first_name...
yongshengwang/builthue
refs/heads/master
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/pagination_regress/tests.py
36
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils.unittest import TestCase class PaginatorTests(TestCase): """ Tests for the Paginator and Page classes. """ def check_paginator(self, params, output): """ Helper method that instantiates a Paginat...
int19h/PTVS
refs/heads/master
Python/Tests/TestData/TestDiscoverer/BasicPytest/test_pt.py
3
def test_pt_pass(): assert True def test_pt_fail(): assert False class TestClassPT(object): def test_method_pass(self): pass
davy39/eric
refs/heads/master
DebugClients/Python/AsyncFile.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing an asynchronous file like socket interface for the debugger. """ import socket from DebugProtocol import EOT def AsyncPendingWrite(file): """ Module function to check for data to be wr...
django-nonrel/django-nonrel
refs/heads/develop
django/contrib/redirects/admin.py
663
from django.contrib import admin from django.contrib.redirects.models import Redirect class RedirectAdmin(admin.ModelAdmin): list_display = ('old_path', 'new_path') list_filter = ('site',) search_fields = ('old_path', 'new_path') radio_fields = {'site': admin.VERTICAL} admin.site.register(Redirect, R...
blockstack/blockstack-server
refs/heads/master
integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_up_xfer_up_xfer_xfer_up.py
1
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
xiaoshaozi52/ansible
refs/heads/devel
v1/ansible/inventory/ini.py
111
# (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...
partofthething/home-assistant
refs/heads/dev
tests/components/hue/test_sensor_base.py
6
"""Philips Hue sensors platform tests.""" import asyncio from unittest.mock import Mock import aiohue from homeassistant.components.hue.hue_event import CONF_HUE_EVENT from .conftest import create_mock_bridge, setup_bridge_for_sensors as setup_bridge PRESENCE_SENSOR_1_PRESENT = { "state": {"presence": True, "la...
dslomov/intellij-community
refs/heads/master
python/testData/inspections/AugmentAssignmentWithContext.py
83
class A: x = 3 a = A() <weak_warning descr="Assignment can be replaced with augmented assignment">a.x = a.x +<caret> 1</weak_warning>
tymiles003/openwebrtc
refs/heads/master
bindings/java/c_generator.py
31
# Copyright (c) 2014-2015, Ericsson AB. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and th...
NESCent/feedingdb
refs/heads/master
src/feeddb/feed/forms.py
1
from haystack.forms import FacetedSearchForm from haystack.inputs import AutoQuery, Exact, Clean from haystack.query import RelatedSearchQuerySet from inspector_panel import debug from django import forms from django.forms.fields import ChoiceField, BooleanField from django.forms.widgets import RadioSelect from django....
amaozhao/algorithms
refs/heads/master
tests/test_stack.py
2
from algorithms.stack import ( first_is_consecutive, second_is_consecutive, is_sorted, remove_min, first_stutter, second_stutter, first_switch_pairs, second_switch_pairs, is_valid, simplify_path, ArrayStack, LinkedListStack, OrderedStack ) import unittest class TestSuite(unittest.Te...
lgarren/spack
refs/heads/develop
var/spack/repos/builtin/packages/xphelloworld/package.py
3
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
westinedu/wrgroups
refs/heads/master
django/contrib/localflavor/sk/sk_districts.py
543
""" Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ DISTRICT_CHOICES = ( ('BB', _('Banska Bystrica')), ('BS', _('Banska Stiavnica')), ('BJ', _('Bardejov')), ('BN', _('Banovce nad Bebravo...
Thraxis/SickRage
refs/heads/master
sickbeard/providers/shazbat.py
1
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
alexpap/exareme
refs/heads/mip
exareme-tools/madis/src/functions/vtable/rc2db.py
4
import os.path import sys import functions import os from itertools import izip import cPickle import cStringIO import vtbase import struct import vtbase import os import gc import re import zlib ### Classic stream iterator registered=True BLOCK_SIZE = 200000000 import apsw import time import marshal class RC2DB(vtb...
andreif/django
refs/heads/master
tests/messages_tests/test_cookie.py
299
import json from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.cookie import ( CookieStorage, MessageDecoder, MessageEncoder, ) from django.test import SimpleTestCase, override_settings from django.utils.safestring import Safe...
arju88nair/projectCulminate
refs/heads/master
venv/lib/python3.5/site-packages/pip/commands/completion.py
343
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
hoangt/tpzsimul.gem5
refs/heads/master
ext/ply/example/BASIC/basiclog.py
166
# An implementation of Dartmouth BASIC (1964) # import sys sys.path.insert(0,"../..") if sys.version_info[0] >= 3: raw_input = input import logging logging.basicConfig( level = logging.INFO, filename = "parselog.txt", filemode = "w" ) log = logging.getLogger() import basiclex import basparse import ...
Tejal011089/digitales_frappe
refs/heads/develop
frappe/translate.py
14
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Contributing: 1. Add the .csv file 2. Run import 3. Then run translate """ # loading # doctype, page, report # boot(startup) # frappe.require # frappe._ import frappe, o...
tony/kivy
refs/heads/master
kivy/uix/relativelayout.py
18
''' Relative Layout =============== .. versionadded:: 1.4.0 This layout allows you to set relative coordinates for children. If you want absolute positioning, use the :class:`~kivy.uix.floatlayout.FloatLayout`. The :class:`RelativeLayout` class behaves just like the regular :class:`FloatLayout` except that its chil...
shingonoide/odoo
refs/heads/deverp_8.0
addons/website_mail_group/models/mail_group.py
321
# -*- coding: utf-8 -*- from openerp.osv import osv from openerp import tools from openerp.tools.translate import _ from openerp.tools.safe_eval import safe_eval as eval from openerp.addons.website.models.website import slug class MailGroup(osv.Model): _inherit = 'mail.group' def message_get_email_values(sel...
jefflyn/buddha
refs/heads/master
src/mlia/Ch02/EXTRAS/createDist.py
5
''' Created on Oct 6, 2010 @author: Peter ''' from numpy import * import matplotlib import matplotlib.pyplot as plt from matplotlib.patches import Rectangle n = 1000 #number of points to create xcord = zeros((n)) ycord = zeros((n)) markers =[] colors =[] fw = open('testSet.txt','w') for i in range(n): [r0,r1] = ...
jwlawson/tensorflow
refs/heads/master
tensorflow/contrib/labeled_tensor/python/ops/core_test.py
112
# 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...
ashaarunkumar/spark-tk
refs/heads/master
python/sparktk/frame/ops/filter.py
14
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 require...
thebarbershopper/Empire
refs/heads/master
lib/modules/situational_awareness/host/dnsserver.py
22
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-SystemDNSServer', 'Author': ['DarkOperator'], 'Description': ('Enumerates the DNS Servers used by a system.'), 'Background' : False, ...
blooparksystems/odoo
refs/heads/9.0
openerp/api.py
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ This module provides the elements for managing two different API styles, namely the "traditional" and "record" styles. In the "traditional" style, parameters like the database cursor, user id, context di...
IshankGulati/scikit-learn
refs/heads/master
sklearn/utils/__init__.py
13
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, ...
P0cL4bs/WiFi-Pumpkin
refs/heads/master
plugins/external/Responder/servers/IMAP.py
5
#!/usr/bin/env python # This file is part of Responder # Original work by Laurent Gaffie - Trustwave Holdings # # 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, o...
eSpark/phabricator
refs/heads/master
externals/twilio-php/docs/_themes/flask_theme_support.py
2228
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
mdtraj/mdtraj
refs/heads/master
mdtraj/utils/validation.py
4
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: # # MDTraj is free software: y...
inares/edx-platform
refs/heads/inares_sass
lms/djangoapps/verify_student/tests/fake_software_secure.py
73
""" Fake Software Secure page for use in acceptance tests. """ from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.utils.decorators import method_decorator from django.views.generic.base import View from edxmako.shortcuts ...
robertmattmueller/sdac-compiler
refs/heads/master
sympy/physics/optics/tests/test_waves.py
14
from sympy import (symbols, Symbol, pi, sqrt, cos, sin, Derivative, Function, simplify, C, I, atan2) from sympy.abc import x, epsilon, mu from sympy.physics.units import c, m, s from sympy.physics.optics import TWave def test_twave(): A1, phi1, A2, phi2, f = symbols('A1, phi1, A2, phi2, f') n = Symbol('n'...
rfk/promise
refs/heads/master
promise/tests/finder.py
2
import promise items = range(100) def verify(finder): """Check that the given finder function works correctly.""" assert finder(0) assert finder(42) assert not finder(101) assert not finder(1001) def finder0(item): """Base 'finder' fuction; is quite stupid and slow.""" i = 0 while i ...
opencloudinfra/orchestrator
refs/heads/master
venv/Lib/site-packages/django/conf/locale/sk/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 = 'G:i' DATET...