repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
FireBladeNooT/Medusa_1_6 | refs/heads/master | lib/bs4/element.py | 39 | __license__ = "MIT"
from pdb import set_trace
import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backwa... |
40223125/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/decimal.py | 623 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... |
stahta01/codeblocks_svn2git_metadata | refs/heads/master | src/sdk/wxscintilla/src/scintilla/scripts/Face.py | 17 | # Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Requires Python 2.5 or later
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
line = line.... |
CanalTP-Cityway/apii_sim_engine | refs/heads/master | source/apiisim/mis_translator/mis_api/stub/pays_de_la_loire.py | 1 | import os
from base import MisApi as StubApi
NAME = "stub_pays_de_la_loire"
class MisApi(StubApi):
_STOPS_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "stub_pays_de_la_loire_stops.json")
_DB_NAME = "stub_pays_de_la_loire_db"
|
anaprados/Practica3-IV | refs/heads/master | código/practica.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Ana Belén Rodríguez Prados
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)... |
hujiajie/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/internal/backends/chrome/crx_id_unittest.py | 31 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import unittest
import tempfile
from telemetry.core import util
from telemetry.internal.backends.chrome import crx_id
class CrxIdUn... |
jianlirong/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/pychecker-0.8.18/test_input/test21.py | 11 | 'test inconsistent return types'
a, b = 0, 0
def f(z):
'should be a warning'
if z:
return 1
return []
def g(z):
'should be a warning'
if z:
return (1, 2)
return []
def h(z):
'should be a warning'
if z:
return {}
return []
def y():
'should not be a ... |
bm424/diffraction-toybox | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# diffraction-toybox documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 11 10:32:13 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... |
tsabi/Odoo-tsabi-fixes | refs/heads/master | addons/bus/__openerp__.py | 42 | {
'name' : 'IM Bus',
'version': '1.0',
'author': 'OpenERP SA',
'category': 'Hidden',
'complexity': 'easy',
'description': "Instant Messaging Bus allow you to send messages to users, in live.",
'depends': ['base', 'web'],
'data': [
'views/bus.xml',
'security/ir.model.acces... |
felipealmeida/gcc-vc4 | refs/heads/master | contrib/update-copyright.py | 63 | #!/usr/bin/python
#
# Copyright (C) 2013 Free Software Foundation, Inc.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This script... |
shadowmint/nwidget | refs/heads/master | lib/pyglet-1.4.4/tests/window/EVENT_MOUSE_SCROLL.py | 33 | #!/usr/bin/env python
'''Test that mouse scroll event works correctly.
Expected behaviour:
One window will be opened. Move the scroll wheel and check that events
are printed to console. Positive values are associated with scrolling
up.
Scrolling can also be side-to-side, for example with an Apple M... |
alviano/python | refs/heads/master | pyrunner/validator.py | 1 | import fileinput
from lxml import etree
import re
import subprocess
import sys
import time
import os
class AllValidator:
def valid(self, command, benchmark, testcase, xml):
return True
def setDirname(self, dirname):
pass
class ExitCodeValidator:
def __init__(self, validExitCodes=[... |
afonsoduarte/gardensquareproject-site | refs/heads/master | templates/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSUtil.py | 566 | # 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
... |
ulrikpedersen/malcolm | refs/heads/master | test/zmqComms/test_system.py | 1 | #!/bin/env dls-python
from pkg_resources import require
from malcolm.core.device import Device
from malcolm.core.method import wrap_method
from malcolm.core.loop import TimerLoop
from malcolm.core.process import Process
from malcolm.core.directoryService import DirectoryService
require("mock")
require("pyzmq")
import u... |
jlinn/pylastica | refs/heads/master | pylastica/cluster/health/__init__.py | 1 | __author__ = 'Joe Linn'
from .index import *
from .shard import *
class Health(object):
def __init__(self, client):
"""
@param client:
@type client: pylastica.client.Client
"""
super(Health, self).__init__()
self._client = client
self.refresh()
self.... |
ktnyt/chainer | refs/heads/master | tests/chainerx_tests/unit_tests/routines_tests/test_indexing.py | 2 | import numpy
import pytest
import chainerx
import chainerx.testing
from chainerx_tests import array_utils
# TODO(niboshi): Remove strides_check=False
@chainerx.testing.numpy_chainerx_array_equal(strides_check=False)
@pytest.mark.parametrize("shape,indices", [
# empty indexing
((), ()),
((3,), ()),
(... |
mattaw/SoCFoundationFlow | refs/heads/master | admin/waf/waf-1.8.19/waflib/Tools/c_config.py | 2 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
C/C++/D configuration helpers
"""
import os, re, shlex
from waflib import Build, Utils, Task, Options, Logs, Errors, Runner
from waflib.TaskGen import after_method, feature
from waflib.Configure import conf
WAF_CONFIG_H = 'config.h'
"""defa... |
CristianCantoro/august-presenter | refs/heads/master | presenter.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""August Presenter.
Usage:
presenter.py [-v]
presenter.py [-v] (-d NAME | --device=NAME)
presenter.py (-h | --help)
presenter.py --version
Options:
-d NAME,--device=NAME Device NAME
[default: /dev/input/by-id/usb-1d57_ad03-event-kbd].
... |
pasqualguerrero/django | refs/heads/master | django/contrib/flatpages/views.py | 475 | from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader
from django.uti... |
yakky/django | refs/heads/master | django/contrib/flatpages/views.py | 475 | from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader
from django.uti... |
mess110/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/base_classes.py | 125 | from . import utilities
from .. import constants, exceptions
class BaseClass(constants.BASE_DICT):
"""Base class which inherits from a base dictionary object."""
_defaults = {}
def __init__(self, parent=None, type=None):
constants.BASE_DICT.__init__(self)
self._type = type
self.... |
JulyKikuAkita/PythonPrac | refs/heads/master | cs15211/DesignHashSet.py | 1 | __source__ = 'https://leetcode.com/problems/design-hashset/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 705. Design HashSet
#
# Design a HashSet without using any built-in hash table libraries.
#
# To be specific, your design should include these functions:
#
# add(value): Insert a value into the HashSet.
# ... |
Abi1ity/uniclust2.0 | refs/heads/master | flask/lib/python2.7/site-packages/django/contrib/auth/tests/test_hashers.py | 35 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, load_has... |
rahulmr/vboxweb | refs/heads/master | cherrypy/_cpserver.py | 17 | """Manage HTTP servers with CherryPy."""
import warnings
import cherrypy
from cherrypy.lib import attributes
# We import * because we want to export check_port
# et al as attributes of this module.
from cherrypy.process.servers import *
class Server(ServerAdapter):
"""An adapter for an HTTP server.
Yo... |
cstavr/synnefo | refs/heads/develop | snf-astakos-app/astakos/oa2/tests/djangobackend.py | 9 | # -*- coding: utf8 -*-
# Copyright (C) 2010-2014 GRNET S.A.
#
# 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 p... |
mizzao/ggplot | refs/heads/master | visual_tests.py | 13 | #!/usr/bin/env python
#
# This builds a html page of all images from the image comparisson tests
# and opens that page in the browser.
#
# $ python visual_tests.py
#
import os
import time
import six
from collections import defaultdict
def run():
# Build a website for visual comparison
image_dir = "result_i... |
Gabriel439/pants | refs/heads/master | tests/python/pants_test/targets/test_python_binary.py | 10 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import pytest
from ... |
bebby520/essay_devel | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 1007 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... |
karservice/kobra | refs/heads/master | kobra/settings/production.py | 1 | # -*- coding: utf-8 -*-
from . import *
SECRET_KEY = env.str('KOBRA_SECRET_KEY')
DEBUG = env.bool('KOBRA_DEBUG_MODE', False)
DATABASES = {
'default': env.db_url('KOBRA_DATABASE_URL')
}
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
|
WholeGrainGoats/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_error_lineno.py | 261 | import WebIDL
def WebIDLTest(parser, harness):
# Check that error messages put the '^' in the right place.
threw = False
input = """\
// This is a comment.
interface Foo {
};
/* This is also a comment. */
interface ?"""
try:
parser.parse(input)
results = parser.finish()
except Web... |
kg-bot/SupyBot | refs/heads/master | plugins/Polls/config.py | 1 | ###
# Copyright (c) 2012, DAn
# All rights reserved.
#
#
###
import supybot.conf as conf
import supybot.registry as registry
def configure(advanced):
# This will be called by supybot to configure this module. advanced is
# a bool that specifies whether the user identified himself as an advanced
# user or... |
mobo95/pyload | refs/heads/stable | module/plugins/hoster/UploadableCh.py | 2 | # -*- coding: utf-8 -*-
import re
from time import sleep
from module.plugins.internal.CaptchaService import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UploadableCh(SimpleHoster):
__name__ = "UploadableCh"
__type__ = "hoster"
__version__ = "0.08"
... |
andreparrish/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/ctypes/test/test_checkretval.py | 137 | import unittest
from ctypes import *
class CHECKED(c_int):
def _check_retval_(value):
# Receives a CHECKED instance.
return str(value.value)
_check_retval_ = staticmethod(_check_retval_)
class Test(unittest.TestCase):
def test_checkretval(self):
import _ctypes_test
dll =... |
bixbydev/Bixby | refs/heads/master | google/dist/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/utils/OpenSSL_TripleDES.py | 359 | """OpenSSL/M2Crypto 3DES implementation."""
from cryptomath import *
from TripleDES import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(TripleDES):
def __init__(self, key, mode, IV):
TripleDES.__init__(self, key, mo... |
lixiangning888/whole_project | refs/heads/master | modules/signatures_orginal_20151110/infostealer_mail.py | 1 | # Copyright (C) 2014 Optiv, Inc. (brad.spengler@optiv.com)
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class EmailStealer(Signature):
name = "infostealer_mail"
description = "Harves... |
OkCupid/okws | refs/heads/master | test/regtest/cases/48.py | 5 |
desc = "test legacy support of switch statements"
filedata=[ """
{$ globals { v : [ "v0v0v0", "v1v1v1", "v2v2v2", "v3v3v3" ],
bar : "BARs" }
include ("$[1]", { foo : "f1" })
include ("$[1]", { foo : "f2" })
include ("$[1]", { foo : "f3" })
include ("$[1]")
$}
""",
"""
{$
switch (foo) {
... |
ffu/DSA-3.2.2 | refs/heads/master | gr-trellis/src/examples/test_tcm_parallel.py | 8 | #!/usr/bin/env python
from gnuradio import gr
from gnuradio import audio
from gnuradio import trellis
from gnuradio import eng_notation
import math
import sys
import fsm_utils
def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P):
tb = gr.top_block ()
# TX
src = gr.lfsr_32k_source_s(... |
sebbrandt87/jenkins-job-builder | refs/heads/master | jenkins_jobs/modules/project_maven.py | 20 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/contrib/factorization/python/ops/gmm.py | 44 | # 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... |
ingokegel/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_1/_pkg0_0_1_1/__init__.py | 30 | from ._pkg0_0_1_1_0 import *
from ._pkg0_0_1_1_1 import * |
chidea/GoPythonDLLWrapper | refs/heads/master | bin/lib/test/test_pep352.py | 92 | import unittest
import builtins
import warnings
import os
from platform import system as platform_system
class ExceptionClassTests(unittest.TestCase):
"""Tests for anything relating to exception objects themselves (e.g.,
inheritance hierarchy)"""
def test_builtins_new_style(self):
self.assertTru... |
DevNetMansur/dev-network | refs/heads/master | OpenVpnAdmin/openvpn_auto.py | 1 | #!/usr/bin/python3
# -*- coding=utf-8 -*-
# $$$$$$$\ $$\ $$\
# $$ __$$\ $$$\ $$$ |
# $$ | $$ |$$\ $$\ $$\ $$$$\ $$$$ | $$$$$$\ $$$$$$$\ $$$$$$$\ $$\ $$\ $$$$$$\
# $$$$$$$\ |$$ | $$ | \__| $$\$$\$$ $$ | \____$$\ $$ __$$\ $$ _____| $$ | ... |
flyballlabs/threatdetectionservice | refs/heads/master | api/venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/__about__.py | 72 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__a... |
openstack/swift | refs/heads/master | swift/common/linkat.py | 3 | # Copyright (c) 2016 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
fivejjs/GPy | refs/heads/master | GPy/kern/_src/todo/fixed.py | 19 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from kernpart import Kernpart
import numpy as np
class Fixed(Kernpart):
def __init__(self, input_dim, K, variance=1.):
"""
:param input_dim: the number of input dimensions
:type... |
akuseru/zulip | refs/heads/master | zerver/management/commands/bankrupt_users.py | 116 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_update_message_flags
from zerver.models import UserProfile, Message, get_user_profile_by_email
class Command(BaseCommand):
help = """Bankrupt one or many users."""
def add_arguments(s... |
GiulioRossetti/ndlib | refs/heads/master | ndlib/viz/mpl/DiffusionViz.py | 1 | import abc
from bokeh.palettes import Category20_9 as cols
import os
import matplotlib as mpl
if os.environ.get('DISPLAY', '') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
import future.utils
import six
__author__ = 'Giulio Rossetti'
__licen... |
sasukeh/neutron | refs/heads/master | neutron/tests/tempest/common/service_client.py | 47 | # Copyright 2015 NEC Corporation. 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 ... |
ArtProcessors/django-tenant-schemas | refs/heads/master | examples/tenant_tutorial/manage.py | 15 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tenant_tutorial.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/google/appengine/tools/devappserver2/python/runtime_test.py | 6 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
cedricschaff/lockfile-p3k | refs/heads/master | lockfile/sqlitelockfile.py | 14 | from __future__ import absolute_import, division
import time
import os
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, threaded=True):
"""
>>> lock = SQLiteLo... |
andrew-szymanski/gae_django | refs/heads/master | urls.py | 1 | from django.conf.urls.defaults import *
handler500 = 'djangotoolbox.errorviews.server_error'
urlpatterns = patterns('',
('^_ah/warmup$', 'djangoappengine.views.warmup'),
('^$', 'django.views.generic.simple.direct_to_template',
{'template': 'home.html'}),
url(r'^favicon\.ico$',... |
hgl888/web-testing-service | refs/heads/master | tools/pywebsocket/src/mod_pywebsocket/msgutil.py | 658 | # Copyright 2011, 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 of conditions and the f... |
frishberg/django | refs/heads/master | django/utils/encoding.py | 47 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse import un... |
customcommander/selenium | refs/heads/master | py/selenium/webdriver/opera/options.py | 100 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
s6530085/FundSpider | refs/heads/master | stock/outputer.py | 1 | # -*- coding: utf-8 -*-
__author__ = 'study_sun'
import sys
from spider_base.convenient import now_day, safe_mean
reload(sys)
sys.setdefaultencoding('utf-8')
import pandas as pd
from pylab import *
mpl.rcParams['font.sans-serif'] = ['SimHei'] #指定默认字体
mpl.rcParams['axes.unicode_minus'] = False #解决保存图像是负号'-'显示为方块的问题
cl... |
andresailer/DIRAC | refs/heads/rel-v6r22 | Core/Utilities/test/Test_File.py | 6 | ########################################################################
# File: FileTestCase.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2011/01/17 14:00:52
########################################################################
""" :mod: FileTestCase
=======================
.. module: FileTestCase
... |
jaycedowell/rtl_osv21 | refs/heads/master | parser.py | 1 | # -*- coding: utf-8 -*-
"""
Function for parsing data packets from Oregon Scientific weather sensors
"""
from utils import computeDewPoint, computeWindchill, computeSeaLevelPressure
__version__ = '0.1'
__all__ = ['nibbles2value', 'computeChecksum', 'parsePacketv21', 'parseBitStream',
'__version__', '__al... |
robclark/chromium | refs/heads/master | third_party/tlslite/tlslite/utils/ASN1Parser.py | 80 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... |
K3D-tools/K3D-jupyter | refs/heads/master | k3d/transfer_function_editor.py | 1 | import ipywidgets as widgets
import numpy as np
from IPython.display import display
from traitlets import Unicode, Int
from traitlets import validate
from traittypes import Array
from .colormaps import paraview_color_maps
from ._version import __version__ as version
from .helpers import array_serialization_wrap
clas... |
akurtakov/Pydev | refs/heads/master | plugins/org.python.pydev.jython/Lib/encodings/iso2022_jp.py | 816 | #
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... |
gylian/sickrage | refs/heads/master | lib/unidecode/x050.py | 252 | data = (
'Chang ', # 0x00
'Chi ', # 0x01
'Bing ', # 0x02
'Zan ', # 0x03
'Yao ', # 0x04
'Cui ', # 0x05
'Lia ', # 0x06
'Wan ', # 0x07
'Lai ', # 0x08
'Cang ', # 0x09
'Zong ', # 0x0a
'Ge ', # 0x0b
'Guan ', # 0x0c
'Bei ', # 0x0d
'Tian ', # 0x0e
'Shu ', # 0x0f
'Shu ', # 0x10... |
kennyledet/Algorithm-Implementations | refs/heads/master | Patience_Sort/Python/argvk/PatienceSort_test.py | 19 | from PatienceSort import patience_sort
foo = [4, 65, 2, 4, -31, 0, 99, 1, 83, 782, 1]
fin_foo = [-31, 0, 1, 1, 2, 4, 4, 65, 83, 99, 782]
patience_sort(foo)
assert(foo == fin_foo)
|
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py | 360 | from __future__ import absolute_import
import logging
import os
import warnings
from ..exceptions import (
HTTPError,
HTTPWarning,
MaxRetryError,
ProtocolError,
TimeoutError,
SSLError
)
from ..packages.six import BytesIO
from ..request import RequestMethods
from ..response import HTTPResponse
... |
fengyoulong/ns3-gpcr | refs/heads/master | src/click/bindings/callbacks_list.py | 169 | callback_classes = [
['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empt... |
JShadowMan/package | refs/heads/master | python/logging.py | 2 | #!/bin/env python3
|
ZazieTheBeast/oscar | refs/heads/master | oscar/lib/python2.7/genericpath.py | 4 | /usr/lib/python2.7/genericpath.py |
jostep/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/conv_ops_test.py | 10 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
GDGLima/contentbox | refs/heads/master | third_party/social/backends/foursquare.py | 83 | """
Foursquare OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/foursquare.html
"""
from social.backends.oauth import BaseOAuth2
class FoursquareOAuth2(BaseOAuth2):
name = 'foursquare'
AUTHORIZATION_URL = 'https://foursquare.com/oauth2/authenticate'
ACCESS_TOKEN_URL = 'https://fours... |
kangfend/django | refs/heads/master | django/contrib/admindocs/urls.py | 574 | from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url('^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'),
name='django-admindocs-docroot'),
url('^bookmarklets/$',
views.BookmarkletsView.as_view(),
name='django-ad... |
kenorb/BitTorrent | refs/heads/master | BitTorrent/translation.py | 2 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
teoliphant/numpy-refactor | refs/heads/refactor | numpy/oldnumeric/linear_algebra.py | 102 | """Backward compatible with LinearAlgebra from Numeric
"""
# This module is a lite version of the linalg.py module in SciPy which contains
# high-level Python interface to the LAPACK library. The lite version
# only accesses the following LAPACK functions: dgesv, zgesv, dgeev,
# zgeev, dgesdd, zgesdd, dgelsd, zgelsd, ... |
andi34/android_kernel_samsung_espresso10 | refs/heads/cm-10.1 | 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... |
bertucho/epic-movie-quotes-quiz | refs/heads/master | dialogos/build/Twisted/twisted/python/text.py | 11 | # -*- test-case-name: twisted.test.test_text -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Miscellany of text-munging functions.
"""
def stringyString(object, indentation=''):
"""
Expansive string formatting for sequence types.
C{list.__str__} and C{dict.__str__} use ... |
akshaybabloo/Car-ND | refs/heads/master | Term_1/Transfer_Learning_8/Alexnet_8_1/imagenet_inference.py | 5 | # NOTE: You don't need to edit this code.
import time
import tensorflow as tf
import numpy as np
from scipy.misc import imread
from caffe_classes import class_names
from alexnet import AlexNet
# placeholders
x = tf.placeholder(tf.float32, (None, 227, 227, 3))
# By keeping `feature_extract` set to `False`
# we indica... |
ocefpaf/iris | refs/heads/master | lib/iris/tests/unit/analysis/trajectory/test_Trajectory.py | 5 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Unit tests for :class:`iris.analysis.trajectory.Trajectory`.
"""
# Import iris.tests first so that some things can be ini... |
kaday/rose | refs/heads/master | lib/python/rose/macros/value.py | 1 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
sebgoa/kubeless | refs/heads/master | vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/util.py | 7 |
# Copyright 2015 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... |
nafest/directcmr | refs/heads/master | thirdparty/googletest/googletest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
habibiefaried/ryu | refs/heads/master | ryu/services/protocols/bgp/operator/ssh.py | 12 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
ceb8/astroquery | refs/heads/track_master | astroquery/dace/__init__.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Dace API
--------
:author: Julien Burnier (julien.burnier@unige.ch)
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.dace`.
"""
server = _config.ConfigItem(... |
endlessm/chromium-browser | refs/heads/master | third_party/webrtc/tools_webrtc/coverage/generate_coverage_command.py | 2 | #!/usr/bin/env python
# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... |
stinos/micropython | refs/heads/master | tests/basics/del_local.py | 118 | # delete local then try to reference it
def f():
x = 1
y = 2
print(x, y)
del x
print(y)
try:
print(x)
except NameError:
print("NameError");
f()
# delete local then try to delete it again
def g():
x = 3
y = 4
print(x, y)
del x
print(y)
try:
del... |
PrathapB/LTLMoP | refs/heads/development | src/etc/utils/region2svg.py | 8 | import sys, re, os
import Polygon, Polygon.IO
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
import lib.regions as regions
fn_in = sys.argv[1]
fn_out = re.sub(r"\.regions$", ".svg", fn_in)
rfi = regions.RegionFileInterface()
rfi.readFile(fn_in)
polyList = []
for region in rfi.regions:
poin... |
emilhetty/home-assistant | refs/heads/patch-3 | homeassistant/helpers/script.py | 6 | """Helpers to execute scripts."""
import logging
import threading
from itertools import islice
import homeassistant.util.dt as date_util
from homeassistant.const import EVENT_TIME_CHANGED, CONF_CONDITION
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.helpers import service, conditio... |
Azure/azure-quickstart-templates | refs/heads/master | application-workloads/cloudera/cloudera-director-on-centos/scripts/director_user_passwd.py | 102 | #! /usr/bin/env python
# Copyright (c) 2016 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
snim2/python-csp | refs/heads/master | examples/raytracer/raytracer.py | 3 | #!/usr/bin/env python
import copy, math, struct, time
from csp.csp import *
INFINITY = float('infinity')
delta = 0.000000001 # in Java this is java.lang.Math.ulp(1.0)
class Vector(object): # Use numpy arrays instead.
def __init__(self, x, y, z):
self.x, self.y, self.z = x, y, z
return
def __... |
felixma/nova | refs/heads/master | nova/api/openstack/compute/shelve.py | 27 | # Copyright 2013 Rackspace Hosting
#
# 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 agre... |
lemming52/white_knight | refs/heads/master | integration/cornu.py | 1 | # Custom Packages
import fresnel
# External Packages
import numpy as np
from scipy.integrate import quad
def coord_pair(u):
# Calculate the C and S values for a particular u, which give
# coordinates for the spiral.
coeff = np.pi/2
C = quad(fresnel.cos_integrand, 0, u, args=(coeff, ))
... |
Nikoli/youtube-dl | refs/heads/master | youtube_dl/extractor/canalc2.py | 145 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Canalc2IE(InfoExtractor):
IE_NAME = 'canalc2.tv'
_VALID_URL = r'http://.*?\.canalc2\.tv/video\.asp\?.*?idVideo=(?P<id>\d+)'
_TEST = {
'url': 'http://www.canalc2.tv/video.asp?idVideo=12163&v... |
caisq/tensorflow | refs/heads/master | tensorflow/contrib/kfac/python/ops/loss_functions.py | 13 | # 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... |
mitya57/debian-buildbot | refs/heads/master | buildbot/process/remotecommand.py | 2 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/gb/gb_regions.py | 199 | """
Sources:
English regions: http://www.statistics.gov.uk/geography/downloads/31_10_01_REGION_names_and_codes_12_00.xls
Northern Ireland regions: http://en.wikipedia.org/wiki/List_of_Irish_counties_by_area
Welsh regions: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales
Scottish regions: http://... |
jolyonb/edx-platform | refs/heads/master | lms/djangoapps/commerce/migrations/0006_auto_20170424_1734.py | 25 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commerce', '0005_commerceconfiguration_enable_automatic_refund_approval'),
]
operations = [
migrations.AlterField(
... |
anbangr/trusted-nova | refs/heads/master | nova/tests/test_quantum.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011,2012 Nicira, 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/... |
marcomaio/NatixisUnofficialAPI | refs/heads/master | main.py | 1 | import getpass
import natixis.connections
from natixis.handler import Handler
## YOUR CREDENTIALS HERE ##
NUMERO_ENTERPRISE = raw_input("Insert your \"NUMERO D\'ENTERPRISE\": ")
CODE_SERVEUR = raw_input("Insert your \"CODE SERVEUR\": ")
PASSWORD = getpass.getpass("Insert your \"PASSWORD\": ")
# Get your nati... |
ShiYw/Sigil | refs/heads/master | 3rdparty/python/Lib/ntpath.py | 93 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
from genericpath import *
__all__ = ["normcase","is... |
maxtorete/frappe | refs/heads/develop | frappe/desk/page/setup_wizard/install_fixtures.py | 15 | # 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
from frappe import _
def install():
update_genders_and_salutations()
@frappe.whitelist()
def update_genders_and_salutations():
defau... |
whereismyjetpack/ansible | refs/heads/devel | lib/ansible/inventory/vars_plugins/__init__.py | 145 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
|
wrh3c/Maslow-GroundControl | refs/heads/master | UIElements/manualControls.py | 4 | from kivy.uix.floatlayout import FloatLayout
class ManualControl(FloatLayout):
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.