repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
mick-d/nipype
refs/heads/master
nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py
1
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..brains import BRAINSTrimForegroundInDirection def test_BRAINSTrimForegroundInDirection_inputs(): input_map = dict(BackgroundFillValue=dict(argstr='--BackgroundFillValue %s', ), args=dict(argstr='%s', )...
daill/OPy
refs/heads/master
opy/client/o_db_set.py
1
# Copyright 2015 Christian Kramer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
SaptakS/pune.pycon.org
refs/heads/master
symposion/schedule/migrations/0002_auto_20150723_0856.py
4
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('symposion_schedule', '0001_initial'), ] operations = [ migrations.AddField( model_name='presentation', ...
rhndg/openedx
refs/heads/master
common/lib/xmodule/xmodule/tests/test_conditional.py
21
import json import unittest from fs.memoryfs import MemoryFS from mock import Mock, patch from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.error_module import NonStaffErrorDescriptor from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from xmodule.modules...
aleaf/pest_tools
refs/heads/master
par_sen.py
2
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import pandas as pd class ParSen: def __init__(self, jco_df, obs_dict, pars_dict, drop_regul = False, drop_groups = None, keep_groups = None): ''' Create ParSen class Parameters ---------- jco...
truekonrads/tweepy
refs/heads/master
tweepy/__init__.py
32
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. """ Tweepy Twitter API library """ __version__ = '3.4.0' __author__ = 'Joshua Roesslein' __license__ = 'MIT' from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category from tweepy.erro...
sethc23/iTerm2
refs/heads/master
tools/ply/ply-3.4/test/yacc_notfunc.py
174
# ----------------------------------------------------------------------------- # yacc_notfunc.py # # p_rule not defined as a function # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import...
routeflow/AutomaticConfigurationRouteFlow
refs/heads/master
POX_CONTROLLER/debug-pox.py
47
#!/bin/sh - # Copyright 2011-2012 James McCauley # # 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 ...
zstewar1/autotank
refs/heads/master
web/ioControl/xmlrpc.py
2
from django.http import HttpResponse from django.utils import simplejson from django.template import RequestContext, loader from ioControl.models import Motor import xmlrpclib s = xmlrpclib.ServerProxy('http://192.168.0.108:8000', allow_none=True) def changeTurretDirection(*args): s.changeTurretDirection(*args) def...
beiko-lab/gengis
refs/heads/master
bin/Lib/site-packages/wx-2.8-msw-unicode/wxPython/lib/ClickableHtmlWindow.py
6
## This file imports items from the wx package into the wxPython package for ## backwards compatibility. Some names will also have a 'wx' added on if ## that is how they used to be named in the old wxPython package. import wx.lib.ClickableHtmlWindow __doc__ = wx.lib.ClickableHtmlWindow.__doc__ wxPyClickableHtmlWin...
lachtanek/pb138-address-visualisation
refs/heads/master
address_visualisation/visualisers/square_count.py
1
#!/usr/bin/python3 """ Module with visualiser of count of squares in area in database. """ from address_visualisation import Visualiser from address_visualisation.transform_to_feature_collection import feature_collection_from_areas class SquareCountVisualiser(Visualiser): """ Visualiser which finds towns with most ...
JrGoodle/clowder
refs/heads/master
clowder/cli/repo.py
1
"""Clowder command line repo controller .. codeauthor:: Joe DeCapo <joe@polka.cat> """ import argparse from clowder.clowder_controller import print_clowder_name from clowder.environment import clowder_git_repo_required, clowder_repo_required, ENVIRONMENT from clowder.git.clowder_repo import ClowderRepo, print_clowd...
spotify/annoy
refs/heads/master
test/examples_test.py
4
import unittest def execfile(fn): with open(fn) as f: exec(f.read()) def simple_test(): execfile('examples/simple_test.py') def mmap_test(): execfile('examples/mmap_test.py') def precision_test(): execfile('examples/precision_test.py')
theguardian/headphones
refs/heads/master
lib/unidecode/x010.py
252
data = ( 'k', # 0x00 'kh', # 0x01 'g', # 0x02 'gh', # 0x03 'ng', # 0x04 'c', # 0x05 'ch', # 0x06 'j', # 0x07 'jh', # 0x08 'ny', # 0x09 'nny', # 0x0a 'tt', # 0x0b 'tth', # 0x0c 'dd', # 0x0d 'ddh', # 0x0e 'nn', # 0x0f 'tt', # 0x10 'th', # 0x11 'd', # 0x12 'dh', ...
nagyistoce/edx-platform
refs/heads/master
lms/djangoapps/instructor_task/tests/test_subtasks.py
146
""" Unit tests for instructor_task subtasks. """ from uuid import uuid4 from mock import Mock, patch from student.models import CourseEnrollment from instructor_task.subtasks import queue_subtasks_for_query from instructor_task.tests.factories import InstructorTaskFactory from instructor_task.tests.test_base import ...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/building/general/shared_cloning_facility_general.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/general/shared_cloning_facility_general.iff" result.attribute_templ...
carsongee/edx-platform
refs/heads/master
lms/lib/comment_client/utils.py
20
from contextlib import contextmanager from dogapi import dog_stats_api import logging import requests from django.conf import settings from time import time from uuid import uuid4 from django.utils.translation import get_language log = logging.getLogger(__name__) def strip_none(dic): return dict([(k, v) for k, v...
healthchecks/healthchecks
refs/heads/master
hc/front/tests/test_filtering_rules.py
2
from hc.api.models import Check from hc.test import BaseTestCase class FilteringRulesTestCase(BaseTestCase): def setUp(self): super().setUp() self.check = Check.objects.create(project=self.project) self.url = "/checks/%s/filtering_rules/" % self.check.code self.redirect_url = "/ch...
caotianwei/django
refs/heads/master
tests/project_template/test_settings.py
274
import unittest from django.test import TestCase from django.utils import six @unittest.skipIf(six.PY2, 'Python 2 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py file.') class TestStartProjectSettings(TestCase): def test_middleware_classes_headers(...
cedk/odoo
refs/heads/8.0
openerp/addons/test_workflow/models.py
337
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
pidydx/grr
refs/heads/master
grr/gui/api_plugins/report_plugins/report_plugins_test.py
1
#!/usr/bin/env python """Tests for report plugins.""" import itertools import math import os from grr.gui.api_plugins import stats as stats_api from grr.gui.api_plugins.report_plugins import client_report_plugins from grr.gui.api_plugins.report_plugins import filestore_report_plugins from grr.gui.api_plugins.report_p...
kcsry/lippukala
refs/heads/master
lippukala/models/code.py
1
from random import randint, choice from string import digits from django.db import models from django.utils.timezone import now from lippukala.consts import CODE_STATUS_CHOICES, UNUSED, USED from lippukala.excs import CantUseException from lippukala.models import Order import lippukala.settings as settings class Co...
potash/scikit-learn
refs/heads/master
sklearn/datasets/lfw.py
11
"""Loader for the Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ Each picture is centered on a single face. The typical task is called Face Veri...
paladin74/neural-network-animation
refs/heads/master
matplotlib/backends/qt_editor/__init__.py
118
from __future__ import (absolute_import, division, print_function, unicode_literals)
xHeliotrope/injustice_dropper
refs/heads/master
env/lib/python3.4/site-packages/gunicorn/app/wsgiapp.py
96
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from gunicorn.errors import ConfigError from gunicorn.app.base import Application from gunicorn import util class WSGIApplication(Application): def init(self, parse...
simdeveloper/bitcoin
refs/heads/master
qa/rpc-tests/test_framework/authproxy.py
22
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
gangadharkadam/johnerp
refs/heads/develop
erpnext/patches/v4_0/fix_address_template.py
39
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors from __future__ import unicode_literals import frappe def execute(): missing_line = """{{ address_line1 }}<br>""" for name, template in frappe.db.sql("select name, template from `tabAddress Template`"): if missing_line not in template: d =...
muxi/grpc
refs/heads/master
src/python/grpcio_reflection/grpc_reflection/__init__.py
525
# Copyright 2016 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 law or agreed to in writing...
ahojjati/grr
refs/heads/master
client/vfs.py
6
#!/usr/bin/env python """This file implements a VFS abstraction on the client.""" from grr.client import client_utils from grr.lib import config_lib from grr.lib import registry from grr.lib import utils from grr.lib.rdfvalues import paths as rdf_paths # A central Cache for vfs handlers. This can be used to keep ob...
aarchiba/scipy
refs/heads/master
scipy/linalg/special_matrices.py
4
from __future__ import division, print_function, absolute_import import math import numpy as np from scipy._lib.six import xrange from scipy._lib.six import string_types from numpy.lib.stride_tricks import as_strided __all__ = ['tri', 'tril', 'triu', 'toeplitz', 'circulant', 'hankel', 'hadamard', 'leslie',...
kriwil/django-filer
refs/heads/develop
filer/south_migrations/0009_auto__add_field_folderpermission_can_edit_new__add_field_folderpermiss.py
49
# -*- 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 'FolderPermission.can_edit_new' db.add_column('filer_folderpermission', 'can_edit_new', ...
murphycj/AGFusion
refs/heads/master
agfusion/__init__.py
1
from .cli import * from .model import * from .utils import * from .database import * from .exceptions import * from .plot import * from .parsers import * from ._version import __version__
ol-loginov/intellij-community
refs/heads/master
python/testData/refactoring/introduceVariable/functionOccurrences.after.py
83
import xml.etree.ElementTree as etree def entries_to_xml(entries, dict_id, dict_name, closed): dictionary = etree.Element(u'Dictionary', IDName=dict_id) a = etree.SubElement a(dictionary, u'Name').text = dict_name a(dictionary, u'Closed').text = repr(closed).lower() a(dictionary, u'Action').text = u...
ericpre/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/utils/samfire.py
2
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
tek/amino
refs/heads/master
amino/boolean.py
1
from typing import Union, Any, TypeVar, Type, Callable, Tuple import amino from amino import maybe from amino.either import Right, Left, Either from amino.func import call_by_name A = TypeVar('A') B = TypeVar('B') class Boolean: def __init__(self, value: Union['Boolean', bool]) -> None: self.value = bo...
bmya/odoo-argentina
refs/heads/11.0
l10n_ar_base/__init__.py
1
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import SUPERUSER_ID, api from odoo.addons import account old_au...
MarcusTan/yncn-grid
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/utils.py
250
from __future__ import absolute_import, division, unicode_literals from types import ModuleType try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree class MethodDispatcher(dict): """Dict with 2 special properties: On initiation, keys ...
aisipos/django
refs/heads/master
django/test/testcases.py
3
from __future__ import unicode_literals import difflib import errno import json import os import posixpath import socket import sys import threading import unittest import warnings from collections import Counter from contextlib import contextmanager from copy import copy from functools import wraps from unittest.util...
bolkedebruin/airflow
refs/heads/master
tests/providers/celery/sensors/test_celery_queue.py
1
# -*- 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 #...
pursuitxh/u-boot-2013.07
refs/heads/master
tools/buildman/builder.py
31
# Copyright (c) 2013 The Chromium OS Authors. # # Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com> # # See file CREDITS for list of people who contributed to this # project. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public ...
nschloe/quadpy
refs/heads/main
tools/xiao_gimbutas/import_xiao_gimbutas_tri.py
1
""" Parse Fortran code to extract points and weight of the Xiao-Gimbutas schemes. """ import numpy as np def _parsed_strings_to_array(strings): return np.array( [ val.replace(",", "").replace("&", "").replace("/", "").replace("D", "e") for val in strings ], dtype=fl...
jinser/automate_pydatastream
refs/heads/master
getcustom.py
1
from pydatastream import Datastream import json import datetime import sys import os.path #hardcoded directories dir_input = "input/" dir_output = "output/" #check that the login credentials and input file location are being passed in numOfArgs = len(sys.argv) - 1 if numOfArgs != 3: print "Please run this python s...
Vassy/odoo
refs/heads/master
addons/l10n_ma/l10n_ma.py
39
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
mkhuthir/learnPython
refs/heads/master
Book_learning-python-r1.1/ch3/for.no.else.py
1
class DriverException(Exception): pass people = [('James', 17), ('Kirk', 9), ('Lars', 13), ('Robert', 8)] driver = None for person, age in people: if age >= 18: driver = (person, age) break if driver is None: raise DriverException('Driver not found.')
bdang2012/taiga-back-casting
refs/heads/branch_casting
taiga/projects/history/templatetags/functions.py
1
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
MediffRobotics/DeepRobotics
refs/heads/master
DeepLearnMaterials/tutorials/tensorflowTUT/tf18_CNN3/for_you_to_practice.py
2
# View more python tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly. ...
ghandiosm/Test
refs/heads/master
addons/website_event_track/__init__.py
1023
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import controllers import models
marinho/geraldo
refs/heads/master
site/newsite/django_1_0/django/middleware/cache.py
14
from django.conf import settings from django.core.cache import cache from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers, get_max_age class CacheMiddleware(object): """ Cache middleware. If this is enabled, each Django-powered page will be cached (based on URLs). Only...
PopCap/GameIdea
refs/heads/master
Engine/Source/ThirdParty/HTML5/emsdk/emscripten/1.30.0/tools/split.py
2
import sys import os from sets import Set def split_javascript_file(input_filename, output_filename_prefix, max_part_size_in_bytes): try: # Javascript main file. On execution, this file needs to be loaded at last (!) output_main_filename = output_filename_prefix + ".js" output_main_file = open(output_m...
fintech-circle/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/transformers/tests/test_student_view.py
7
""" Tests for StudentViewTransformer. """ # pylint: disable=protected-access from openedx.core.djangoapps.content.block_structure.factory import BlockStructureFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import ToyCourseFactory from ..student...
adsznzhang/learntosolveit
refs/heads/version1
languages/python/design_stack.py
7
""" Implementation of stack data structure in Python. """ class Stack: def __init__(self,*vargs): self.stack = list(vargs) def __repr__(self): return str(self.stack) def top(self): return self.stack[0] def push(self,elem): self.stack.insert(0,elem) def pop(self):...
Markcial/python-tutor
refs/heads/master
package/module.py
1
variable = 'foo' def function(): return 'hello world!' class Class: pass
clebergnu/autotest
refs/heads/master
frontend/migrations/050_more_test_planner_additions.py
18
UP_SQL = """ ALTER TABLE `planner_test_runs` ADD CONSTRAINT `test_runs_unique` UNIQUE KEY (`plan_id`, `test_job_id`, `tko_test_id`, `host_id`); ALTER TABLE `planner_tests` ADD COLUMN `is_server` tinyint(1) DEFAULT 1; ALTER TABLE `planner_hosts` ADD COLUMN `added_by_label` tinyint(1) DEFAULT 0; """ DOWN_SQL = """ ALT...
cs-shadow/phabricator-tools
refs/heads/master
py/phl/phlmail_mocksender__t.py
4
from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import phlmail_mocksender class Test(unittest.TestCase): def test_empty(self): mailsender = phlmail_mocksender.MailSender() self.assertEqual(len(mailsender.mailboxes), 0)...
mega-force/osmc
refs/heads/master
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x060.py
250
data = ( 'Huai ', # 0x00 'Tai ', # 0x01 'Song ', # 0x02 'Wu ', # 0x03 'Ou ', # 0x04 'Chang ', # 0x05 'Chuang ', # 0x06 'Ju ', # 0x07 'Yi ', # 0x08 'Bao ', # 0x09 'Chao ', # 0x0a 'Min ', # 0x0b 'Pei ', # 0x0c 'Zuo ', # 0x0d 'Zen ', # 0x0e 'Yang ', # 0x0f 'Kou ', # 0x10 ...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/googlecloudsdk/third_party/apis/dns/v1/resources.py
6
# Copyright 2015 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 ag...
ol-loginov/intellij-community
refs/heads/master
python/testData/inspections/PyProtectedMemberInspection/trueNegative.py
83
__author__ = 'ktisha' class A: def __init__(self): self._a = 1 def foo(self): self.b= 1 class B(A): def __init__(self): A.__init__(self) self.b = self._a
piyushroshan/xen-4.3
refs/heads/master
tools/python/xen/util/xsm/acm/acm.py
27
#=========================================================================== # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope tha...
imruahmed/microblog
refs/heads/master
flask/lib/python2.7/site-packages/pip/operations/freeze.py
284
from __future__ import absolute_import import logging import re import pip from pip.compat import stdlib_pkgs from pip.req import InstallRequirement from pip.utils import get_installed_distributions from pip._vendor import pkg_resources logger = logging.getLogger(__name__) # packages to exclude from freeze output ...
nhlfr/virtlet
refs/heads/master
image_skel/cleanup.py
2
#!/usr/bin/env python # Copyright 2016 Mirantis # # 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 ag...
ABaldwinHunter/django-clone-classic
refs/heads/master
tests/migrations/test_migrations/0001_initial.py
266
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ...
bliz937/kivy
refs/heads/master
kivy/uix/effectwidget.py
20
''' EffectWidget ============ .. versionadded:: 1.9.0 This code is still experimental, and its API is subject to change in a future version. The :class:`EffectWidget` is able to apply a variety of fancy graphical effects to its children. It works by rendering to a series of :class:`~kivy.graphics.Fbo` instan...
ask-compu/python-twitter
refs/heads/master
simplejson/encoder.py
138
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
Antiun/odoo
refs/heads/8.0
openerp/tests/addons/test_translation_import/__openerp__.py
352
# -*- coding: utf-8 -*- { 'name': 'test-translation-import', 'version': '0.1', 'category': 'Tests', 'description': """A module to test translation import.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['base'], 'data': ['view....
ytlei/808X-mid-proj
refs/heads/master
vendor/googletest/googletest/scripts/upload_gtest.py
1963
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
Kaik541/kernel_lge_gee
refs/heads/jb-devel
tools/perf/python/twatch.py
7370
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
ccowmu/whatistheplan.com
refs/heads/master
tests/test_routes.py
1
from django.contrib.auth.models import User from django.test import Client, TestCase from django.core.urlresolvers import reverse class RoutesTest(TestCase): def setUp(self): self.client = Client() self.logged_in_client = Client() self.user = User.objects.create_user("testuser", "test@email...
elba7r/lite-system
refs/heads/master
erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py
45
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.email import sendmail_to_system_managers from frappe.utils import get_link_to_form def execute(): wrong_records = [] for...
mammique/django
refs/heads/tp_alpha
tests/regressiontests/null_fk/tests.py
118
from __future__ import absolute_import, unicode_literals from django.db.models import Q from django.test import TestCase from .models import (SystemDetails, Item, PropertyValue, SystemInfo, Forum, Post, Comment) class NullFkTests(TestCase): def test_null_fk(self): d = SystemDetails.objects.create(...
NMGRL/pychron
refs/heads/develop
pychron/github.py
2
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
tangfeixiong/nova
refs/heads/stable/juno
nova/tests/unit/virt/test_configdrive.py
46
# Copyright 2014 IBM Corp. # # 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 agree...
carlomt/dicom_tools
refs/heads/master
dicom_tools/pyqtgraph/opengl/glInfo.py
50
from ..Qt import QtCore, QtGui, QtOpenGL from OpenGL.GL import * app = QtGui.QApplication([]) class GLTest(QtOpenGL.QGLWidget): def __init__(self): QtOpenGL.QGLWidget.__init__(self) self.makeCurrent() print("GL version:" + glGetString(GL_VERSION)) print("MAX_TEXTURE_SIZE: %d" % glGe...
vadimkantorov/wigwam
refs/heads/master
wigs/gdb.py
1
class gdb(Wig): tarball_uri = 'http://ftp.gnu.org/gnu/gdb/gdb-{RELEASE_VERSION}.tar.gz' last_release_version = '7.12' dependencies = ['texinfo']
pgmillon/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_eip.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # 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', ...
itabulous/mysql-connector-python
refs/heads/master
lib/mysql/connector/errorcode.py
14
# -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. T...
anupkdas-nus/global_synapses
refs/heads/master
pyNN-dispackgaes/nineml/synapses.py
1
""" :copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS. :license: CeCILL, see LICENSE for details. """ from utility import catalog_url class StaticSynapticConnection(object): definition_url = "%s/connectiontypes/static_connection.xml" % catalog_url
SysCompass/compass-core
refs/heads/master
compass/hdsdiscovery/hdmanager.py
2
"""Manage hdsdiscovery functionalities""" import os import re import logging from compass.hdsdiscovery import utils class HDManager: """Process a request.""" def __init__(self): base_dir = os.path.dirname(os.path.realpath(__file__)) self.vendors_dir = os.path.join(base_dir, 'vendors') ...
chanceraine/nupic
refs/heads/master
tests/integration/nupic/engine/vector_file_sensor_test.py
34
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
tapple/nsize-web
refs/heads/master
nsize/config/__init__.py
4
from __future__ import absolute_import from .local import Local # noqa from .production import Production # noqa
draugiskisprendimai/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
293
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
vignanl/Plinth
refs/heads/master
plinth/modules/radicale/forms.py
9
# # This file is part of Plinth. # # 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 program is distribute...
BenjamenMeyer/eom
refs/heads/master
eom/utils/redis_pool.py
3
# Copyright (c) 2013 Rackspace, 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 wr...
whausen/part
refs/heads/master
src/adhocracy/lib/auth/tag.py
2
from pylons import tmpl_context as c from authorization import has from adhocracy.lib.auth.authorization import NOT_LOGGED_IN def index(check): check.perm('tag.show') def show(check, t): check.perm('tag.show') def create(check): check.valid_email() check.perm('tag.create') def edit(check, t): ...
BennettRand/Solar-Circuit
refs/heads/master
solar_circuit/libs/pyModbusTCP/utils.py
2
# -*- coding: utf-8 -*- # Python module: Some functions for modbus data mangling import struct ############### # bits function ############### def get_bits_from_int(val_int, val_size=16): """Get the list of bits of val_int integer (default size is 16 bits) Return bits list, least significant bit first....
mwoodson1/youtube-8m-competition
refs/heads/master
losses.py
1
# 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 ...
liutang123/spark
refs/heads/master
python/pyspark/sql/streaming.py
7
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
tianweizhang/nova
refs/heads/v0
nova/virt/hardware.py
3
# Copyright 2014 Red Hat, 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 writing, s...
Mierdin/devstack-odl
refs/heads/master
files/pip-1.4.1/build/lib/pip/vendor/distlib/database.py
79
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import hashlib import logging import os import sys import zipimport from . import DistlibExce...
chrisdickinson/nojs
refs/heads/master
build/android/emma_coverage_stats_test.py
6
#!/usr/bin/env 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. # pylint: disable=protected-access import unittest from xml.etree import ElementTree import emma_coverage_stats from pylib.constants ...
tswast/google-cloud-python
refs/heads/master
dataproc/google/cloud/dataproc_v1/proto/jobs_pb2_grpc.py
2
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.cloud.dataproc_v1.proto import ( jobs_pb2 as google_dot_cloud_dot_dataproc__v1_dot_proto_dot_jobs__pb2, ) from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class JobControllerStub(object): ...
Ichag/odoo
refs/heads/8.0
addons/hw_scanner/__openerp__.py
93
# -*- 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...
Lujeni/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_snmp.py
22
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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 os import json import pytest import sys if sys.version_info < (2, ...
jrgdiz/cardwalker
refs/heads/master
grammar/entities/people/decl.py
1
from pyparsing import * import act your = Forward().setParseAction(act.your) its = Forward().setParseAction(act.its) their = Forward().setParseAction(act.their) his = Forward().setParseAction(act.his) singleposs = Forward().setParseAction(act.singleposs) who = Forward().setParseAction(act.who) person = Forward().se...
scalable-networks/gnuradio-3.7.0.1
refs/heads/master
gr-filter/python/filter/qa_iir_filter.py
10
#!/usr/bin/env python # # Copyright 2004,2007,2010,2013 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 ...
rghe/ansible
refs/heads/devel
lib/ansible/modules/network/fortimanager/fmgr_script.py
44
#!/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...
ridfrustum/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/bin/unique-messages.py
454
#!/usr/bin/env python import os import sys def unique_messages(): basedir = None if os.path.isdir(os.path.join('conf', 'locale')): basedir = os.path.abspath(os.path.join('conf', 'locale')) elif os.path.isdir('locale'): basedir = os.path.abspath('locale') else: print "this scri...
indictranstech/focal-erpnext
refs/heads/develop
setup/doctype/global_defaults/global_defaults.py
34
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals """Global Defaults""" import frappe import frappe.defaults from frappe.utils import cint from frappe.core.doctype.property_setter.property_setter imp...
dedupeio/dedupe
refs/heads/master
tests/duplicateCluster_memory_case.py
2
import random import dedupe.core import dedupe.dedupe # noqa: F401 # simulated_candidates = (((1, {'name': 'asdffdsa'}), (2, {'name': 'fdsaasdf'})) # for _ in xrange(10**6)) # data_model = {"fields": {"name": {"type": "String", "weight": -1.0}}, # "bias": 1.0} # threshold = 0 # dupes = dedupe.core.scoreDuplicates(...
sergei-maertens/django
refs/heads/master
tests/flatpages_tests/test_views.py
36
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(object): ...
MartinThoma/algorithms
refs/heads/master
Python/structured-logging/pure_example.py
1
import json import logging import os import sys from typing import Optional from pythonjsonlogger import jsonlogger def is_local(local_str: Optional[str]) -> bool: if local_str is None or local_str.lower() in ["n", "0", "false", "no"]: return False else: return True logger = logging.getLogg...