repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
openiitbombayx/edx-platform | refs/heads/master | lms/djangoapps/staticbook/tests.py | 131 | """
Test the lms/staticbook views.
"""
import textwrap
import mock
import requests
from django.core.urlresolvers import reverse, NoReverseMatch
from student.tests.factories import UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django... |
CGATOxford/Optic | refs/heads/master | scripts/trees2tree.py | 1 | """
trees2tree.py - aggregate trees into a single tree
==================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
This script reads a collection of trees from stdin and aggregates
them into fewer or a single tree.
Possible aggregation functi... |
winklerand/pandas | refs/heads/master | pandas/tests/series/common.py | 20 | from pandas.util._decorators import cache_readonly
import pandas.util.testing as tm
import pandas as pd
_ts = tm.makeTimeSeries()
class TestData(object):
@cache_readonly
def ts(self):
ts = _ts.copy()
ts.name = 'ts'
return ts
@cache_readonly
def series(self):
series =... |
dereklarson/nnGen | refs/heads/master | nnGen/Dataset.py | 1 | """ This class houses the raw feature data and adds some structure and
extra functionality such as preparing validation splits and shuffling.
"""
import cPickle as cp
import numpy as np
import glob
import re
import theano
Tfloat = theano.config.floatX
Tsh = theano.shared
class Dataset(object):
"""Structures ... |
edxnercel/edx-platform | refs/heads/master | cms/envs/dev_dbperf.py | 171 | """
This configuration is to turn on the Django Toolbar stats for DB access stats, for performance analysis
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .dev import *
DEBUG_... |
k0ste/ansible | refs/heads/devel | test/units/playbook/role/test_role.py | 58 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Scripts/pywin32_testall.py | 2 | #!C:\Users\tito\Desktop\Kivy-dev\Python27\python.exe
# EASY-INSTALL-SCRIPT: 'pywin32==218',u'pywin32_testall.py'
__requires__ = 'pywin32==218'
import pkg_resources
pkg_resources.run_script('pywin32==218', u'pywin32_testall.py')
|
ampax/edx-platform | refs/heads/master | common/test/acceptance/fixtures/config.py | 6 | """
Fixture to manipulate configuration models.
"""
import requests
import re
import json
from lazy import lazy
from . import LMS_BASE_URL
class ConfigModelFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class ConfigModelFixture(object):
"""
Configure... |
docusign/docusign-python-client | refs/heads/master | docusign_esign/models/power_form_senders_response.py | 1 | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... |
XeryusTC/search | refs/heads/master | astar.py | 1 | # -*- coding: utf-8 -*-
import heapq
import draw
import grid
import util
def astar(g, start, goal):
closed = set()
open_list = []
heapq.heappush(open_list, (0, start))
g_scores = {start: 0}
came_from = {}
while open_list != []:
prio, current = heapq.heappop(open_list)
if curre... |
benschmaus/catapult | refs/heads/master | telemetry/telemetry/core/util_unittest.py | 7 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import tempfile
import unittest
from telemetry.core import util
class TestGetSequentialFileName(unittest.TestCase):
def __init__... |
HERA-Team/Monitor_and_Control | refs/heads/master | scripts/add_part.py | 2 | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2019 the HERA Collaboration
# Licensed under the 2-clause BSD license.
"""
Script to handle adding a part.
"""
from hera_mc import mc, cm_utils, cm_partconnect
def query_args(args):
"""
Gets information from user
"""
if args.hp... |
si618/pi-time | refs/heads/master | node_modules/grunt-pylint/tasks/lib/pylint/pyreverse/main.py | 67 | # # Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License,... |
zsinx6/elainethegoddess | refs/heads/master | src/buscacomite_tela.py | 1 | #! python
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from buscacomite import Ui_Form
from bdconn import insert, showdialog, executa_select, executa_cmd
import buscacomite2_tela
class busca_comite(QtWidgets.QWidget):
def __init__(self, parent=None):
super(busca... |
EmreAtes/spack | refs/heads/develop | var/spack/repos/builtin/packages/liblockfile/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
Datera/cinder | refs/heads/datera_queens_backport | cinder/volume/drivers/ibm/ibm_storage/strings.py | 7 | # Copyright (c) 2016 IBM Corporation
# 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 req... |
aspidites/django | refs/heads/master | django/core/checks/messages.py | 319 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.encoding import force_str, python_2_unicode_compatible
# Levels
DEBUG = 10
INFO = 20
WARNING = 30
ERROR = 40
CRITICAL = 50
@python_2_unicode_compatible
class CheckMessage(object):
def __init__(self, level, msg, hint=None, obj=Non... |
zlorb/mitmproxy | refs/heads/master | mitmproxy/utils/bits.py | 14 | def setbit(byte, offset, value):
"""
Set a bit in a byte to 1 if value is truthy, 0 if not.
"""
if value:
return byte | (1 << offset)
else:
return byte & ~(1 << offset)
def getbit(byte, offset):
mask = 1 << offset
return bool(byte & mask)
|
tillahoffmann/tensorflow | refs/heads/master | tensorflow/python/platform/tf_logging.py | 74 | # 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... |
asedunov/intellij-community | refs/heads/master | python/testData/optimizeImports/libraryRootInsideProject/main.after.py | 37 | import b
import a
print(a, b)
|
themurph/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.5.45/roles/openshift_master_facts/test/openshift_master_facts_default_priorities_tests.py | 15 | import pytest
DEFAULT_PRIORITIES_1_1 = [
{'name': 'LeastRequestedPriority', 'weight': 1},
{'name': 'BalancedResourceAllocation', 'weight': 1},
{'name': 'SelectorSpreadPriority', 'weight': 1}
]
DEFAULT_PRIORITIES_1_2 = [
{'name': 'LeastRequestedPriority', 'weight': 1},
{'name': 'BalancedResourceAl... |
RobinD42/shiboken | refs/heads/master | tests/samplebinding/typeconverters_test.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms... |
jonathanverner/brython | refs/heads/master | www/src/Lib/itertools.py | 10 | import operator
class accumulate:
def __init__(self, iterable, func = operator.add):
self.it = iter(iterable)
self._total = None
self.func = func
def __iter__(self):
return self
def __next__(self):
if not self._total:
self._total = next(self.it)... |
vshtanko/scikit-learn | refs/heads/master | sklearn/datasets/lfw.py | 38 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... |
AndKe/MAVProxy | refs/heads/master | MAVProxy/modules/lib/mav_fft.py | 4 | #!/usr/bin/env python
'''
extract ISBH and ISBD messages from AP_Logging files and produce FFT plots
'''
import numpy
import os
import pylab
import sys
import time
from pymavlink import mavutil
from MAVProxy.modules.lib.multiproc_util import MPDataLogChildTask
class MavFFT(MPDataLogChildTask):
'''A class used t... |
oscarolar/odoo | refs/heads/master | addons/hw_scanner/__init__.py | 1894 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
mirsys/linux-3.4.y | refs/heads/npi2 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
ns950/calibre | refs/heads/master | src/calibre/library/database2.py | 2 | from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
The database used to store ebook metadata
'''
import os, sys, shutil, cStringIO, glob, time, functools, traceback, re, \
json, uuid, hashlib, copy, t... |
drmateo/ecto | refs/heads/master | samples/experimental/use_executioner.py | 5 | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# n... |
valentin-krasontovitsch/ansible | refs/heads/devel | test/legacy/cleanup_gce.py | 77 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import optparse
import os
import re
import sys
import yaml
try:
from libclo... |
python-febraban/cnab240 | refs/heads/develop | cnab240/tipos/lote.py | 1 | # -*- encoding: utf8 -*-
from evento import Evento
from eventos import (
cobranca,
pagamento,
)
from .. import errors
from ..constantes import (
TIPO_OPERACAO_LANCAMENTO_CREDITO,
TIPO_OPERACAO_LANCAMENTO_DEBITO,
TIPO_OPERACAO_EXTRATO_CONCILIACAO,
TIPO_OPERACAO_GESTAO_DE_CAIXA,
TIPO_OPERACA... |
chauhanhardik/populo | refs/heads/master | lms/djangoapps/class_dashboard/__init__.py | 254 | """
init.py file for class_dashboard
"""
|
svn2github/gyp | refs/heads/master | test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py | 315 | #!/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.
"""
Verify that .s files don't always trigger a rebuild, as would happen if depfiles
were used for them (since clang & gcc ignore -MMD when ... |
tiagochiavericosta/edx-platform | refs/heads/master | common/djangoapps/util/milestones_helpers.py | 56 | # pylint: disable=invalid-name
"""
Utility library for working with the edx-milestones app
"""
from django.conf import settings
from django.utils.translation import ugettext as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.content.course_overviews.m... |
gennad/www_gennad_org | refs/heads/master | django/contrib/gis/tests/test_geoip.py | 290 | import os, unittest
from django.db import settings
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.utils import GeoIP, GeoIPException
# Note: Requires use of both the GeoIP country and city datasets.
# The GEOIP_DATA path should be the only setting set (the directory
# should contain links or ... |
mmnelemane/nova | refs/heads/master | nova/scheduler/opts.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 the Li... |
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Lib/site-packages/docutils/parsers/rst/languages/fi.py | 128 | # -*- coding: utf-8 -*-
# $Id: fi.py 7119 2011-09-02 13:00:23Z milde $
# Author: Asko Soukka <asko.soukka@iki.fi>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files ... |
ArtemZ/wal-e | refs/heads/master | tests/test_s3_deleter.py | 9 | import gevent
import pytest
from gevent import coros
from boto.s3 import bucket
from boto.s3 import key
from fast_wait import fast_wait
from wal_e import exception
from wal_e.worker.s3 import s3_deleter
assert fast_wait
class BucketDeleteKeysCollector(object):
"""A callable to stand-in for bucket.delete_keys
... |
kevinconway/PyPerf | refs/heads/alpha | pyperf/profilers/memory.py | 1 | """Memory profiler powered by memory_profiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import functools
import memory_profiler
import six
from ..interfaces import profiler
from . import base
class BaseM... |
qioixiy/git-repo | refs/heads/master | subcmds/cherry_pick.py | 40 | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... |
nickmeharry/django-mysql | refs/heads/master | tests/testapp/test_forms.py | 1 | # -*- coding:utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from django import forms
from django.core import exceptions
from django.test import SimpleTestCase
from django_mysql.forms import JSONField, SimpleListField, SimpleSetField
class TestSimpl... |
Donkyhotay/MoonPy | refs/heads/master | zope/app/error/error.py | 1 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... |
scilo7/dynalchemy | refs/heads/master | dynalchemy/__init__.py | 1 | from .meta import Registry
|
mikedingjan/wagtail | refs/heads/master | wagtail/images/tests/test_models.py | 10 | import unittest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.utils import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
from django.u... |
florentx/OpenUpgrade | refs/heads/8.0 | addons/product/migrations/8.0.1.1/post-migration.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alexandre Fayolle
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... |
amisrs/angular-flask | refs/heads/master | angular_flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py | 508 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import base
from ..constants import voidElements, namespaces
class T... |
pbecotte/devblog | refs/heads/master | backend/alembic/versions/3448071662dc_.py | 1 | """initial migration
Revision ID: 3448071662dc
Revises:
Create Date: 2015-05-28 20:49:57.657797
"""
# revision identifiers, used by Alembic.
revision = '3448071662dc'
down_revision = None
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('ent... |
Tokyo-Buffalo/tokyosouth | refs/heads/master | env/lib/python3.6/site-packages/twisted/test/test_pcp.py | 15 | # -*- Python -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
__version__ = '$Revision: 1.5 $'[11:-2]
from twisted.trial import unittest
from twisted.protocols import pcp
# Goal:
# Take a Protocol instance. Own all outgoing data - anything that
# would go to p.transport.write. Own all ... |
shizeeg/pyicqt | refs/heads/master | src/xdb/mysql.py | 1 | # Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com>
# Licensed for distribution under the GPL version 2, check COPYING for details
#
# MySQL database storage. See db-setup.mysql in the tools directory in
# the root of the distribution, as well as configuration options in your
# transport config file. (see co... |
GoogleCloudPlatform/sap-deployment-automation | refs/heads/master | third_party/github.com/ansible/awx/awx/plugins/library/scan_files.py | 2 | #!/usr/bin/env python
import os
import stat
from ansible.module_utils.basic import * # noqa
DOCUMENTATION = '''
---
module: scan_files
short_description: Return file state information as fact data for a directory tree
description:
- Return file state information recursively for a directory tree on the filesystem... |
srinathv/vispy | refs/heads/master | examples/basics/visuals/line_transform.py | 17 | # -*- coding: utf-8 -*-
# vispy: gallery 1
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Demonstration of Line visual with arbitrary transforms.
Several Line visuals are displayed that all have the same vertex position
information, but diff... |
sunqb/oa_qian | refs/heads/master | app/attendance.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
' 考勤 '
__author__ = 'sunqb'
import sys
import urllib2
import re
import urllib
import logging as log
# 编码
reload(sys)
sys.setdefaultencoding('utf-8')
# 日志配置
logger = log.getLogger()
logger.setLevel(log.DEBUG)
# 自己的username
myusername = '''sunqingbiao'''
class Attenda... |
PlatinumMaster/SM-G360T1_kernel | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
STS-Dev-Team/kernel_omap4_xt912 | refs/heads/jellybean | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
antoinecarme/pyaf | refs/heads/master | docs/exogenous_example.py | 1 | import numpy as np
import pandas as pd
import datetime
csvfile_link = "data/ozone-la-exogenous-2.csv"
exog_dataframe = pd.read_csv(csvfile_link);
exog_dataframe['Date'] = exog_dataframe['Date'].astype(np.datetime64);
# print(exog_dataframe.info())
exog_dataframe.head()
import pyaf.ForecastEngine as autof
lEngine = au... |
rdio/translate-toolkit | refs/heads/master | lang/fr.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... |
kaiweifan/vse-lbaas-plugin-poc | refs/heads/master | quantum/plugins/nicira/nicira_nvp_plugin/common/metadata_access.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira, 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/lic... |
freezmeinster/avagata-site | refs/heads/dev | django/contrib/localflavor/cz/forms.py | 157 | """
Czech-specific form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Select, RegexField, Field
from django.utils.translation import ugettext_lazy as _
import re
birth_number = re.compile(r'^(?P<birth>\d{6})/?(?P<id>\d{3,4})$')
ic_... |
schlichtanders/pyparsing-2.0.3-OrderedDict | refs/heads/master | examples/cLibHeader.py | 1 | #
# cLibHeader.py
#
# A simple parser to extract API doc info from a C header file
#
# Copyright, 2012 - Paul McGuire
#
from pyparsingOD import Word, alphas, alphanums, Combine, oneOf, Optional, delimitedList, Group, Keyword
testdata = """
int func1(float *vec, int len, double arg1);
int func2(float ... |
dreispt/geospatial | refs/heads/8.0 | base_geoengine/geo_polygon.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... |
splice/splice-server | refs/heads/master | src/splice/entitlement/tests/candlepin_client.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 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 impli... |
georgetye/openemr | refs/heads/master | vendor/adodb/adodb-php/scripts/buildrelease.py | 16 | #!/usr/bin/python -u
'''
ADOdb release build script
- Create release tag if it does not exist
- Copy release files to target directory
- Generate zip/tar balls
-
'''
import errno
import getopt
import re
import os
from os import path
import shutil
import subprocess
import sys
import tempfile
impor... |
guettli/django | refs/heads/master | django/db/models/sql/__init__.py | 132 | from django.core.exceptions import EmptyResultSet
from django.db.models.sql.query import * # NOQA
from django.db.models.sql.subqueries import * # NOQA
from django.db.models.sql.where import AND, OR
__all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']
|
nhmc/xastropy | refs/heads/master | xastropy/igm/abs_sys/tests/test_init_llssurvey.py | 1 | # Module to run tests on initializing AbsSurvey
# TEST_UNICODE_LITERALS
import numpy as np
import glob, os, imp, pdb
import pytest
#from astropy import units as u
#from astropy.coordinates import SkyCoord
from xastropy.igm.abs_sys.lls_utils import LLSSurvey
xa_path = imp.find_module('xastropy')[1]
'''
def data_pat... |
battlecat/flasky | refs/heads/master | app/exceptions.py | 190 | class ValidationError(ValueError):
pass
|
zrhans/pythonanywhere | refs/heads/master | .virtualenvs/django19/lib/python3.4/site-packages/pandas/core/categorical.py | 9 | # pylint: disable=E1101,W0232
import numpy as np
from warnings import warn
import types
from pandas import compat, lib
from pandas.compat import u
from pandas.core.algorithms import factorize
from pandas.core.base import PandasObject, PandasDelegate, NoNewAttributesMixin
import pandas.core.common as com
from pandas.... |
slz/delidded-kernel-n900j-note3 | refs/heads/cm-12.1 | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
grengojbo/django-app | refs/heads/master | DjangoApp/base/urls.py | 1 | # -*- mode: python; coding: utf-8; -*-
"""urlconf for the base application"""
from django.conf.urls import url, patterns
urlpatterns = patterns('DjangoApp.base.views',
url(r'^$', 'home', name='home'),
url(r'^register/', 'register', name='register_form')
)
|
GiladE/birde | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/formtools/preview.py | 103 | """
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form her... |
tlodge/dataware.nox | refs/heads/master | src/nox/webapps/webserver/webauth.py | 9 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is dist... |
credativ/pulp | refs/heads/master | server/pulp/server/managers/auth/permission/query.py | 16 | from pulp.server.db.model.auth import Permission
class PermissionQueryManager(object):
"""
Manager used to process queries on permissions. Permissions returned from
these calls are permission SON objects from the database.
"""
def find_all(self):
"""
Returns serialized versions of ... |
datapythonista/pandas | refs/heads/master | pandas/_testing/_warnings.py | 3 | from __future__ import annotations
from contextlib import contextmanager
import re
from typing import (
Sequence,
Type,
cast,
)
import warnings
@contextmanager
def assert_produces_warning(
expected_warning: type[Warning] | bool | None = Warning,
filter_level="always",
check_stacklevel: bool =... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/static/structure/naboo/nboo_imprv_metal_fence_wall_sml_s02.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/component/weapon/mustafar/tulrus_lance_core.py | 85615 | import sys
def setup(core, object):
return |
mandeepdhami/netvirt-ctrl | refs/heads/master | sdncon/statdropd/models.py | 3 | #
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... |
tuxfux-hlp-notes/python-batches | refs/heads/master | batch-67/12-modules/myenv/lib/python2.7/sre_constants.py | 4 | /usr/lib/python2.7/sre_constants.py |
scorpionhiccup/StockPricePrediction | refs/heads/master | scripts/Algorithms/regression_helpers.py | 1 | # -*- coding: utf-8 -*-
"""
Miscellaneous Functions for Regression File.
"""
from __future__ import print_function
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.ensemble import RandomForestRegressor
import matplotlib.p... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/lepl/lexer/matchers.py | 2 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... |
40223148/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/__init__.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
Jamlum/pytomo | refs/heads/master | pytomo/kaa_metadata/audio/webradio.py | 3 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# webradio.py - read webradio attributes
# -----------------------------------------------------------------------------
# $Id: webradio.py 2581 2007-03-22 14:16:50Z tack $
#
# ----------------------------------... |
Agent007/deepchem | refs/heads/master | contrib/nn/objectives.py | 8 | """Ops for objectives
Code borrowed from Keras.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
import warnings
import tensorflow as tf
from deepchem.nn import model_ops
def mean_squared_error(y_true, y_pred):
... |
tmenjo/cinder-2015.1.0 | refs/heads/master | cinder/volume/flows/api/create_volume.py | 4 | # 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... |
unseenlaser/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/codesearch/__init__.py | 274 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007 Benoit Chesneau <benoitc@metavers.net>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS... |
EightMedia/djangopypi | refs/heads/master | djangopypi/management/commands/loadclassifiers.py | 4 | """
Management command for loading all the known classifiers from the official
pypi, or from a file/url.
Note, pypi docs says to not add classifiers that are not used in submitted
packages. On the other hand it can be usefull to have a list of classifiers
to choose if you have to modify package data. Use it if you nee... |
AlphaX2/FotoShareN9 | refs/heads/master | 1.6.1/fotoshare/opt/FotoShareN9/plugins/scp/libs/paramiko/sftp_attr.py | 26 | # Copyright (C) 2003-2006 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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... |
billygoo/dev-365 | refs/heads/master | python/flask/minitwit/venv/Lib/genericpath.py | 88 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... |
NetIQ/mongo-connector | refs/heads/master | tests/test_oplog_manager.py | 5 | # Copyright 2013-2014 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 writin... |
himleyb85/django | refs/heads/master | tests/aggregation_regress/tests.py | 3 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... |
exadeci/grounds-images | refs/heads/master | examples/code/python2/hello_stderr.py | 4 | import sys
sys.stderr.write("Hello stderr\n")
|
openstack/oslo.concurrency | refs/heads/master | doc/source/conf.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2020 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 ... |
Pablo126/SSBW | refs/heads/master | Entrega1/lib/python3.5/site.py | 784 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... |
nevins-b/lemur | refs/heads/master | lemur/plugins/lemur_cfssl/tests/conftest.py | 45 | from lemur.tests.conftest import * # noqa
|
DonaldWhyte/module-dependency | refs/heads/master | tests/files/some_dependencies.py | 1 | import a
from a import b
from c import *
from d import e, f
from g import dummy, *
from . import h
from . import i, j
from .k import l
from .m import *
from .n import o.p
from .q import another_dummy, *
class DummyClass:
def something():
from sys import path
print(path)
def somethingEntirely... |
drawks/ansible | refs/heads/devel | lib/ansible/modules/network/eos/eos_linkagg.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible by Red Hat, inc
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/utils/queue.py | 16 | from __future__ import with_statement
import os
import struct
import glob
from collections import deque
from scrapy.utils.py26 import json
class FifoMemoryQueue(object):
"""Memory FIFO queue."""
def __init__(self):
self.q = deque()
def push(self, obj):
self.q.appendleft(obj)
def p... |
crazy-cat/incubator-mxnet | refs/heads/master | tools/ipynb2md.py | 41 | #!/usr/bin/env python
# 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
# "L... |
inveniosoftware/invenio-stats | refs/heads/master | invenio_stats/contrib/aggregations/aggr_record_view/__init__.py | 1 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Record views aggregations Elasticsearch index templates."""
|
Teagan42/home-assistant | refs/heads/dev | tests/components/opentherm_gw/test_config_flow.py | 2 | """Test the Opentherm Gateway config flow."""
import asyncio
from unittest.mock import patch
from pyotgw import OTGW_ABOUT
from serial import SerialException
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.opentherm_gw.const import (
CONF_FLOOR_TEMP,
CONF_PRECISI... |
tayfun/django | refs/heads/master | tests/urlpatterns_reverse/urls_without_full_import.py | 452 | # A URLs file that doesn't use the default
# from django.conf.urls import *
# import pattern.
from django.conf.urls import url
from .views import bad_view, empty_view
urlpatterns = [
url(r'^test_view/$', empty_view, name="test_view"),
url(r'^bad_view/$', bad_view, name="bad_view"),
]
|
40223227/40223227 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/abc.py | 743 | """Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
import abc
import imp
import marshal
import sys
import tokenize
import warnings
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.