repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Bjay1435/capstone | refs/heads/master | rootfs/usr/lib/python3.4/distutils/command/build_scripts.py | 92 | """distutils.command.build_scripts
Implements the Distutils 'build_scripts' command."""
import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
from distutils.dep_util import newer
from distutils.util import convert_path, Mixin2to3
from distutils import log
import tok... |
wolfram74/numerical_methods_iserles_notes | refs/heads/master | venv/lib/python2.7/site-packages/IPython/kernel/zmq/heartbeat.py | 2 | """The client and server for a basic ping-pong style heartbeat.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... |
GiovanniConserva/TestDeploy | refs/heads/master | venv/Lib/site-packages/binstar_client/commands/whoami.py | 1 | '''
Print the information of the current user
'''
from __future__ import unicode_literals
from binstar_client import errors
from binstar_client.utils import get_server_api
from binstar_client.utils.pprint import pprint_user
import logging
log = logging.getLogger('binstar.whoami')
def main(args):
aserver_api = get... |
ali-filth/android_kernel_samsung_msm8226 | refs/heads/cm-11.0 | 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... |
RobertWalsh/zBar | refs/heads/master | python/examples/read_one.py | 38 | #!/usr/bin/python
from sys import argv
import zbar
# create a Processor
proc = zbar.Processor()
# configure the Processor
proc.parse_config('enable')
# initialize the Processor
device = '/dev/video0'
if len(argv) > 1:
device = argv[1]
proc.init(device)
# enable the preview window
proc.visible = True
# read at ... |
laenderoliveira/exerclivropy | refs/heads/master | cap08/listagem-08-09.py | 1 | def fatorial(x):
fat = 1
while x > 1:
fat *= x
x -= 1
return fat
print(fatorial(0)) |
geimer/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/generic/toolchain.py | 4 | ##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
SPKian/Testing | refs/heads/master | erpnext/patches/v5_0/newsletter.py | 60 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
import frappe.permissions
def execute():
frappe.reload_doc("core", "doctype", "block_module")
frappe.reload_doctype("User")
frappe.reload_doctype("Lead")
frappe.reload_docty... |
nrwahl2/ansible | refs/heads/devel | lib/ansible/module_utils/cnos_devicerules.py | 87 | # 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... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/positionalOnlyMarkerPropagatesExistingParameterSignatureDefaultToCall.before.py | 10 | def func(a=None, b=None):
pass
func(b=1)
func()
|
Archcady/mbed-os | refs/heads/master | TESTS/netsocket/host_tests/udp_shotgun.py | 39 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
Maistho/CouchPotatoServer | refs/heads/master | libs/qbittorrent/client.py | 2 | import requests
import json
class LoginRequired(Exception):
def __str__(self):
return 'Please login first.'
class QBittorrentClient(object):
"""class to interact with qBittorrent WEB API"""
def __init__(self, url):
if not url.endswith('/'):
url += '/'
self.url = url
... |
icomfort/cobbler | refs/heads/master | cobbler/item_profile.py | 2 | """
A Cobbler Profile. A profile is a reference to a distribution, possibly some kernel options, possibly some Virt options, and some kickstart data.
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GN... |
mlperf/training_results_v0.7 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/topi/python/topi/tag.py | 2 | # 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... |
t0in4/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/7_auto.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "6_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
larsmans/scipy | refs/heads/master | scipy/special/basic.py | 4 | #
# Author: Travis Oliphant, 2002
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
import math
from scipy._lib.six import xrange
from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt,
where, mgrid, sin, place, issubdtype,... |
Jaccorot/python | refs/heads/master | horx/0009/run.py | 40 | #!/usr/bin/env python3
import re
import requests
r = requests.get('https://github.com')
matches = re.findall('(?:https?|ftp)://[^\s/$\.?#].[^\s]+', r.text)
for i in range(0, len(matches)):
print('matche >>>: {} \n'.format(matches[i]))
|
aspose-pdf/Aspose.Pdf-for-Cloud | refs/heads/master | SDKs/Aspose.Pdf-Cloud-SDK-for-Python/asposepdfcloud/models/ResponseMessage.py | 27 | #!/usr/bin/env python
class ResponseMessage(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type... |
pelson/pelican-plugins | refs/heads/master | representative_image/__init__.py | 65 | from .representative_image import *
|
rasika-amaratissa/xhtml2pdf | refs/heads/master | demo/tgpisa/tgpisa/model.py | 169 | from turbogears.database import PackageHub
# import some basic SQLObject classes for declaring the data model
# (see http://www.sqlobject.org/SQLObject.html#declaring-the-class)
from sqlobject import SQLObject, SQLObjectNotFound, RelatedJoin
# import some datatypes for table columns from SQLObject
# (see http://www.sql... |
hulkamania/lockdown | refs/heads/master | src/daemonize.py | 1 | import os
import sys
class Daemonize:
''' Generic class for creating a daemon
http://code.activestate.com/recipes/578072-generic-way-to-create-a-daemonized-process-in-pyth/
'''
def daemonize(self):
try:
#this process would create a parent and a child
pid = os.fork()
if pid > 0:
# take care of the ... |
cupy/cupy | refs/heads/master | tests/cupyx_tests/scipy_tests/sparse_tests/__init__.py | 2 | import pytest
import cupy
if cupy.cuda.runtime.is_hip:
pytest.skip('HIP sparse support is not yet ready',
allow_module_level=True)
|
mchaperc/web_search | refs/heads/master | constants.py | 1 | links = [
"https://www.news.ycombinator.com",
"https://www.bloomberg.com/",
] |
sukiand/idapython | refs/heads/master | pywraps/deploy_all.py | 16 | # Please use the same tag for the same .i file
# That means if many insertions are going to happen in one
# given .i file then don't use more than code marking tag
print "\n-------- DEPLOY started --------------------------------------------------\n"
deploys = {
"idaapi (common functions, notifywhen)" : {
... |
ice9js/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_arraybuffer.py | 158 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestArrayBuffer {
attribute ArrayBuffer bufferAttr;
void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4);
attribute ArrayBufferView viewAttr;
... |
haoyuchen1992/osf.io | refs/heads/develop | tests/test_share.py | 39 | import xml
from mock import patch
from nose.tools import * # flake8: noqa (PEP8 asserts)
from tests.base import OsfTestCase
from website.search import util
from website.search import share_search
STANDARD_RETURN_VALUE = {
'hits': {
'hits': [{
"_score": 1,
"_type": "squaredcircle"... |
mccarrmb/moztrap | refs/heads/master | moztrap/view/manage/runs/forms.py | 3 | """
Management forms for runs.
"""
import floppyforms.__future__ as forms
from django.core.exceptions import ValidationError
from moztrap import model
from moztrap.view.lists import filters
from moztrap.view.utils import mtforms
class RunForm(mtforms.NonFieldErrorsClassFormMixin, mtforms.MTModelForm):
"""Bas... |
TAMU-CPT/galaxy-tools | refs/heads/master | tools/util/compare_codons.py | 1 | #!/usr/bin/env python
import argparse
import numpy as np
import itertools
import pygal
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from pygal.style import LightSolarizedStyle
def tntable(table=11):
codons = itertools.product("ACTG", repeat=3)
_table = {}
translation = {}
for x in ["".join(y... |
pabloborrego93/edx-platform | refs/heads/master | lms/djangoapps/edxnotes/decorators.py | 72 | """
Decorators related to edXNotes.
"""
import json
from django.conf import settings
from edxnotes.helpers import (
get_edxnotes_id_token,
get_public_endpoint,
get_token_url,
generate_uid,
is_feature_enabled,
)
from edxmako.shortcuts import render_to_string
def edxnotes(cls):
"""
Decora... |
Tejal011089/fbd_erpnext | refs/heads/develop | erpnext/setup/utils.py | 18 | # 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 _, throw
from frappe.utils import flt
def get_company_currency(company):
currency = frappe.db.get_value("Company", co... |
naojsoft/ginga | refs/heads/master | ginga/misc/Settings.py | 3 | #
# Settings.py -- Simple class to manage stateful user preferences.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
import re
import ast
import numpy as np
from . import Callback
from . import Bunch
unset_value = "^^UNSET^^"
regex_assign = re... |
ncclient/ncclient | refs/heads/master | ncclient/operations/retrieve.py | 3 | # Copyright 2009 Shikhar Bhushan
#
# 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 writin... |
TeachCraft/TeachCraft-Examples | refs/heads/master | examples/mcpi_import_3d_model.py | 1 | # These two lines are because of the folder the demos are located in, and aren't normally necessary
import os.path, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
#Example Source from: https://github.com/martinohanlon/minecraft-renderObjv2
#from minecraftstuff import Minecra... |
Qalthos/ansible | refs/heads/devel | test/units/modules/cloud/misc/virt_net/conftest.py | 38 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import pytest
from ansible.modules.cloud.misc import virt_net
from units.compat import mock
virt_net.libvirt = None
virt_net.HAS_VIRT = True
class DummyNetw... |
fldc/CouchPotatoServer | refs/heads/custom | libs/chardet/charsetgroupprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 ... |
okuta/chainer | refs/heads/master | tests/chainer_tests/test_backprop.py | 6 | import unittest
import mock
import numpy as np
import pytest
import chainer
from chainer.backends import cuda
from chainer import testing
from chainer.testing import attr
import chainerx
class TestBackward(unittest.TestCase):
def test_no_output(self):
chainer.backward([])
chainer.backward([], [... |
peeyush-tm/check_mk | refs/heads/nocout | livestatus/api/python/example.py | 6 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/numpy/distutils/command/config.py | 75 | # Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
from __future__ import division, absolute_import, print_function
import os, signal
import warnings
import sys
fr... |
MotorolaMobilityLLC/external-chromium_org | refs/heads/kitkat-mr1-release-falcon-gpe | tools/deep_memory_profiler/lib/pageframe.py | 123 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import re
import struct
LOGGER = logging.getLogger('dmprof')
class PageFrame(object):
"""Represents a pageframe and maybe its ... |
SNoiraud/gramps | refs/heads/master | gramps/gui/merge/mergefamily.py | 4 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Michiel D. Nauta
#
# 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 2 of the License, or
# (at your option... |
shakamunyi/neutron-vrrp | refs/heads/master | neutron/plugins/mlnx/db/__init__.py | 69 | # Copyright 2013 Mellanox Technologies, Ltd
#
# 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 t... |
damdam-s/OCB | refs/heads/8.0 | addons/l10n_ae/__init__.py | 669 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
ping/youtube-dl | refs/heads/master | youtube_dl/extractor/weibo.py | 12 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
import json
import random
import re
from ..compat import (
compat_parse_qs,
compat_str,
)
from ..utils import (
js_to_json,
strip_jsonp,
urlencode_postdata,
)
class WeiboIE(InfoExtractor):
_VALID_URL =... |
wooga/airflow | refs/heads/master | airflow/providers/apache/spark/operators/__init__.py | 5130 | #
# 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... |
MarcoFalke/bitcoin | refs/heads/master | test/functional/wallet_encryption.py | 8 | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Wallet encryption"""
import time
from test_framework.test_framework import BitcoinTestFramework
... |
oscarsjogren/dlw | refs/heads/master | dlw/cost.py | 1 | from __future__ import division
import numpy as np
from abc import ABCMeta, abstractmethod
from storage_tree import BigStorageTree
class Cost(object):
"""Abstract Cost class for the EZ-Climate model."""
__metaclass__ = ABCMeta
@abstractmethod
def cost(self):
pass
@abstractmethod
def price(self):
pass
cla... |
barseghyanartur/oauth2app | refs/heads/develop | tests/testsite/apps/oauth2/urls.py | 5 | #-*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from oauth2app.token import TokenGenerator
from oauth2app.consts import MAC
urlpatterns = patterns('',
(r'^missing_redirect_uri/?$', 'testsite.apps.oauth2.views.missing_redirect_uri'),
(r'^authorize_not_refreshable/?$'... |
daisukekobayashi/phase-only-correlation | refs/heads/master | pocpy/logpolar_opencv2.py | 1 | import cv2
import cv2.cv as cv
import numpy as np
def logpolar(src, center, magnitude_scale=40):
mat1 = cv.fromarray(np.float64(src))
mat2 = cv.CreateMat(src.shape[0], src.shape[1], mat1.type)
cv.LogPolar(
mat1,
mat2,
center,
magnitude_scale,
cv.CV_INTER_CUBIC + c... |
jirutka/ansible-modules-extras | refs/heads/devel | web_infrastructure/jboss.py | 32 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.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 th... |
Maccimo/intellij-community | refs/heads/master | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsTypeBothMixedElse_after.py | 10 | def func():
value = "not-none"
if value is not None: # Regular
print("Not none")
else: # type: SomeType
print("None") |
dracos/QGIS | refs/heads/master | python/plugins/processing/algs/lidar/lastools/lasvalidate.py | 9 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lasvalidate.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
*************... |
lzamparo/crisprML | refs/heads/master | src/pkl_to_csv.py | 1 | import pickle
import re
extractor = re.compile("(chr[0-9|XY]{1,2}):([\d]+)-([\d]+)\_\[\'(-?1)")
def parse_kv(key, value, extractor):
guide = key[:-3]
string_val = value[0]
match = extractor.match(string_val)
if match:
chrom, start, end, strand = match.groups()
return guid... |
ddv2005/intercom | refs/heads/master | 3rdparty/pjproject/tests/pjsua/scripts-call/400_tel_uri.py | 57 | # $Id: 400_tel_uri.py 3323 2010-09-28 07:43:18Z bennylp $
#
from inc_cfg import *
# Simple call
test_param = TestParam(
"tel: URI in From",
[
InstanceParam("callee", "--null-audio --max-calls=1 --id tel:+111"),
InstanceParam("caller", "--null-audio --max-calls=1")
]
)
|
chrishales/interpgain | refs/heads/master | task_interpgain.py | 1 | from taskinit import *
import numpy as np
# interpgain is released under a BSD 3-Clause License
# See LICENSE for details
# HISTORY:
# 1.0 28Sep2016 Initial version.
# 1.1 24Oct2016 Minor help file fixes, no change to code
#
def interpgain(caltable,obsid,field,extrapolate):
#
# Task interpgain
#... |
LICEF/edx-platform | refs/heads/master | common/djangoapps/terrain/stubs/tests/test_youtube_stub.py | 51 | """
Unit test for stub YouTube implementation.
"""
import unittest
import requests
from ..youtube import StubYouTubeService
class StubYouTubeServiceTest(unittest.TestCase):
def setUp(self):
self.server = StubYouTubeService()
self.url = "http://127.0.0.1:{0}/".format(self.server.port)
sel... |
Mirantis/swift-encrypt | refs/heads/master | doc/source/conf.py | 13 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2012 OpenStack Foundation.
#
# Swift documentation build configuration file, created by
# sphinx-quickstart on Tue May 18 13:50:15 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values a... |
misterdanb/micropython | refs/heads/master | tests/basics/builtin_hex.py | 72 | # test builtin hex function
print(hex(1))
print(hex(-1))
print(hex(15))
print(hex(-15))
print(hex(12345))
print(hex(0x12345))
print(hex(12345678901234567890))
print(hex(0x12345678901234567890))
|
dexterx17/nodoSocket | refs/heads/master | clients/Python-2.7.6/Tools/freeze/makemakefile.py | 53 | # Write the actual Makefile.
import os
def makemakefile(outfp, makevars, files, target):
outfp.write("# Makefile generated by freeze.py script\n\n")
keys = makevars.keys()
keys.sort()
for key in keys:
outfp.write("%s=%s\n" % (key, makevars[key]))
outfp.write("\nall: %s\n\n" % target)
... |
florentx/OpenUpgrade | refs/heads/8.0 | addons/portal_project/__init__.py | 438 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
cwisecarver/osf.io | refs/heads/develop | api_tests/users/views/test_user_addons.py | 7 | # -*- coding: utf-8 -*-
import abc
from nose.tools import * # flake8: noqa
import re
import pytest
from api.base.settings.defaults import API_BASE
from tests.base import ApiAddonTestCase
from osf_tests.factories import AuthUserFactory
from addons.box.tests.factories import BoxAccountFactory
from addons.dataverse.te... |
martinogden/django-banner-rotator | refs/heads/master | banner_rotator/models.py | 1 | #-*- coding:utf-8 -*-
from __future__ import unicode_literals
try:
from hashlib import md5
except ImportError:
from md5 import md5
from time import time
from django.contrib.auth.models import User
from django.db import models
from django.core.validators import MaxLengthValidator
from django.utils.translation ... |
zymtech/Scrapiders | refs/heads/master | jd_zhilian/jd_zhilian/spiders/jd.py | 1 | # -*- coding = utf-8 -*-
from scrapy import Spider
from scrapy.http import Request
import datetime
import urllib
import os
from scrapy.exceptions import IgnoreRequest
from jd_zhilian.items import JdZhilianItem
class jd(Spider):
name = "jd_zhilian"
allowed_domain = ["zhaopin.com"]
#start_urls = ["http://s... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/telnetlib.py | 108 | r"""TELNET client class.
Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds
Example:
>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79) # connect to finger port
>>> tn.write('guido\r\n')
>>> print tn.read_all()
Login Name TTY Idle When ... |
etherkit/OpenBeacon2 | refs/heads/master | client/win/venv/Lib/site-packages/pip/_vendor/pep517/colorlog.py | 56 | """Nicer log formatting with colours.
Code copied from Tornado, Apache licensed.
"""
# Copyright 2012 Facebook
#
# 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/licen... |
comran/SpartanBalloon2016 | refs/heads/master | third_party/googletest/googlemock/test/gmock_test_utils.py | 769 | #!/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... |
cg31/tensorflow | refs/heads/master | tensorflow/contrib/tensor_forest/hybrid/python/layers/decisions_to_data_test.py | 25 | # 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... |
sharonpkingsley/BINF3111 | refs/heads/master | old/config.py | 2 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
tsl143/zamboni | refs/heads/master | mkt/stats/tests/test_views.py | 18 | import json
import mock
import requests
from nose.tools import eq_, ok_
from rest_framework.reverse import reverse
from django.conf import settings
import mkt
from mkt.api.tests.test_oauth import RestOAuth
from mkt.purchase.models import Contribution
from mkt.site.fixtures import fixture
from mkt.site.tests import a... |
stevehof/CouchPotatoServer | refs/heads/master | couchpotato/core/media/_base/matcher/main.py | 15 | from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.variable import possibleTitles
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.matcher.base import MatcherBase
from caper import Caper
log = CPLog(__name__)
class Matcher(MatcherBase):
def __init__(s... |
vicenteneto/online-judge-solutions | refs/heads/master | URI/1-Beginner/1557.py | 1 | # -*- coding: utf-8 -*-
while 1:
n = int(raw_input())
if not n:
break
A = [['1' for x in range(n)] for y in range(n)]
last_len = len(str((2 ** (n - 1)) ** 2))
for i in range(n):
line = ''
for j in range(n):
if i == 0 and j == 0:
A[i][j] = '1'
... |
zaxtax/scikit-learn | refs/heads/master | examples/covariance/plot_lw_vs_oas.py | 159 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... |
ChanduERP/odoo | refs/heads/8.0 | addons/survey/__init__.py | 385 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
clarkperkins/stackdio | refs/heads/master | stackdio/core/warnings.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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... |
rcoscali/external-chromium-trace | refs/heads/master | trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/util.py | 35 | # 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... |
Aerojspark/PyFR | refs/heads/develop | pyfr/backends/base/kernels.py | 1 | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
import itertools as it
import types
from pyfr.util import memoize, proxylist
class _BaseKernel(object):
def __call__(self, *args, **kwargs):
return self, args, kwargs
@property
def retval(self):
return None
def run(sel... |
DarthMaulware/EquationGroupLeaks | refs/heads/master | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/file/cmd/strings/data/__init__.py | 148 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
pass |
dfrey382/opencharity | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 1869 | # Copyright 2014 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... |
maurofaccenda/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_asg.py | 14 | #!/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... |
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.5/django/conf/urls/shortcut.py | 205 | from django.conf.urls import patterns
urlpatterns = patterns('django.views',
(r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
)
|
dmitriy-serdyuk/fuel | refs/heads/master | fuel/bin/fuel_info.py | 19 | #!/usr/bin/env python
"""Fuel utility for extracting metadata."""
import argparse
import os
import h5py
message_prefix_template = 'Metadata for {}'
message_body_template = """
The command used to generate this file is
{}
Relevant versions are
H5PYDataset {}
fuel.converters {}
"... |
benjaminjkraft/django | refs/heads/master | tests/defer_regress/models.py | 282 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerF... |
yokose-ks/edx-platform | refs/heads/gacco3/master | cms/djangoapps/contentstore/tests/test_transcripts_utils.py | 10 | # -*- coding: utf-8 -*-
""" Tests for transcripts_utils. """
import unittest
from uuid import uuid4
import copy
import textwrap
from mock import patch, Mock
from pymongo import MongoClient
from django.test.utils import override_settings
from django.conf import settings
from django.utils import translation
from nose.... |
kokushozero/mifsaDBProject | refs/heads/master | web2py/applications/welcome/languages/zh-tw.py | 149 | # coding: utf8
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s s... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/django/contrib/gis/tests/inspectapp/models.py | 312 | from django.contrib.gis.db import models
class AllOGRFields(models.Model):
f_decimal = models.FloatField()
f_float = models.FloatField()
f_int = models.IntegerField()
f_char = models.CharField(max_length=10)
f_date = models.DateField()
f_datetime = models.DateTimeField()
f_time = models.Tim... |
georgejhunt/olpc-kernel | refs/heads/xsce4.1 | scripts/gdb/linux/cpus.py | 997 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... |
noahchense/upm | refs/heads/master | examples/python/ina132.py | 16 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limi... |
Reggad/gameEngines1 | refs/heads/master | Dependancies/SDL_ttf/external/freetype-2.4.12/src/tools/docmaker/docbeauty.py | 877 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... |
alxgu/ansible | refs/heads/devel | lib/ansible/module_utils/network/ios/providers/cli/config/bgp/neighbors.py | 14 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
import re
from ansible.module_utils.six import iteritems
from ansible.module_utils.network.common.utils import to_list
from ansible.module_utils.network.ios.providers.providers import Cl... |
ashishlal/pjproject-2.0.1 | refs/heads/master | tests/pjsua/scripts-recvfrom/203_reg_good_empty_realm.py | 58 | # $Id: 203_reg_good_empty_realm.py 3150 2010-04-29 00:23:43Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
pjsua = "--null-audio --id=sip:CLIENT --registrar sip:127.0.0.1:$PORT " + \
"--realm=* --user=username --password=password " + \
"--auto-update-nat=0"
# 401 Response, missing realm value
req1 = sip.Rec... |
fafaman/django | refs/heads/master | django/contrib/gis/db/models/functions.py | 209 | from decimal import Decimal
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import AreaField
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as DistanceMeasure,
)
from django.core.ex... |
rven/odoo | refs/heads/14.0-fix-partner-merge-mail-activity | addons/repair/models/account_move.py | 2 | # -*- coding: utf-8 -*-
from odoo import models, fields
class AccountMove(models.Model):
_inherit = 'account.move'
repair_ids = fields.One2many('repair.order', 'invoice_id', readonly=True, copy=False)
def unlink(self):
repairs = self.sudo().repair_ids.filtered(lambda repair: repair.state != 'ca... |
alexgorban/models | refs/heads/master | research/textsum/data.py | 23 | # 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... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/ec2/keypair.py | 150 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
nishigori/boto | refs/heads/develop | boto/swf/__init__.py | 145 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without... |
gaojinhua/cocos2d-x-samples | refs/heads/v3 | samples/MoonWarriors/frameworks/runtime-src/proj.android/build_native.py | 43 | #!/usr/bin/python
'''
build_native.py
This script will copy resources to assets and build native code with NDK.
'''
import sys
import os, os.path
import shutil
from optparse import OptionParser
def get_num_of_cpu():
''' The build process can be accelerated by running multiple concurrent job processes using the -... |
projectcalico/calico-neutron | refs/heads/calico-readme | neutron/tests/unit/cisco/l3/test_l3_router_appliance_plugin.py | 3 | # Copyright 2014 Cisco Systems, 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 requir... |
StephenOrJames/aviation | refs/heads/master | aviation_weather/components/temperature.py | 2 | import re
from aviation_weather.components import Component
from aviation_weather.exceptions import TemperatureDecodeError
class Temperature(Component):
"""The Temperature class represents a combined group of temperature and dew point.
Attributes:
temperature (int): The temperature in whole degrees ... |
buguelos/odoo | refs/heads/master | openerp/addons/test_impex/tests/test_import.py | 154 | # -*- coding: utf-8 -*-
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def ok(n):
""" Successful import of ``n`` records
:param int n: number of records which should have been imported
"""
return n, 0, 0, 0
def error(row, me... |
2014cdag5/2014cdag5 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/dummy.py | 1061 | # Empty module for testing the loading of modules
|
oz123/python-nvd3 | refs/heads/develop | nvd3/NVD3Chart.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from __future__ import uni... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.