repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ProfessionalIT/maxigenios-website | refs/heads/master | sdk/google_appengine/google/appengine/tools/devappserver2/php/runtime.py | 5 | #!/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... |
flass/agrogenom | refs/heads/master | pipeline/scripts_agrogenom/3_Ananalysis_of_genome_histories/spegenes_to_db.py | 1 | #!/usr/bin/python
import sys, os, tree2
dirspegeneannot = sys.argv[1]
nfreftree = sys.argv[2]
nfout = sys.argv[3]
constrastingclades = ['N15', 'N10','N5','N4']
if len(sys.argv)>4 : maxrelax = sys.argv[4]
else: maxrelax = 2
lnfspegeneannot = os.listdir(dirspegeneannot)
fout = open(nfout, 'w')
reftree = tree2.Referen... |
wanghuan1115/sdkbox-vungle-sample | refs/heads/master | cpp/cocos2d/build/android-build.py | 49 | #!/usr/bin/python
# android-build.py
# Build android
import sys
import os, os.path
from optparse import OptionParser
CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests', 'game-controller-test']
LUA_SAMPLES = ['lua-empty-test', 'lua-tests', 'lua-game-controller-test']
JS_SAMPLES = ['js-tests']
ALL_SAMPLES = CPP_SAMPLES + LUA... |
danielhers/dynet | refs/heads/master | examples/devices/xor-multidevice.py | 6 | # Usage:
# python xor-multidevice.py --dynet-devices CPU,GPU:0,GPU:1
# or python xor-multidevice.py --dynet-gpus 2
import sys
import dynet as dy
#xsent = True
xsent = False
HIDDEN_SIZE = 8
ITERATIONS = 2000
m = dy.Model()
trainer = dy.SimpleSGDTrainer(m)
pW1 = m.add_parameters((HIDDEN_SIZE, 2), device="GPU:1")
... |
aleksey-sinos/ardupilot | refs/heads/master | Tools/autotest/arducopter.py | 18 | # fly ArduCopter in SITL
# Flight mode switch positions are set-up in arducopter.param to be
# switch 1 = Circle
# switch 2 = Land
# switch 3 = RTL
# switch 4 = Auto
# switch 5 = Loiter
# switch 6 = Stabilize
import util, pexpect, sys, time, math, shutil, os
from common import *
from pymavlink import mavut... |
siosio/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/methodParameterClassMethod.py | 12 | class MyClass:
@classmethod
def method<caret> |
roryj/apartmenthunter | refs/heads/master | src/apartment.py | 1 | #!/usr/bin/python
from random import randint
import library.dateutil.parser as parse
from library.dateutil.relativedelta import *
from library.dateutil.tz import tzlocal
from datetime import *
from math import pow, log, log10, e
class Apartment(object):
def __init__(self, title, link, description, created):
self.... |
ryfeus/lambda-packs | refs/heads/master | Selenium_PhantomJS/source/pkg_resources/_vendor/packaging/_structures.py | 1152 | # 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
class Infinity(object):
def __repr__(self):
return "Infinity... |
mhaessig/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/set-cookie-secure_wsh.py | 119 | #!/usr/bin/python
import urlparse
from mod_pywebsocket import common, msgutil, util
from mod_pywebsocket.handshake import hybi
def web_socket_do_extra_handshake(request):
url_parts = urlparse.urlsplit(request.uri)
request.connection.write('HTTP/1.1 101 Switching Protocols:\x0D\x0AConnection: Upgrade\x0D\x0AU... |
40223211/cadpbtest0615 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/select.py | 730 | """
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ... |
marrow/tags | refs/heads/develop | marrow/tags/base.py | 1 | # encoding: utf-8
import inspect
from copy import deepcopy
from cgi import escape
from marrow.util.compat import IO
from marrow.util.object import NoDefault
from marrow.tags.util import quoteattrs
__all__ = ['Fragment', 'Tag', 'Text', 'AutoTag', 'tag']
class Fragment(object):
def __init__(self, data=None, *... |
apple/swift-llbuild | refs/heads/release/5.5 | examples/simple-make/simplebuild.py | 1 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... |
lupyuen/RaspberryPiImage | refs/heads/master | home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/S3/DeleteBucket.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeleteBucket
# Deletes a bucket from your Amazon S3 account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... |
informatics-isi-edu/synspy | refs/heads/master | launcher/launcher/impl/process_tasks.py | 1 | import os
import subprocess
from deriva.core import format_exception
from launcher.impl import LauncherTask, Task
class SubprocessTask(LauncherTask):
def __init__(self, parent=None):
super(SubprocessTask, self).__init__(parent)
class ViewerTask(SubprocessTask):
def __init__(self, executable, is_owne... |
shepdelacreme/ansible | refs/heads/devel | lib/ansible/modules/network/ios/ios_facts.py | 7 | #!/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... |
delete/estofadora | refs/heads/master | estofadora/statement/admin.py | 1 | # coding: utf-8
from django.utils.datetime_safe import datetime
from django.contrib import admin
from estofadora.statement.models import Cash, Balance
class CashAdmin(admin.ModelAdmin):
list_display = ('date', 'history', 'income', 'expenses', 'total')
search_fields = ('date', 'history')
date_hierarchy = '... |
aasoliz/Bitcoin-Statistics | refs/heads/master | venv/lib/python2.7/site-packages/jinja2/loaders.py | 333 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... |
googleapis/google-cloud-php | refs/heads/master | OsLogin/synth.py | 2 | # Copyright 2018 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... |
flgiordano/netcash | refs/heads/master | +/google-cloud-sdk/lib/surface/sql/ssl_certs/create.py | 1 | # Copyright 2013 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... |
Beercow/viper | refs/heads/master | viper/modules/editdistance.py | 6 | # This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import itertools
from viper.common.abstracts import Module
from viper.core.session import __sessions__
from viper.core.database import Database
class Editdistance(Module):
cmd = 'editdistance... |
sunlianqiang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/lib2to3/tests/test_refactor.py | 91 | """
Unit tests for refactor.py.
"""
from __future__ import with_statement
import sys
import os
import codecs
import operator
import io
import tempfile
import shutil
import unittest
import warnings
from lib2to3 import refactor, pygram, fixer_base
from lib2to3.pgen2 import token
from . import support
TEST_DATA_DIR ... |
ds-hwang/chromium-crosswalk | refs/heads/master | third_party/WebKit/Source/platform/v8_inspector/build/xxd.py | 10 | # Copyright 2016 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.
"""Represent a file as a C++ constant string.
Usage:
python xxd.py VAR SOURCE DEST
"""
import sys
import rjsmin
def main():
variable_name, input_fil... |
cgar/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/_code/__init__.py | 176 | """ python inspection/code generation API """
from .code import Code # noqa
from .code import ExceptionInfo # noqa
from .code import Frame # noqa
from .code import Traceback # noqa
from .code import getrawcode # noqa
from .code import patch_builtins # noqa
from .code import unpatch_builtins # noqa
from .source i... |
gooddata/openstack-nova | refs/heads/master | nova/tests/json_ref.py | 6 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
cjlux/Poppy-ENSAM-Talence | refs/heads/French | Environnement_programmation/Cours python/Tests/2012-dec/Correction/DecodeView.py | 1 | # -*- coding: utf-8 -*-
from PyQt4.QtGui import QFrame, QLabel, QPushButton
from PyQt4.QtCore import SIGNAL
from Viewer import Viewer
class DecodeView(Viewer):
'To view the loaded image and the hidden text (if any)'
def __init__(self, parent, posx, posy):
Viewer.__init__(self, parent, po... |
kaiserbrito/pythonshop | refs/heads/master | catalog/models.py | 35 | from django.db import models
|
ibab/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py | 5 | # Copyright 2016 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... |
agermanidis/pyalphaclock | refs/heads/master | pyalphaclock/__init__.py | 1 | import calendar
import datetime
import serial
import time
def pad_string(s, length=5, align='right'):
s = s[:length]
while len(s) < length:
if align == 'left':
s += ' '
else:
s = ' ' + s
return str(s).upper()
def substr(s, start, end):
spaces_before = ' ' * (0-s... |
sdopoku/flask-hello-world | refs/heads/master | venv/lib/python2.7/site-packages/flask/config.py | 781 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... |
oscaro/django-oscar-adyen | refs/heads/master | adyen/migrations/0002_auto_20141016_1601.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('adyen', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='adyentransaction',
name... |
apanju/odoo | refs/heads/8.0 | addons/report/__openerp__.py | 385 | {
'name': 'Report',
'category': 'Base',
'summary': 'Report',
'version': '1.0',
'description': """
Report
""",
'author': 'OpenERP SA',
'depends': ['base', 'web'],
'data': [
'views/layouts.xml',
'views/views.xml',
'data/report_paperformat.xml',
'secu... |
kornev/twitter_nlp | refs/heads/master | python/cap/cap_eval.py | 10 | #!/usr/bin/python
###################################################################################
# cap_eval.py
#
# Evaluates how well we can identify whether a given tweet is properly capitalized
###################################################################################
import re
import sys
sys.path.app... |
DominoTree/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/execute_async_script/collections.py | 9 | import os
from tests.support.asserts import assert_same_element, assert_success
from tests.support.inline import inline
def execute_async_script(session, script, args=None):
if args is None:
args = []
body = {"script": script, "args": args}
return session.transport.send(
"POST", "/sessio... |
sysalexis/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_codecmaps_hk.py | 60 | #
# test_codecmaps_hk.py
# Codec mapping tests for HongKong encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestBig5HKSCSMap(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'big5hkscs'
mapfileurl = 'http://peop... |
ryfeus/lambda-packs | refs/heads/master | Selenium_PhantomJS/source/setuptools/__init__.py | 4 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools.extern.six.moves import filter, filterfalse, map
import setuptools.version
from set... |
pabloborrego93/edx-platform | refs/heads/master | openedx/core/djangoapps/coursetalk/migrations/0001_initial.py | 56 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operati... |
thezawad/kivy | refs/heads/master | examples/widgets/lists/list_simple_in_kv.py | 52 | from kivy.uix.modalview import ModalView
from kivy.uix.listview import ListView
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
Builder.load_string("""
<ListViewModal>:
size_hint: None,None
size: 400,400
ListView:
size_hint: .8,.8
item_strings: [str(index) for index... |
mKeRix/home-assistant | refs/heads/dev | homeassistant/components/mcp23017/binary_sensor.py | 7 | """Support for binary sensor using I2C MCP23017 chip."""
import logging
from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error
import board # pylint: disable=import-error
import busio # pylint: disable=import-error
import digitalio # pylint: disable=import-error
import voluptuous as vol
fr... |
tplusx/ns3-gpsr | refs/heads/master | src/aodv/bindings/callbacks_list.py | 56 | callback_classes = [
['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3... |
kivatu/kivy_old | refs/heads/master | kivy/uix/gridlayout.py | 4 | '''
Grid Layout
===========
.. only:: html
.. image:: images/gridlayout.gif
:align: right
.. only:: latex
.. image:: images/gridlayout.png
:align: right
.. versionadded:: 1.0.4
The :class:`GridLayout` arranges children in a matrix. It takes the available
space and divides it into columns a... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_BE.py | 1 | """Auto-generated file, do not edit by hand. BE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BE = PhoneMetadata(id='BE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2,5}|[2-9]\\d{3}', possible_number... |
stpierre/sponge | refs/heads/master | Sponge/sponge/management/commands/__init__.py | 1 | __all__ = ["rebalanceschedule"]
|
tianyi33/simple_blog | refs/heads/master | django/contrib/localflavor/uk/uk_regions.py | 114 | from django.contrib.localflavor.gb.gb_regions import (
ENGLAND_REGION_CHOICES, NORTHERN_IRELAND_REGION_CHOICES,
WALES_REGION_CHOICES, SCOTTISH_REGION_CHOICES, GB_NATIONS_CHOICES,
GB_REGION_CHOICES)
import warnings
warnings.warn(
'The "UK" prefix for United Kingdom has been deprecated in favour of the '... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatter3d/error_z/_color.py | 1 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="scatter3d.error_z", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
schinke/solid-fortnight-ba | refs/heads/master | flask/venv/lib/python2.7/site-packages/psycopg2/tz.py | 72 | """tzinfo implementations for psycopg2
This module holds two different tzinfo implementations that can be used as
the 'tzinfo' argument to datetime constructors, directly passed to psycopg
functions or used to set the .tzinfo_factory attribute in cursors.
"""
# psycopg/tz.py - tzinfo implementation
#
# Copyright (C) ... |
shackra/thomas-aquinas | refs/heads/stable-branch | summa/audio/soundstatus.py | 1 | # coding: utf-8
# This file is part of Thomas Aquinas.
#
# Thomas Aquinas 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.
#
# Thomas Aq... |
siosio/intellij-community | refs/heads/master | python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/withStatementWithComplexUnpacking_after.py | 31 | x: io.FileIO
z: Optional[int]
y: Any
with undefined() \
as ((x, (z)), y):
pass |
incaser/server-tools | refs/heads/8.0 | base_suspend_security/__openerp__.py | 17 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
Goamaral/SCC | refs/heads/master | App.py | 1 | import inputWindow
import outputWindow
import simulador
from PyQt4 import QtGui
import sys
class InputWindow(QtGui.QMainWindow, inputWindow.Ui_MainWindow):
def __init__(self, parent=None):
super(InputWindow, self).__init__(parent)
self.setupUi(self)
self.botaoSimular.clicked.connect(self.go... |
cloudera/ibis | refs/heads/master | ibis/backends/pandas/client.py | 1 | """The pandas client implementation."""
from __future__ import absolute_import
import re
from functools import partial
import dateutil.parser
import numpy as np
import pandas as pd
import pytz
import toolz
from multipledispatch import Dispatcher
from pandas.api.types import CategoricalDtype, DatetimeTZDtype
from pkg... |
bas-t/media_tree | refs/heads/master | tools/perf/scripts/python/sctop.py | 1996 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
GhostThrone/django | refs/heads/master | django/core/handlers/wsgi.py | 339 | from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_pr... |
kool79/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/geometry/backend/__init__.py | 388 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos')
try:
module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend')
except ImportError, e:
... |
gltn/stdm | refs/heads/master | stdm/third_party/FontTools/fontTools/ttLib/tables/_a_v_a_r.py | 1 | from fontTools.misc.py23 import *
from fontTools import ttLib
from fontTools.misc import sstruct
from fontTools.misc.fixedTools import (
fixedToFloat as fi2fl,
floatToFixed as fl2fi,
floatToFixedToStr as fl2str,
strToFixedToFloat as str2fl,
)
from fontTools.misc.textTools import safeEval
from fontTools.... |
pschella/scipy | refs/heads/master | scipy/special/tests/test_round.py | 20 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import dec
from scipy.special import _test_round
@dec.skipif(not _test_round.have_fenv())
def test_add_round_up():
np.random.seed(1234)
_test_round.test_add_round(10**5, 'up')
@dec.skipif(not _test_round... |
PUNCH-Cyber/stoq-plugins-public | refs/heads/master | symhash/setup.py | 1 | from setuptools import setup, find_packages
setup(
name="symhash",
version="3.0.0",
author="Marcus LaFerrera (@mlaferrera)",
url="https://github.com/PUNCH-Cyber/stoq-plugins-public/v2",
license="Apache License 2.0",
description="Calculate symbol table hashes of a Mach-O executable file",
pa... |
kouaw/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/franceinter.py | 15 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FranceInterIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
_TEST = {
'url': 'http://www.franceinter.fr/player/reecouter?play=793962',
... |
Edraak/edraak-platform | refs/heads/master | common/djangoapps/course_modes/admin.py | 11 | from django import forms
from django.conf import settings
from django.contrib import admin
from django.http.request import QueryDict
from django.utils.translation import ugettext_lazy as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from pytz import UTC, timezone
from course_mode... |
sigysmund/platform_external_skia | refs/heads/master | tools/roll_deps.py | 68 | #!/usr/bin/python2
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Skia's Chromium DEPS roll script.
This script:
- searches through the last N Skia git commits to find out the hash that is
associated with the SVN revision numb... |
wanglei828/apollo | refs/heads/master | cyber/proto/__init__.py | 3 |
# ****************************************************************************
# Copyright 2018 The Apollo 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
#
# h... |
thomashaw/SecGen | refs/heads/master | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/encodings/mbcs.py | 860 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... |
jdelight/django | refs/heads/master | django/contrib/auth/handlers/modwsgi.py | 537 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... |
oktopac/tfword2vec | refs/heads/master | tfword2vec/utils.py | 1 | import collections
import random
import numpy as np
import tensorflow as tf
def read_words(fname):
with open(fname, 'r') as fd:
words = tf.compat.as_str(fd.read()).split()
return words
def generate_vocab(words, n=None):
vocab = collections.Counter(words)
return vocab.most_common(n=n)
def sa... |
ds-hwang/chromium-crosswalk | refs/heads/master | build/copy_test_data_ios.py | 206 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Copies test data files or directories into a given output directory."""
import optparse
import os
import shutil
import sys
cla... |
yephper/django | refs/heads/master | django/bin/minicms/DjangoUeditor/commands.py | 2 | # coding:utf-8
import urllib
from . import settings as USettings
class UEditorEventHandler(object):
"""用来处理UEditor的事件侦听"""
def on_selectionchange(self):
return ""
def on_contentchange(self):
return ""
def render(self,editorID):
jscode="""
%(editor)s.addListener('%(e... |
OCA/purchase-workflow | refs/heads/12.0 | purchase_order_line_price_history/__init__.py | 3 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import wizards
|
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/bx_python-0.7.1-py2.7-linux-x86_64.egg/bx/seq/__init__.py | 7 | """
Classes for dealing with biological sequences. See `core` for the abstract
sequence classes and `nib` and `qdna` for specifics of various
formats.
"""
from bx.seq.core import *
|
qrkourier/ansible | refs/heads/devel | lib/ansible/plugins/lookup/__init__.py | 28 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
NielsZeilemaker/incubator-airflow | refs/heads/master | tests/utils/test_dates.py | 8 | # -*- coding: utf-8 -*-
#
# 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
... |
Ecpy/ecpy | refs/heads/master | tests/app/errors/test_plugin.py | 1 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... |
sanguinariojoe/FreeCAD | refs/heads/master | src/Mod/Robot/Init.py | 18 | # FreeCAD init script of the Robot module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* Copyright (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
#* *
#* This file... |
AndreaCrotti/ansible | refs/heads/devel | lib/ansible/plugins/action/group_by.py | 172 | # Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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... |
michaelld/gnuradio | refs/heads/master | gr-utils/python/modtool/core/info.py | 2 | #
# Copyright 2013, 2018 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)
# any later versio... |
orlenko/bccf | refs/heads/master | src/mezzanine/project_template/deploy/gunicorn.conf.py | 30 | import os
bind = "127.0.0.1:%(gunicorn_port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
proc_name = "%(proj_name)s"
|
pchauncey/ansible | refs/heads/devel | test/units/parsing/utils/test_jsonify.py | 119 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
Stanford-Online/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/partitions/partitions_service.py | 9 | """
This is a service-like API that assigns tracks which groups users are in for various
user partitions. It uses the user_service key/value store provided by the LMS runtime to
persist the assignments.
"""
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
import logging
from op... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/tests/test_cmdline/extensions.py | 19 | """A test extension used to check the settings loading order"""
from scrapy.conf import settings
settings.overrides['TEST1'] = "%s + %s" % (settings['TEST1'], 'loaded')
class TestExtension(object):
def __init__(self):
settings.overrides['TEST1'] = "%s + %s" % (settings['TEST1'], 'started')
|
JMMolenaar/cadnano2.5 | refs/heads/master | cadnano/gui/views/sliceview/partitem.py | 1 |
from cadnano.gui.controllers.itemcontrollers.partitemcontroller import PartItemController
from .emptyhelixitem import EmptyHelixItem
from .virtualhelixitem import VirtualHelixItem
from .activesliceitem import ActiveSliceItem
from . import slicestyles as styles
import cadnano.util as util
from cadnano import getReopen... |
mbbx6spp/nixops | refs/heads/master | nixops/ec2_utils.py | 7 | # -*- coding: utf-8 -*-
import os
import boto.ec2
import time
import random
import nixops.util
from boto.exception import EC2ResponseError
from boto.exception import SQSError
from boto.exception import BotoServerError
def fetch_aws_secret_key(access_key_id):
"""Fetch the secret access key corresponding to the gi... |
LowResourceLanguages/hltdi-l3 | refs/heads/master | disambiguatr/nltk/classify/mallet.py | 5 | # Natural Language Toolkit: Interface to Mallet Machine Learning Package
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
# $Id: naivebayes.py 2063 2004-07-17 21:02:24Z edloper $
"""
A set of func... |
salamer/django | refs/heads/master | tests/postgres_tests/array_default_migrations/0002_integerarraymodel_field_2.py | 377 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('postgres_tests', '0001_initial'),
]
operations = [
migrations.AddField(
mo... |
jwomeara/PDAL | refs/heads/master | vendor/gtest-1.7.0/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... |
Demolisty24/AlexaFood-Backend | refs/heads/master | venv/Lib/encodings/mac_greek.py | 593 | """ Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... |
jenalgit/django | refs/heads/master | tests/bash_completion/tests.py | 327 | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import unittest
from django.apps import apps
from django.core.management import ManagementUtility
from django.test.utils import captured_stdout
class BashCompletionTests(unittest.TestCase):
"""
Testing th... |
vmthunder/nova | refs/heads/master | nova/tests/objects/test_virtual_interface.py | 31 | # Copyright (C) 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
ak64th/IntQuiz | refs/heads/master | api.py | 1 | # coding=utf-8
from flask import request, url_for, g
from flask_peewee.rest import RestAPI, RestrictOwnerResource, Authentication, RestResource
from app import app
from auth import auth
from models import *
class IntApi(RestAPI):
@property
def registry(self):
return self._registry
class IntAuthenti... |
dantebarba/docker-media-server | refs/heads/master | plex/Sub-Zero.bundle/Contents/Libraries/Shared/subzero/modification/main.py | 1 | # coding=utf-8
import traceback
import re
import pysubs2
import logging
import time
from mods import EMPTY_TAG_PROCESSOR, EmptyEntryError
from registry import registry
from subzero.language import Language
logger = logging.getLogger(__name__)
lowercase_re = re.compile(ur'(?sux)[a-zà-ž]')
class SubtitleModificati... |
JPalmerio/GRB_population_code | refs/heads/master | grbpop/basic_example.py | 1 | from cosmology import init_cosmology
from GRB_population import create_GRB_population_from
import io_grb_pop as io
import numpy as np
import logging
import sys
log = logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format='%(asctime)s.%(msecs)03d [%(levelname)s... |
jmighion/ansible | refs/heads/devel | lib/ansible/module_utils/aws/direct_connect.py | 14 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
FRC-Team-3140/north-american-happiness | refs/heads/master | lib/python2.7/site-packages/flask/_compat.py | 783 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... |
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/internet/qtreactor.py | 69 | # -*- test-case-name: twisted.internet.test.test_qtreactor -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
try:
# 'import qtreactor' would have imported this file instead of the
# top-level qtreactor. __import__ does the right thing
# (kids, don't repeat this at home)
instal... |
Kazade/NeHe-Website | refs/heads/master | autoload/models.py | 133 | # Load the siteconf module
from django.conf import settings
from django.utils.importlib import import_module
SITECONF_MODULE = getattr(settings, 'AUTOLOAD_SITECONF', settings.ROOT_URLCONF)
import_module(SITECONF_MODULE)
|
openstack/python-troveclient | refs/heads/master | troveclient/tests/osc/v1/test_database_quota.py | 1 | # 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
# distrib... |
nmrao/robotframework | refs/heads/master | src/robot/model/message.py | 16 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
40223226/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py | 603 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... |
mavit/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_permission.py | 41 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... |
translate/pootle | refs/heads/master | pootle/apps/pootle_app/migrations/0011_directory_tp.py | 8 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-04 07:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pootle_translationproject', '0003_realpath_can_be_none'),
... |
tlatzko/spmcluster | refs/heads/master | .tox/2.7-nocov/lib/python2.7/site-packages/pip/utils/build.py | 899 | from __future__ import absolute_import
import os.path
import tempfile
from pip.utils import rmtree
class BuildDirectory(object):
def __init__(self, name=None, delete=None):
# If we were not given an explicit directory, and we were not given an
# explicit delete option, then we'll default to del... |
Kakadu/xcp-xapi | refs/heads/master | ocaml/idl/binding_sanity_checks/unpoolify.py | 34 | #!/usr/bin/env python
import XenAPI
import sanitychecklib
#log in to the master
print "logging in to ",sanitychecklib.server
session=sanitychecklib.getsession()
sx=session.xenapi
#find the secondary host by name
secondaryserver_list=sx.host.get_by_name_label(sanitychecklib.secondaryserver)
if len(secondaryserver_li... |
hellarafa/ART405-REPFINDER-Project2 | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/input.py | 578 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.