repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
dlopes-samba/dlopes-maps-sambatech | refs/heads/master | django/contrib/formtools/wizard.py | 158 | """
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import settings
from django.contrib.formtools.utils import securit... |
wrightaprilm/plaus | refs/heads/master | fig4.py | 2 | import pandas as pd
data = pd.read_csv("./histogram.csv")
data.plot(kind='bar', legend=False)
plt.savefig('hist1.svg', bbox_inches='tight', dpi=300)
|
tmxdyf/CouchPotatoServer | refs/heads/master | libs/elixir/statements.py | 31 | import sys
MUTATORS = '__elixir_mutators__'
class ClassMutator(object):
'''
DSL-style syntax
A ``ClassMutator`` object represents a DSL term.
'''
def __init__(self, handler):
'''
Create a new ClassMutator, using the `handler` callable to process it
when the time will come... |
romain-li/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/middleware.py | 174 | """
Middleware for user api.
Adds user's tags to tracking event context.
"""
from eventtracking import tracker
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from track.contexts import COURSE_REGEX
from .models import UserCourseTag
class UserTagsEventContextMiddleware(object):
... |
remibergsma/cosmic | refs/heads/play/serviceofferings | cosmic-core/scripts/src/main/resources/python/lib/cloudutils/networkConfig.py | 2 | import logging
import os
import re
import subprocess
from cloudException import CloudRuntimeException, CloudInternalException
from utilities import bash
class networkConfig:
class devInfo:
def __init__(self, macAddr, ipAddr, netmask, gateway, type, name):
self.name = name
self.mac... |
jaysonsantos/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/non_callable_wsh.py | 499 | # 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 conditions and the f... |
h2020-endeavour/iSDX | refs/heads/master | pctrl/peer.py | 1 | #!/usr/bin/env python
# Author:
# Muhammad Shahbaz (muhammad.shahbaz@gatech.edu)
# Rudiger Birkner (Networked Systems Group ETH Zurich)
# Arpit Gupta (Princeton)
from threading import RLock
import time
import os
import sys
np = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if np not in sys.path:
... |
Aaron0927/xen-4.2.1 | refs/heads/master | tools/xm-test/tests/xapi/01_xapi-vm_basic.py | 42 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2006
# Author: Stefan Berger <stefanb@us.ibm.com>
# Basic VM creation test
from XmTestLib import xapi
from XmTestLib.XenAPIDomain import XmTestAPIDomain
from XmTestLib import *
from xen.xend import XendAPIConstants
import commands
import os
tr... |
dmacd/FB-try1 | refs/heads/master | rack/setup_ruby.py | 4 |
import subprocess
import sys
import re
import os
from os.path import expanduser
home = expanduser("~")
def start(args, logfile, errfile):
try:
subprocess.check_call("rvm ruby-2.0.0-p0 do bundle install --gemfile=Gemfile-ruby", shell=True, cwd="rack", stderr=errfile, stdout=logfile)
subprocess.check_call(... |
Splawik/pytigon | refs/heads/master | pytigon/prj/_schtools/__init__.py | 45382 | |
JimCircadian/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_static_route.py | 43 | #!/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... |
kevinr/750book-web | refs/heads/master | 750book-web-env/lib/python2.7/site-packages/amqplib/client_0_8/connection.py | 22 | """
AMQP 0-8 Connections
"""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>
#
# This library 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 2.1 of the License, or (at your o... |
anentropic/django-oscar | refs/heads/master | src/oscar/test/utils.py | 43 | from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.storage.fallback import FallbackStorage
from django.contrib.sessions.backends.db import SessionStore
from django.core.signing import Signer
from django.test import RequestFactory as BaseRequestFactory
from oscar.core.loading import get_c... |
sdeepanshu02/microblog | refs/heads/master | flask/Lib/site-packages/pip/index.py | 50 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... |
ibamacsr/loginlogout | refs/heads/master | loginlogout/utils.py | 1 | import re
def validate_user_funai(username, domain):
regex = re.compile('([^\\s]+)\\@[^\\s]+')
matched = regex.match(username)
if(matched):
username = "%s%s" % (matched.group(1), domain)
else:
username = "%s%s" % (username, domain)
return username |
mbauskar/internal-hr | refs/heads/develop | erpnext/patches/v4_0/update_user_properties.py | 39 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.permissions
import frappe.defaults
def execute():
frappe.reload_doc("core", "doctype", "docfield")
frappe.reload_doc("... |
adexin/Python-Machine-Learning-Samples | refs/heads/master | Other_samples/Gradient_check/gradient_check.py | 1 | import numpy as np
from Other_samples.testCases import *
from Other_samples.Gradient_check.gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, \
gradients_to_vector
def forward_propagation(x, theta):
"""
Implement the linear forward propagation (compute J) presented in Figure 1 (J(... |
MakeICT/event-creator | refs/heads/master | src/plugins/Meetup/meetup/__init__.py | 4 |
__version__ = '0.1.1'
|
jlegendary/youtube-dl | refs/heads/master | youtube_dl/extractor/firstpost.py | 124 | from __future__ import unicode_literals
from .common import InfoExtractor
class FirstpostIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?firstpost\.com/[^/]+/.*-(?P<id>[0-9]+)\.html'
_TEST = {
'url': 'http://www.firstpost.com/india/india-to-launch-indigenous-aircraft-carrier-monday-1025403.html',... |
justinpotts/mozillians | refs/heads/master | mozillians/phonebook/tests/test_views/test_views_emails.py | 4 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from nose.tools import eq_, ok_
from mozillians.common.tests import TestCase
from mozillians.users.models import ExternalAccount
from mozillians.users.tests import UserFactory
class EditEmailsTests(TestCase):
def test_view_... |
caasiu/plugin.video.bdyun | refs/heads/master | resources/modules/pyasn1/codec/der/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
huanpc/IoT-1 | refs/heads/master | gui/controller/.venv/lib/python3.5/site-packages/pip/status_codes.py | 1002 | from __future__ import absolute_import
SUCCESS = 0
ERROR = 1
UNKNOWN_ERROR = 2
VIRTUALENV_NOT_FOUND = 3
PREVIOUS_BUILD_DIR_ERROR = 4
NO_MATCHES_FOUND = 23
|
nopjmp/SickRage | refs/heads/master | lib/rtorrent/file.py | 174 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, modify, ... |
alilotfi/django | refs/heads/master | tests/i18n/tests.py | 87 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import decimal
import gettext as gettext_module
import os
import pickle
from contextlib import contextmanager
from importlib import import_module
from threading import local
from unittest import skipUnless
from django import forms
from ... |
CanalTP/kirin | refs/heads/master | tests/mock_navitia/vj_96231.py | 1 | # coding=utf-8
# Copyright (c) 2001, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and op... |
Russell-IO/ansible | refs/heads/devel | test/sanity/code-smell/use-compat-six.py | 68 | #!/usr/bin/env python
import os
import re
import sys
def main():
skip = set([
'test/sanity/code-smell/%s' % os.path.basename(__file__),
# digital_ocean is checking for six because dopy doesn't specify the
# requirement on six so it needs to try importing six to give the correct error mess... |
Gustavo6046/ChatterBot | refs/heads/master | tests/corpus_tests/test_corpus.py | 3 | from unittest import TestCase
from chatterbot.corpus import Corpus
import os
class CorpusUtilsTestCase(TestCase):
def setUp(self):
self.corpus = Corpus()
def test_get_file_path(self):
"""
Test that a dotted path is properly converted to a file address.
"""
path = self... |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/codecs.py | 4 | /usr/lib/python2.7/codecs.py |
techtonik/numpy | refs/heads/master | numpy/distutils/command/config_compiler.py | 250 | from __future__ import division, absolute_import, print_function
from distutils.core import Command
from numpy.distutils import log
#XXX: Linker flags
def show_fortran_compilers(_cache=[]):
# Using cache to prevent infinite recursion
if _cache: return
_cache.append(1)
from numpy.distutils.fcompiler i... |
ml9951/ghc | refs/heads/pastm | testsuite/driver/testutil.py | 16 | # -----------------------------------------------------------------------------
# Utils
import subprocess
def version_to_ints(v):
return [ int(x) for x in v.split('.') ]
def version_lt(x, y):
return version_to_ints(x) < version_to_ints(y)
def version_le(x, y):
return version_to_ints(x) <= version_to_int... |
JulyKikuAkita/PythonPrac | refs/heads/master | cs15211/ProfitableSchemes.py | 1 | __source__ = 'https://leetcode.com/problems/profitable-schemes/'
# Time: O(N * P * G)
# Space: O(P * G)
#
# Description: Leetcode # 879. Profitable Schemes
#
# There are G people in a gang, and a list of various crimes they could commit.
#
# The i-th crime generates a profit[i] and requires group[i] gang members to pa... |
SociedadMartinez/ToolShare | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
#yo, look at this sick as code!
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toolshare.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jonparrott/google-cloud-python | refs/heads/master | logging/google/cloud/logging_v2/proto/log_entry_pb2.py | 2 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/logging_v2/proto/log_entry.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _... |
IllusionRom-deprecated/android_platform_tools_idea | refs/heads/master | python/testData/resolve/multiFile/fromPackageImport/FromPackageImport.py | 83 | from mypackage import p
# <ref> |
h4ck3rm1k3/FEC-Field-Documentation | refs/heads/master | fec/version/v5_0/SH6.py | 4 | import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'ENTITY TYPE', 'number': '3'},
{'n... |
VinGarcia/kivy | refs/heads/master | examples/kv/ids/id_in_kv/id_in_kv.py | 37 | '''
The use of id in KV
===================
This small example shows how to refer from one widget
to another within KV.
'''
import kivy
kivy.require('1.8.0')
from kivy.app import App
class TestApp(App):
pass
if __name__ == '__main__':
TestApp().run()
|
guaix-ucm/megaradrp | refs/heads/master | megaradrp/instrument/tests/test_configs.py | 2 | import pytest
import astropy.io.fits as fits
import numina.instrument.generic
import numina.core
from megaradrp.loader import load_drp
def create_simple_frame():
hdr = {'INSTRUME': 'MEGARA', 'INSCONF': 'ca3558e3-e50d-4bbc-86bd-da50a0998a48'}
hdu = fits.PrimaryHDU(data=[[1]])
for k, v in hdr.items():
... |
liangazhou/django-rdp | refs/heads/master | packages/Django-1.8.6/django/views/decorators/vary.py | 586 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... |
mgit-at/ansible | refs/heads/devel | lib/ansible/modules/network/cnos/cnos_save.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... |
chennan47/osf.io | refs/heads/develop | addons/dropbox/tests/conftest.py | 447 | from osf_tests.conftest import * # noqa
|
bru32/magz | refs/heads/master | magz/uroot2d.py | 1 | """
2D Root Finder.
Function f(x,y) must return tuple of 2 error.
Bruce Wernick
10 June 2021
"""
import sys
from const import EPS, TINY
class RootFinder(object):
maxi = 96
tol = 1e-6
def __init__(self, f):
self.f = f
self.its = 0
def djac(self, x, y):
'jacobian'
h = 3.4... |
yodalee/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/unittest.py | 176 | """ discovery and running of std-library "unittest" style tests. """
from __future__ import absolute_import
import sys
import traceback
import pytest
# for transfering markers
import _pytest._code
from _pytest.python import transfer_markers
from _pytest.skipping import MarkEvaluator
def pytest_pycollect_makeitem(co... |
mlperf/training_results_v0.7 | refs/heads/master | NVIDIA/benchmarks/minigo/implementations/tensorflow/minigo/ml_perf/init_from_checkpoint.py | 4 | # Copyright 2019 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, ... |
ct-23/home-assistant | refs/heads/dev | homeassistant/components/sensor/zwave.py | 14 | """
Interfaces with Z-Wave sensors.
For more details about this platform, please refer to the documentation
at https://home-assistant.io/components/sensor.zwave/
"""
import logging
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from homeassistant.components.sensor import DOMAIN
from homeass... |
andrewcbennett/iris | refs/heads/placeholder | lib/iris/tests/unit/analysis/test_PROPORTION.py | 12 | # (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 the License, or
# (at your option) any l... |
tiangolo/ansible | refs/heads/devel | v1/ansible/runner/lookup_plugins/inventory_hostnames.py | 173 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... |
zdary/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/DateTodayReturnType/a.py | 83 | from datetime import date
print(date.today().strftime('%y'))
|
funson/rt-xen | refs/heads/master | tools/python/xen/sv/RestoreDomain.py | 46 | from xen.sv.Wizard import *
from xen.sv.util import *
from xen.sv.GenTabbed import PreTab
from xen.xm.create import make_config, OptVals
from xen.xend.XendClient import server
class RestoreDomain( Wizard ):
def __init__( self, urlWriter ):
sheets = [ ChooseRestoreDomain,
DoRestore ]
... |
hachard/Cra-Magnet | refs/heads/master | flask/lib/python3.5/site-packages/guess_language/__init__.py | 64 | from guess_language import *
|
blighj/django | refs/heads/master | django/db/backends/base/client.py | 98 | class BaseDatabaseClient:
"""Encapsulate backend-specific methods for opening a client shell."""
# This should be a string representing the name of the executable
# (e.g., "psql"). Subclasses must override this.
executable_name = None
def __init__(self, connection):
# connection is an insta... |
raghuvam/fusepy | refs/heads/master | pymongo/results.py | 71 | # Copyright 2015 MongoDB, 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 agreed to in writing, so... |
kfox1111/horizon | refs/heads/master | openstack_dashboard/dashboards/project/data_processing/data_image_registry/tests.py | 23 | # 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 t... |
NorfairKing/sus-depot | refs/heads/master | shared/shared/vim/dotvim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/test/test_mount.py | 43 | import bottle
from tools import ServerTestBase
from bottle import response
class TestAppMounting(ServerTestBase):
def setUp(self):
ServerTestBase.setUp(self)
self.subapp = bottle.Bottle()
@self.subapp.route('/')
@self.subapp.route('/test/:test')
def test(test='foo'):
... |
Kitware/arctic-viewer | refs/heads/master | scripts/examples/vtk/samples/diskout-volume.py | 2 | # -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
dataset_destination_path = '/Users/seb/Desktop/diskout_volume_%s'
file_path = '/Users/seb/Downloads/ParaViewData-3.98.1/Data/disk_out_ref.... |
try-dash-now/dash-ia | refs/heads/master | tools/build/bdist.win32/winexe/temp/pyexpat.py | 7 |
def __load():
import imp, os, sys
try:
dirname = os.path.dirname(__loader__.archive)
except NameError:
dirname = sys.prefix
path = os.path.join(dirname, 'pyexpat.pyd')
#print "py2exe extension module", __name__, "->", path
mod = imp.load_dynamic(__name__, path)
## mod.frozen ... |
ewandor/home-assistant | refs/heads/dev | tests/components/binary_sensor/test_ring.py | 9 | """The tests for the Ring binary sensor platform."""
import os
import unittest
import requests_mock
from homeassistant.components.binary_sensor import ring
from homeassistant.components import ring as base_ring
from tests.components.test_ring import ATTRIBUTION, VALID_CONFIG
from tests.common import (
get_test_co... |
memray/seq2seq-keyphrase | refs/heads/master | emolga/models/variational.py | 2 | __author__ = 'jiataogu'
import theano
# theano.config.exception_verbosity = 'high'
import logging
import emolga.basic.objectives as objectives
import emolga.basic.optimizers as optimizers
from emolga.layers.recurrent import *
from emolga.layers.embeddings import *
from emolga.models.encdec import RNNLM, Encoder, Decod... |
Newman101/scipy | refs/heads/master | scipy/optimize/tests/test_linprog.py | 100 | """
Unit test for Linear Programming via Simplex Algorithm.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_, assert_array_almost_equal, assert_allclose,
assert_almost_equal, assert_raises, assert_equal, run_module_suite)
from scipy.opt... |
cyankw/Keyboard-Recorder | refs/heads/master | Stable Version/py-hook.py | 2 | # -*- coding: utf-8 -*- #
__author__ = 'cyankw'
#version = 1.2
import pythoncom
import pyHook
import datetime
import os
oldwindowsName_keyboard = ''
oldwindowsName_Mouse = ''
oldwindowsName=''
def onMouseEvent(event):
timeNow = datetime.datetime.now()
Now = timeNow.strftime('%H:%M:%S')
Mouse_input = ope... |
tensorflow/tfx-bsl | refs/heads/master | tfx_bsl/public/__init__.py | 1 | # Copyright 2019 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... |
vanoudt/jethro-pmm | refs/heads/master | vendor/phpoffice/phpword/docs/conf.py | 19 | # -*- coding: utf-8 -*-
#
# PhpWord documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 14 23:09:26 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
KamalAwasthi/FullContact | refs/heads/master | myvenv/lib/python3.4/site-packages/django/contrib/gis/maps/google/gmap.py | 526 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.gis.maps.google.overlays import (
GMarker, GPolygon, GPolyline,
)
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.util... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pylint/test/functional/unidiomatic_typecheck.py | 15 | """Warnings for using type(x) == Y or type(x) is Y instead of isinstance(x, Y)."""
# pylint: disable=missing-docstring,expression-not-assigned,redefined-builtin,invalid-name
def simple_positives():
type(42) is int # [unidiomatic-typecheck]
type(42) is not int # [unidiomatic-typecheck]
type(42) == int # [un... |
johankaito/fufuka | refs/heads/master | microblog/old-flask/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py | 901 | # Copyright 2014 Donald Stufft
#
# 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, so... |
pinkavaj/gnuradio | refs/heads/master | gr-fec/python/fec/extended_tagged_encoder.py | 24 | #!/usr/bin/env python
#
# Copyright 2014 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)
# ... |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/site-packages/south/tests/deps_c/migrations/0002_c.py | 2088 | from south.db import db
from django.db import models
class Migration:
def forwards(self):
pass
def backwards(self):
pass
|
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.4/django/conf/locale/gl/formats.py | 322 | # -*- encoding: utf-8 -*-
# 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 = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F ... |
pieterlexis/pdns | refs/heads/master | regression-tests/bulktest-to-json.py | 9 | #!/usr/bin/env python2
from __future__ import print_function
import glob, json
varnames = set()
statnames = set()
runs = list()
for fname in glob.glob('testresults-*.xml'):
info = fname[12:-4].split('_')
tag = info.pop(0)
vars = dict(s.split(':') for s in info)
vars['tag'] = tag
varnames.update(vars.keys())
sta... |
spendright/msd | refs/heads/master | msd/output.py | 1 | # Copyright 2014-2015 SpendRight, 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 agreed to in wri... |
aldryn/heroku-buildpack-python | refs/heads/master | vendor/setuptools-1.1/setuptools/tests/__init__.py | 412 | """Tests for the 'setuptools' package"""
import sys
import os
import unittest
from setuptools.tests import doctest
import distutils.core
import distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
from distutils.core import Extension
fr... |
storm-computers/odoo | refs/heads/9.0 | addons/web_editor/tests/test_converter.py | 39 | # -*- coding: utf-8 -*-
import textwrap
import unittest
from lxml import etree, html
from lxml.builder import E
from openerp.tests import common
from openerp.addons.base.ir import ir_qweb
from openerp.addons.web_editor.models.ir_qweb import html_to_text
class TestHTMLToText(unittest.TestCase):
def test_rawstrin... |
FreeAgent/djangoappengine-starter | refs/heads/master | django/contrib/comments/feeds.py | 310 | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... |
sandeepkoduri/GAE-html-to-pdf | refs/heads/master | libs/jinja2/bccache.py | 130 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... |
kontact-chan/seq2seq | refs/heads/master | seq2seq/models/__init__.py | 4 | # Copyright 2017 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 or agreed to in writing,... |
yoghadj/or-tools | refs/heads/master | examples/python/data/nonogram_regular/nonogram_p200.py | 74 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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... |
danegolfs/customCab | refs/heads/master | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
indictranstech/reciphergroup-erpnext | refs/heads/master | erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py | 121 | # 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.model.document import Document
class EmployeeExternalWorkHistory(Document):
pass |
apocquet/django | refs/heads/master | tests/expressions/models.py | 261 | """
Tests for F() query expression syntax.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField... |
gunshor/django-avatar | refs/heads/master | avatar/management/commands/rebuild_avatars.py | 66 | from django.core.management.base import NoArgsCommand
from avatar.models import Avatar
from avatar.settings import AUTO_GENERATE_AVATAR_SIZES
class Command(NoArgsCommand):
help = "Regenerates avatar thumbnails for the sizes specified in " + \
"settings.AUTO_GENERATE_AVATAR_SIZES."
def handle_noar... |
xme1226/horizon | refs/heads/master | openstack_dashboard/enabled/_10_project.py | 26 | # The name of the dashboard to be added to HORIZON['dashboards']. Required.
DASHBOARD = 'project'
# If set to True, this dashboard will be set as the default dashboard.
DEFAULT = True
# A dictionary of exception classes to be added to HORIZON['exceptions'].
ADD_EXCEPTIONS = {}
# A list of applications to be added to IN... |
beatrizjesus/my-first-blog | refs/heads/master | pasta/Lib/site-packages/django/templatetags/cache.py | 471 | from __future__ import unicode_literals
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __in... |
ogajduse/spacewalk | refs/heads/master | client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 10 | # Copyright (c) 2010--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a cop... |
EvanK/ansible | refs/heads/devel | lib/ansible/modules/database/proxysql/proxysql_manage_config.py | 57 | #!/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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: proxysql_manage_config
ver... |
Honry/crosswalk-test-suite | refs/heads/master | apptools/apptools-linux-tests/apptools/create_with_target_platform.py | 15 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
Mhynlo/SickRage | refs/heads/master | lib/requests/packages/urllib3/util/url.py | 713 | from __future__ import absolute_import
from collections import namedtuple
from ..exceptions import LocationParseError
url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment']
class Url(namedtuple('Url', url_attrs)):
"""
Datastructure for representing an HTTP URL. Used as a return value f... |
Kronuz/django-denorm | refs/heads/master | test_denorm_project/test_denorm_project/settings_mysql.py | 9 | from settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'denorm_test',
'HOST': 'localhost',
'USER': 'root',
'PASSWORD': '',
}
}
|
djmax81/Hani_Kernel_Exynos5433 | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # 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,... |
nmercier/linux-cross-gcc | refs/heads/master | win32/bin/Lib/multiprocessing/synchronize.py | 5 | #
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Re... |
leilihh/nova | refs/heads/stable/icehouse | nova/tests/integrated/integrated_helpers.py | 4 | # Copyright 2011 Justin Santa Barbara
# 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 requ... |
toladata/TolaTables | refs/heads/master | silo/migrations/0006_auto_20160805_1504.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-08-05 22:04
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('silo', '0005_anonymizingfields'),
]
operations = [
migrations.RenameModel(
... |
MiCHiLU/flatbuffers | refs/heads/appengine-compatible | android/jni/run_flatc.py | 36 | #!/usr/bin/python
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
zozo123/buildbot | refs/heads/master | slave/buildslave/test/unit/test_commands_svn.py | 3 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
TrossSoftwareAndTech/webvt | refs/heads/master | lib/node-v7.2.0/deps/v8_inspector/third_party/jinja2/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... |
hkariti/ansible | refs/heads/devel | lib/ansible/module_utils/facts/__init__.py | 172 | # 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... |
yianni/strands_qsr_lib | refs/heads/master | qsr_lib/tests/abstractclass_unittest_dyadic.py | 8 | #!/usr/bin/env python
from __future__ import print_function, division
from abc import ABCMeta
from abstractclass_unittest import AbstractClass_UnitTest
from qsrlib.qsrlib import QSRlib_Request_Message
from unittests_utils import *
class Abstractclass_Unittest_Dyadic(AbstractClass_UnitTest):
__metaclass__ = ABCMeta... |
CumulusNetworks/linux-apd | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
Bouska/bolton-urgences | refs/heads/master | scraper/scraper/settings.py | 1 | # -*- coding: utf-8 -*-
# Scrapy settings for scraper project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest... |
Kazade/NeHe-Website | refs/heads/master | google_appengine/lib/django-1.4/django/bin/profiling/gather_profile_stats.py | 75 | #!/usr/bin/env python
"""
gather_profile_stats.py /path/to/dir/of/profiles
Note that the aggregated profiles must be read with pstats.Stats, not
hotshot.stats (the formats are incompatible)
"""
from hotshot import stats
import os
import pstats
import sys
def gather_stats(p):
profiles = {}
for f in os.listdi... |
alexshin/django-guardian | refs/heads/devel | example_project/posts/models.py | 126 | from django.db import models
class Post(models.Model):
title = models.CharField('title', max_length=64)
slug = models.SlugField(max_length=64)
content = models.TextField('content')
created_at = models.DateTimeField(auto_now_add=True, db_index=True)
class Meta:
permissions = (
... |
dallascard/guac | refs/heads/master | core/external/get_phrases.py | 1 | import os
import glob
import phrasemachine
from optparse import OptionParser
from scipy.sparse import lil_matrix
from ..util import dirs
from ..util import file_handling as fh
def main():
usage = "%prog project"
parser = OptionParser(usage=usage)
#parser.add_option('--keyword', dest='key', default=None,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.