repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
makinacorpus/django | refs/heads/master | django/contrib/gis/geos/io.py | 623 | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WK... |
jstutters/Plumbium | refs/heads/master | example/example.py | 1 | from collections import OrderedDict
import sys
from pirec import call, record, pipeline
from pirec.recorders import CSVFile
@record()
def pipeline_stage_1():
call(['echo', 'foo'])
@record()
def pipeline_stage_2():
call(['echo', 'data: 55'])
def my_pipeline():
pipeline_stage_1()
pipeline_stage_2()
... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/kubernetesconfiguration/azure-mgmt-kubernetesconfiguration/azure/mgmt/kubernetesconfiguration/aio/_configuration.py | 1 | # 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 may ... |
mhkeller/electron | refs/heads/master | tools/posix/generate_breakpad_symbols.py | 185 | #!/usr/bin/env python
# Copyright (c) 2013 GitHub, Inc.
# Copyright (c) 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.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only suppo... |
saydulk/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/groups/tests.py | 29 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
gangadhar-kadam/mtn-erpnext | refs/heads/master | selling/doctype/quotation_item/quotation_item.py | 483 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
Itxaka/libcloud | refs/heads/trunk | libcloud/utils/dist.py | 57 | # 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 use ... |
dymkowsk/mantid | refs/heads/master | scripts/AbinsModules/AbinsParameters.py | 2 | import math
"""
Parameters for instruments and Abins
"""
# Instruments constants #############################
# These parameters can be changed by a user if necessary
fwhm = 3.0 # approximate value for the full width at half maximum for Gaussian experimental resolutions
# TwoDMap instrument
delta_width = 0.1 # w... |
rdeheele/odoo | refs/heads/master | addons/project_issue/res_config.py | 441 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_vest_field_hutt_03.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_vest_field_hutt_03.iff"
result.at... |
Adenilson/servo | refs/heads/master | python/mach/mach/test/providers/throw.py | 122 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import time
from mach.decorators import (
CommandArgument,
CommandProv... |
SolaWing/ycmd | refs/heads/mine | cpp/ycm/tests/gmock/gtest/test/gtest_list_tests_unittest.py | 1898 | #!/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... |
OpenUpgrade-dev/OpenUpgrade | refs/heads/8.0 | openerp/addons/base/tests/test_expression.py | 260 | import unittest2
import openerp
from openerp.osv.expression import get_unaccent_wrapper
from openerp.osv.orm import BaseModel
import openerp.tests.common as common
class test_expression(common.TransactionCase):
def _reinit_mock(self):
self.query_list = list()
def _mock_base_model_where_calc(self, mo... |
cemoody/chainer | refs/heads/master | tests/chainer_tests/links_tests/activation_tests/test_prelu.py | 3 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class TestPReLUSingle(unittest.TestCase):
def setUp(self):
self.link = lin... |
eng-tools/sfsimodels | refs/heads/master | sfsimodels/scores.py | 1 | import numpy as np
def lc_score(value):
"""
Evaluates the accuracy of a predictive measure (e.g. r-squared)
:param value: float, between 0.0 and 1.0.
:return:
"""
rebased = 2 * (value - 0.5)
if rebased == 0:
return 0
elif rebased > 0:
compliment = 1.0 - rebased
... |
jolyonb/edx-platform | refs/heads/master | lms/djangoapps/course_blocks/transformers/library_content.py | 1 | """
Content Library Transformer.
"""
from __future__ import absolute_import
import json
import six
from eventtracking import tracker
from courseware.models import StudentModule
from openedx.core.djangoapps.content.block_structure.transformer import (
BlockStructureTransformer,
FilteringTransformerMixin
)
fro... |
caramucho/pybindgen | refs/heads/master | examples/buffer/modulegen.py | 12 | #! /usr/bin/env python
import sys
import pybindgen
from pybindgen import ReturnValue, Parameter, Module, Function, FileCodeSink
from pybindgen import CppMethod, CppConstructor, CppClass, Enum
from pybindgen.typehandlers.base import ForwardWrapperBase
class BufferReturn(ReturnValue):
CTYPES = []
def __init_... |
nikhilsinghmus/csound | refs/heads/develop | tests/commandline/testUI.py | 14 | from Tkinter import *
class TestApplication(Frame):
def selectTest(self):
selected = self.listBox.curselection()[0]
self.textBox.insert(0, selected[5])
def createWidgets(self):
self.scrollbar = Scrollbar(self)
self.scrollbar.grid(row=0, column=1, sticky="ns")
self.lis... |
jiangzhuo/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_userlist.py | 116 | # Check every path through every method of UserList
from collections import UserList
from test import support, list_tests
class UserListTest(list_tests.CommonTest):
type2test = UserList
def test_getslice(self):
super().test_getslice()
l = [0, 1, 2, 3, 4]
u = self.type2test(l)
... |
oinopion/django | refs/heads/master | tests/extra_regress/models.py | 166 | from __future__ import unicode_literals
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RevisionableModel(models.Model):
base = models.ForeignKey('self', null=Tru... |
nelmiux/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/lib2to3/fixes/fix_reduce.py | 326 | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for reduce().
Makes sure reduce() is imported from the functools module if reduce is
used in that module.
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import touch_import
class FixReduce(fixer_base.BaseFix):
... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/third_party/python-future/src/libpasteurize/fixes/fix_memoryview.py | 71 | u"""
Fixer for memoryview(s) -> buffer(s).
Explicit because some memoryview methods are invalid on buffer objects.
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import Name
class FixMemoryview(fixer_base.BaseFix):
explicit = True # User must specify that they want this.
PATTERN = u"""
... |
yagince/text_ux | refs/heads/master | vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ruby.py | 14 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Options,Utils
from waflib.TaskGen import before_method,feature,after_method,Task,extension
from waflib.Configure import conf
def init_rubyext... |
Archcady/mbed-os | refs/heads/master | tools/export/kds/__init__.py | 16 | """
mbed SDK
Copyright (c) 2011-2016 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... |
kaedroho/django | refs/heads/master | tests/i18n/forms.py | 500 | from django import forms
from .models import Company
class I18nForm(forms.Form):
decimal_field = forms.DecimalField(localize=True)
float_field = forms.FloatField(localize=True)
date_field = forms.DateField(localize=True)
datetime_field = forms.DateTimeField(localize=True)
time_field = forms.TimeF... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/forms/widgets.py | 155 | """
HTML Widget classes
"""
import datetime
from itertools import chain
import time
from urlparse import urljoin
from util import flatatt
import django.utils.copycompat as copy
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, condi... |
samhoo/askbot-realworld | refs/heads/master | askbot/views/commands.py | 1 | """
:synopsis: most ajax processors for askbot
This module contains most (but not all) processors for Ajax requests.
Not so clear if this subdivision was necessary as separation of Ajax and non-ajax views
is not always very clean.
"""
from django.conf import settings as django_settings
from django.core import exceptio... |
david-ragazzi/nupic | refs/heads/master | examples/opf/experiments/multistep/hotgym/permutations_sp.py | 8 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... |
niceQWER007/jaikuengine | refs/heads/master | common/test/runner.py | 34 | # Copyright 2009 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, ... |
SUSE/azure-sdk-for-python | refs/heads/master | azure-monitor/azure/monitor/operations/tenant_activity_logs_operations.py | 1 | # 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 ... |
ClovisIRex/Snake-django | refs/heads/master | env/lib/python3.6/site-packages/packaging/version.py | 1151 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... |
AzaiaInquisitor/MindScryer | refs/heads/master | bp_includes/external/requests/packages/chardet/compat.py | 2942 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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
# versio... |
fubecka/f5-dashboard | refs/heads/master | flask/lib/python2.6/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
jsjohnst/tornado | refs/heads/master | tornado/concurrent.py | 32 | #!/usr/bin/env python
#
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
google/makani | refs/heads/master | analysis/checks/collection/q7_checks.py | 1 | # Copyright 2020 Makani Technologies 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... |
kore-plugins/kore-plugins-ini | refs/heads/master | kore_plugins_ini/parsers.py | 1 | from configparser import ConfigParser
class CaseConfigParser(ConfigParser):
def optionxform(self, optionstr):
return optionstr
|
vmanoria/bluemix-hue-filebrowser | refs/heads/master | hue-3.8.1-bluemix/desktop/core/ext-py/python-openid-2.2.5/openid/test/test_symbol.py | 87 | import unittest
from openid import oidutil
class SymbolTest(unittest.TestCase):
def test_selfEquality(self):
s = oidutil.Symbol('xxx')
self.failUnlessEqual(s, s)
def test_otherEquality(self):
x = oidutil.Symbol('xxx')
y = oidutil.Symbol('xxx')
self.failUnlessEqual(x, y... |
sariths/stadicViewer | refs/heads/master | StadicViewer/gui/pyqtGui/dump/ui3.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui1.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... |
opennode/nodeconductor | refs/heads/develop | waldur_core/cost_tracking/managers.py | 1 | import datetime
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import models as django_models
from django.db.models import Q
from django.utils import timezone
from waldur_core.core import utils as core_utils
from waldur_core.core.manager... |
spaceof7/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_simpson_ascii.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_simpson_ascii.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
****************... |
LuaDist/scintilla | refs/heads/master | test/XiteMenu.py | 85 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Define the menu structure used by the Pentacle applications """
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
["Exercised",... |
Jovy23/N930TUVU1APGC_Kernel | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 1544 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
hbhdytf/mac | refs/heads/master | swift/container/updater.py | 16 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
BeegorMif/HTPC-Manager | refs/heads/master | lib/sqlalchemy/dialects/postgresql/__init__.py | 78 | # postgresql/__init__.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, psycopg2, pg8000, pypostgresql, zxjdbc
base.dialect = psyc... |
tardyp/buildbot | refs/heads/master | master/buildbot/test/unit/util/test_maildir.py | 5 | # 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... |
Denisolt/Tensorflow_Chat_Bot | refs/heads/master | local/lib/python2.7/site-packages/wheel/tool/__init__.py | 93 | """
Wheel command-line utility.
"""
import os
import hashlib
import sys
import json
from glob import iglob
from .. import signatures
from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary,
matches_requirement)
from ..install import WheelFile, VerifyingZipFile
from ..paths import ... |
hellhovnd/django | refs/heads/master | django/conf/locale/uk/formats.py | 236 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y р.'
TIME_FORMAT = 'H:i:s'
... |
adminneyk/codificacionproyectando | refs/heads/master | application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/ntpath.py | 60 | # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
__all__ ... |
catapult-project/catapult | refs/heads/master | third_party/gsutil/gslib/vendored/boto/tests/unit/machinelearning/test_machinelearning.py | 91 | # Copyright (c) 2015 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 restriction, including
# without limitation the rights ... |
gauravbose/digital-menu | refs/heads/master | digimenu2/tests/file_uploads/tests.py | 12 | #! -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import errno
import hashlib
import json
import os
import shutil
import tempfile as sys_tempfile
import unittest
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.m... |
bumfo/sublime-real-javascript | refs/heads/master | libs/js-beautify/python/six.py | 271 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... |
cbertinato/pandas | refs/heads/master | pandas/core/ops.py | 1 | """
Arithmetic operations for PandasObjects
This is not a public API.
"""
import datetime
import operator
import textwrap
from typing import Dict, Optional
import warnings
import numpy as np
from pandas._libs import algos as libalgos, lib, ops as libops
from pandas.errors import NullFrequencyError
from pandas.util._... |
naro/django-guardian | refs/heads/master | guardian/models.py | 35 | from django.db import models
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.utils.translation import ugettext_lazy as _
from guardian... |
rajathkumarmp/BinPy | refs/heads/develop | BinPy/examples/source/ic/Series_7400/IC7431.py | 5 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 7431
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 7431:
ic = IC_7431()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {1: 1, 3: 1, 5: 0, 6: 0, 8: 0, ... |
bhattmansi/Implementation-of-CARED-in-ns3 | refs/heads/master | src/csma/test/examples-to-run.py | 198 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
digideskio/django-gather | refs/heads/master | gather/migrations/0011_auto__add_field_event_location__add_field_event_series__add_field_even.py | 2 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Event.location'
db.add_column('gather_event', 'location',
self.gf('dja... |
dhondta/tinyscript | refs/heads/master | tinyscript/helpers/data/types/strings.py | 1 | # -*- coding: UTF-8 -*-
"""String-related checking functions and argument types.
"""
import ast
import re
from six import binary_type, string_types
from string import ascii_lowercase as LC, ascii_uppercase as UC, \
ascii_letters as letters, digits, printable, punctuation
__all__ = __features__ = [... |
ghandiosm/Test | refs/heads/master | addons/website_partner/__init__.py | 616 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import models
import controllers
|
sugartom/tensorflow-alien | refs/heads/master | tensorflow/examples/tutorials/mnist/input_data.py | 165 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
wwj718/ANALYSE | refs/heads/master | lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py | 80 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'XModuleStudentInfoField'
db.create_table('courseware_xmodulestudentinfofield', (
... |
ChenTangMark/Control_MKZ | refs/heads/master | control_ws/src/path_follower/rosbag/bag2csv.py | 1 | '''
This script saves each topic in a bagfile as a csv.
Accepts a filename as an optional argument. Operates on all bagfiles in current directory if no argument provided
Usage1 (for one bag file):
python bag2csv.py filename.bag
Usage 2 (for all bag files in current directory):
python bag2csv.py
Written by Nick Spe... |
CoolCloud/ansible | refs/heads/devel | test/units/plugins/action/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
bryanrtboy/videoselector | refs/heads/master | shutdownclients.py | 1 | from pssh import ParallelSSHClient, utils
output = []
hosts = ['client0', 'client1', 'client2','client3', 'client4']
client = ParallelSSHClient(hosts)
def shutdown_all():
cmds=["shutdown now"]
for cmd in cmds:
output.append(client.run_command(cmd, stop_on_errors=False, sudo=True))
for _output in output:
... |
fschaefer/android-samsung-3.0-jb | refs/heads/android-samsung-3.0-jb-mr0 | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
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 ... |
anushav85/IntroToHadoopAndMR__Udacity_Course | refs/heads/master | ProblemStatement1/Python/P1Q3_Mapper.py | 4 | #!/usr/bin/python
# Find the total sales value across all the stores, and the total number of sales. Assume there is only one reducer.
# Format of each line is:
# date\ttime\tstore name\titem description\tcost\tmethod of payment
import sys
for line in sys.stdin:
data = line.strip().split("\t")
if len(data) ... |
sestrella/ansible | refs/heads/devel | test/units/modules/network/check_point/test_cp_mgmt_security_zone.py | 19 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... |
cidadania/e-cidadania | refs/heads/master | tests/unit_tests/src/core/views/test_invite.py | 2 | #/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 v... |
bzero/networkx | refs/heads/master | networkx/algorithms/core.py | 26 | """
Find the k-cores of a graph.
The k-core is found by recursively pruning nodes with degrees less than k.
See the following reference for details:
An O(m) Algorithm for Cores Decomposition of Networks
Vladimir Batagelj and Matjaz Zaversnik, 2003.
http://arxiv.org/abs/cs.DS/0310049
"""
__author__ = "\n".join(['Dan... |
hoangt/gem5v | refs/heads/master | tests/configs/pc-simple-timing.py | 2 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/PIL/PcfFontFile.py | 72 | #
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library
# $Id$
#
# portable compiled font file parser
#
# history:
# 1997-08-19 fl created
# 2003-09-13 fl fixed loading of unicode fonts
#
# Copyright (c) 1997-2003 by Secret Labs AB.
# Copyright (c) 1997-2003 by Fredrik Lundh.
#
# See the README file for informa... |
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | refs/heads/master | bin/pyFoamCaseReport.py | 3 | #! /usr/bin/env python
from PyFoam.Applications.CaseReport import CaseReport
CaseReport()
|
cernops/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_floating_ips_bulk.py | 35 | # Copyright 2012 IBM Corp.
#
# 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... |
egaxegax/dbCarta | refs/heads/master | demos/data/countries.py | 1 | """
List with coords of world countries.
[[ftype, ftag, coords, label, centerof, ismap],...]
"""
COUNTRIES=[
["Country","AF0",[[74.5654296875,37.0278167724609],[74.0352630615234,36.8153762817383],[72.5785980224609,36.8254318237305],[71.6441802978516,36.4659690856934],[71.2460861206055,36.1313781738281],[71.6483230590... |
CloCkWeRX/rabbitvcs | refs/heads/master | rabbitvcs/vcs/git/gittyup/tests/stage.py | 3 | #
# test/stage.py
#
import os
from shutil import rmtree
from sys import argv
from optparse import OptionParser
from gittyup.client import GittyupClient
from gittyup.objects import *
from util import touch, change
parser = OptionParser()
parser.add_option("-c", "--cleanup", action="store_true", default=False)
(option... |
Eficent/purchase-workflow | refs/heads/10.0 | procurement_batch_generator/__manifest__.py | 2 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Procurement Batch Generator module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
#
# This program is free software: y... |
WillGuan105/django | refs/heads/master | tests/test_client/tests.py | 71 | # -*- coding: utf-8 -*-
"""
Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
... |
eldie1984/Scripts | refs/heads/master | MPF/pentaho/alarma_v3.py | 1 | #coding: utf-8
import logging
from sys import argv,exit,path
import getopt
import datetime
from decimal import *
import codecs
from os import environ
# Funcion que iporta las conexiones a la base
path.insert(0, '/home/git/repo/scripts-py')
# Funcion que iporta las conexiones a la base
from commons import *
#Defino lo... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | script.module.resolveurl/lib/resolveurl/plugins/hugefiles.py | 2 | '''
Hugefiles resolveurl plugin
Copyright (C) 2013 Vinnydude
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is d... |
mnahm5/django-estore | refs/heads/master | Lib/site-packages/placebo/serializer.py | 2 | # Copyright (c) 2015 Mitch Garnaat
#
# 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... |
radioprotector/flask-admin | refs/heads/master | flask_admin/tests/test_model.py | 7 | import wtforms
from nose.tools import eq_, ok_
from flask import Flask, session
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.test import Client
from wtforms import fields
from flask_admin import Admin, form
from flask_admin._compat import iteritems, itervalues
from flask_admin.model import base, fi... |
donovan-duplessis/pwnurl | refs/heads/master | pwnurl/__init__.py | 1 | # -*- coding: utf-8 -*-
__version__ = '0.1.0'
__author__ = 'Donovan du Plessis'
__email__ = '[email protected]'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2014, Donovan du Plessis'
import os
pkgedir = os.path.abspath(os.path.dirname(__file__))
basedir = os.path.dirname(pkgedir)
|
SPriyaJain/studybuddy | refs/heads/master | env/lib/python2.7/site-packages/pyflakes/test/test_return_with_arguments_inside_generator.py | 53 |
from sys import version_info
from pyflakes import messages as m
from pyflakes.test.harness import TestCase, skipIf
class Test(TestCase):
@skipIf(version_info >= (3, 3), 'new in Python 3.3')
def test_return(self):
self.flakes('''
class a:
def b():
for x in a.c:
... |
sethportman/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... |
benjaminoh1/tensorflowcookbook | refs/heads/master | Chapter 02/back_propagation.py | 1 | # Back Propagation
#############################################################################################
# This python function shows how to implement back propagation in regression and classification models.
# Regression Example:
# - We will create sample data as follows: x-data: 100 random samples from a n... |
zsiciarz/django | refs/heads/master | django/db/models/sql/constants.py | 633 | """
Constants specific to the SQL storage portion of the ORM.
"""
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = {
'exact', 'iexact', 'contains', 'icontains', 'gt', '... |
ol-loginov/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/dontSuggestBuiltinTypeNames.py | 166 | "foo <caret>bar" |
Baumelbi/IntroPython2016 | refs/heads/master | students/jbearer/session07/ex40.py | 3 | #!/usr/bin/env/python3
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print(line)
def len_of_song(self):
print(len(self.lyrics))
happy_bday = Song(["Happy birthday to you",
"I... |
bigpyer/QConf | refs/heads/master | test/unit/gtest/test/gtest_test_utils.py | 1100 | #!/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... |
cjerdonek/pip | refs/heads/develop | tests/lib/git_submodule_helpers.py | 58 | from __future__ import absolute_import
import textwrap
def _create_test_package_submodule(env):
env.scratch_path.join("version_pkg_submodule").mkdir()
submodule_path = env.scratch_path / 'version_pkg_submodule'
env.run('touch', 'testfile', cwd=submodule_path)
env.run('git', 'init', cwd=submodule_path... |
dablak/boto | refs/heads/develop | tests/unit/sqs/test_message.py | 9 | # Copyright (c) 2013 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 restriction, including
# without limitation the rights ... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env64/lib/python2.7/site-packages/pyasn1/type/tag.py | 20 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <[email protected]>
# License: http://pyasn1.sf.net/license.html
#
from operator import getitem
from pyasn1 import error
__all__ = ['tagClassUniversal', 'tagClassApplication', 'tagClassContext',
'tagClassPrivate', 'tagFormat... |
Taranys/Sick-Beard | refs/heads/development | sickbeard/providers/t411.py | 5 | # -*- coding: latin-1 -*-
# Author: Guillaume Serre <[email protected]>
# 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 Softwar... |
guaix-ucm/megaradrp | refs/heads/master | megaradrp/tests/test_drp.py | 2 |
import pytest
from numina.core import BaseRecipe
import numina.core.tagexpr as tagexpr
import numina.types.multitype as mt
from ..loader import load_drp
@pytest.fixture
def current_drp():
return load_drp()
def simple_tagger(depos, keys):
result = {}
for k in keys:
result[k] = depos[k]
ret... |
Erethon/synnefo | refs/heads/develop | snf-cyclades-app/synnefo/logic/management/commands/server-create.py | 3 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... |
infinnovation/mbed-os | refs/heads/master | tools/host_tests/example/BroadcastSend.py | 128 | """
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... |
ScreamingUdder/mantid | refs/heads/master | Testing/SystemTests/scripts/performance/make_report.py | 3 | #!/usr/bin/env python
import argparse
import sys
import os
import subprocess
import sqlite3
#====================================================================================
def getSourceDir():
"""Returns the location of the source code."""
import os
import sys
script = os.path.abspath(sys.argv[0]... |
alajara/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hixie75.py | 681 | # 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... |
xu6148152/Binea_Python_Project | refs/heads/master | DataAnalysis/pandas_test/pandas_test.py | 1 | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from pandas import Series, DataFrame
def test_series():
obj = Series([4, 7, -5, 3])
print(obj)
print(obj.values)
print(obj.index)
obj2 = Series([4, 7, -5, 3], index=['d', 'b', 'a', 'c'])
print(obj2)
print(obj2.index)
def test_dataframe():... |
PolyJIT/benchbuild | refs/heads/master | benchbuild/projects/benchbuild/gzip.py | 1 | from plumbum import local
import benchbuild as bb
from benchbuild.environments.domain.declarative import ContainerImage
from benchbuild.settings import CFG
from benchbuild.source import HTTP
from benchbuild.utils.cmd import make, tar
from benchbuild.utils.settings import get_number_of_jobs
class Gzip(bb.Project):
... |
iEngage/python-sdk | refs/heads/master | iengage_client/apis/user_authentication_api.py | 1 | # coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.