repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
michellab/SireUnitTests
refs/heads/devel
unittests/SireIO/test_ambgro.py
1
from Sire.IO import * from Sire.System import * from Sire.MM import * from Sire.Mol import * from Sire.CAS import * from Sire.Units import * from nose.tools import assert_equal, assert_almost_equal def _assert_almost_equal( a, b, tol=0.5 ): if abs( a - b ) > tol: assert_almost_equal(a, b, 2) def _ad...
gangadhar-kadam/latestchurcherp
refs/heads/v5.0
erpnext/hr/doctype/holiday_list/test_holiday_list.py
112
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe test_records = frappe.get_test_records('Holiday List')
kou/arrow
refs/heads/master
python/pyarrow/tests/test_flight.py
3
# 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 u...
AndrewPeelMV/Blender2.78c
refs/heads/master
2.78/scripts/addons/presets/operator/mesh.bolt_add/m10.py
2
import bpy op = bpy.context.active_operator op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' op.bf_Shank_Length = 0.0 op.bf_Shank_Dia = 10.0 op.bf_Phillips_Bit_Depth = 4.082691192626953 op.bf_Allen_Bit_Depth = 5.0 op.bf_Allen_Bit_Flat_Dista...
propertyshelf/ps.plone.hostingctl
refs/heads/master
src/ps/plone/hostingctl/views/views.py
1
# -*- coding: utf-8 -*- # zope imports from Products.Five import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from zope.component import queryUtility from zope.interface import implementer from zope.publisher.interfaces import IPublishTraverse # local imports from .forms import...
tctara/calamares
refs/heads/master
src/modules/fstab/main.py
2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2014, Aurélien Gâteau <agateau@kde.org> # Copyright 2016, Teo Mrnjavac <teo@kde.org> # # Calamares is free software: you can redistribute it and/or modify # it under the terms ...
Inspq/ansible
refs/heads/inspq
lib/ansible/modules/cloud/rackspace/rax_cbs.py
70
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
RAtechntukan/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/mechanize/_sockettimeout.py
149
import socket try: _GLOBAL_DEFAULT_TIMEOUT = socket._GLOBAL_DEFAULT_TIMEOUT except AttributeError: _GLOBAL_DEFAULT_TIMEOUT = object()
qk4l/Flexget
refs/heads/develop
flexget/tests/api_tests/test_api_validator.py
9
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import json class TestValidator(object): config = '{tasks: {}}' def test_invalid_payload(self, api_client): new_task = { 'name': 'new_task', ...
flyfei/python-for-android
refs/heads/master
python-modules/twisted/twisted/names/resolve.py
54
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Lookup a name using multiple resolvers. Future Plans: This needs someway to specify which resolver answered the query, or someway to specify (authority|ttl|cache behavior|more?) @author: Jp Calderone """ from twisted.internet imp...
kyleshrader/pithos
refs/heads/master
pithos/gobject_worker.py
2
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- ### BEGIN LICENSE # Copyright (C) 2010-2012 Kevin Mehall <km@kevinmehall.net> #This program is free software: you can redistribute it and/or modify it #under the terms of the GNU General Public License version 3, as published #by the Free Software Foundati...
DaveSpivey/muttwhat
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py
2779
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
cshtarkov/autobump
refs/heads/master
autobump/handlers/java_native.py
1
# Copyright 2016-2017 Christian Shtarkov # # This file is part of Autobump. # # 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 ver...
theopak/glassface
refs/heads/master
server/glassface/migrations/0003_auto__add_field_glassfaceuser_profile_picture1__add_field_glassfaceuse.py
1
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GlassfaceUser.profile_picture1' db.add_column(u'glassface_glassfaceuser', 'profile_picture1'...
rinderer/fusesoc
refs/heads/master
fusesoc/provider/url.py
2
from fusesoc.utils import pr_info, pr_warn import subprocess import os.path import sys import tarfile import zipfile import shutil import logging logger = logging.getLogger(__name__) if sys.version_info[0] >= 3: import urllib.request as urllib from urllib.error import URLError else: import urllib from...
kerneltask/micropython
refs/heads/master
tests/basics/exception_chain.py
92
# Exception chaining is not supported, but check that basic # exception works as expected. try: raise Exception from None except Exception: print("Caught Exception")
saltduck/OpenBazaar-Server
refs/heads/master
market/network.py
4
__author__ = 'chris' import base64 import bitcointools import gnupg import httplib import json import nacl.signing import nacl.hash import nacl.encoding import nacl.utils import obelisk import os.path import pickle import time import struct from binascii import unhexlify from bitcoin.core import b2lx from collections ...
ThQ/p8ste
refs/heads/master
src/libs/smoid/languages/begin.py
2
from smoid.languages import Check, CheckCollection class BeginCheck (Check): def __init__ (self): Check.__init__(self) self.name = "Begin" self.example = "begin" self.add_language("ada") self.add_language("ruby") self.add_multiple_matches("(?:^|\r|\n|;)\s*begi...
x2nie/odoo
refs/heads/8.0
addons/l10n_si/__init__.py
439
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright: (C) 2012 - Mentis d.o.o., Dravograd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
megajanlott/cbor-decoder
refs/heads/master
tests/test_UInt.py
1
from io import BytesIO from cbor.MajorType import MajorType from cbor.CBORStream import CBORStream from cbor.type.UInt import UIntInfo from tests.MockHandler import MockHandler def ignore_handler(v): return def test_run_uint_probe(): data = CBORStream(BytesIO(bytes([0b00000001]))) assert type(MajorType(...
agiliq/django
refs/heads/master
django/contrib/contenttypes/generic.py
99
from __future__ import unicode_literals import warnings from django.utils.deprecation import RemovedInDjango19Warning warnings.warn( ('django.contrib.contenttypes.generic is deprecated and will be removed in ' 'Django 1.9. Its contents have been moved to the fields, forms, and admin ' 'submodules of dj...
theoneandonly-vector/LaZagne
refs/heads/master
Windows/src/LaZagne/softwares/wifi/wifi.py
11
from config.write_output import print_output, print_debug from config.header import Header from config.get_system_priv import get_system_priv from ctypes import * import time, tempfile from ConfigParser import RawConfigParser import os from config.moduleInfo import ModuleInfo class Wifi(ModuleInfo): def __i...
Sigf/outbreak
refs/heads/master
birdseye/src/geoip_lookup.py
1
""" file: geoip_lookup.py desc: TODO """ import geoip2.webservice def geoip_lookup(ip_list): geoip_list = [] user_id = 96141 license = 'dpnkKYI2nCCv' client = geoip2.webservice.Client(user_id, license) if ip_list is None or not ip_list: return geoip_list for ip in ip_list: t...
krieger-od/nwjs_chromium.src
refs/heads/master
tools/memory_inspector/memory_inspector/classification/rules_unittest.py
109
# Copyright 2014 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 unittest from memory_inspector.classification import rules _TEST_RULE = """ [ { 'name': '1', 'mmap-file': r'/foo/1', 'foo': 'bar', 'childre...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/cognitiveservices/azure-cognitiveservices-search-visualsearch/azure/cognitiveservices/search/visualsearch/models/image_knowledge_py3.py
1
# 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 ...
fpy171/django
refs/heads/master
tests/string_lookup/models.py
281
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def...
kaichogami/scikit-learn
refs/heads/master
doc/datasets/twenty_newsgroups_fixture.py
41
"""Fixture module to skip the datasets loading when offline Doctests are skipped if the datasets have not already been downloaded and cached in the past. """ from os.path import exists from os.path import join from nose import SkipTest from sklearn.datasets import get_data_home def setup_module(module): data_hom...
meteorcloudy/tensorflow
refs/heads/master
tensorflow/python/training/checkpoint_ops_test.py
35
# 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...
pamu/FooService
refs/heads/master
FooService1/project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
#!/usr/bin/env python # Copyright (c) 2011 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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
seann1/portfolio5
refs/heads/master
.meteor/dev_bundle/python/Lib/distutils/util.py
64
"""distutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. """ __revision__ = "$Id$" import sys, os, string, re from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer from distutils.spawn import spawn from distutils import ...
SimVascular/VTK
refs/heads/master
Common/DataModel/Testing/Python/TestICPTransform.py
26
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ========================================================================= Program: Visualization Toolkit Module: TestNamedColorsIntegration.py Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www....
openfun/edx-platform
refs/heads/master
common/djangoapps/terrain/stubs/video_source.py
181
""" Serve HTML5 video sources for acceptance tests """ from SimpleHTTPServer import SimpleHTTPRequestHandler from .http import StubHttpService from contextlib import contextmanager import os from logging import getLogger LOGGER = getLogger(__name__) class VideoSourceRequestHandler(SimpleHTTPRequestHandler): """ ...
numenta-ci/nupic
refs/heads/master
src/nupic/regions/CLAClassifierRegion.py
3
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditio...
emakis/erpnext
refs/heads/develop
erpnext/patches/v5_0/update_account_types.py
120
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): for company in frappe.db.get_all("Company"): company = frappe.get_doc("Company", company.name) match_types = ("Stock...
calvinleenyc/zulip
refs/heads/master
zerver/lib/message.py
8
from __future__ import absolute_import import datetime import ujson import zlib from django.utils.translation import ugettext as _ from six import binary_type, text_type from zerver.lib.avatar import get_avatar_url from zerver.lib.avatar_hash import gravatar_hash import zerver.lib.bugdown as bugdown from zerver.lib....
MiLk/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_info_center_trap.py
39
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
pshen/ansible
refs/heads/devel
lib/ansible/plugins/connection/lxc.py
44
# (c) 2015, Joerg Thalheim <joerg@higgsboson.tk> # # 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 ve...
niosus/tapiriik
refs/heads/master
tapiriik/web/models.py
10644
from django.db import models # Create your models here.
catalpainternational/rapidsms
refs/heads/master
rapidsms/router/celery/tests.py
2
from mock import patch from django.test import TestCase from django.test.utils import override_settings from rapidsms.tests import harness from rapidsms.router import get_router from rapidsms.router.celery.tasks import receive_async, send_async class CeleryRouterTest(harness.DatabaseBackendMixin, TestCase): """...
chennan47/osf.io
refs/heads/develop
addons/dataverse/settings/local-travis.py
54
DEFAULT_HOSTS = [ 'dataverse.harvard.edu', # Harvard PRODUCTION server 'dataverse.lib.virginia.edu' # University of Virginia server ]
fbradyirl/home-assistant
refs/heads/dev
tests/components/panel_iframe/__init__.py
39
"""Tests for the panel_iframe component."""
rolandgeider/OpenSlides
refs/heads/master
openslides/motions/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-02 01:22 from __future__ import unicode_literals import django.db.models.deletion import jsonfield.fields from django.conf import settings from django.db import migrations, models import openslides.utils.models class Migration(migrations.Migration): ...
fernandoacorreia/DjangoWAWSLogging
refs/heads/master
DjangoWAWSLogging/env/Lib/site-packages/pywin32-218-py2.7-win32.egg/pythoncom.py
49
# Magic utility that "redirects" to pythoncomxx.dll import pywintypes pywintypes.__import_pywin32_system_module__("pythoncom", globals())
SaptakS/open-event-orga-server
refs/heads/master
migrations/versions/cc6c2a3152bd_.py
10
"""empty message Revision ID: cc6c2a3152bd Revises: 752be2444e8d Create Date: 2016-07-29 20:18:15.871000 """ # revision identifiers, used by Alembic. revision = 'cc6c2a3152bd' down_revision = '752be2444e8d' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto...
Program-person75/SCTtest
refs/heads/master
plugins/ti.alloy/plugin.py
1729
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
ministryofjustice/salt-cloud-provider-vcloud
refs/heads/master
salt/cloud/clouds/vcloud.py
1
import sys import copy import pprint import logging from lxml.builder import E import salt.config as config from salt.cloud.libcloudfuncs import * # pylint: disable-msg=W0614,W0401 from salt.utils import namespaced_function import salt.utils.cloud import libcloud from libcloud.compute.base import NodeImage from .v...
mlperf/inference_results_v0.5
refs/heads/master
closed/Google/code/gnmt/tpu-gnmt/home/kbuilder/mlperf-inference/google3/third_party/mlperf/inference/gnmt/nmt/gnmt_model.py
5
# Copyright 2017 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 a...
JTarball/generator-dockerized-django-polymer
refs/heads/master
app/templates/docker/app/app/backend/apps/_archive/accounts_old/django-rest-auth-master/rest_auth/app_settings.py
29
from django.conf import settings from rest_auth.serializers import ( TokenSerializer as DefaultTokenSerializer, UserDetailsSerializer as DefaultUserDetailsSerializer, LoginSerializer as DefaultLoginSerializer, PasswordResetSerializer as DefaultPasswordResetSerializer, PasswordResetConfirmSerializer...
ionutbalutoiu/ironic
refs/heads/master
ironic/api/controllers/v1/node.py
2
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
epa/sqlalchemy
refs/heads/master
lib/sqlalchemy/engine/threadlocal.py
59
# engine/threadlocal.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides a thread-local transactional wrapper around the root Engine class....
BackupGGCode/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/profile.py
50
#! /usr/bin/env python3 # # Class for profiling python code. rev 1.0 6/2/94 # # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licens...
gnuhub/intellij-community
refs/heads/master
python/testData/formatter/spaceInMethodDeclaration.py
83
def foo(bar, baz): pass foo(True, False)
step21/inkscape-osx-packaging-native
refs/heads/master
packaging/macosx/Inkscape.app/Contents/Resources/extensions/color_desaturate.py
3
import coloreffect class C(coloreffect.ColorEffect): def colmod(self,r,g,b): l = (max(r,g,b)+min(r,g,b))/2 ig=int(round(l)) return '%02x%02x%02x' % (ig,ig,ig) c = C() c.affect()
automl/RoBO
refs/heads/master
experiments/fabolas/run_mtbo.py
2
import os import sys import json import logging import numpy as np logging.basicConfig(level=logging.INFO) from robo.fmin import mtbo from hpolib.benchmarks.ml.svm_benchmark import SvmOnMnist, SvmOnVehicle, SvmOnCovertype, SvmOnAdult, SvmOnHiggs, SvmOnLetter from hpolib.benchmarks.ml.residual_networks import Residua...
michal-stuglik/newtbase
refs/heads/master
newtbase/data_loaders/loader_objects.py
1
""" Methods for annotation data loading into database. """ # transcript class from newtbase.models import Transcript, Orf, Accession, Blast, Go, GoUniprotMapper # Annotation data DB_PATH = 'Trinotate.sqlite' ACCESSION_PATH = 'uniprot_annot' def blast_annotation_extractor(cur): accession_set = set() # sqlit...
gjtempleton/moto
refs/heads/master
moto/swf/urls.py
22
from .responses import SWFResponse url_bases = [ "https?://swf.(.+).amazonaws.com", ] url_paths = { '{0}/$': SWFResponse.dispatch, }
jsteemann/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32com/test/testDynamic.py
17
# Test dynamic policy, and running object table. import pythoncom import winerror from win32com.server.exception import Exception error = "testDynamic error" iid = pythoncom.MakeIID("{b48969a0-784b-11d0-ae71-d23f56000000}") class VeryPermissive: def _dynamic_(self, name, lcid, wFlags, args): if wFlags ...
jackru/pybrain
refs/heads/master
pybrain/optimization/populationbased/coevolution/coevolution.py
25
from __future__ import print_function __author__ = 'Tom Schaul, tom@idsia.ch' from scipy import argmax, array from random import sample, choice, shuffle from pybrain.utilities import fListToString, Named class Coevolution(Named): """ Population-based generational evolutionary algorithm with fitness being b...
patrioticcow/MessagesForSkype
refs/heads/master
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/idlelib/PathBrowser.py
70
import os import sys import imp from TreeWidget import TreeItem from ClassBrowser import ClassBrowser, ModuleBrowserTreeItem class PathBrowser(ClassBrowser): def __init__(self, flist): self.init(flist) def settitle(self): self.top.wm_title("Path Browser") self.top.wm_iconname("Path B...
Eddy0402/Environment
refs/heads/master
vim/ycmd/third_party/jedi/test/test_evaluate/not_in_sys_path/not_in_sys_path.py
34
value = 3
asedunov/intellij-community
refs/heads/master
python/testData/inspections/PyAttributeOutsideInitInspection/staticMethod.py
80
class C(object): @staticmethod def static_method(obj, name): obj.name = name # warning here
numenta/htmresearch
refs/heads/master
projects/sequence_prediction/discrete_sequences/plotFaultyTMPerformance.py
12
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
abligh/xen4.2-minideb
refs/heads/master
tools/python/logging/logging-0.4.9.2/test/log_test2.py
42
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
ptitjano/bokeh
refs/heads/master
sphinx/source/docs/user_guide/source_examples/charts_histogram_bins.py
8
from bokeh.charts import Histogram, output_file, show from bokeh.sampledata.autompg import autompg as df p = Histogram(df, values='mpg', bins=50, title="MPG Distribution (50 bins)") output_file("histogram_bins.html") show(p)
mtaufen/test-infra
refs/heads/master
gubernator/pull_request_test.py
18
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
googleapis/google-cloud-cpp
refs/heads/main
google/cloud/storage/emulator/utils/generation.py
1
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
cirocosta/cheader
refs/heads/master
src/cheader.py
1
#!/usr/bin/python from __future__ import print_function import sys sys.path.extend(['.', '..']) from pycparser import c_parser, c_ast, parse_file, c_generator def get_func_defs(filename): gotten = [] ast = parse_file(filename, use_cpp=True) generator = c_generator.CGenerator() for ext in ast.ext: ...
way2heavy/youtube-dl-1
refs/heads/master
youtube_dl/downloader/rtsp.py
119
from __future__ import unicode_literals import os import subprocess from .common import FileDownloader from ..utils import ( check_executable, encodeFilename, ) class RtspFD(FileDownloader): def real_download(self, filename, info_dict): url = info_dict['url'] self.report_destination(file...
WhireCrow/openwrt-mt7620
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/gbk.py
816
# # gbk.py: Python Unicode Codec for GBK # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gbk') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrementalEnco...
ddddwee1/SULsT
refs/heads/master
SUL1/sample/text_detection/data_reader.py
1
# class for data reader # include online data augmentation steps import numpy as np import cv2 import random class data_reader(): def __init__(self, validation_ratio): data = self.load_dataset() # data: list of [image, label] random.shuffle(data) val_index = int(len(data)*validation_ratio) self.training_...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/gdata/src/gdata/tlslite/integration/IMAP4_TLS.py
319
"""TLS Lite + imaplib.""" import socket from imaplib import IMAP4 from gdata.tlslite.TLSConnection import TLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper # IMAP TLS PORT IMAP4_TLS_PORT = 993 class IMAP4_TLS(IMAP4, ClientHelper): """This class extends L{imaplib.IMAP4} with TLS suppor...
vipul-sharma20/oh-mainline
refs/heads/master
vendor/packages/twisted/setup.py
16
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Distutils installer for Twisted. """ try: # Load setuptools, to build a specific source package import setuptools except ImportError: pass import sys, os def getExtensions(): """ Get all extension...
syskill/snowy
refs/heads/master
lib/recaptcha/client/captcha.py
21
import urllib2, urllib API_SSL_SERVER="https://api-secure.recaptcha.net" API_SERVER="http://api.recaptcha.net" VERIFY_SERVER="api-verify.recaptcha.net" class RecaptchaResponse(object): def __init__(self, is_valid, error_code=None): self.is_valid = is_valid self.error_code = error_code def display...
mgarg1/ecg
refs/heads/master
ecg_visualizer_ble_PC/streamplot.py
1
''' stream-plot is a data visualization tool for streaming data. Copyright (C) 2013 Sagar G V E-mail : sagar.writeme@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundat...
ucrcsedept/galah
refs/heads/master
galah/sheep/virtualsuites/vz/pyvz.py
3
import subprocess, ConfigParser, sys, os, datetime from galah.base.magic import memoize # Load Galah's configuration. from galah.base.config import load_config config = load_config("sheep/vz") vzctlPath = "/usr/sbin/vzctl" vzlistPath = "/usr/sbin/vzlist" containerDirectory = None nullFile = open("/dev/null", "w") de...
mrquim/mrquimrepo
refs/heads/master
repo/script.module.youtube.dl/lib/youtube_dl/extractor/condenast.py
17
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_urlparse, ) from ..utils import ( determine_ext, extract_attributes, int_or_none, js_to_json, mimetype2ext, orderedSet, pa...
Nitaco/ansible
refs/heads/devel
lib/ansible/plugins/action/net_lldp.py
756
# (c) 2017, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
nuuuboo/odoo
refs/heads/8.0
addons/gamification/wizard/update_goal.py
386
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
irap-omp/deconv3d
refs/heads/master
lib/math_utils.py
1
import numpy as np def merge_where_nan(target, filler): """ Mutates `target` by replacing its nan values by values from `filler`. This is a very simple polyfill for `numpy.copyto`. (for numpy<1.7) """ try: np.copyto(target, filler, where=np.isnan(target)) except AttributeError: ...
cntnboys/410Lab6
refs/heads/master
build/django/build/lib.linux-x86_64-2.7/django/core/management/commands/makemessages.py
34
import fnmatch import glob import io import os import re import sys from itertools import dropwhile from optparse import make_option import django from django.conf import settings from django.core.management.base import CommandError, NoArgsCommand from django.core.management.utils import (handle_extensions, find_comma...
probcomp/cgpm
refs/heads/master
tests/test_cmi_partition.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
cyrus-/typy
refs/heads/typy
typy/old/_fragment.py
1
"""typy fragments""" __all__ = ("Fragment",) class Fragment(object): def __init__(self): raise FragmentCannotBeInstantiated()
TimYi/django
refs/heads/master
tests/model_formsets_regress/tests.py
173
from __future__ import unicode_literals from django import forms from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet from django.forms.models import ( BaseModelFormSet, inlineformset_factory, modelform_factory, modelformset_factory, ) from django.forms.utils import ErrorDict, ErrorList from djan...
Ingenico-ePayments/connect-sdk-python2
refs/heads/master
examples/merchant/refunds/approve_refund_example.py
2
# # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # import os from ingenico.connect.sdk.factory import Factory from ingenico.connect.sdk.domain.refund.approve_refund_request import ApproveRefundRequest class ApproveRefundExample(object): ...
emawind84/readthedocs.org
refs/heads/master
readthedocs/rtd_tests/tests/test_404.py
32
import lxml.html from django.test import TestCase from readthedocs.projects.models import Project class Testmaker(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='eric', password='test') self.pip = Project.objects.get(slug='pip') self.latest =...
user-none/calibre
refs/heads/master
src/calibre/ebooks/markdown/extensions/meta.py
46
""" Meta Data Extension for Python-Markdown ======================================= This extension adds Meta Data handling to markdown. Basic Usage: >>> import markdown >>> text = '''Title: A Test Doc. ... Author: Waylan Limberg ... John Doe ... Blank_Data: ... ... The body. This ...
RubenKelevra/rethinkdb
refs/heads/next
external/gtest_1.6.0/test/gtest_xml_output_unittest.py
356
#!/usr/bin/env python # # Copyright 2006, 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...
tghosgor/libarmmcu
refs/heads/master
gyp/test/external-cross-compile/src/tochar.py
344
#!/usr/bin/python # 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. import sys src = open(sys.argv[1]) dst = open(sys.argv[2], 'w') for ch in src.read(): dst.write('%d,\n' % ord(ch)) src.close() dst.close()
openilabs/falconlab
refs/heads/master
env/lib/python2.7/site-packages/talons/auth/interfaces.py
1
# -*- encoding: utf-8 -*- # # Copyright 2013 Jay Pipes # # 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 la...
spencerjanssen/Flexget
refs/heads/develop
tests/test_thetvdb.py
14
from __future__ import unicode_literals, division, absolute_import from flexget.manager import Session from flexget.plugins.api_tvdb import lookup_episode from tests import FlexGetBase, use_vcr class TestThetvdbLookup(FlexGetBase): __yaml__ = """ templates: global: thetvdb_lookup: ...
foodszhang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_json/test_tool.py
124
import os import sys import textwrap import unittest import subprocess from test import support from test.script_helper import assert_python_ok class TestTool(unittest.TestCase): data = """ [["blorpie"],[ "whoops" ] , [ ],\t"d-shtaeou",\r"d-nthiouh", "i-vhbjkhnth",...
ahb0327/intellij-community
refs/heads/master
python/testData/hierarchy/call/Static/Parentheses/main.py
80
from file_1 import target_func def nothing(x): pass target_<caret>func()
elkingtonmcb/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/werkzeug/testsuite/wsgi.py
146
# -*- coding: utf-8 -*- """ werkzeug.testsuite.wsgi ~~~~~~~~~~~~~~~~~~~~~~~ Tests the WSGI utilities. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from os import path from contextlib import closing from werkzeug.testsuite import Werkzeug...
lepricon49/CouchPotatoServer
refs/heads/master
couchpotato/core/media/_base/providers/torrent/passthepopcorn.py
4
import htmlentitydefs import json import re import time import traceback from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.variable import getTitle, tryInt, mergeDicts, getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.bas...
dimitri-yatsenko/datajoint-python
refs/heads/master
tests/schema.py
2
""" Sample schema with realistic tables for testing """ import random import numpy as np import datajoint as dj import inspect from . import PREFIX, CONN_INFO schema = dj.Schema(PREFIX + '_test1', connection=dj.conn(**CONN_INFO)) @schema class TTest(dj.Lookup): """ doc string """ definition = """ ...
saurabh6790/medsynaptic-app
refs/heads/develop
patches/september_2012/repost_stock.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals def execute(): import webnotes from stock.stock_ledger import update_entries_after res = webnotes.conn.sql("select distinct item_code, warehouse f...
SemaiCZE/TrainDeathToll
refs/heads/master
lib/requests/packages/charade/codingstatemachine.py
206
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
micbou/ycmd
refs/heads/master
ycmd/completers/cs/cs_completer.py
2
# Copyright (C) 2011-2018 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
theguardian/headphones
refs/heads/master
lib/unidecode/x05e.py
250
data = ( 'Za ', # 0x00 'Bi ', # 0x01 'Shi ', # 0x02 'Bu ', # 0x03 'Ding ', # 0x04 'Shuai ', # 0x05 'Fan ', # 0x06 'Nie ', # 0x07 'Shi ', # 0x08 'Fen ', # 0x09 'Pa ', # 0x0a 'Zhi ', # 0x0b 'Xi ', # 0x0c 'Hu ', # 0x0d 'Dan ', # 0x0e 'Wei ', # 0x0f 'Zhang ', # 0x10 'Tang ...
michaelaye/vispy
refs/heads/master
examples/demo/gloo/rain.py
18
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------------------...