repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
penguinscontrol/Spinal-Cord-Modeling | refs/heads/master | ClarkesNetwork/clarke.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 10:34:07 2016
@author: Radu
"""
from cell import Cell
from neuron import h
class ClarkeRelay(Cell): #### Inherits from Cell
"""Two-section cell: A soma with active channels and
a dendrite with passive properties."""
#### __init__ is gone and handled in Ce... |
akamel001/Sick-Beard | refs/heads/master | lib/subliminal/videos.py | 17 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... |
tectronics/pysal | refs/heads/master | pysal/version.py | 5 | version = "1.6.0dev"
|
pedrobaeza/odoo | refs/heads/master | addons/web_tests/__init__.py | 385 | # -*- coding: utf-8 -*-
import tests
|
agry/NGECore2 | refs/heads/master | scripts/object/mobile/smuggler_broker_ria.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_talon_karrde.py | 85615 | import sys
def setup(core, object):
return |
eighilaza/beghrira | refs/heads/master | beghrira-django/pipelines/models.py | 1 | from django.db import models
from django.forms import ModelForm
class Pipeline(models.Model):
project_name = models.CharField(max_length = 100)
ihm_port = models.IntegerField()
slave_port = models.IntegerField()
def __str__(self):
return self.project_name
class PipelineForm(ModelForm):
cla... |
UMWRG/demos | refs/heads/master | TrivialExample/model/pyomo/alt_format/trivial_example_type_format.py | 1 | # (c) Copyright 2015, University of Manchester
#
# This file is part of the Pyomo Plugin Demo Suite.
#
# The Pyomo Plugin Demo Suite 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... |
bouk/redshift_sqlalchemy | refs/heads/master | tests/test_unload_from_select.py | 2 | from unittest import TestCase
from sqlalchemy import Table, Column, Integer, String, MetaData
from sqlalchemy.sql import select, func
from redshift_sqlalchemy.dialect import UnloadFromSelect
import re
class TestUnloadFromSelect(TestCase):
def setUp(self):
'''
Sets up a table and associate met... |
YiddishKop/ucore_lab | refs/heads/master | related_info/ostep/ostep6-paging-policy.py | 53 | #! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def convert(size):
length = len(size)
lastchar = size[length-1]
if (lastchar == 'k') or (lastchar == 'K'):
m = 1024
nsize = int(size[0:length-1]) * m
elif (lastchar == 'm') or (lastchar == 'M'... |
tungvx/deploy | refs/heads/master | .google_appengine/google/appengine/_internal/django/core/handlers/wsgi.py | 23 | from threading import Lock
from pprint import pformat
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from google.appengine._internal.django import http
from google.appengine._internal.django.core import signals
from google.appengine._internal.django.core.handlers import b... |
tipsi/tipsi_tools | refs/heads/master | tests/test_common.py | 1 | import pytest
from tipsi_tools.django.fields import ChoicesEnum
from tipsi_tools.python import usd_round
@pytest.fixture
def foobar_enum():
class FooBarEnum(ChoicesEnum):
foo = 1
bar = 2
return FooBarEnum
def test_choices_enum(foobar_enum):
expected = [(1, 'foo'), (2, 'bar')]
choice... |
pamfilos/invenio | refs/heads/master-sql-fixes | modules/websubmit/lib/functions/Register_Approval_Request.py | 35 | ## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio 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) any later versio... |
pentestfail/TA-Github | refs/heads/master | bin/ta_github_declare.py | 1 | # encode = utf-8
"""
This module is used to filter and reload PATH.
This file is genrated by Splunk add-on builder
"""
import os
import sys
import re
ta_name = 'TA-Github'
ta_lib_name = 'ta_github'
pattern = re.compile(r"[\\/]etc[\\/]apps[\\/][^\\/]+[\\/]bin[\\/]?$")
new_paths = [path for path in sys.path if not pat... |
ytan-git/plugin.video.myclouds | refs/heads/master | lib/Clouds/CloudXunlei/captcha.py | 1 | # -*- coding: utf-8 -*-
import os
import time
import urllib2
import xbmcgui, xbmcaddon
__addonid__ = "plugin.video.myclouds"
addon = xbmcaddon.Addon(id=__addonid__)
pgpath = addon.getAddonInfo('path')
DEFAULT_CAPTCHA = os.path.join(pgpath, 'resources', 'images', 'noimage.gif')
ACTION_PARENT_DIR = 9
ACTION_PREVIOUS_ME... |
kisna72/django | refs/heads/master | tests/migrations/migrations_test_apps/unspecified_app_with_conflict/migrations/0002_second.py | 425 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("unspecified_app_with_conflict", "0001_initial")]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Auth... |
LaynePeng/magnum | refs/heads/master | magnum/common/pythonk8sclient/client/models/V1beta3_Volume.py | 15 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... |
wilsonxiao/machinekit | refs/heads/master | src/emc/usr_intf/touchy/listing.py | 35 | # Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy 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) any later version.
#
# Touchy i... |
public-ink/public-ink | refs/heads/master | server/appengine/lib/unidecode/x09e.py | 252 | data = (
'Shu ', # 0x00
'Luo ', # 0x01
'Qi ', # 0x02
'Yi ', # 0x03
'Ji ', # 0x04
'Zhe ', # 0x05
'Yu ', # 0x06
'Zhan ', # 0x07
'Ye ', # 0x08
'Yang ', # 0x09
'Pi ', # 0x0a
'Ning ', # 0x0b
'Huo ', # 0x0c
'Mi ', # 0x0d
'Ying ', # 0x0e
'Meng ', # 0x0f
'Di ', # 0x10
'Yue ', ... |
mhrivnak/pulp | refs/heads/master | nodes/common/__init__.py | 187 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
Varriount/Colliberation | refs/heads/master | libs/twisted/internet/test/test_iocp.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.iocpreactor}.
"""
import errno
from array import array
from struct import pack
from socket import AF_INET6, AF_INET, SOCK_STREAM, SOL_SOCKET, error, socket
from zope.interface.verify import verifyClass
from twis... |
RyanChinSang/ECNG3020-ORSS4SCVI | refs/heads/master | BETA/TestCode/SpchRecg/APP-SpchRecg4.py | 2 | import speech_recognition as sr
import socket
from threading import Thread
GOOGLE_SPEECH_RECOGNITION_API_KEY = None
def internet(host="8.8.8.8", port=53, timeout=3):
"""
Host: 8.8.8.8 (google-public-dns-a.google.com)
OpenPort: 53/tcp
Service: domain (DNS/TCP)
"""
try:
socket.setdefaul... |
Edraak/edraak-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_export_git.py | 25 | """
Test the ability to export courses to xml from studio
"""
import copy
import os
import shutil
import subprocess
from uuid import uuid4
from django.conf import settings
from django.test.utils import override_settings
import contentstore.git_export_utils as git_export_utils
from contentstore.utils import reverse_c... |
sudkannan/xen-hv | refs/heads/master | tools/xm-test/tests/domid/01_domid_basic_pos.py | 42 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
import re
from XmTestLib import *
status, output = traceCommand("xm domid Domain-0")
if status != 0:
FAIL("domid(Domain-0) returned invalid %i != 0" % status)
elif output != "0":
if verbose:
... |
vicky2135/lucious | refs/heads/master | oscar/lib/python2.7/site-packages/requests/packages/chardet/jpcntx.py | 1776 | ######################## 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 R... |
Kazade/NeHe-Website | refs/heads/master | google_appengine/lib/django-1.5/tests/regressiontests/special_headers/tests.py | 64 | from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SpecialHeadersTest(TestCase):
fixtures = ['data.xml']
urls = 'regressiontests.special_head... |
cidles/poio-api | refs/heads/master | src/poioapi/tests/io/test_graf.py | 1 | # -*- coding: utf-8 -*-
#
# Poio Tools for Linguists
#
# Copyright (C) 2009-2013 Poio Project
# Author: António Lopes <alopes@cidles.eu>
# URL: <http://media.cidles.eu/poio/>
# For license information, see LICENSE.TXT
import os
import poioapi.io.elan
import poioapi.io.graf
import xml.etree.ElementTree
class TestBa... |
sdcooke/django | refs/heads/master | django/contrib/gis/geoip/__init__.py | 700 | """
This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
C API (http://www.maxmind.com/app/c). This is an alternative to the GPL
licensed Python GeoIP interface provided by MaxMind.
GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
For IP-based geolocation, t... |
mlaprise/PyOFTK | refs/heads/master | PyOFTK/amplifier.py | 1 | """
Copyright (C) 2007-2010 Martin Laprise (mlaprise@gmail.com)
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; version 2 dated June, 1991.
This software is distributed in the hope that it will be ... |
hackerharp/blueman | refs/heads/master | blueman/main/applet/BluezAgent.py | 2 | # Copyright (C) 2008 Valmantas Paliksa <walmis at balticum-tv dot lt>
# Copyright (C) 2008 Tadas Dailyda <tadas at dailyda dot com>
#
# Licensed under the GNU General Public License Version 3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... |
czervenka/gap | refs/heads/master | gap/utils/tests.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2007 Robin Gottfried <google@kebet.cz> and Lukas Lukovsky
#
# 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.... |
czpython/django-cms | refs/heads/develop | cms/signals/utils.py | 2 | from contextlib import contextmanager
from django.db.models import signals
from ..models.pluginmodel import CMSPlugin
from .plugins import (
pre_delete_plugins,
pre_save_plugins,
post_delete_plugins,
)
@contextmanager
def disable_cms_plugin_signals():
"""
Disconnects all plugin signal handlers r... |
pbs/django-filer | refs/heads/master_pbs | filer/utils/loader.py | 1 | #-*- coding: utf-8 -*-
"""
This function is snatched from
https://github.com/ojii/django-load/blob/3058ab9d9d4875589638cc45e84b59e7e1d7c9c3/django_load/core.py#L49
local changes:
* added check for basestring to allow values that are already an object
or method.
"""
from importlib import import_module
def load_obj... |
saisai/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/runner_unittest.py | 124 | # Copyright (C) 2012 Google, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer... |
japeto/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/psycopg2/tests/test_bugX000.py | 81 | #!/usr/bin/env python
# bugX000.py - test for DateTime object allocation bug
#
# Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundati... |
chouseknecht/ansible-modules-core | refs/heads/devel | system/setup.py | 40 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
brodyberg/autorest | refs/heads/master | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/Header/setup.py | 28 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
joelddiaz/openshift-tools | refs/heads/prod | scripts/monitoring/cron-send-connection-count.py | 12 | #!/bin/env python2
'''
Command to send process connection count to MetricSender
'''
# vim: expandtab:tabstop=4:shiftwidth=4
# Disabling invalid-name because pylint doesn't like the naming conention we have.
# pylint: disable=invalid-name
import argparse
import psutil
# Reason: disable pylint import-error because ou... |
vicky2135/lucious | refs/heads/master | oscar/lib/python2.7/site-packages/django/db/backends/base/creation.py | 64 | import sys
import time
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.utils.six import StringIO
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_... |
katsikas/gnuradio | refs/heads/master | gr-trellis/src/examples/python/fsm_utils.py | 23 | #!/usr/bin/env python
#
# Copyright 2004 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)
# ... |
Gravecorp/Gap | refs/heads/master | Gap/Lib/macpath.py | 191 | """Pathname and path-related operations for the Macintosh."""
import os
import warnings
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getc... |
BrotherPhil/django | refs/heads/master | tests/admin_views/custom_has_permission_admin.py | 380 | """
A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission().
"""
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth import get_permission_codename
from django.contrib.auth.forms import AuthenticationForm
from . import admin as base_admin, models
PERM... |
Haabb/pwnfork | refs/heads/haabb_pwntools | pwn/crypto/polyalphabetic.py | 1 | import string
import pwn
import util
import freq
import monoalphabetic as mono
#####################################
# GENERAL CALCULATION OF KEY PERIOD #
#####################################
def strand_scores(strands, alphabet=string.uppercase):
"""
Calculate the index of coincidence of several texts.
... |
Timmenem/micropython | refs/heads/master | tests/basics/set_discard.py | 118 | s = {1, 2}
print(s.discard(1))
print(list(s))
|
j4/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/pages/admin/system/flavorspage.py | 36 | # 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
# d... |
grimmjow8/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/gem.py | 50 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Johan Wiren <johan.wiren.se@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 th... |
w4ilun/mraa | refs/heads/master | tests/mock/spi_checks_bit_per_word.py | 21 | #!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko.
#
# 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, includin... |
svogl/mbed-os | refs/heads/master | features/FEATURE_LWIP/TESTS/mbedmicro-net/host_tests/tcp_echo.py | 48 | # Copyright 2015 ARM Limited, 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... |
tianweizhang/nova | refs/heads/v0 | nova/tests/api/openstack/compute/contrib/test_certificates.py | 12 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 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/lice... |
profkronholm/COSCnotes | refs/heads/master | COSCnotes/day012/directfib.py | 1 | # directfib.py
# Bill Kronholm
# 2015
#
# A program to compute the Fibonacci numbers directly.
from math import sqrt
def getfib(n):
phi = (1 + sqrt(5))/2
psi = 1 - phi
return (phi**n - psi**n)/sqrt(5)
print getfib(1000)
|
freeflightsim/ffs-app-engine | refs/heads/master | ffs-cal.appspot.com/gdata/contacts/__init__.py | 7 | #!/usr/bin/python2.4
#
# Copyright 2009 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 require... |
LarsFronius/ansible | refs/heads/devel | lib/ansible/modules/database/influxdb/influxdb_database.py | 70 | #!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.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
# ... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/motif/pwm_tests.py | 7 | import pwm
from numpy import allclose, isnan
def test_create():
m = pwm.FrequencyMatrix.from_rows( ['A','C','G','T'], get_ctcf_rows() )
# Alphabet sort
assert m.sorted_alphabet == [ 'A', 'C', 'G', 'T' ]
# Character to index mapping
assert m.char_to_index[ ord('A') ] == 0
assert m.char_to_index[... |
ThkerLee/torngas | refs/heads/master | torngas/logger/client.py | 3 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import tornado.log
from functools import partial
from ..settings_manager import settings
ACCESS_LOGNAME = 'torngas.accesslog'
TRACE_LOGNAME = 'torngas.tracelog'
INFO_LOGNAME = 'torngas.infolog'
class _SysLogger(object):
def __init__(self):
sel... |
lisa-lab/pylearn2 | refs/heads/master | pylearn2/models/softmax_regression.py | 49 | """
Softmax regression
Note: softmax regression is implemented as a special case of the MLP.
It is an MLP with no hidden layers, and with the output layer
always set to be softmax.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]... |
cntnboys/410Lab6 | refs/heads/master | build/django/build/lib.linux-x86_64-2.7/django/contrib/gis/tests/geogapp/tests.py | 76 | """
Tests for geography support in PostGIS 1.5+
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.measure import D
from django.contrib.gis.tests.utils import postgis
fr... |
andnovar/networkx | refs/heads/master | networkx/generators/nonisomorphic_trees.py | 43 | """
Implementation of the Wright, Richmond, Odlyzko and McKay (WROM)
algorithm for the enumeration of all non-isomorphic free trees of a
given order. Rooted trees are represented by level sequences, i.e.,
lists in which the i-th element specifies the distance of vertex i to
the root.
"""
# Copyright (C) 2013 by
# ... |
charukiewicz/beer-manager | refs/heads/master | venv/lib/python3.4/site-packages/pip/pep425tags.py | 469 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_abbr_impl():
"""Return abbreviated implementation name."""
if hasat... |
viggates/oslo.messaging | refs/heads/master | oslo/messaging/conffixture.py | 2 |
# Copyright 2013 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 agr... |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/pygments/lexers/sql.py | 25 | # -*- coding: utf-8 -*-
"""
pygments.lexers.sql
~~~~~~~~~~~~~~~~~~~
Lexers for various SQL dialects and related interactive sessions.
Postgres specific lexers:
`PostgresLexer`
A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
lexer are:
- keywords and dat... |
40223236/lego | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementTree.py | 730 | #
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... |
philippeserruys/paparazzi_aurea | refs/heads/paparazzi4_1 | sw/lib/python/settings_tool.py | 14 | #!/usr/bin/env python
from ivy.std_api import *
import os
import logging
import sys
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
from settings_xml_parse import PaparazziACSettings
_SHOW_IVY_MSGS_ = False
class IvySettingsInterface(PaparazziACSettings):
def __init__(self, ac_ids):
Papara... |
nismod/smif | refs/heads/master | src/smif/sample_project/models/energy_demand.py | 3 | """Energy demand dummy model
"""
import numpy as np
from smif.model.sector_model import SectorModel
class EDMWrapper(SectorModel):
"""Energy model
"""
def before_model_run(self, data):
data = data.get_base_timestep_data('energy_demand')
self.logger.info("Energy demand in base year is %s",... |
reinout/django | refs/heads/master | django/conf/locale/zh_Hans/formats.py | 130 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5日
TIME_FORMAT = 'H:i' # 20:45
DATETIME_FORMAT =... |
chatcannon/scipy | refs/heads/master | scipy/weave/examples/fibonacci.py | 100 | # Typical run:
# C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py
# Recursively computing the first 30 fibonacci numbers:
# speed in python: 4.31599998474
# speed in c: 0.0499999523163
# speed up: 86.32
# Looping to compute the first 30 fibonacci numbers:
# speed in python: 0.000520999908447
# speed in c:... |
ginkgobioworks/curious | refs/heads/master | tests/dummy/wsgi.py | 2 | """
WSGI config for dummy project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dummy.settings")
from django.core.wsgi ... |
ogenstad/ansible | refs/heads/devel | lib/ansible/modules/commands/shell.py | 22 | # Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# # There is no actual shell module source, when you use 'shell' in ansible,
# it runs the 'command' module with special arguments and it behaves differently.
# See the command source and the comme... |
Ophiuchus1312/enigma2-master | refs/heads/master | lib/python/Components/Renderer/EGclock.py | 43 | from Components.VariableValue import VariableValue
from Renderer import Renderer
from enigma import eGauge
class EGclock(VariableValue, Renderer):
def __init__(self):
Renderer.__init__(self)
VariableValue.__init__(self)
GUI_WIDGET = eGauge
def changed(self, what):
if what[0] == self.CHANGED_CLEAR:
retur... |
davidoren/CuckooSploit | refs/heads/master | analyzer/windows/modules/packages/bin.py | 6 | # Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.common.abstracts import Package
from lib.api.process import Process
class Shellcode(Package):
"""Shellcode (any x86 executable code) anal... |
ya-induhvidual/libfs | refs/heads/master | Libfs/misc.py | 1 | """
collection of function useful for all other modules
"""
from collections import defaultdict
from functools import wraps
import inspect
import logging
import logging.config
import threading
from traceback import format_tb
import os
import sys
# dict to store the actual calltrace
# by thread-identifier
# calltrace[t... |
NinjaMSP/crossbar | refs/heads/master | crossbar/router/test/test_pytrie.py | 3 | #####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... |
devananda/ironic | refs/heads/master | ironic/tests/unit/drivers/modules/test_pxe.py | 1 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/deed/event_perk/npc_actor_deed.py | 85615 | import sys
def setup(core, object):
return |
amiguez/youtube-dl | refs/heads/master | youtube_dl/extractor/rbmaradio.py | 145 | # encoding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class RBMARadioIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rbmaradio\.com/shows/(?P<videoID>[^/]+)$'
_TEST = {
'url': 'http://www.rbm... |
kluyckx/solrupdater | refs/heads/master | src/pyth/plugins/pdf/writer.py | 6 | """
Render documents as Reportlab PDF stories
"""
from cStringIO import StringIO
import cgi # For escape()
from pyth import document
from pyth.format import PythWriter
from reportlab.platypus import SimpleDocTemplate, Paragraph
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.p... |
mhnatiuk/phd_sociology_of_religion | refs/heads/master | scrapper/lib/python2.7/site-packages/twisted/test/test_twisted.py | 23 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for miscellaneous behaviors of the top-level L{twisted} package (ie, for
the code in C{twisted/__init__.py}.
"""
from __future__ import division, absolute_import
import sys
from types import ModuleType, FunctionType
from twisted impor... |
dragondjf/QMarkdowner | refs/heads/master | markdown/extensions/meta.py | 114 | """
Meta Data Extension for Python-Markdown
=======================================
This extension adds Meta Data handling to markdown.
See <https://pythonhosted.org/Markdown/extensions/meta_data.html>
for documentation.
Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com).
All changes Copyrigh... |
igemsoftware/SYSU-Software2013 | refs/heads/master | project/Python27/Tools/scripts/texi2html.py | 46 | #! /usr/bin/env python
# Convert GNU texinfo files into HTML, one file per node.
# Based on Texinfo 2.14.
# Usage: texi2html [-d] [-d] [-c] inputfile outputdirectory
# The input file must be a complete texinfo file, e.g. emacs.texi.
# This creates many files (one per info node) in the output directory,
# overwriting e... |
giovannicode/python-framework | refs/heads/master | codeblocks/lib/codeblock_manager/forms/NewCodeBlockForm.py | 1 | import sys
sys.path.append('../../form_code')
from Form import *
class NewCodeBlockForm(Form):
def __init__(self, name, action, method):
Form.__init__(self, name, action, method)
self.add_input(LabelTextbox('codeblock_name', 'Codeblock Name: '))
self.add_input(LabelFilebox('codeblock_html', 'HTM... |
twz915/django | refs/heads/master | tests/template_tests/filter_tests/test_yesno.py | 430 | from django.template.defaultfilters import yesno
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_true(self):
self.assertEqual(yesno(True), 'yes')
def test_false(self):
self.assertEqual(yesno(False), 'no')
def test_none(self):
self.assertEqual... |
yychen/twd97 | refs/heads/master | twd97/__init__.py | 1 | from twd97.converter import fromwgs84, towgs84
|
AntouanK/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/itsdangerous/__init__.py | 49 |
from itsdangerous import *
|
mrgardner/mrgardner.github.io | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/setup.py | 2462 | #!/usr/bin/env python
# Copyright (c) 2009 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 setuptools import setup
setup(
name='gyp',
version='0.1',
description='Generate Your Projects',
author='Chromium Authors',
a... |
linjoahow/lego_Automatic-assembly | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/textwrap.py | 745 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... |
40223131/2015cda_g20519 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/locale.py | 624 | def getdefaultlocale():
return __BRYTHON__.language,None
def localeconv():
""" localeconv() -> dict.
Returns numeric and monetary locale-specific parameters.
"""
# 'C' locale default values
return {'grouping': [127],
'currency_symbol': '',
... |
TechWritingWhiz/indy-node | refs/heads/master | environment/vagrant/sandbox/DevelopmentEnvironment/common/indypool.py | 3 | #!/usr/bin/python3
# Ideally, we would use a virtualenv instead of hardcoding python3.
# python3 is hardcoded, because the python Docker SDK is being installed in a
# python >= 3.5.2 site-packages using pip3/pip3.5.
from __future__ import print_function
from docker.errors import BuildError, APIError, ImageNotFound, C... |
Zelgadis87/Sick-Beard | refs/heads/master | sickbeard/databases/cache_db.py | 17 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
sve-odoo/odoo | refs/heads/master | openerp/osv/fields.py | 24 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
newyork167/volatility | refs/heads/master | volatility/plugins/overlays/windows/win2003.py | 44 | # Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
tuxnani/open-telugu | refs/heads/master | tamil/txt2unicode/encode2utf8.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# #
# (C) 2014 Arulalan.T <arulalant@gmail.com> #
# ... |
manoj24rana/MobileIPv6 | refs/heads/master | src/visualizer/bindings/modulegen__gcc_LP64.py | 34 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
yongtang/tensorflow | refs/heads/master | tensorflow/tools/compatibility/ipynb.py | 17 | # Lint as: python2, python3
# Copyright 2019 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
#
... |
cyrixhero/scrapy | refs/heads/master | tests/test_pipeline_files.py | 88 | import os
import time
import hashlib
import warnings
from tempfile import mkdtemp
from shutil import rmtree
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.pipelines.files import FilesPipeline, FSFilesStore
from scrapy.item import Item, Field
from scrapy.http import Request, Response... |
mkiyer/chimerascan | refs/heads/master | chimerascan/deprecated/gene_to_genome2.py | 12 | '''
Created on Jan 31, 2011
@author: mkiyer
chimerascan: chimeric transcript discovery using RNA-seq
Copyright (C) 2011 Matthew Iyer
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 ... |
Xifax/jp-net-kit | refs/heads/master | jpnetkit/jisho.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Jisho.org semi-api
"""
import re
from collections import OrderedDict
from itertools import islice
import requests
from requests import RequestException
from bs4 import BeautifulSoup
class Jisho:
def __init__(self):
self.url = u'http://jisho.org/wor... |
nabsboss/CouchPotatoServer | refs/heads/develop | libs/chardet/gb2312freq.py | 323 | ######################## 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 R... |
wfarner/aurora | refs/heads/master | src/main/python/apache/thermos/observer/http/file_browser.py | 2 | #
# 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
# distributed under ... |
lukw00/powerline | refs/heads/develop | tests/lib/fsconfig.py | 24 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import json
from subprocess import check_call
from shutil import rmtree
from itertools import chain
from powerline import Powerline
CONFIG_DIR = os.path.join(os.path.dirname(os.path.dirname(... |
nrhine1/scikit-learn | refs/heads/master | sklearn/externals/joblib/pool.py | 237 | """Custom implementation of multiprocessing.Pool with custom pickler
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
available... |
hansent/dwolla-python | refs/heads/master | examples/send.py | 1 | # Include the Dwolla REST Client
from dwolla import DwollaUser
# Include any required keys
import _keys
# Instantiate a new Dwolla User client
# And, Sseed a previously generated access token
DwollaUser = DwollaUser(_keys.token)
'''
EXAMPLE 1:
Send money ($1.00) to a Dwolla ID
'''
transaction = DwollaUse... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.