repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
dvberkel/servo
refs/heads/master
python/mach/mach/test/test_entry_point.py
121
# 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/. from __future__ import unicode_literals import imp import os import sys from mach.base import MachError from mach.test....
thanhphat11/Kernel-Stock-A900-SLK
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
piosz/test-infra
refs/heads/master
gubernator/third_party/cloudstorage/errors.py
147
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
hrjn/scikit-learn
refs/heads/master
sklearn/decomposition/dict_learning.py
19
""" Dictionary learning """ from __future__ import print_function # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import time import sys import itertools from math import sqrt, ceil import numpy as np from scipy import linalg from numpy.lib.stride_tricks import as_strided from ..b...
gsmaxwell/phase_offset_rx
refs/heads/master
gnuradio-core/src/lib/filter/generate_gr_fir_util.py
17
#!/bin/env python # # Copyright 2003,2009 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) #...
JonathanSeguin/Mariana
refs/heads/master
Mariana/network.py
1
from collections import OrderedDict from wrappers import TheanoFunction import Mariana.settings as MSET import types __all__= ["Network", "OutputMap"] # TYPE_INPUT_LAYER = "input" # TYPE_OUTPUT_LAYER = "output" # TYPE_HIDDEN_LAYER = "hidden" def loadModel(filename) : """Shorthand for Network.load""" return N...
manastech/de-bee
refs/heads/master
gdata/media/data.py
132
#!/usr/bin/python # # Copyright (C) 2009 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 ...
moinulkuet/machine-learning
refs/heads/master
Part 3 - Classification/Section 20 - Random Forest Classification/random_forest_classification.py
6
# Random Forest Classification # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Social_Network_Ads.csv') X = dataset.iloc[:, [2, 3]].values y = dataset.iloc[:, 4].values # Splitting the dataset into the Training set and Te...
Lh4cKg/sl4a
refs/heads/master
python/src/Lib/test/fork_wait.py
58
"""This test case provides support for checking forking and wait behavior. To test different wait behavior, overrise the wait_impl method. We want fork1() semantics -- only the forking thread survives in the child after a fork(). On some systems (e.g. Solaris without posix threads) we find that all active threads su...
penpen/graphite-web
refs/heads/master
webapp/graphite/render/views.py
18
"""Copyright 2008 Orbitz WorldWide 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...
snakeleon/YouCompleteMe-x64
refs/heads/master
third_party/ycmd/third_party/jedi_deps/jedi/test/examples/not_in_sys_path/not_in_sys_path_package/__init__.py
34
value = 'package'
OCA/l10n-italy
refs/heads/12.0
l10n_it_website_sale_corrispettivi/models/__init__.py
1
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import website
RydrDojo/Ridr_app
refs/heads/master
pylotVenv/lib/python2.7/site-packages/pip/_vendor/html5lib/constants.py
497
from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly ...
rossella/neutron
refs/heads/master
quantum/tests/unit/__init__.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
vyscond/cocos
refs/heads/master
test/test_rich_label.py
6
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 5, s, t 10.1, s, q" tags = "RichLabel" import cocos from cocos.director ...
peterlauri/django
refs/heads/master
django/contrib/gis/utils/__init__.py
92
""" This module contains useful utilities for GeoDjango. """ from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.utils.wkt import precision_wkt # NOQA if HAS_GDAL: from django.contrib.gis.utils.ogrinfo import ogrinfo # NOQA from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect...
lattwood/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/TestResultServer/handlers/__init__.py
6014
# Required for Python to search this directory for module files
TalShafir/ansible
refs/heads/devel
lib/ansible/modules/utilities/logic/async_status.py
19
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # 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...
pysv/djep
refs/heads/develop
pyconde/search/search_indexes.py
3
import re from django.test.client import RequestFactory from django.template import RequestContext from haystack import indexes from cms import models as cmsmodels rf = RequestFactory() HTML_TAG_RE = re.compile(r'<[^>]+>') def cleanup_content(s): """ Removes HTML tags from data and replaces them with sp...
john-soklaski/CoilSnake
refs/heads/master
coilsnake/ui/gui.py
1
#! /usr/bin/env python import tkinter from functools import partial import logging from subprocess import Popen from threading import Thread import tkinter.filedialog import tkinter.messagebox import tkinter.simpledialog from traceback import format_exc import tkinter.ttk import webbrowser from tkinter import * from t...
rs2/bokeh
refs/heads/master
bokeh/sampledata/stocks.py
2
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/conf/locale/de/formats.py
107
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y H:i:s' YEAR_MONTH...
Acehaidrey/incubator-airflow
refs/heads/master
airflow/utils/net.py
10
# # 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...
pokemon4ik2008/py-airfoil
refs/heads/master
manage.py
2
import os from ctypes import * from async import Scheduler map_expansion_const=50.0 (map_x_size, map_z_size)=(1.0,1.0) worker=Scheduler(block=False) global proxy proxy=None global server server=None global sound_effects sound_effects=False global opt global scale scale=3.0 global y_terrain_scale y_terrain_scale=3.0 ...
repotvsupertuga/tvsupertuga.repository
refs/heads/master
script.module.resolveurl/lib/resolveurl/plugins/movierulz.py
2
""" resolveurl site plugin Copyright (C) 2018 gujal 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 distribute...
arpitpanwar/zulip
refs/heads/master
zerver/test_hooks.py
103
# -*- coding: utf-8 -*- from zerver.lib.test_helpers import AuthedTestCase from zerver.lib.test_runner import slow from zerver.models import Message import ujson class JiraHookTests(AuthedTestCase): def send_jira_message(self, action): email = "hamlet@zulip.com" api_key = self.get_api_key(email) ...
efortuna/AndroidSDKClone
refs/heads/master
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/cgi.py
64
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
vadimtk/chrome4sdp
refs/heads/master
build/toolchain/mac/setup_toolchain.py
146
# Copyright (c) 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 os import stat import sys def CopyTool(source_path): """Copies the given tool to the current directory, including a warning not to edit it.""...
CoderBotOrg/coderbot
refs/heads/develop
rotary_encoder_tests/velocity_test2.py
1
from time import sleep from motorencoder import MotorEncoder import pigpio pi = pigpio.pi() m = MotorEncoder(pi, 22, 25, 24, 14, 16) m.control(power=100.0, time_elapse=5)
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/ship/components/shield_generator/shared_shd_incom_mark9.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/shield_generator/shared_shd_incom_mark9.iff" result...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/matplotlib/tri/trirefine.py
8
""" Mesh refinement for triangular grids. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six import numpy as np from matplotlib.tri.triangulation import Triangulation import matplotlib.tri.triinterpolate class TriRefi...
adrianschroeter/kiwi
refs/heads/master
kiwi/partitioner/base.py
2
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
jjdmol/LOFAR
refs/heads/master
LCU/checkhardware/lib/general_lib.py
1
r""" general script """ from subprocess import (Popen, PIPE) import traceback import time import os import sys import logging general_version = '0913' logger = logging.getLogger() def writeMessage(msg): sendCmd('wall', msg) return # Return date string in the following format YYYYMMDD def getShortDateStr(tm...
jiaphuan/models
refs/heads/master
research/compression/entropy_coder/lib/blocks_masked_conv2d_test.py
5
# 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 applicab...
stephane-martin/salt-debian-packaging
refs/heads/master
salt-2016.3.3/salt/utils/nb_popen.py
2
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` salt.utils.nb_popen ~~~~~~~~~~~~~~~~~~~ Non blocking subprocess Popen. This functionality has been adapted to work on windows following the recipe found on: http://code.activestate.com/recipes/44055...
vladmm/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/Nonlocal.before.py
83
def foo(): x = 1 def bar(): nonlocal x <selection>x = 2</selection> print(x) bar() foo()
Ballz0fSteel/Umeko
refs/heads/master
lib/youtube_dl/extractor/mit.py
77
from __future__ import unicode_literals import re import json from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( clean_html, ExtractorError, get_element_by_id, ) class TechTVMITIE(InfoExtractor): IE_NAME = 'techtv.mit.edu' _VALID_URL = r'https?://techtv\.mit\....
BigGillyStyle/exercism
refs/heads/master
python/hello-world/hello_world.py
12
# # Skeleton file for the Python "Hello World" exercise. # def hello(name=''): return
mosaic-cloud/mosaic-distribution-dependencies
refs/heads/development
dependencies/otp/17.1/lib/asn1/test/asn1_SUITE_data/SeqSetLib.py
97
SeqSetLib DEFINITIONS IMPLICIT TAGS ::= BEGIN EXPORTS Seq1,Set1; Seq1 ::= SEQUENCE { bool1 BOOLEAN, int1 INTEGER, seq1 SeqIn } Set1 ::= SET { bool1 BOOLEAN, int1 INTEGER, set1 SetIn } SetIn ::= SET { boolIn BOOLEAN, intIn INTEGER } SeqIn ::= SEQUENCE { boolIn BOOLEAN, intIn INTEG...
JordanReiter/django-notification
refs/heads/master
notification/lockfile.py
39
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = FileLock('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked alread...
pschwartz/ansible
refs/heads/devel
v1/ansible/runner/connection_plugins/accelerate.py
109
# (c) 2012, 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) any lat...
takaaptech/sky_engine
refs/heads/master
build/android/gyp/jar.py
36
#!/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 fnmatch import optparse import os import sys from util import build_utils from util import md5_check def Jar(class_files, c...
ajyoon/brown
refs/heads/master
doc/generator.py
1
import os import shutil import sys from jinja2 import Environment, PackageLoader from scss.compiler import Compiler as ScssCompiler import doc.doc_config as doc_config from doc.utils import (ensure_path_exists, module_path_to_import_name, package_path_to_import_name) from...
bitcoinknots/bitcoin
refs/heads/0.19.x-knots
test/functional/feature_notifications.py
1
#!/usr/bin/env python3 # Copyright (c) 2014-2019 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 the -alertnotify, -blocknotify and -walletnotify options.""" import os from test_framework.addres...
digitalreasoning/vowpal_wabbit
refs/heads/master
python/test_search.py
29
import sys import pyvw class SequenceLabeler(pyvw.SearchTask): def __init__(self, vw, sch, num_actions): # you must must must initialize the parent class # this will automatically store self.sch <- sch, self.vw <- vw pyvw.SearchTask.__init__(self, vw, sch, num_actions) # you can te...
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/win32comext/shell/__init__.py
186
# See if we have a special directory for the binaries (for developers) import win32com win32com.__PackageSupportBuildPath__(__path__)
d40223223/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_io.py
629
""" Python implementation of the io module. """ import os import abc import codecs import errno # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock import io #brython fix me #from io imp...
awkspace/ansible
refs/heads/devel
test/units/contrib/inventory/test_vmware_inventory.py
70
import json import os import pytest import sys BASIC_INVENTORY = { 'all': { 'hosts': ['foo', 'bar'] }, '_meta': { 'hostvars': { 'foo': {'hostname': 'foo'}, 'bar': {'hostname': 'bar'} } } } class FakeArgs(object): debug = False write_dumpfile = N...
amwelch/a10sdk-python
refs/heads/master
a10sdk/core/interface/interface_ve_ip_stateful_firewall.py
2
from a10sdk.common.A10BaseClass import A10BaseClass class StatefulFirewall(A10BaseClass): """Class Description:: Configure Stateful Firewall direction. Class stateful-firewall supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` ...
google/NeuroNER-CSPMC
refs/heads/master
neuroner/utils_tf.py
2
import tensorflow as tf def variable_summaries(var): ''' Attach a lot of summaries to a Tensor (for TensorBoard visualization). From https://www.tensorflow.org/get_started/summaries_and_tensorboard ''' with tf.name_scope('summaries'): mean = tf.reduce_mean(var) tf.summary.scalar('me...
cpennington/edx-platform
refs/heads/master
openedx/core/djangoapps/catalog/management/commands/create_catalog_integrations.py
4
'''CatalogIntegration management command''' from django.core.management import BaseCommand, CommandError from openedx.core.djangoapps.catalog.models import CatalogIntegration class Command(BaseCommand): """Management command used to create catalog integrations.""" help = "Create catalog integration record i...
julian-seward1/servo
refs/heads/master
tests/wpt/web-platform-tests/webdriver/actions/mouse.py
24
from support.refine import get_events, filter_dict def test_click_at_coordinates(session, test_actions_page, mouse_chain): div_point = { "x": 82, "y": 187, } button = 0 mouse_chain \ .pointer_move(div_point["x"], div_point["y"], duration=1000) \ .pointer_down(button) \ ...
farlandliu/zinnia
refs/heads/master
migrations/0006_entry_template.py
4
from south.db import db from south.v2 import SchemaMigration from zinnia.migrations import user_name from zinnia.migrations import user_table from zinnia.migrations import user_orm_label from zinnia.migrations import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding f...
iseppi/zookeepr
refs/heads/master
zk/model/proposal.py
4
"""The application's model objects""" import sqlalchemy as sa from meta import Base from pylons.controllers.util import abort from meta import Session from person import Person from person_proposal_map import person_proposal_map from attachment import Attachment from review import Review from stream import Stream ...
Sensis/pyaem
refs/heads/master
test/test_webconsole.py
1
from mock import MagicMock import pyaem from pyaem import bagofrequests as bag import unittest from .util import HandlersMatcher class TestWebConsole(unittest.TestCase): def setUp(self): self.web_console = pyaem.webconsole.WebConsole('http://localhost:4502', debug=True) bag.request = MagicMock()...
lucastanure/GoGo-Real-Software
refs/heads/master
qtcreator/update.py
1
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright (C) 2010-2012 Lucas Aníbal Tanure Alves - ME # Contact Lucas Tanure [ltanure@gmail.com] # # This file is part of GoGo Real. # # GoGo Real is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
stopstalk/stopstalk-deployment
refs/heads/master
aws_lambda/spoj_aws_lambda_function/lambda_code/pip/_internal/resolve.py
8
"""Dependency Resolution The dependency resolution in pip is performed as follows: for top-level requirements: a. only one spec allowed per project, regardless of conflicts or not. otherwise a "double requirement" exception is raised b. they override sub-dependency requirements. for sub-dependencies ...
alkalait/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
refs/heads/master
ExamplesFromChapters/Chapter2/FreqOfCheaters.py
97
import pymc as pm p = pm.Uniform("freq_cheating", 0, 1) @pm.deterministic def p_skewed(p=p): return 0.5 * p + 0.25 yes_responses = pm.Binomial( "number_cheaters", 100, p_skewed, value=35, observed=True) model = pm.Model([yes_responses, p_skewed, p]) # To Be Explained in Chapter 3! mcmc = pm.MCMC(model) mc...
Edeleon4/PoolShark
refs/heads/master
Python279/Tools/i18n/makelocalealias.py
24
#!/usr/bin/env python """ Convert the X11 locale.alias file into a mapping dictionary suitable for locale.py. Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10. """ import locale # Location of the alias file LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias' def parse(filename): f = open(f...
AlmogCohen/flask-admin
refs/heads/master
examples/quickstart/app2.py
42
from flask import Flask from flask_admin import Admin, BaseView, expose class MyView(BaseView): @expose('/') def index(self): return self.render('index.html') app = Flask(__name__) app.debug = True admin = Admin(app, name="Example: Quickstart2") admin.add_view(MyView(name='Hello')) if __name__ == '...
Immortalin/python-for-android
refs/heads/master
python3-alpha/extra_modules/oauth2/clients/imap.py
885
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
ROMFactory/android_external_chromium_org
refs/heads/kitkat
chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/imap.py
885
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
emiliop/webservice
refs/heads/master
vendor/psy/psysh/test/tools/gen_unvis_fixtures.py
536
#! /usr/bin/env python3 import sys from os.path import abspath, expanduser, dirname, join from itertools import chain import json import argparse from vis import vis, unvis, VIS_WHITE __dir__ = dirname(abspath(__file__)) OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json') # Add custom fixtures her...
indautgrp/erpnext
refs/heads/develop
erpnext/schools/doctype/program_fee/program_fee.py
54
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ProgramFee(Document): pass
hellwen/ivy_3dprint_site
refs/heads/master
list/lib/python3.3/site-packages/pip/vendor/html5lib/inputstream.py
79
from __future__ import absolute_import, division, unicode_literals from pip.vendor.six import text_type import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import utils from io import StringIO try: from io im...
andy928/xpenology
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
joongh/robotframework
refs/heads/master
atest/testresources/listeners/ListenAll.py
27
import os import time class ListenAll: ROBOT_LISTENER_API_VERSION = '2' def __init__(self, *path): path = ':'.join(path) if path else self._get_default_path() self.outfile = open(path, 'w') def _get_default_path(self): return os.path.join(os.getenv('TEMPDIR'), 'listen_all.txt') ...
allenta/varnish-bans-manager
refs/heads/master
varnish_bans_manager/core/views/user.py
1
# -*- coding: utf-8 -*- ''' :copyright: (c) 2012 by Allenta Consulting, see AUTHORS.txt for more details. :license: GPL, see LICENSE.txt for more details. ''' from __future__ import absolute_import import urlparse from abc import ABCMeta from django.contrib import auth, messages from django.contrib.auth.decorators im...
Nowheresly/odoo
refs/heads/8.0
addons/base_gengo/wizard/base_gengo_translations.py
296
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
NESCent/dplace
refs/heads/master
dplace_app/tests/test_serializers.py
4
from django.test import TestCase from dplace_app.serializers import Legend # much of the testing of serializers is done in test_api, this is here to catch the # remainder of the unexposed/untested code. class LegendTestCase(TestCase): """Tests the Legend""" def test_name(self): assert Legend('name', ...
BasuCert/DefaceDetector
refs/heads/master
app/utils.py
1
import os import yaml def get_parent_path(file_path): curfilePath = os.path.abspath(file_path) curDir = os.path.abspath(os.path.join(curfilePath, os.pardir)) return os.path.abspath(os.path.join(curDir, os.pardir)) def get_config(term, section="general"): try: conf_file = get_parent_path(__fi...
DataDog/integrations-core
refs/heads/master
envoy/tests/test_metrics.py
1
from datadog_checks.envoy.metrics import METRIC_PREFIX, METRIC_TREE, METRICS from datadog_checks.envoy.utils import make_metric_tree def test_metric_prefix(): assert METRIC_PREFIX == 'envoy.' def test_metric_tags_sequence_type(): for metric in METRICS: for tag in METRICS[metric]['tags']: ...
tntnatbry/tensorflow
refs/heads/master
tensorflow/contrib/slim/python/slim/nets/overfeat.py
164
# 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...
k2wl/evolution_i9082
refs/heads/cm11exp
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
rwecho/fflask_blog
refs/heads/master
five8/five8/mydb/db_context.py
1
from sqlalchemy import create_engine, func, cast, desc, distinct, exists, Column, String, INT, DATETIME, TEXT from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from datetime import datetime import pytz import five8.config as config Base = declarative_base() connection = c...
Juliusz/ntlmaps
refs/heads/master
ntlmaps/http_header.py
5
# This file is part of 'NTLM Authorization Proxy Server' # Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru> # # NTLM APS 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 Licens...
khwang/plum
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/msvs_emulation.py
388
# Copyright (c) 2012 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
googleapis/python-translate
refs/heads/master
google/cloud/__init__.py
120
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
crcox/NEXT
refs/heads/master
next/database/database_lib.py
1
#!/usr/bin/python """ Helper methods for database backup and restore. """ import shutil import tempfile import subprocess import next.constants as constants def make_mongodump(name,exp_uid_list=[]): tmp_dir = tempfile.mkdtemp() if len(exp_uid_list)==0: subprocess.call(('/usr/bin/mongodump -vvvvv --host...
denovator/myfriki
refs/heads/master
lib/jinja2/jinja2/testsuite/lexnparse.py
402
# -*- coding: utf-8 -*- """ jinja2.testsuite.lexnparse ~~~~~~~~~~~~~~~~~~~~~~~~~~ All the unittests regarding lexing, parsing and syntax. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja...
helinb/Tickeys-linux
refs/heads/master
tickeys/kivy/core/image/img_tex.py
54
''' Tex: Compressed texture ''' __all__ = ('ImageLoaderTex', ) import json from struct import unpack from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderTex(ImageLoaderBase): @staticmethod def extensions(): return ('tex', ) def lo...
JohnHowland/kivy
refs/heads/master
kivy/core/image/img_tex.py
54
''' Tex: Compressed texture ''' __all__ = ('ImageLoaderTex', ) import json from struct import unpack from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderTex(ImageLoaderBase): @staticmethod def extensions(): return ('tex', ) def lo...
cafecivet/django_girls_tutorial
refs/heads/master
Lib/site-packages/django/db/backends/mysql/client.py
84
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_...
partofthething/home-assistant
refs/heads/dev
homeassistant/components/hikvisioncam/switch.py
14
"""Support turning on/off motion detection on Hikvision cameras.""" import logging import hikvision.api from hikvision.error import HikvisionError, MissingParamError import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import ( CONF_HOST, ...
timy/dm_spec
refs/heads/exp
ana/seidner/plot_ppar_2d.py
1
import numpy as np import sys sys.path.append( '../../pkg' ) import pymod_indx, pymod_data, pymod_plot dat_idx = [[0, '[-1, 1, 1] in z-axis']] func = np.abs time = np.loadtxt( "res/time.dat" ) grid = np.loadtxt( "res/grid_2d_0.dat") i_dir = 40 # data = np.loadtxt( "res/ppar_2d_dpl0_coo2_%d_0.dat" % i_dir ) # for i i...
AOSP-S4-KK/platform_external_chromium_org
refs/heads/kk-4.4
net/tools/testserver/testserver_base.py
63
# 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 BaseHTTPServer import errno import json import optparse import os import re import socket import SocketServer import struct import sys import warnings...
auready/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/app1/3_auto.py
133
from django.db import migrations class Migration(migrations.Migration): dependencies = [("app1", "2_auto"), ("app2", "2_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
ccrouch/tuskar
refs/heads/master
tuskar/openstack/common/timeutils.py
39
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # 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.apac...
alfayez/gnuradio
refs/heads/master
gr-analog/python/qa_dpll.py
3
#!/usr/bin/env python # # 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) # ...
PFCal-dev/HGCanalysis
refs/heads/master
test/recoStep_cfg.py
2
# Auto generated configuration file # using: # Revision: 1.20 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: step3_diPhotonP10 --conditions auto:upgradePLS3 -n 100 --eventcontent FEVTDEBUGHLT -s RAW2DIGI,L1Reco,RECO --datatier GEN-SIM-RECO --custom...
yxtj/Neuron
refs/heads/master
dataAnalysis/method_base.py
2
import math def _check_length(l1,l2): if l1!=l2: raise ValueError('length of line1 ('+str(l1)+') do not match length of line2 ('+str(l2)+')!') #Calculate Pearson coefficient for two vector on SAME LENGTH def pearson_lines(line1,line2,param=None): l=len(line1) _check_length(l,len(line2)) c=0; s1=[0,0]; s2=[0,0]...
unless/-Wind_iproj_JB_kernel_temp
refs/heads/master
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...
himikof/aiohttp_debugtoolbar
refs/heads/master
aiohttp_debugtoolbar/panels/performance.py
1
try: import cProfile as profile except ImportError: # pragma: no cover try: import profile except ImportError: # pragma: no cover profile = None try: import resource except ImportError: # pragma: no cover resource = None # Will fail on Win32 systems try: import pstats except ...
DMLoy/ECommerceBasic
refs/heads/master
lib/python2.7/site-packages/django/contrib/localflavor/mk/forms.py
109
from __future__ import absolute_import, unicode_literals import datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.mk.mk_choices im...
dyrock/trafficserver
refs/heads/master
doc/conf.py
2
# -*- coding: utf-8 -*- # # Apache Traffic Server documentation build configuration file, created by # sphinx-quickstart on Mon Mar 4 06:23:15 2013. # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional ...
mzupan/Diamond
refs/heads/master
src/collectors/aurora/aurora.py
48
import diamond.collector import urllib2 class AuroraCollector(diamond.collector.Collector): def get_default_config_help(self): config_help = super(AuroraCollector, self).get_default_config_help() config_help.update({ 'host': 'Scheduler Hostname', ...
wangmiao1981/spark
refs/heads/master
examples/src/main/python/sql/streaming/structured_network_wordcount_windowed.py
27
# # 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...
huangzonghao/ycmd
refs/heads/master
examples/.ycm_extra_conf.py
37
#!/usr/bin/env python # # Copyright (C) 2014 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
malcolmw/seismic-python
refs/heads/master
seispy/pandas/__init__.py
3
from . import io from . import catalog from . import time
miguelparaiso/OdooAccessible
refs/heads/master
addons/l10n_fr/wizard/fr_report_bilan.py
374
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential #...