repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
yukoba/sympy
refs/heads/master
sympy/physics/vector/frame.py
47
from sympy import (diff, trigsimp, expand, sin, cos, solve, Symbol, sympify, eye, ImmutableMatrix as Matrix) from sympy.core.compatibility import string_types, u, range from sympy.physics.vector.vector import Vector, _check_vector __all__ = ['CoordinateSym', 'ReferenceFrame'] class CoordinateSym(S...
Endika/django-debug-toolbar
refs/heads/master
tests/panels/test_template.py
3
# coding: utf-8 from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import User from django.template import Context, RequestContext, Template from ..base import BaseTestCase from ..models import NonAsciiRepr class TemplatesPanelTestCase(BaseTestCase): def setUp(self): ...
abhilashnta/edx-platform
refs/heads/master
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
130
""" Acceptance tests for Studio related to the acid xblock. """ from bok_choy.web_app_test import WebAppTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage from ...pages.xblock.acid import AcidView from ...fixtures.course import CourseFixture, XBlockFixtureDes...
biodrone/plex-desk
refs/heads/master
desk/flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1775
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
hmoraes/dynamic-stream-server
refs/heads/master
dss/web_handlers/info.py
2
import tornado.web from bson import json_util from .. import providers options = '|'.join([ 'provider', 'stream', ]) class InfoHandler(tornado.web.RequestHandler): def get(self, opt, id=None, **kw): data = None if opt == 'provider': providers_ = providers.Providers.enabled() ...
wesyoung/pyzyre
refs/heads/master
buildutils/zmq/configure.py
1
from __future__ import with_statement, print_function import os import shutil import sys from distutils.ccompiler import get_default_compiler from distutils.ccompiler import new_compiler from distutils.extension import Extension from distutils.command.build_ext import build_ext from glob import glob from os.path imp...
GiedriusM/openthread
refs/heads/master
tools/harness-automation/cases/commissioner_9_2_1.py
16
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
vellamike/maltese_spellchecker_norvig
refs/heads/master
spellcorrect/operator_evaluators.py
1
""" The idea here is to look at the result of every operation and price it. Give a finer idea of how expensive the operation was. This is tricky in some way - is a i -> ie mapping cheaper than a h to k mapping? Where is the correct place for this? is it in the operations? My instinct is that the cost of an operation sh...
defance/edx-platform
refs/heads/master
lms/djangoapps/courseware/student_field_overrides.py
164
""" API related to providing field overrides for individual students. This is used by the individual due dates feature. """ import json from .field_overrides import FieldOverrideProvider from .models import StudentFieldOverride class IndividualStudentOverrideProvider(FieldOverrideProvider): """ A concrete i...
rahul-ramadas/BagOfTricks
refs/heads/master
RunMultipleCommands.py
1
import sublime import sublime_plugin class RunMultipleCommandsCommand(sublime_plugin.TextCommand): def run(self, edit, commands=None, command=None, times=1): if commands is None: commands = [command] if command is not None else [] for _ in range(times): for com...
connoranderson/Speechables
refs/heads/master
mechanize-0.2.5/test-tools/unittest/runner.py
22
"""Running tests""" import sys import time from unittest import result class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __getattr__(self, attr): if attr in ('stream', '__getstate__...
vigneras/sequencer
refs/heads/master
tests/test_smartdisplay.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) Bull S.A.S (2010, 2011) # Contributor: Pierre Vignéras <pierre.vigneras@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of th...
broderboy/ai-stager
refs/heads/master
stager/django_evolution/tests/db/sqlite3.py
3
add_field = { 'AddNonNullNonCallableColumnModel': '\n'.join([ 'CREATE TEMPORARY TABLE "TEMP_TABLE"("int_field" integer NOT NULL, "id" integer NOT NULL UNIQUE PRIMARY KEY, "char_field" varchar(20) NOT NULL, "added_field" integer NOT NULL);', 'INSERT INTO "TEMP_TABLE" SELECT "int_field...
ashhher3/ibis
refs/heads/master
ibis/config.py
16
# This file has been adapted from pandas/core/config.py. pandas 3-clause BSD # license. See LICENSES/pandas # # Further modifications: # # Copyright 2014 Cloudera 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 ...
iamaziz/simpleai
refs/heads/master
simpleai/search/__init__.py
5
# coding: utf-8 from simpleai.search.models import CspProblem, SearchProblem from simpleai.search.traditional import breadth_first, depth_first, limited_depth_first, iterative_limited_depth_first, uniform_cost, greedy, astar from simpleai.search.local import ( beam, hill_climbing, hill_climbing_stochastic, simulate...
jeffbinder/adamsmith
refs/heads/master
correlate-index.py
1
# Matches up 1784 index to the topic model by using Spearman's rank # coefficient to find best matches for each topic. import numpy import os import pickle import scipy.stats import time index = pickle.load(open('index.pkl')) def match(): f = open('doc_topics.txt', 'r') f.readline() topic_coefs = {} ...
lastmansleeping/hindi-toolkit
refs/heads/master
hindi_toolkit/ner/create_train.py
1
# coding: utf-8 import codecs import json input_file = codecs.open('../data/ner/train', 'r', 'utf-8') sentences = [] sentence = [] for line in input_file: if line == '\n': sentences.append(sentence) sentence = [] else: row = line.split('\t') word = [] for entry in ro...
ehsan/js-symbolic-executor
refs/heads/master
cvc3/java/run_all.py
5
#! /usr/bin/env python import os libs = [ "AUFLIA", "AUFLIRA", "AUFNIRA", "QF_AUFBV", "QF_AUFLIA", "QF_IDL", "QF_LIA", "QF_LRA", "QF_RDL", "QF_UF", "QF_UFBV32", "QF_UFIDL", "QF_UFLIA", ] for lib in libs: command = "./run_tests.py -vc 'java -esa -Xss100M -jar l...
JetBrains/intellij-community
refs/heads/master
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/__init__.py
2547
# Dummy file to make this directory a package.
hehongliang/tensorflow
refs/heads/master
tensorflow/python/data/experimental/kernel_tests/optimization/map_and_batch_fusion_test.py
2
# 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...
fermat618/pida
refs/heads/master
pida/services/filemanager/filehiddencheck.py
1
# -*- coding: utf-8 -*- """ :copyright: 2005-2008 by The PIDA Project :license: GPL 2 or later (see README/COPYING/LICENSE) """ SCOPE_PROJECT = 0 SCOPE_GLOBAL = 1 def fhc(scope, label): def decorate(fn): fn.scope = scope fn.label = label fn.identifier = fn.__name__ return ...
easycoin-core/Easycoin
refs/heads/master
qa/rpc-tests/rawtransactions.py
17
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly)...
ImageEngine/gaffer
refs/heads/master
python/GafferUITest/SliderTest.py
1
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
jameslegg/boto
refs/heads/develop
boto/ec2/attributes.py
182
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 the Software without restriction, including # without limitation the rights ...
worldforge/cyphesis
refs/heads/master
tools/scripts/generator/cpp/stub_class.py
2
#!/usr/bin/env python # # Copyright 2008 Google Inc. All Rights Reserved. # Copyright 2017 Erik Ogenvik # # 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/license...
zouyapeng/horizon-newtouch
refs/heads/master
openstack_dashboard/dashboards/project/data_processing/jobs/urls.py
34
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
msebire/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/CsvRegisterDialect/_csv.py
21
def register_dialect(name, dialect): pass class Dialect(object): pass
AnthonyQuach/cs3240-labdemo
refs/heads/master
helper.py
40
def greeting(msg): print(msg)
srjoglekar246/sympy
refs/heads/master
sympy/physics/matrices.py
2
"""Known matrices related to physics""" from sympy import Matrix, I def msigma(i): """Returns a Pauli matrix sigma_i. i=1,2,3 See Also ======== http://en.wikipedia.org/wiki/Pauli_matrices Examples ======== >>> from sympy.physics.matrices import msigma >>> msigma(1) [0, 1] [...
ltilve/chromium
refs/heads/igalia-sidebar
tools/telemetry/PRESUBMIT.py
15
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys PYLINT_BLACKLIST = [] PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101'] def _CommonChecks(input_api, output_api): results = [] ...
texcaltech/windmilltownhomes-old
refs/heads/master
django/db/models/fields/__init__.py
5
import datetime import decimal import re import time import math from itertools import tee import django.utils.copycompat as copy from django.db import connection from django.db.models.fields.subclassing import LegacyConnection from django.db.models.query_utils import QueryWrapper from django.conf import settings fro...
Kromey/piroute
refs/heads/master
iptables/views.py
1
from django.shortcuts import render from django.template.loader import render_to_string from django.forms import formset_factory from . import forms, utils # Create your views here. def index(request): rules = None if request.method == 'POST': ifaces = forms.InterfacesForm(request.POST) rul...
arun6582/django-manage-reset-migrations
refs/heads/master
reinit_migrations/apps.py
2
from __future__ import unicode_literals from django.apps import AppConfig class ReInitMigrationsConfig(AppConfig): name = 'reinit_migrations'
epzt/GiSedTrend
refs/heads/master
ui_pygisedtrend_text_file_analysis.py
1
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_pygisedtrend_text_file_analysis.ui' # # Created: Mon Aug 10 11:31:03 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QSt...
begoldsm/autorest
refs/heads/master
src/generator/AutoRest.Python.Tests/AcceptanceTests/custom_base_uri_tests.py
9
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
kennedyshead/home-assistant
refs/heads/dev
tests/components/cloud/test_tts.py
8
"""Tests for cloud tts.""" from unittest.mock import Mock from hass_nabucasa import voice import pytest import voluptuous as vol from homeassistant.components.cloud import const, tts @pytest.fixture() def cloud_with_prefs(cloud_prefs): """Return a cloud mock with prefs.""" return Mock(client=Mock(prefs=clou...
rnzaws/test-ci-codepipeline-elastic-beanstalk
refs/heads/master
processor/processor/urls.py
1
"""processor URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
windedge/odoo
refs/heads/8.0
addons/base_geolocalize/__init__.py
389
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
waheedahmed/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/tests/test_utils.py
3
# -*- coding: utf-8 -*- import datetime import json import ddt 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 dja...
mamachanko/lymph
refs/heads/master
lymph/core/channels.py
8
import gevent import gevent.queue from lymph.exceptions import Timeout, Nack, RemoteError from lymph.core.messages import Message class Channel(object): def __init__(self, request, server): self.request = request self.server = server class RequestChannel(Channel): def __init__(self, request...
mbayon/TFG-MachineLearning
refs/heads/master
venv/lib/python3.6/site-packages/django/forms/boundfield.py
28
from __future__ import unicode_literals import datetime import warnings from django.forms.utils import flatatt, pretty_name from django.forms.widgets import Textarea, TextInput from django.utils import six from django.utils.deprecation import RemovedInDjango21Warning from django.utils.encoding import force_text, pyth...
airfer/Gtest1.7
refs/heads/master
test/gtest_help_test.py
2968
#!/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...
xunilrj/sandbox
refs/heads/master
courses/MITx/MITx 6.86x Machine Learning with Python-From Linear Models to Deep Learning/project3/mnist/part2-mnist/utils.py
5
import pickle, gzip, numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import math def plot_images(X): if X.ndim == 1: X = np.array([X]) num_images = X.shape[0] num_rows = math.floor(math.sqrt(num_images)) num_cols = math.ceil(num_images/num_rows) for i in range(num_im...
sanghinitin/golismero
refs/heads/master
tools/sqlmap/waf/fortiweb.py
8
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.enums import HTTP_HEADER from lib.core.settings import WAF_ATTACK_VECTORS __product__ = "FortiWeb Web Application Firewall (Fortinet Inc.)" def dete...
namccart/gnuradio
refs/heads/master
gr-blocks/python/blocks/__init__.py
47
# # Copyright 2012 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. # #...
jrxFive/python-nomad
refs/heads/master
nomad/api/jobs.py
1
import nomad.api.exceptions from nomad.api.base import Requester class Jobs(Requester): """ The jobs endpoint is used to query the status of existing jobs in Nomad and to register new jobs. By default, the agent's local region is used. https://www.nomadproject.io/docs/http/jobs.html """ ...
skristiansson/eco32-linux
refs/heads/master
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
ido-ran/ran-smart-frame2
refs/heads/master
web/server/lib/oauth2client/_pure_python_crypt.py
59
# 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 ...
anilmuthineni/tensorflow
refs/heads/master
tensorflow/python/client/device_lib_test.py
7
# 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...
sudheesh001/pontoon
refs/heads/master
pontoon/base/__init__.py
3
"""Application base, containing global templates.""" default_app_config = 'pontoon.base.apps.BaseConfig' MOZILLA_REPOS = ( 'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/',...
brandsExclusive/msnp
refs/heads/master
msnp/error.py
3
# error.py -- Error class(es) # # Copyright (C) 2003 Manish Jethani (manish_jethani AT yahoo.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (...
soldag/home-assistant
refs/heads/dev
homeassistant/components/smart_meter_texas/config_flow.py
10
"""Config flow for Smart Meter Texas integration.""" import asyncio import logging from aiohttp import ClientError from smart_meter_texas import Account, Client from smart_meter_texas.exceptions import ( SmartMeterTexasAPIError, SmartMeterTexasAuthError, ) import voluptuous as vol from homeassistant import co...
mixmar91/rabbitmq
refs/heads/master
python/rpc_client.py
17
#!/usr/bin/env python import pika import uuid class FibonacciRpcClient(object): def __init__(self): self.connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) self.channel = self.connection.channel() result = self.channel.queue_declare(exclusiv...
OpenXT/sync-database
refs/heads/master
sync_db_test/test_admin_repo.py
1
# # Copyright (c) 2012 Citrix Systems, Inc. # # 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 dist...
bonitadecker77/python-for-android
refs/heads/master
python-modules/twisted/twisted/test/reflect_helper_ZDE.py
101
# Helper module for a test_reflect test 1/0
srluge/SickRage
refs/heads/master
lib/html5lib/treewalkers/dom.py
1229
from __future__ import absolute_import, division, unicode_literals from xml.dom import Node import gettext _ = gettext.gettext from . import _base class TreeWalker(_base.NonRecursiveTreeWalker): def getNodeDetails(self, node): if node.nodeType == Node.DOCUMENT_TYPE_NODE: return _base.DOCTYP...
duanwujie/depot_tools
refs/heads/master
third_party/protobuf26/descriptor_pb2.py
26
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/descriptor.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from protobuf26 import descriptor as _descriptor from protobuf26 import message as _message from protobuf26 import reflection as _r...
paulondc/gaffer
refs/heads/master
python/GafferSceneTest/PathMatcherTest.py
1
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam
refs/heads/master
unittests/Applications/CaseBuilder.py
3
import unittest from PyFoam.Applications.CaseBuilder import CaseBuilder theSuite=unittest.TestSuite()
ArneBab/pypyjs
refs/heads/master
website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_functools.py
4
import functools import sys import unittest from test import test_support from weakref import proxy import pickle @staticmethod def PythonPartial(func, *args, **keywords): 'Pure Python approximation of partial()' def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.update...
dalegregory/odoo
refs/heads/8.0
addons/project/res_partner.py
334
# -*- 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...
markoshorro/gem5
refs/heads/master
src/arch/mips/MipsTLB.py
69
# -*- mode:python -*- # Copyright (c) 2007 MIPS Technologies, 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 ...
HyperBaton/ansible
refs/heads/devel
lib/ansible/modules/network/panos/_panos_check.py
41
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
patrick1981/LibraryTools
refs/heads/master
Sushi_Project/resourceList.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- resources = { # sage 'VISN': { 'ajr': { 'host': 'https://www.ajronline.org/', 'api_key': '', 'requestor_id': 'LS730876', 'customer_id': '728125', }, "highwirePress":{ 'host':'https://hwdpapi.highwire.org/sushi/', ...
MiLk/youtube-dl
refs/heads/master
youtube_dl/extractor/cspan.py
12
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, unescapeHTML, find_xpath_attr, ) class CSpanIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?c-span\.org/video/\?(?P<id>[0-9a-f]+)' IE_DESC = 'C-SPAN' _TESTS = [{ ...
ikaee/bfr-attendant
refs/heads/master
facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/crf/python/kernel_tests/crf_test.py
57
# 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...
arcticshores/kivy
refs/heads/master
examples/widgets/asyncimage.py
38
''' Asynchronous image loading ========================== Test of the widget AsyncImage. We are just putting it in a CenteredAsyncImage for beeing able to center the image on screen without doing upscale like the original AsyncImage. ''' from kivy.app import App from kivy.uix.image import AsyncImage from kivy.lang im...
sabi0/intellij-community
refs/heads/master
python/testData/codeInsight/classMRO/MetaClassDeclaredThroughAncestor.py
20
class Meta(type): pass class Base(metaclass=Meta): pass class MyClass(Base): pass
djkskqyr3/CSipSimple
refs/heads/master
jni/pjsip/sources/pjsip-apps/build/get-footprint.py
59
# $Id: get-footprint.py 1352 2007-06-08 01:41:25Z bennylp $ # # This file is used to generate PJSIP/PJMEDIA footprint report. # To use this file, just run it in pjsip-apps/build directory, to # produce footprint.txt and footprint.htm report files. # import os import sys import string import time compile_flags1 = [ ...
xHeliotrope/injustice_dropper
refs/heads/master
env/lib/python3.4/site-packages/pip/_vendor/cachecontrol/wrapper.py
953
from .adapter import CacheControlAdapter from .cache import DictCache def CacheControl(sess, cache=None, cache_etags=True, serializer=None, heuristic=None): cache = cache or DictCache() adapter = CacheControlAdapter( cache, c...
karllessard/tensorflow
refs/heads/master
tensorflow/python/ops/list_ops.py
1
# 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...
hperreault/ProjectEuler
refs/heads/master
Problems.py
1
import os import re # A class representing the list of all the problems # Used for unit testing the problems and their answers class Problems: @staticmethod def get_problems(): files = [f for f in os.listdir('.') if os.path.isfile(f)] problems = [] for f in files: if re.ma...
liorvh/infernal-twin
refs/heads/master
build/pip/pip/_vendor/cachecontrol/caches/file_cache.py
762
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
GaloisInc/hacrypto
refs/heads/master
src/C/john-1.8.0-jumbo-1/run/7z2john.py
2
#!/usr/bin/python -u # # Copyright (c) 2013 by Dhiru Kholia, <dhiru (at) openwall.com> # # Python Bindings for LZMA # # Copyright (c) 2004-2010 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can re...
maxamillion/ansible-modules-extras
refs/heads/devel
cloud/amazon/sns_topic.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # # This is a 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. # # This Ansible library is distri...
etzhou/edx-platform
refs/heads/master
common/djangoapps/django_locale/__init__.py
81
""" TODO: This module is imported from the stable Django 1.8 branch, as a copy of https://github.com/django/django/blob/stable/1.8.x/django/middleware/locale.py. Remove this file and re-import this middleware from Django once the codebase is upgraded with a modern version of Django. [PLAT-671] """
GunoH/intellij-community
refs/heads/master
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalSimpleAssignmentTargetWithExistingComment_after.py
19
def func(): var = 'foo' # type: [str] # comment var
qedi-r/home-assistant
refs/heads/dev
homeassistant/components/device_tracker/__init__.py
2
"""Provide functionality to keep track of devices.""" import asyncio import voluptuous as vol from homeassistant.loader import bind_hass from homeassistant.components import group from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv from homeassistant.helpers.typing import ...
robinro/ansible-modules-extras
refs/heads/devel
commands/expect.py
18
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Martz <matt@sivel.net> # # 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, ...
jkeifer/pyHytemporal
refs/heads/master
old_TO_MIGRATE/test4.py
1
__author__ = 'phoetrymaster' import os os.system("gdal_translate -ot Float32 -of GTiff -scale ")
xuemy/btbbs
refs/heads/master
btbbs/urls.py
1
"""btbbs URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
markflyhigh/incubator-beam
refs/heads/master
sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio_test.py
1
# # 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...
yuanagain/seniorthesis
refs/heads/master
venv/lib/python2.7/site-packages/scipy/weave/blitz_tools.py
97
from __future__ import absolute_import, print_function import parser import sys import warnings import copy import numpy from . import ast_tools from . import slice_handler from . import size_check from . import converters from . import inline_tools from .inline_tools import attempt_function_call function_catalog = ...
timj/scons
refs/heads/master
src/engine/SCons/Tool/docbook/__init__.py
1
"""SCons.Tool.docbook Tool-specific initialization for Docbook. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # ...
dhruvsrivastava/OJ
refs/heads/master
flask/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py
50
# engine/interfaces.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Define core interfaces used by the engine system.""" from .. import util, e...
archhurd/archweb
refs/heads/master
main/migrations/0027_auto__chg_field_package_compressed_size__chg_field_package_installed_s.py
5
# encoding: 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): # Changing field 'Package.compressed_size' db.alter_column('packages', 'compressed_size', self.gf('django.db.models...
mdaniel/intellij-community
refs/heads/master
python/testData/resolveTest/test.py
30
from unittest import TestCase TestCase().assertIsNotNo<caret>
incaser/server-tools
refs/heads/8.0
base_external_dbsource/base_external_dbsource.py
7
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis # 2011 # # 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 Foundati...
vitan/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/str/models.py
54
# -*- coding: utf-8 -*- """ 2. Adding __str__() or __unicode__() to models Although it's not a strict requirement, each model should have a ``_str__()`` or ``__unicode__()`` method to return a "human-readable" representation of the object. Do this not only for your own sanity when dealing with the interactive prompt, ...
Robpol86/PythonTemplate
refs/heads/master
tests/test_main.py
1
"""Example test.""" from replace_me import main def test(capsys): """Example test.""" main() stdout, stderr = capsys.readouterr() assert 'Hello World!\n' == stdout assert not stderr
drawks/ansible
refs/heads/devel
contrib/inventory/spacewalk.py
28
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
google-code-export/rietveld
refs/heads/master
main.py
23
# Copyright 2008 Google 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, ...
walteryang47/ovirt-engine
refs/heads/eayunos-4.2
packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-common/config/__init__.py
8
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 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 # # Unl...
colaftc/webtool
refs/heads/master
top/api/rest/WlbTmsorderQueryRequest.py
1
''' Created by auto_sdk on 2014.11.04 ''' from top.api.base import RestApi class WlbTmsorderQueryRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.order_code = None self.page_no = None self.page_size = None def getapiname(self): re...
AnderEnder/ansible-modules-extras
refs/heads/devel
cloud/cloudstack/cs_portforward.py
22
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
dysonltd/gts
refs/heads/develop
app/lib/gtest-1.6.0/test/gtest_catch_exceptions_test.py
414
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
lmprice/ansible
refs/heads/devel
lib/ansible/plugins/lookup/random_choice.py
157
# (c) 2013, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 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 DOCUMENTATION = """ lookup: random_choice author:...
ceph/teuthology
refs/heads/master
teuthology/provision/cloud/base.py
3
import logging from copy import deepcopy from libcloud.compute.providers import get_driver from libcloud.compute.types import Provider as lc_Provider import teuthology.orchestra.remote import teuthology.provision.cloud from teuthology.misc import canonicalize_hostname, decanonicalize_hostname log = logging.getLogger...
Serag8/Bachelor
refs/heads/master
google_appengine/google/storage/speckle/python/django/management/commands/__init__.py
1333
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
gojira/tensorflow
refs/heads/master
tensorflow/python/estimator/exporter_test.py
13
# 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...