repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
TeamWin/kernel_samsung_lt02ltetmo
refs/heads/android-4.4
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...
chongtianfeiyu/kbengine
refs/heads/master
kbe/src/lib/python/Doc/includes/sqlite3/text_factory.py
51
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() AUSTRIA = "\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUSTRIA # but we can make sqlite3 always return bytestrings ... con.text_factory = bytes cur.execute("sel...
Workday/OpenFrame
refs/heads/master
third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
1
# -*- coding: utf-8; -*- # # Copyright (C) 2011 Google Inc. All rights reserved. # Copyright (C) 2009 Torch Mobile Inc. # Copyright (C) 2009 Apple Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, a...
licco/zipline
refs/heads/master
tests/test_execution_styles.py
3
# # Copyright 2014 Quantopian, 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...
shakamunyi/neutron-vrrp
refs/heads/master
neutron/tests/unit/ml2/drivers/arista/test_arista_l3_driver.py
3
# Copyright (c) 2013 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
sjperkins/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/scatter_nd_ops_test.py
48
# Copyright 2017 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...
nikoonia/gem5v
refs/heads/master
src/arch/x86/isa/insts/x87/control/save_and_restore_x87_environment.py
26
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
fxtentacle/Cura
refs/heads/master
cura/PrintInformation.py
4
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, QDateTime, QTimer, pyqtSignal, pyqtSlot, pyqtProperty from UM.Application import Application from UM.Settings.MachineSettings import MachineSettings from UM.Resources import Resources from...
dnjohnstone/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/__init__.py
4
# -*- coding: utf-8 -*- # Copyright 2007-2020 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...
ryfeus/lambda-packs
refs/heads/master
Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
63
# 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...
AirtrafficAnalysisGroup/graph_tools_networkx
refs/heads/master
readdbexample.py
1
import sqlite3 import sys import scipy import numpy as np import scipy.stats database_path='database/' if len(sys.argv) == 2: database_path += sys.argv[1] else: database_path += 'bfdatabase.db' # recovery from great recession? # so for like all the markets (i.e. all market ids) # get the sum(in_ and out_degree pe...
estaban/pyload
refs/heads/stable
module/plugins/hoster/EasybytezCom.py
1
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in...
h-hirokawa/ansible
refs/heads/devel
lib/ansible/constants.py
2
# (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...
chromium/chromium
refs/heads/master
remoting/host/installer/linux/build_deb.py
5
# 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. """A simple python wrapper so GN can run build-deb.sh.""" import os import subprocess import sys def main(): this_dir = os.path.dirname(os.path.abspath(_...
LeetCoinTeam/lc_api_examples
refs/heads/master
python_appengine/jinja2/__init__.py
107
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
codexns/sublime-coverage
refs/heads/master
st2_linux_x32/coverage/version.py
10
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. version_info = (4, 0, 0,...
mmuellner/vigra
refs/heads/master
vigranumpy/test/test2.py
13
####################################################################### # # Copyright 2009-2010 by Ullrich Koethe # # This file is part of the VIGRA computer vision library. # The VIGRA Website is # http://hci.iwr.uni-heidelberg.de/vigra/ # Please direct questions, bug reports, and contributions...
xingwu1/autorest
refs/heads/master
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/models/date_wrapper.py
8
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
nico01f/nifo.github.io
refs/heads/master
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/scanner.py
365
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
2014c2g9/c2g9
refs/heads/master
exts/w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/minidom.py
727
"""Simple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("<foo><bar/></foo>") Todo: ===== * convenience methods for getting elements and text. * more testing * bring some of the writer and linearizer code into conformance with this ...
mkoistinen/aldryn-faq
refs/heads/master
aldryn_faq/forms.py
1
from django import forms from hvad.forms import TranslatableModelForm from sortedm2m.forms import SortedMultipleChoiceField from .models import Category, QuestionListPlugin, Question class CategoryAdminForm(TranslatableModelForm): class Meta: model = Category def clean_slug(self): slug = ...
wwj718/edx-platform
refs/heads/master
common/djangoapps/embargo/messages.py
148
"""Define messages for restricted courses. These messages are displayed to users when they are blocked from either enrolling in or accessing a course. """ from collections import namedtuple BlockedMessage = namedtuple('BlockedMessage', [ # A user-facing description of the message 'description', # The m...
termie/pupa
refs/heads/master
nova/rpc.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
google/neural-light-transport
refs/heads/master
third_party/robust_loss/fit_partition_spline_test.py
1
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
RafaelTorrealba/odoo
refs/heads/8.0
addons/account/report/common_report_header.py
386
# -*- 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...
vmax-feihu/hue
refs/heads/master
desktop/core/src/desktop/lib/json_utils.py
35
#!/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...
pbrod/scipy
refs/heads/master
benchmarks/benchmarks/integrate.py
10
from __future__ import division, absolute_import, print_function import numpy as np from .common import Benchmark from scipy.integrate import quad try: import ctypes import scipy.integrate._test_multivariate as clib_test from scipy._lib import _test_ccallback_cython except ImportError: _test_ccallbac...
SungEun-Steve-Kim/test-mp
refs/heads/master
tests/basics/bytearray1.py
22
print(bytearray(4)) a = bytearray([1, 2, 200]) print(type(a)) print(a[0], a[2]) print(a[-1]) print(a) a[2] = 255 print(a[-1]) a.append(10) print(len(a)) s = 0 for i in a: s += i print(s) print(a[1:]) print(a[:-1]) print(a[2:3]) print(str(bytearray(b"123"), "utf-8")) # Comparisons print(bytearray([1]) == bytearr...
ToonTownInfiniteRepo/ToontownInfinite
refs/heads/master
toontown/catalog/CatalogSurfaceItem.py
2
import CatalogItem import CatalogAtticItem from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from CatalogSurfaceColors import * STWallpaper = 0 STMoulding = 1 STFlooring = 2 STWainscoting = 3 NUM_ST_TYPES = 4 class CatalogSurfaceItem(CatalogAtticItem.CatalogAtticItem): def ma...
nfallen/servo
refs/heads/master
tests/wpt/harness/wptrunner/manifestexpected.py
91
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import os import urlparse from wptmanifest.backends import static from wptmanifest.backends.static import ManifestItem ...
RudyReeves/ud858-master
refs/heads/master
Lesson_2/001_Hello_Endpoints_Solutions/helloworld_api.py
48
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
cc272309126/panda3d
refs/heads/master
direct/src/showbase/MessengerLeakDetector.py
12
from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.DirectObject import DirectObject from direct.showbase.Job import Job import gc, __builtin__ class MessengerLeakObject(DirectObject): def __init__(self): self.accept('leakEvent', self._handleEvent) def _handleEvent(self...
joshuajan/odoo
refs/heads/master
addons/product_email_template/models/product.py
379
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class product_template(osv.Model): """ Product Template inheritance to add an optional email.template to a product.template. When validating an invoice, an email will be send to the customer based on this template. The customer will receive an e...
nnethercote/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/webencodings/webencodings/x_user_defined.py
171
# coding: utf-8 """ webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs ### Codec APIs class Code...
piskvorky/gensim
refs/heads/develop
docs/src/auto_examples/core/run_similarity_queries.py
8
r""" Similarity Queries ================== Demonstrates querying a corpus for similar documents. """ import logging logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) ############################################################################### # # Creating the Corpus # ---...
davidandreoletti/loggingapi-core-lib
refs/heads/master
scripts/google-cpp-style-guide/cpplint.py
3
#!/usr/bin/python2.4 # # Copyright (c) 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 ...
tinacg/tinacg.github.io
refs/heads/master
taggednotes/process.py
1
import sys if len(sys.argv) != 2: print("Usage: python process.py languagenotes") else: language = sys.argv[1].replace(".", "") with open(language + ".js", 'w') as output: print("var notes = {", file=output) with open(language + ".txt") as input: id = 0 whil...
youssef-poisson/angular
refs/heads/master
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
# Copyright 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
aYukiSekiguchi/ACCESS-Chromium
refs/heads/master
third_party/mesa/MesaLib/src/mapi/glapi/gen/license.py
58
# (C) Copyright IBM Corporation 2004 # 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 # on the rights to use, copy, m...
utecuy/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/annotatable_module.py
107
import logging from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.fields import Scope, String import textwrap log = logging.getLogger(__name__) # Make '_' a no-op so we can scrape strings _ = lambda text: tex...
hurricup/intellij-community
refs/heads/master
python/testData/optimizeImports/alphabeticalOrder.py
92
from __future__ import unicode_literals from __future__ import absolute_import import z import b import a from a import C1 from alphabet import D from alphabet import A from b import func from import foo # broken import sys from . import m1 from datetime import timedelta import # broken from alphabet import * from .. ...
SlimRemix/android_external_chromium_org
refs/heads/lp5.1
chrome/common/extensions/docs/server2/compiled_file_system_test.py
79
#!/usr/bin/env python # Copyright 2013 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 functools import os from compiled_file_system import Cache, CompiledFileSystem from copy import deepcopy from environment impor...
ethers/pyethereum
refs/heads/master
pyethereum/peer.py
1
import time import Queue import socket import logging import signals from stoppable import StoppableLoopThread from packeter import packeter from utils import big_endian_to_int as idec from utils import recursive_int_to_big_endian import rlp import blocks MAX_GET_CHAIN_ACCEPT_HASHES = 2048 # Maximum number of send h...
fentas/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/__init__.py
143
# Required for Python to search this directory for module files from handlers.updatebase import UpdateBase
eaobservatory/hedwig
refs/heads/master
lib/hedwig/db/part/review.py
1
# Copyright (C) 2015-2020 East Asian Observatory # All Rights Reserved. # # 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...
vismartltd/edx-platform
refs/heads/master
common/test/acceptance/pages/studio/library.py
28
""" Library edit page in Studio """ from bok_choy.javascript import js_defined, wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver.support.select import Select from .component_editor import ComponentEditorView from .container import XBlockWrapper fr...
bovee/Aston
refs/heads/master
aston/tracefile/mime.py
1
import binascii from glob import glob import inspect from importlib import import_module import mimetypes import os import os.path as op from aston.cache import cache # File types from http://en.wikipedia.org/wiki/Mass_spectrometry_data_format # and http://www.amdis.net/What_is_AMDIS/AMDIS_Detailed/amdis_detailed.ht...
Panaetius/woipv
refs/heads/master
src/models/test_leak.py
1
import argparse import psutil from os import getpid import tensorflow as tf import numpy as np def create_model(input_size, output_size): # model placeholders: shape = tf.clip_by_value(tf.cast(tf.random_normal([2]) * 38.0 + 64.0, tf.int32), 38, 120) shape = tf.concat([[1], shape, [512]], axis=0) retu...
nilsonmorales/Puppyes-nightrc
refs/heads/master
usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/__init__.py
1
from .appletrailers import AppleTrailersIE from .addanime import AddAnimeIE from .anitube import AnitubeIE from .archiveorg import ArchiveOrgIE from .ard import ARDIE from .arte import ( ArteTvIE, ArteTVPlus7IE, ArteTVCreativeIE, ArteTVFutureIE, ) from .auengine import AUEngineIE from .bambuser import B...
atosatto/ansible
refs/heads/devel
lib/ansible/module_utils/network_common.py
60
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
jun-wan/scilifelab
refs/heads/master
tests/data.py
4
data_files = {} data_files['RunInfo.xml'] = """<?xml version="1.0"?> <RunInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2"> <Run Id="120924_SN0002_0003_CC003CCCXX" Number="1"> <Flowcell>CC003CCCXX</Flowcell> <Instrument>SN0002</Instrument> ...
disruptek/boto
refs/heads/develop
boto/vpc/internetgateway.py
170
# Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
rockmans/KyleAndEmily
refs/heads/master
kyleandemily/rsvp/management/commands/total_guests.py
1
from django.core.management.base import BaseCommand, CommandError from kyleandemily.rsvp.models import Invitation class Command(BaseCommand): help = 'Prints the guest totals' def handle(self, *args, **options): welcome_guests = 0 wedding_guests = 0 farewell_guests = 0 for inv i...
pchaigno/grr
refs/heads/master
lib/flows/general/memory.py
1
#!/usr/bin/env python """Flows for controlling access to memory. These flows allow for distributing memory access modules to clients and performing basic analysis. """ import json import logging from grr.lib import aff4 from grr.lib import config_lib from grr.lib import flow from grr.lib import rekall_profile_ser...
graphite-project/graphite-web
refs/heads/master
webapp/tests/test_storage.py
5
import os import random import shutil import time import whisper from django.conf import settings from django.test import override_settings from mock import patch, Mock from .base import TestCase from graphite.finders.utils import BaseFinder from graphite.intervals import Interval, IntervalSet from graphite.node imp...
jasonseminara/OpenSourceFinal
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
679
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
open-power/eCMD
refs/heads/master
mkscripts/makeext.py
1
#!/usr/bin/env python3 import os import sys import errno # A script to create the files generated by the configured extensions # Configured extensions come from the EXTENSIONS environment variable # Create the ecmdExtInterpreter.C # This is a combo of generated code from this script and code snippets # stored with t...
ZuluPro/django-dbbackup
refs/heads/master
dbbackup/db/sqlite.py
2
from __future__ import unicode_literals import warnings from tempfile import SpooledTemporaryFile from shutil import copyfileobj from django.db import IntegrityError, OperationalError from django.utils.six import BytesIO from .base import BaseDBConnector DUMP_TABLES = """ SELECT "name", "type", "sql" FROM "sqlite_mas...
mmalyska/eve-wspace
refs/heads/develop
evewspace/staticdata_introspect.py
27
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # Feel free to rename the models, but don't rename db_table values or field names. # # Also note: You'll have to ...
st4lk/babel
refs/heads/master
babel/numbers.py
2
# -*- coding: utf-8 -*- """ babel.numbers ~~~~~~~~~~~~~ Locale dependent formatting and parsing of numeric data. The default locale for the functions in this module is determined by the following environment variables, in that order: * ``LC_NUMERIC``, * ``LC_ALL``, and * ``LANG`` ...
cobalys/django
refs/heads/master
django/contrib/gis/geometry/backend/__init__.py
128
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend') except ImportError: tr...
obsh/tornado
refs/heads/master
tornado/test/websocket_test.py
1
from __future__ import absolute_import, division, print_function, with_statement import traceback from tornado.concurrent import Future from tornado import gen from tornado.httpclient import HTTPError, HTTPRequest from tornado.log import gen_log, app_log from tornado.testing import AsyncHTTPTestCase, gen_test, bind_u...
speed-of-light/pyslider
refs/heads/master
lib/exp/tools/slider.py
1
import cv2 from ..summary import Summary from pdf_reader import PdfReader class Slider(PdfReader): """ A helper to get slide information """ def __init__(self, root="", name=""): PdfReader.__init__(self, root, name) def __blank_slide(self, gray=False): sp = self.slides_path() ...
haeusser/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/random_ops_test.py
39
# Copyright 2015 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...
openhdf/enigma2-wetek
refs/heads/master
lib/python/Components/Converter/ServiceOrbitalPosition.py
102
# -*- coding: utf-8 -*- from Components.Converter.Converter import Converter from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceCenter from ServiceReference import resolveAlternate from Components.Element import cached class ServiceOrbitalPosition(Converter, object): FULL = 0 SHO...
stephenpascoe/esgf-pyclient
refs/heads/master
test/test_opendap.py
2
""" test for secure opendap support """ import tempfile import os import os.path as op import shutil from unittest import TestCase import re from pyesgf.logon import LogonManager, DAP_CONFIG_MARKER from pyesgf.search import SearchConnection from test.config import TEST_SERVICE class TestOpendap(TestCase): def s...
halwai/cnn-rnn-siamese-video-similarity
refs/heads/master
finetune.py
1
#! /usr/bin/env python import tensorflow as tf import numpy as np import re import os import time import datetime import gc from helper import InputHelper, save_plot, compute_distance from siamese_network import SiameseLSTM import gzip from random import random from amos import Conv # Parameters # ===================...
arseny-tsyro/python_training
refs/heads/master
fixture/application.py
1
__author__ = 'Arseniy' from selenium import webdriver from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.contact import ContactHelper class Application: def __init__(self, browser, base_url): if browser == 'firefox': self.wd = webdriver.Firefox() ...
timblakely/bigbrain
refs/heads/master
bigbrain/bigbrain/oauth2/httplib2/socks.py
91
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 ...
mats116/ElasticBigQuery
refs/heads/master
dmp/external/pyasn1/compat/octets.py
96
from sys import version_info if version_info[0] <= 2: int2oct = chr ints2octs = lambda s: ''.join([ int2oct(x) for x in s ]) null = '' oct2int = ord octs2ints = lambda s: [ oct2int(x) for x in s ] str2octs = lambda x: x octs2str = lambda x: x isOctetsType = lambda s: isinstance(s, str) ...
bugfree-software/the-internet-solution-python
refs/heads/master
tests/test_windows.py
1
from . import TheInternetTestCase from helium.api import find_all, Window, click, Text, switch_to class WindowsTest(TheInternetTestCase): def get_page(self): return "http://the-internet.herokuapp.com/windows" def test_open_new_window(self): windows = find_all(Window()) self.assertEqual(len(windows), 1) self....
wemanuel/smry
refs/heads/master
Crypto/SelfTest/Hash/test_SHA512.py
116
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_SHA512.py: Self-test for the SHA-512 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that...
jkugler/ansible
refs/heads/devel
lib/ansible/plugins/lookup/etcd.py
151
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
karec/oct
refs/heads/master
tests/test_report.py
2
import os import unittest from oct.results.report import ReportResults from oct.results.models import set_database, db BASE_DIR = os.path.dirname(os.path.realpath(__file__)) class ReportTest(unittest.TestCase): def test_empty_results(self): """Test report with empty results """ set_data...
mchristopher/PokemonGo-DesktopMap
refs/heads/master
app/pywin/Lib/lib2to3/fixes/fix_apply.py
315
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for apply(). This converts apply(func, v, k) into (func)(*v, **k).""" # Local imports from .. import pytree from ..pgen2 import token from .. import fixer_base from ..fixer_util import Call, Comma, parenthesi...
robhudson/zamboni
refs/heads/master
apps/access/helpers.py
22
import jinja2 from jingo import register import acl @register.function @jinja2.contextfunction def check_ownership(context, object, require_owner=False, require_author=False, ignore_disabled=True): return acl.check_ownership(context['request'], object, require_o...
opennode/waldur-mastermind
refs/heads/develop
src/waldur_mastermind/analytics/models.py
2
from django.contrib.contenttypes import fields as ct_fields from django.contrib.contenttypes import models as ct_models from django.db import models from waldur_core.core.managers import GenericKeyMixin class QuotaManager(GenericKeyMixin, models.Manager): def update_or_create_quota(self, scope, name, date, usage...
nricklin/PyGithub
refs/heads/master
github/Notification.py
74
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 AKFish <akfish@gmail.com> # # Copyright 2013 Peter Golm <golm.peter@gmail.com> ...
bliti/pydweet
refs/heads/master
example/main.py
1
#!/usr/bin/env python from dweet import Dweet if __name__ == "__main__": dweet = Dweet() #dweet an dweet without a thing name. Returns a a thing name in the response print dweet.dweet({"hello": "world"}) #dweet with a thing name print dweet.dweet_by_name(name="test_thing", data={"hello"...
simone/django-gb
refs/heads/master
tests/view_tests/default_urls.py
65
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # This is the same as in the default project template url(r'^admin/', include(admin.site.urls)), )
mdworks2016/work_development
refs/heads/master
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/contrib/auth/validators.py
55
import re from django.core import validators from django.utils.deconstruct import deconstructible from django.utils.translation import gettext_lazy as _ @deconstructible class ASCIIUsernameValidator(validators.RegexValidator): regex = r'^[\w.@+-]+\Z' message = _( 'Enter a valid username. This value m...
CoderDojoSG/todo
refs/heads/master
todo5/application.py
2
from flask import Flask from flask import make_response from flask import request from flask import session from flask import render_template from flask import redirect from flask import url_for from flask.ext.mongoengine import MongoEngine import logging from logging.handlers import RotatingFileHandler app = Flask(_...
driquet/dahu
refs/heads/master
dahu/config.py
1
# Front end related data FRONTEND_HOST = 'localhost' FRONTEND_PORT = 8080 FRONTEND_PREFIX = '' FRONTEND_THEME = 'default' # Data related to albums and cache ALBUMS_PATH = '/Users/driquet/Pictures/Albums/' CACHE_PATH...
jhona22baz/blog-flask
refs/heads/master
python2.7/lib/python2.7/site-packages/setuptools/tests/test_sandbox.py
342
"""develop tests """ import sys import os import shutil import unittest import tempfile import types import pkg_resources import setuptools.sandbox from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): """ Run this to determine if the local machine has win32com, and if it d...
meiavy/python-weixin
refs/heads/master
lib/python2.7/site-packages/pip/vendor/html5lib/tokenizer.py
1710
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/ship/components/chassis/shared_tieinterceptor_chassis_token.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 = Tangible() result.template = "object/tangible/ship/components/chassis/shared_tieinterceptor_chassis_token.iff" re...
danielmohr/androguard
refs/heads/master
androarsc.py
38
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation,...
NullScope/BorderlessStone
refs/heads/master
tests/import/relimp/relimp/relimp3.py
7
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
res2k/0install
refs/heads/master
zeroinstall/injector/qdom.py
3
"""A quick DOM implementation. Python's xml.dom is very slow. The xml.sax module is also slow (as it imports urllib2). This is our light-weight version. """ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. from xml.parsers import expat import zeroinstall from zer...
afaheem88/rally
refs/heads/master
rally/plugins/openstack/context/ceilometer/samples.py
6
# 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 agreed to in writing, software #...
yinquan529/platform-external-chromium_org
refs/heads/master
tools/telemetry/telemetry/core/browser_options.py
23
# Copyright (c) 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 copy import logging import optparse import os import shlex import sys from telemetry.core import browser_finder from telemetry.core import profil...
jerradgenson/infinium
refs/heads/master
lib/ui/config.py
1
""" An API for interfacing with the Infinium configuration file. The only public component is ``get_config``, which returns a ``configuration`` object used to access and update config file fields. There is only one ``configuration`` object, because it is meant to be shared between all parts of the program to keep confi...
boompieman/iim_project
refs/heads/master
project_python2/lib/python2.7/site-packages/pygments/styles/pastie.py
50
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style impor...
watkinsr/.dotfiles
refs/heads/master
emacs/anaconda-mode/0.1.6/jedi-0.9.0-py2.7.egg/jedi/evaluate/iterable.py
33
""" Contains all classes and functions to deal with lists, dicts, generators and iterators in general. Array modifications ******************* If the content of an array (``set``/``list``) is requested somewhere, the current module will be checked for appearances of ``arr.append``, ``arr.insert``, etc. If the ``arr`...
lirenjie95/DataMining
refs/heads/master
DataMining-UIUC/DataVisualization/dolphins.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import string import networkx from matplotlib import pyplot as plt Net = networkx.Graph() NodeName = dict() fid = open('dolphins.gml','r') flag_node = False for line in fid: if flag_node: line = line.rsplit() if line[0]=='id': node...
drcapulet/sentry
refs/heads/master
src/sentry/db/postgres/exceptions.py
28
from __future__ import absolute_import import psycopg2 import traceback class CompositeTraceback(object): def __init__(self, tb_list): assert isinstance(tb_list, (list, tuple)) self.__tb_list = tb_list self.__iterator = iter(self) def __iter__(self): for tb in self.__tb_list:...
mcking49/apache-flask
refs/heads/master
Python/Lib/site-packages/jinja2/testsuite/__init__.py
404
# -*- coding: utf-8 -*- """ jinja2.testsuite ~~~~~~~~~~~~~~~~ All the unittests of Jinja2. These tests can be executed by either running run-tests.py using multiple Python versions at the same time. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ i...
wxthon/googletest
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...
michellab/SireUnitTests
refs/heads/devel
unittests/SireIO/test_amber2_write.py
1
from Sire.IO import * from Sire.Mol import * from Sire.MM import * from Sire.FF import * from nose.tools import assert_equal, assert_almost_equal def _getEnergies(s): intraclj = IntraFF("intraclj") intraclj.add(s.molecules()) intraff = InternalFF("intraff") intraff.setUse14Calculation(True) intr...
erindieringer/erindieringer-byte1
refs/heads/master
lib/werkzeug/test.py
308
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...