repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
pschmitt/home-assistant
refs/heads/dev
tests/components/august/test_gateway.py
6
"""The gateway tests for the august platform.""" from homeassistant.components.august.const import DOMAIN from homeassistant.components.august.gateway import AugustGateway from tests.async_mock import MagicMock, patch from tests.components.august.mocks import _mock_august_authentication, _mock_get_config async def t...
chinmaygarde/mojo
refs/heads/ios
third_party/cython/src/Cython/Compiler/Scanning.py
90
# cython: infer_types=True, language_level=3, py2_import=True # # Cython Scanner # import os import platform import cython cython.declare(EncodedString=object, any_string_prefix=unicode, IDENT=unicode, print_function=object) from Cython import Utils from Cython.Plex.Scanners import Scanner from Cyth...
shanot/imp
refs/heads/develop
modules/em2d/test/test_images_opencv.py
2
from __future__ import print_function import IMP import IMP.test import IMP.em2d as em2d import os import random class Tests(IMP.test.TestCase): def test_read_and_write_opencv_images(self): """Test read/write for the images using OpenCV data storage""" srw = em2d.SpiderImageReaderWriter() ...
kevinmel2000/sl4a
refs/heads/master
python/src/Mac/Modules/ibcarbon/IBCarbonscan.py
34
# IBCarbonscan.py import sys from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX def main(): print "---Scanning IBCarbonRuntime.h---" input = ["IBCarbonRuntime.h"] output = "IBCarbongen.py" defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py" scanne...
kalvdans/scipy
refs/heads/master
scipy/io/harwell_boeing/hb.py
83
""" Implementation of Harwell-Boeing read/write. At the moment not the full Harwell-Boeing format is supported. Supported features are: - assembled, non-symmetric, real matrices - integer for pointer/indices - exponential format for float values, and int format """ from __future__ import division, print_...
intgr/django
refs/heads/master
tests/select_related_onetoone/models.py
106
from django.db import models class User(models.Model): username = models.CharField(max_length=100) email = models.EmailField() def __str__(self): return self.username class UserProfile(models.Model): user = models.OneToOneField(User, models.CASCADE) city = models.CharField(max_length=10...
TeppieC/M-ords
refs/heads/master
mords_backend/mords_api/migrations/0002_auto_20161108_0630.py
2
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-11-08 06:30 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('mords_api', '0001_initial'), ] operations = [ ...
CalebBell/thermo
refs/heads/master
docs/plots/PR_maximum_pressure.py
1
import matplotlib.pyplot as plt import numpy as np from thermo import * from fluids.numerics import logspace from math import log10 thing = PR(P=1e5, T=460, Tc=658.0, Pc=1820000.0, omega=0.9) Ts = logspace(log10(1000), log10(2000000), 100) Ps = [] for T in Ts: try: Ps.append(thing.to(T=T, V=thing.V_l).P) ...
bratsche/Neutron-Drive
refs/heads/master
google_appengine/lib/django_1_2/django/conf/urls/i18n.py
383
from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^setlang/$', 'django.views.i18n.set_language'), )
sa2ajj/DistroTracker
refs/heads/upstream
pts/project/__init__.py
1
# Copyright 2013 The Distro Tracker Developers # See the COPYRIGHT file at the top-level directory of this distribution and # at http://deb.li/DTAuthors # # This file is part of Distro Tracker. It is subject to the license terms # in the LICENSE file found in the top-level directory of this # distribution and at http:/...
thinkopensolutions/l10n-brazil
refs/heads/10.0
l10n_br_account/tests/__init__.py
3
# -*- coding: utf-8 -*- # Copyright (C) 2017 Daniel Sadamo - KMEE INFORMATICA LTDA # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import test_account_invoice
liaoyuke/EECS542_Final_Project_VQA
refs/heads/master
code/concept_extraction/lib/en/parser/nltk_lite/contrib/marshalbrill.py
9
# Natural Language Toolkit: Brill Tagger # # Copyright (C) 2001-2005 University of Pennsylvania # Authors: Christopher Maloof <cjmaloof@gradient.cis.upenn.edu> # Edward Loper <edloper@gradient.cis.upenn.edu> # Steven Bird <sb@ldc.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LI...
dzamie/weasyl
refs/heads/master
libweasyl/libweasyl/text.py
1
from __future__ import unicode_literals import re from lxml import etree, html import misaka from .compat import unicode from .defang import defang from .legacy import login_name try: from html.parser import locatestarttagend except ImportError: try: from html.parser import locatestarttagend_toleran...
ChuanleiGuo/AlgorithmsPlayground
refs/heads/master
LeetCodeSolutions/python/101_Symmetric_Tree.py
1
class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def isSymmetric(self, root): """ :type root: TreeNode :rtype: bool """ def is_S(left, right): if left is None and r...
leonardbj/AIMS
refs/heads/master
src/exec/sp_lab.py
1
""" Description here Author: Leonard Berrada Date: 2 Nov 2015 """ import sys sys.path.append("../") try: import seaborn as sns sns.set(color_codes=True) except: pass from process_data import data_from_file from Regression import AutoRegressive, AutoCorrelation # file_name = "finPredProb.mat" # file_na...
gyroninja/tnoodle
refs/heads/master
svglite/tmtproject.py
4
import tmt DESCRIPTION = "A dead simple svg generation library written in pure Java, with no dependencies. This code runs on both desktop Java, Android, and compiles to Javascript with GWT." tmt.EclipseProject(tmt.projectName(), description=DESCRIPTION)
fheinle/Photoblog
refs/heads/master
gdata/tlslite/BaseDB.py
238
"""Base class for SharedKeyDB and VerifierDB.""" import anydbm import thread class BaseDB: def __init__(self, filename, type): self.type = type self.filename = filename if self.filename: self.db = None else: self.db = {} self.lock = thre...
jjmiranda/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_capa_module.py
3
# -*- coding: utf-8 -*- """ Tests of the Capa XModule """ # pylint: disable=missing-docstring # pylint: disable=invalid-name import datetime import json import random import os import textwrap import unittest import ddt from lxml import etree from mock import Mock, patch, DEFAULT import webob from webob.multidict imp...
Jortolsa/l10n-spain
refs/heads/8.0
l10n_es_aeat_mod340/__init__.py
14
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 20011 Ting (http://www.ting.es) # Copyright (c) 2011-2013 Acysos S.L. (http://acysos.com) # Ignacio Ibeas Izquierdo <ignacio@...
466152112/scikit-learn
refs/heads/master
sklearn/neighbors/tests/test_kd_tree.py
129
import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap, simultaneous_sort, kernel_norm, nodeheap_sort, DTYPE, ITYPE) from sklearn.neighbors.dist_metrics import Dista...
toomanyjoes/mrperfcs386m
refs/heads/master
evalResults/baseFiles_numHosts/conv.py
5
#!/usr/bin/python """Hadoop Simulator This simulator takes three configuration files, topology.xml, metadata.xml, and job.xml, describing a Hadoop job and the topology it will run on. Two tcl files, topology.tcl and events.tcl, will be generated as input for ns-2 for further simulation. """ #import xml.dom import x...
JanNash/sms-tools
refs/heads/master
lectures/05-Sinusoidal-model/plots-code/spectral-sine-synthesis.py
24
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris from scipy.fftpack import fft, ifft, fftshift import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import stft as S...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/scattercarpet/marker/gradient/_color.py
1
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="scattercarpet.marker.gradient", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent...
renecannao/proxysql
refs/heads/master
deps/libinjection/sqlparse2c.py
8
#!/usr/bin/env python # # Copyright 2012, 2013 Nick Galbreath # nickg@client9.com # BSD License -- see COPYING.txt for details # """ Converts a libinjection JSON data file to a C header (.h) file """ import sys def toc(obj): """ main routine """ print """ #ifndef _LIBINJECTION_SQLI_DATA_H #define _LIBINJ...
hubsaysnuaa/odoo
refs/heads/8.0
addons/web_diagram/controllers/__init__.py
1214
from . import main
chubbymaggie/barf-project
refs/heads/master
examples/scripts/x86/recover_cfg.py
1
#! /usr/bin/env python import os import sys from barf.barf import BARF if __name__ == "__main__": # # Open file # try: filename = os.path.abspath("../../bin/x86/branch4") barf = BARF(filename) except Exception as err: print err print "[-] Error opening file : %s" ...
valtech-mooc/edx-platform
refs/heads/master
lms/djangoapps/instructor/offline_gradecalc.py
26
""" ======== Offline calculation of grades ============================================================= Computing grades of a large number of students can take a long time. These routines allow grades to be computed offline, by a batch process (eg cronjob). The grades are stored in the OfflineComputedGrade table of...
arkenthera/mpc-hc
refs/heads/develop
src/mpc-hc/mpcresources/sync.py
8
# (C) 2015 see Authors.txt # # This file is part of MPC-HC. # # MPC-HC 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. # # MPC-HC is di...
zdary/intellij-community
refs/heads/master
python/testData/completion/className/simple/simple.py
166
Shaz<caret>
jarshwah/django
refs/heads/master
django/contrib/auth/views.py
9
import functools import warnings from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contrib.auth.decorators import log...
stanford-mast/nn_dataflow
refs/heads/master
nn_dataflow/tests/tool_test/test_nn_dataflow_search.py
1
""" $lic$ Copyright (C) 2016-2020 by Tsinghua University and The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it wi...
gordon1992/BallGame
refs/heads/master
src/mainGame.py
1
''' Project was conceptualised formally on the 3rd of November 2010 Last updated 12th of January 2011 by Gordon Reid @title: Ball Game @author: Gordon Reid - gordon.reid1992@hotmail.co.uk This code is freely available for anybody to view and edit. I request that if any code is used that credit is given in an appropriat...
youprofit/scikit-image
refs/heads/master
skimage/transform/pyramids.py
20
import math import numpy as np from scipy import ndimage as ndi from ..transform import resize from ..util import img_as_float def _smooth(image, sigma, mode, cval): """Return image with each channel smoothed by the Gaussian filter.""" smoothed = np.empty(image.shape, dtype=np.double) # apply Gaussian f...
Xykon/pycom-micropython-sigfox
refs/heads/master
tests/basics/class3.py
118
# inheritance class A: def a(): print('A.a() called') class B(A): pass print(type(A)) print(type(B)) print(issubclass(A, A)) print(issubclass(A, B)) print(issubclass(B, A)) print(issubclass(B, B)) print(isinstance(A(), A)) print(isinstance(A(), B)) print(isinstance(B(), A)) print(isinstance(B(), B)...
ujenmr/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_host_acceptance.py
48
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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 = { 'metadat...
drxos/python-social-auth
refs/heads/master
examples/flask_example/routes/__init__.py
63
from flask_example.routes import main from social.apps.flask_app import routes
jerbob92/CouchPotatoServer
refs/heads/master
couchpotato/core/providers/userscript/filmweb/main.py
21
from couchpotato.core.providers.userscript.base import UserscriptBase import re class Filmweb(UserscriptBase): version = 2 includes = ['http://www.filmweb.pl/film/*'] def getMovie(self, url): cookie = {'Cookie': 'welcomeScreen=welcome_screen'} try: data = self.urlopen(url,...
jlegendary/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/optionaltags.py
1727
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
madan96/sympy
refs/heads/master
sympy/physics/pring.py
94
from __future__ import print_function, division from sympy import sqrt, exp, S, pi, I from sympy.physics.quantum.constants import hbar def wavefunction(n, x): """ Returns the wavefunction for particle on ring. n is the quantum number, x is the angle, here n can be positive as well as negative whi...
Mausy5043/domod
refs/heads/v3
again21d.py
1
#!/usr/bin/env python3 # again21.py measures the DS18B20 temperature. # uses moving averages # Wiring : # Sensor pin : R-Pi B+ pin # =================:============== # VIN (red) = 01 - 3v3 # Data (yellow) = 07 - GPIO04 # GND (blue) = 09 - GND import configparser import glob import os import ...
andfoy/margffoy-tuay-server
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
naojsoft/ginga
refs/heads/master
ginga/web/jupyterw/ImageViewJpw.py
3
# # ImageViewJpw.py -- Module for a Ginga FITS viewer in a Jupyter web notebook. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # """ This example illustrates using a Ginga as the driver of a Jupyter web widget. REQUIREMENTS: To use this code you will ne...
ihacklog/osdlyrics
refs/heads/master
tools/create-lyricsource.py
1
# -*- coding: utf-8 -*- # # Copyright (C) 2012 Tiger Soldier <tigersoldi@gmail.com> # # This file is part of OSD Lyrics. # # OSD Lyrics 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 ...
philwilliammee/pyPincher2
refs/heads/master
tool_path_editor.py
1
#!/usr/bin/env python2.7 ''' do testing here ''' from numpy import * import numpy as np import pylab as p import matplotlib.axes as a import mpl_toolkits.mplot3d.axes3d as a3d from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection #open a obj file and read faces and vertices v...
hubsaysnuaa/odoo
refs/heads/8.0
addons/account_asset/report/__init__.py
445
# -*- 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...
vshtanko/scikit-learn
refs/heads/master
sklearn/cluster/birch.py
207
# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Joel Nothman <joel.nothman@gmail.com> # License: BSD 3 clause from __future__ import division import warnings import numpy as np from scipy import sparse from math import sqrt fro...
cubells/l10n-spain
refs/heads/12.0
l10n_es_aeat_sii/models/product_product.py
2
# Copyright 2017 MINORISA (http://www.minorisa.net) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class ProductTemplate(models.Model): _inherit = "product.template" sii_exempt_cause = fields.Selection( string="SII Exempt Cause", selection=[('...
lfontana/BrewsBrothersChillerFrontEnd
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
ARM-software/CMSIS_5
refs/heads/develop
CMSIS/NN/Scripts/NNFunctions/table_gen.py
3
#!/usr/bin/python import math class Table(object): def __init__(self, table_entry=256, table_range=8): self.table_entry = table_entry self.table_range = table_range pass def sigmoid(self, x): return 1 / (1 + math.exp(-1*x)) def tanh(self, x): return (math.exp(2*x)-1) / (math.exp(2*x)+1)...
mikedingjan/wagtail
refs/heads/master
wagtail/contrib/routable_page/tests.py
7
from unittest import mock from django.test import RequestFactory, TestCase from django.urls.exceptions import NoReverseMatch from wagtail.contrib.routable_page.templatetags.wagtailroutablepage_tags import routablepageurl from wagtail.core.models import Page, Site from wagtail.tests.routablepage.models import ( Ro...
onshape-public/onshape-clients
refs/heads/master
python/onshape_client/oas/models/bt_global_tree_node_list_response_bt_team_info.py
1
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
antoinecarme/pyaf
refs/heads/master
tests/artificial/transf_BoxCox/trend_MovingAverage/cycle_12/ar_/test_artificial_128_BoxCox_MovingAverage_12__0.py
1
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 0);
Critical-Impact/django-inplaceedit
refs/heads/master
testing/testing/test_fk/views.py
6027
# Create your views here.
pwnieexpress/pwn_plug_sources
refs/heads/master
src/metagoofil/hachoir_parser/file_system/__init__.py
94
from hachoir_parser.file_system.ext2 import EXT2_FS from hachoir_parser.file_system.fat import FAT12, FAT16, FAT32 from hachoir_parser.file_system.mbr import MSDos_HardDrive from hachoir_parser.file_system.ntfs import NTFS from hachoir_parser.file_system.iso9660 import ISO9660 from hachoir_parser.file_system.reiser_fs ...
gtaylor/ansible
refs/heads/devel
v2/ansible/utils/debug.py
210
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time import sys from multiprocessing import Lock from ansible import constants as C global_debug_lock = Lock() def debug(msg): if C.DEFAULT_DEBUG: global_debug_lock.acquire() print("%6d %0.5f...
GustavoHennig/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gce_img.py
70
#!/usr/bin/python # Copyright 2015 Google Inc. All Rights Reserved. # # 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 o...
smmribeiro/intellij-community
refs/heads/master
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/typeCommentLocalWithTarget.py
38
def func(): with open('file.txt') as var: v<caret>ar
saintdragon2/python-3-lecture-2015
refs/heads/master
civil-final/1st_presentation/11조/pygame/tests/display_test.py
26
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
fedepad/espressopp
refs/heads/master
contrib/mpi4py/mpi4py-2.0.0/demo/mpe-logging/ring.py
9
#!/usr/bin/env python import os os.environ['MPE_LOGFILE_PREFIX'] = 'ring' import mpi4py mpi4py.profile('mpe') from mpi4py import MPI from array import array comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() src = rank-1 dest = rank+1 if rank == 0: src = size-1 if rank == size-1: dest = 0 ...
cchurch/ansible
refs/heads/devel
lib/ansible/modules/notification/irc.py
32
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jan-Piet Mens <jpmens () gmail.com> # 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', ...
Bysmyyr/chromium-crosswalk
refs/heads/master
chrome/test/ispy/server/gs_bucket.py
88
# 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. """Implementation of CloudBucket using Google Cloud Storage as the backend.""" import os import sys import cloudstorage from common import cloud_bucket c...
paninetworks/neutron
refs/heads/master
neutron/tests/unit/agent/linux/test_bridge_lib.py
25
# Copyright 2015 Intel Corporation. # Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Licen...
mezz64/home-assistant
refs/heads/dev
homeassistant/components/doorbird/switch.py
5
"""Support for powering relays in a DoorBird video doorbell.""" import datetime from homeassistant.components.switch import SwitchEntity import homeassistant.util.dt as dt_util from .const import DOMAIN, DOOR_STATION, DOOR_STATION_INFO from .entity import DoorBirdEntity IR_RELAY = "__ir_light__" async def async_se...
watchcat/cbu-rotterdam
refs/heads/master
giveaminute/projectResource.py
4
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ from framework.log import log import helpers.censor as censor class ProjectResource(): def __init__(self, db, projectResourceId): self.id = projectResourceId self.db ...
GenericStudent/home-assistant
refs/heads/dev
tests/components/volumio/__init__.py
17
"""Tests for the Volumio integration."""
devanlai/mbed
refs/heads/master
workspace_tools/host_tests/example/BroadcastSend.py
128
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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...
ProgVal/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-xctest.py
221
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that xctest targets are correctly configured. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.Te...
cansik/pg4nosql
refs/heads/master
pg4nosql/PostgresNoSQLUtil.py
1
import json from pg4nosql.PostgresNoSQLResultItem import PostgresNoSQLResultItem from psycopg2.extensions import adapt, AsIs __author__ = 'cansik' def to_sql_string(obj): if obj is None: return AsIs(obj) return str(obj) def to_nullable_string(obj): if obj is None: return 'Null' if i...
MiLk/youtube-dl
refs/heads/master
youtube_dl/extractor/steam.py
2
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unescapeHTML, ) class SteamIE(InfoExtractor): _VALID_URL = r"""(?x)http://store\.steampowered\.com/ (agecheck/)? (?P<urltype>video|app)/ #If the page ...
smart-developerr/my-first-blog
refs/heads/master
Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py
3007
######################## 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...
rootulp/xpython
refs/heads/master
exercises/bracket-push/example.py
7
def check_brackets(string): counterparts = {')': '(', '}': '{', ']': '['} stack = [] for char in string: if char in counterparts.values(): stack.append(char) elif char in counterparts: if not stack: return False if stack.pop() != counterpa...
victorpoluceno/shortener_frontend
refs/heads/master
rest_api/views.py
6027
# Create your views here.
endlessm/chromium-browser
refs/heads/master
third_party/skia/infra/bots/gen_compile_isolate.py
4
#!/usr/bin/env python # # Copyright 2019 Google LLC # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import difflib import os import re import subprocess import sys # Any files in Git which match these patterns will be included, either directly # or indirectly ...
googleinterns/learnbase
refs/heads/master
learnbase/src/main/webapp/WEB-INF/Lib/re.py
153
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
jlopex/kernel_linaro_snowball
refs/heads/mesh
Documentation/target/tcm_mod_builder.py
4981
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
PolicyStat/selenium-old
refs/heads/master
py/test/selenium/webdriver/firefox/test_ff_executing_javascript_test.py
4
#!/usr/bin/python # # Copyright 2008-2010 WebDriver committers # Copyright 2008-2010 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...
bdryburgh/pynet_testX
refs/heads/master
str_ex2.py
1
#!/usr/bin/env python from __future__ import print_function try: # PY2 ip_addr = raw_input("Please enter IP address: ") except NameError: # PY3 ip_addr = input("Please enter IP address: ") ip_addr = ip_addr.split(".") print() print("=" * 70) print("{:<20} {:<20} {:<20} {:<20}".format(*ip_addr)) p...
Korkki/django
refs/heads/master
tests/sitemaps_tests/base.py
380
from django.apps import apps from django.contrib.sites.models import Site from django.core.cache import cache from django.test import TestCase, modify_settings, override_settings from .models import I18nTestModel, TestModel @modify_settings(INSTALLED_APPS={'append': 'django.contrib.sitemaps'}) @override_settings(ROO...
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/sphinx/sphinx-quickstart.py
15
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys if __name__ == '__main__': from sphinx.quicksta...
henrykironde/scikit-learn
refs/heads/master
sklearn/externals/joblib/_multiprocessing_helpers.py
326
"""Helper module to factorize the conditional multiprocessing import logic We use a distinct module to simplify import statements and avoid introducing circular dependencies (for instance for the assert_spawning name). """ import os import warnings # Obtain possible configuration from the environment, assuming 1 (on...
nirmeshk/oh-mainline
refs/heads/master
mysite/missions/shell/views.py
15
# This file is part of OpenHatch. # # 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 distribut...
ekesken/istatistikciadamlazim
refs/heads/master
openid/consumer/html_parse.py
167
""" This module implements a VERY limited parser that finds <link> tags in the head of HTML or XHTML documents and parses out their attributes according to the OpenID spec. It is a liberal parser, but it requires these things from the data in order to work: - There must be an open <html> tag - There must be an open...
matthewelse/micropython
refs/heads/emscripten
tests/basics/int_divmod.py
37
# test integer floor division and modulo # test all combination of +/-/0 cases for i in range(-2, 3): for j in range(-4, 5): if j != 0: print(i, j, i // j, i % j, divmod(i, j)) # this tests bignum modulo a = 987654321987987987987987987987 b = 19 print(a % b) print(a % -b) print(-a % b) print(-...
dongjoon-hyun/DIGITS
refs/heads/master
digits/model/__init__.py
8
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from .images import * from .job import ModelJob
Thraxis/SickRage
refs/heads/master
lib/github/GitObject.py
74
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
mrroach/CentralServer
refs/heads/master
csrv/model/actions/break_subroutine.py
1
"""Break a subroutine with an icebreaker.""" from csrv.model import appropriations from csrv.model import cost from csrv.model import errors from csrv.model import events from csrv.model import game_object from csrv.model import parameters from csrv.model.actions import action from csrv.model.cards import card_info ...
leag/swftools
refs/heads/master
spec/textarea3.py
10
from sys import * from pdflib_py import * import md5 import Image import math img = Image.open("baboon.png") width, height = img.size img.load() p = PDF_new() PDF_open_file(p, "textarea3.pdf") PDF_set_parameter(p, "usercoordinates", "true") PDF_set_info(p, "Creator", "smalltext.py") PDF_begin_page(p, width, heig...
fqxp/nete-gtk
refs/heads/master
nete/state/utils/note_list.py
1
from pyrsistent import freeze def add_new(notes, note): return freeze(ordered(notes.append(note))) def without(notes, title): return freeze( ordered( [note for note in notes if note['title'] != title] )) def ordered(notes): return freeze( sorted( notes, ...
f1aky/xadmin
refs/heads/django1.10
xadmin/adminx.py
6
import xadmin from models import UserSettings, Log from xadmin.layout import * from django.utils.translation import ugettext_lazy as _, ugettext class UserSettingsAdmin(object): model_icon = 'fa fa-cog' hidden_menu = True xadmin.site.register(UserSettings, UserSettingsAdmin) class LogAdmin(object): def...
joberreiter/pyload
refs/heads/stable
module/plugins/crypter/RelinkUs.py
1
# -*- coding: utf-8 -*- from __future__ import with_statement import binascii import re import os from Crypto.Cipher import AES from module.plugins.internal.Crypter import Crypter from module.utils import save_join as fs_join class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" __v...
esc/Bento
refs/heads/master
bento/private/_yaku/yaku/conf.py
3
import os import sys import re try: from hashlib import md5 except ImportError: from md5 import md5 if sys.version_info[0] < 3: from cStringIO \ import \ StringIO else: from io \ import \ StringIO from yaku.errors \ import \ UnknownTask from yaku.ut...
hehongliang/tensorflow
refs/heads/master
tensorflow/python/ops/parallel_for/control_flow_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...
mekarpeles/waltz
refs/heads/master
waltz/treasury.py
1
#!/usr/bin/env python """ ballroom.treasury ~~~~~~~~~~~~~~~~~ The treasury contains several modules which, when joined, provide shopping cart function. Product: A Product is a generic interface which one may extend or inherit in order to represent a physical or digital e-commerce product. Item:...
vikas1885/test1
refs/heads/master
common/lib/xmodule/xmodule/util/duedate.py
256
""" Miscellaneous utility functions. """ from functools import partial def get_extended_due_date(node): """ Gets the actual due date for the logged in student for this node, returning the extendeded due date if one has been granted and it is later than the global due date, otherwise returning the glob...
gezb/osmc
refs/heads/master
package/mediacenter-addon-osmc/src/script.module.osmcsetting.remotes/resources/lib/remote_gui.py
6
# KODI modules import xbmc import xbmcaddon import xbmcgui # Standard modules import sys import os import shutil import subprocess import threading addonid = "script.module.osmcsetting.remotes" __addon__ = xbmcaddon.Addon("script.module.osmcsetting.remotes") __path__ = xbmc.translatePath(xbmcaddon.Addon(addonid)...
infincia/AEServmon
refs/heads/master
frontpage.py
1
#!/usr/bin/env python # Copyright (c) 2009, Steve Oliver (steve@xercestech.com) #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 #...
tomncooper/heron
refs/heads/master
heronpy/api/tests/python/topology_unittest.py
5
#!/usr/bin/env python # -*- encoding: 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...
kevintaw/django
refs/heads/master
django/utils/archive.py
562
""" Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/ Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors. 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 So...
aehlig/bazel
refs/heads/master
tools/android/aar_resources_extractor.py
3
# Lint as: python2, python3 # pylint: disable=g-direct-third-party-import # Copyright 2017 The Bazel 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:...
thepaul/uftrace
refs/heads/master
tests/t114_replay_trg_time.py
1
#!/usr/bin/env python from runtest import TestBase import subprocess as sp TDIR='xxx' class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'sleep', result=""" # DURATION TID FUNCTION [16873] | main() { [16873] | foo() { [16873] | mem_alloc...