repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
Batterfii/django
tests/gis_tests/gdal_tests/test_ds.py
273
11450
import os import unittest from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from ..test_data import TEST_DATA, TestDS, get_ds_file if HAS_GDAL: from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION from django.contrib.gis....
bsd-3-clause
M4sse/chromium.src
third_party/ply/__init__.py
108
1797
# PLY package # Author: David Beazley (dave@dabeaz.com) # ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification...
bsd-3-clause
aldencolerain/mc2kernel
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
narurien/ganeti-ceph
test/py/ganeti.utils.io_unittest.py
8
36321
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010, 2011 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version...
gpl-2.0
aosprey/rose
lib/python/rose/config_editor/updater.py
1
35992
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-8 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
Jonekee/chromium.src
tools/telemetry/telemetry/core/memory_cache_http_server_unittest.py
21
2696
# Copyright 2014 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 from telemetry.core import util from telemetry.unittest_util import tab_test_case class MemoryCacheHTTPServerTest(tab_test_case.TabTestCase): ...
bsd-3-clause
fabianvf/osf.io
website/addons/zotero/tests/test_models.py
24
10911
# -*- coding: utf-8 -*- import mock from nose.tools import * # noqa from framework.auth.core import Auth from framework.exceptions import PermissionsError from tests.base import OsfTestCase from tests.factories import UserFactory, ProjectFactory from website.addons.zotero.tests.factories import ( ZoteroAccountF...
apache-2.0
jiasir/pycs
vulpo/https_connection.py
1
4593
# Copyright 2007,2011 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 writ...
mit
Insoleet/aiohttp
aiohttp/client.py
1
22566
"""HTTP Client for asyncio.""" import asyncio import base64 import hashlib import os import sys import traceback import warnings import http.cookies import urllib.parse import aiohttp from .client_reqrep import ClientRequest, ClientResponse from .errors import WSServerHandshakeError from .multidict import MultiDictPr...
apache-2.0
yipenggao/moose
python/MooseDocs/tests/app_syntax/test_app_syntax.py
3
9411
#!/usr/bin/env python #pylint: disable=missing-docstring #################################################################################################### # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simu...
lgpl-2.1
LukeMike/ardupilot
Tools/scripts/magfit_flashlog.py
29
4745
#!/usr/bin/env python ''' fit best estimate of magnetometer offsets from ArduCopter flashlog using the algorithm from Bill Premerlani ''' import sys, time, os, math # command line option handling from optparse import OptionParser parser = OptionParser("magfit_flashlog.py [options]") parser.add_option("--verbose", ac...
gpl-3.0
mattesno1/Sick-Beard
lib/requests/packages/urllib3/packages/six.py
2375
11628
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 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 without l...
gpl-3.0
astynax/ranger
ranger/core/runner.py
2
9418
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. """This module is an abstract layer over subprocess.Popen It gives you highlevel control about how processes are run. Example: run = Runner(logfunc=print) run('sleep 2', wait=True) # wai...
gpl-3.0
annavonzansen/exams
exams/migrations/0013_auto__add_field_examination_year__add_field_examination_season__add_un.py
1
21642
# -*- 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 'Examination.year' db.add_column(u'exams_examination', 'year', self.gf(...
gpl-2.0
kho0810/likelion_Web
lib/wtforms/ext/django/orm.py
38
6096
""" Tools for generating forms based on Django models. """ from wtforms import fields as f from wtforms import Form from wtforms import validators from wtforms.compat import iteritems from wtforms.ext.django.fields import ModelSelectField __all__ = ( 'model_fields', 'model_form', ) class ModelConverterBase(obje...
apache-2.0
ronanlopes/gokano_bot
gokano_bot.py
1
1811
#!/usr/bin/env python # -*- coding: utf-8 -*- import mechanize import cookielib import re from time import sleep from daemonize import daemonize from time import gmtime, strftime #creates a browser br = mechanize.Browser() url = 'http://www.gokano.com' email = 'xxx@email.com' password = 'xxx' @daemonize(stdout=...
gpl-3.0
RobertArbon/YAMLP
SciFlow/FFtraversal.py
1
2387
import ImportData import numpy as np import CoulombMatrix import cProfile, pstats, StringIO import time from datetime import datetime import matplotlib.pyplot as plt def fft_idx(X, k): """ This function does something. :param X: parameter X :param k: parameter k :return: returns training indexes ...
mit
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Box/Files/DownloadFile.py
5
3494
# -*- coding: utf-8 -*- ############################################################################### # # DownloadFile # Retrieves the contents of a specified file. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use ...
gpl-2.0
blackbliss/callme
flask/lib/python2.7/site-packages/pip/log.py
344
9455
"""Logging """ import sys import os import logging from pip import backwardcompat from pip._vendor import colorama, pkg_resources def _color_wrap(*colors): def wrapped(inp): return "".join(list(colors) + [inp, colorama.Style.RESET_ALL]) return wrapped def should_color(consumer, environ, std=(sys.s...
mit
duqiao/django
tests/custom_methods/tests.py
228
1197
from __future__ import unicode_literals from datetime import date from django.test import TestCase from .models import Article class MethodsTests(TestCase): def test_custom_methods(self): a = Article.objects.create( headline="Area man programs in Python", pub_date=date(2005, 7, 27) ...
bsd-3-clause
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/django/dispatch/saferef.py
345
10495
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
apache-2.0
DmitryNikiforov/SpaceChallenge
modis-image-processing/vanish-clouds.py
1
3096
import os, numpy, PIL from PIL import Image def paging(BASE_INDEX): # Access all PNG files in directory allfiles=os.listdir(os.getcwd()) imlist=[filename for filename in allfiles if filename[-4:] in [".jpg",".JPG"]] imlist = sorted(imlist) base_imlist = imlist WINDOWS = 10 left = BASE_IND...
apache-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/models/operation_py3.py
1
1145
# 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 ...
mit
jpakkane/meson
test cases/common/215 link custom/custom_stlib.py
2
2466
#!/usr/bin/env python3 import shutil, sys, subprocess, argparse, pathlib parser = argparse.ArgumentParser() parser.add_argument('--private-dir', required=True) parser.add_argument('-o', required=True) parser.add_argument('cmparr', nargs='+') contents = '''#include<stdio.h> void flob() { printf("Now flobbing.\\...
apache-2.0
wrouesnel/ansible
test/units/modules/network/nxos/test_nxos_interface.py
16
2954
# (c) 2016 Red Hat 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 License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
ccpgames/eve-metrics
web2py/gluon/tests/test_storage.py
1
1874
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for storage.py """ import sys import os import unittest if os.path.isdir('gluon'): sys.path.append(os.path.realpath('gluon')) else: sys.path.append(os.path.realpath('../')) from storage import Storage class TestStorage(unittest.Te...
mit
sstirling/live-boundary-map
live-boundary-map/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py
203
40541
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO ...
cc0-1.0
awildeone/Wusif
msnp/net.py
3
4372
# net.py -- Connection, HttpProxyConnection classes # # Copyright (C) 2003 Manish Jethani (manish_jethani AT yahoo.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 o...
gpl-2.0
skoslowski/gnuradio
gr-analog/python/analog/qa_pll_refout.py
3
8138
#!/usr/bin/env python # # Copyright 2004,2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from __future__ import division import math from gnuradio import gr, gr_unittest, analog, blocks class test_pll_refout(gr_unittest.TestCase): ...
gpl-3.0
2014c2g3/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/csv.py
637
16166
""" csv.py - read/write/investigate CSV files """ import re from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ ...
gpl-3.0
xianian/qt-creator
tests/system/shared/project.py
2
37492
############################################################################# ## ## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this file in ## accordance wit...
lgpl-2.1
MiroK/DolfinSurface
site-packages/dolfin/multistage/multistagescheme.py
2
12274
"""This module defines different MultiStageScheme classes which can be passed to a RKSolver""" # Copyright (C) 2013 Johan Hake # # This file is part of DOLFIN. # # DOLFIN 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 Sof...
gpl-3.0
avoinsystems/odoo
addons/l10n_ch/account_wizard.py
424
2192
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
agpl-3.0
varunarya10/rally
rally/cmd/main.py
2
1293
# Copyright 2013: Mirantis 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 b...
apache-2.0
alianmohammad/pd-gem5-latest
src/arch/micro_asm.py
86
14724
# Copyright (c) 2003-2005 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 ...
bsd-3-clause
leilihh/novaha
nova/virt/baremetal/db/migration.py
29
1306
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
nwswanson/checkin
server/vendor/jinja2/constants.py
1169
1626
# -*- coding: utf-8 -*- """ jinja.constants ~~~~~~~~~~~~~~~ Various constants. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ #: list of lorem ipsum words used by the lipsum() helper function LOREM_IPSUM_WORDS = u'''\ a ac accumsan ad adipiscing aenean a...
mit
fengzhyuan/scikit-learn
sklearn/covariance/robust_covariance.py
198
29735
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
bsd-3-clause
alzamer2/Crunchyroll-XML-Decoder
crunchy-xml-decoder/requests/packages/chardet/euctwfreq.py
3133
34872
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
discountry/larawechat
vendor/mockery/mockery/docs/conf.py
468
8442
# -*- coding: utf-8 -*- # # Mockery Docs documentation build configuration file, created by # sphinx-quickstart on Mon Mar 3 14:04: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. ...
mit
Aggieyixin/cjc2016
code/tba/tutorials-scikit-learn-master/robustness.py
5
2733
import numpy as np from matplotlib import pyplot as plt from scipy import stats from sklearn.tree import DecisionTreeClassifier def plot_surface(model, X, y): n_classes = 3 plot_colors = "ryb" cmap = plt.cm.RdYlBu plot_step = 0.02 plot_step_coarser = 0.5 x_min, x_max = X[:, 0].min() - 1, X[:,...
mit
stelfrich/openmicroscopy
examples/ScriptingService/HelloWorld.py
15
2911
#!/usr/bin/env python # -*- coding: utf-8 -*- """ examples/ScriptingService/HelloWorld.py ----------------------------------------------------------------------------- Copyright (C) 2006-2010 University of Dundee. All rights reserved. This program is free software; you can redistribute it and/or modify it und...
gpl-2.0
dfranco/shinken
test/test_dot_virg_in_command.py
18
1934
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the F...
agpl-3.0
eltonsantos/django
django/db/backends/util.py
4
5253
from __future__ import unicode_literals import datetime import decimal import hashlib import logging from time import time from django.conf import settings from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class CursorWrapper(objec...
bsd-3-clause
bratsche/Neutron-Drive
google_appengine/google/appengine/ext/db/__init__.py
2
123046
#!/usr/bin/env python # # Copyright 2007 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 o...
bsd-3-clause
ntduong/data-science-newbie
RecSys_mrjob/test_mrjob/most_used_word.py
1
1266
''' Created on 2013/09/29 @author: duong ''' from mrjob.job import MRJob import re WORD_RE = re.compile(r"[\w']+") class MRMostUsedWord(MRJob): def mapper_get_words(self, _, line): # emit (word, 1) for each word in line for word in WORD_RE.findall(line): yield (word.lower(), 1) ...
mit
plxaye/chromium
src/build/android/pylib/utils/report_results.py
3
4502
# 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. """Module containing utility functions for reporting results.""" import logging import os import re from pylib import buildbot_report from pylib import...
apache-2.0
xinjiguaike/edx-platform
common/lib/xmodule/xmodule/tests/test_vertical.py
118
2560
""" Tests for vertical module. """ from fs.memoryfs import MemoryFS from xmodule.tests import get_test_system from xmodule.tests.xml import XModuleXmlImportTest from xmodule.tests.xml import factories as xml from xmodule.x_module import STUDENT_VIEW, AUTHOR_VIEW class BaseVerticalBlockTest(XModuleXmlImportTest): ...
agpl-3.0
political-memory/django-representatives
representatives/contrib/francedata/tests/test_francedata_import_representatives.py
2
1129
import pytest import os import copy from django.core.serializers.json import Deserializer from representatives.models import Representative from representatives.contrib.francedata import import_representatives @pytest.mark.django_db def test_francedata_import_representatives(): inputjson = os.path.join(os.path.d...
agpl-3.0
kool79/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixer_util.py
227
14597
"""Utility functions, node construction macros, etc.""" # Author: Collin Winter from itertools import islice # Local imports from .pgen2 import token from .pytree import Leaf, Node from .pygram import python_symbols as syms from . import patcomp ########################################################### ### Common...
apache-2.0
melviso/phycpp
beatle/app/resources/_folderT.py
2
6051
# -*- coding: utf-8 -*- _folderT = [ "24 24 297 2", " c None", ". c #FFFFFF", "+ c #FDFEFF", "@ c #FBFCFF", "# c #FCFCFF", "$ c #FDFFFF", "% c #FFFFFD", "& c #F6D021", "* c #FACF0E", "= c #FAD00F", "- c #FAD00E", "; c #FACF0C", "> c #F5CD22", ", c #FBFBFF", "' c #EEDA94", ") c #F2C32C", "! c #F5D463"...
gpl-2.0
skosukhin/spack
var/spack/repos/builtin/packages/libxc/package.py
1
3469
############################################################################## # 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...
lgpl-2.1
ArtsiomCh/tensorflow
tensorflow/python/framework/meta_graph_test.py
8
28745
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
encbladexp/ansible
test/support/windows-integration/plugins/modules/win_wait_for.py
68
4634
#!/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) # this is a windows documentation stub, actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
goyalankit/po-compiler
object_files/networkx-1.8.1/examples/drawing/sampson.py
40
1379
#!/usr/bin/env python """ Sampson's monastery data. Shows how to read data from a zip file and plot multiple frames. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" # Copyright (C) 2010 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # Al...
apache-2.0
switowski/invenio
invenio/modules/search/fixtures.py
7
62380
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your optio...
gpl-2.0
Drgravy/kernel_lge_g3
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
mikkylok/mikky.lu
venv/lib/python2.7/site-packages/mako/ext/linguaplugin.py
100
1663
import io from lingua.extractors import Extractor from lingua.extractors import Message from lingua.extractors import get_extractor from mako.ext.extract import MessageExtractor from mako import compat class LinguaMakoExtractor(Extractor, MessageExtractor): '''Mako templates''' extensions = ['.mako'] def...
mit
chaen/DIRAC
AccountingSystem/Client/Types/Job.py
4
2638
from DIRAC.AccountingSystem.Client.Types.BaseAccountingType import BaseAccountingType import DIRAC __RCSID__ = "$Id$" class Job(BaseAccountingType): def __init__(self): BaseAccountingType.__init__(self) self.definitionKeyFields = [('User', 'VARCHAR(32)'), ('UserGroup', 'VAR...
gpl-3.0
atila1974/AK-OnePlusOne-CAF
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
yan12125/youtube-dl
youtube_dl/extractor/tvplayer.py
50
2826
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, ) from ..utils import ( extract_attributes, try_get, urlencode_postdata, ExtractorError, ) class TVPlayerIE(InfoExtractor): _VALID_URL = r'https?:...
unlicense
mcardillo55/django
django/shortcuts.py
129
7958
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager imp...
bsd-3-clause
rhndg/openedx
common/lib/xmodule/xmodule/assetstore/tests/test_asset_xml.py
59
3623
""" Test for asset XML generation / parsing. """ from path import path from lxml import etree from contracts import ContractNotRespected import unittest from opaque_keys.edx.locator import CourseLocator from xmodule.assetstore import AssetMetadata from xmodule.modulestore.tests.test_assetstore import AssetStoreTestDa...
agpl-3.0
sharag/py_analis
searchCOUNTERS/searchCOUNTERS_gui.py
1
1650
import sys import os import argparse from PyQt5.QtWidgets import QApplication from searchCOUNTERS.searchCOUNTERS_win import SCOUNTERS_mainwin # -p "e:\msvs\tlm_new\Debug\withoutD2_D5\" -o 16 -k 200 def createParser(): parser = argparse.ArgumentParser() parser.add_argument('-p', '--path', nargs='?', he...
gpl-3.0
jjlee3/openthread
tests/scripts/thread-cert/Cert_6_1_02_REEDAttach.py
5
3197
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # 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. Redistributions of source code must retain the above copyright # not...
bsd-3-clause
moshthepitt/swiss_tournament
tournament.py
1
13501
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # import bleach import datetime import psycopg2 def connect(): """Connect to the PostgreSQL database. Returns a database connection.""" return psycopg2.connect("dbname=tournament") def createTournament(name="Tournament On...
mit
cristianav/PyDEX
share/lib/pydex/update.py
1
26640
# -*- coding: utf-8 -*- # # update.py # # Copyright Cristian Navalici ncristian [at] lemonsoftware.eu # # 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 vers...
gpl-3.0
google-research/google-research
persistent_es/plot_toy_regression.py
1
5719
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
apache-2.0
svenstaro/ansible
lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py
26
5401
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, 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 License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
Aaron-Zhao123/nn_library
preprocessing/preprocessing.py
23
12905
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
mit
ludwiktrammer/odoo
openerp/osv/fields.py
6
75697
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ Fields: - simple - relations (one2many, many2one, many2many) - function Fields Attributes: * _classic_read: is a classic sql fields * _type : field type * _auto_join: ...
agpl-3.0
ucrawler/cp-uc
libs/tornado/platform/posix.py
352
1859
#!/usr/bin/env python # # Copyright 2011 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...
gpl-3.0
wudi312858/hdg-from
tests/test_flow.py
1
3161
# # hdg-from -- Generate HDG files for GEMSS # # Copyright (C) 2017 Di WU # All rights reserved. # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # # Compatibility with Pyhton 2.7 from __future__ import absolute_import, division, print_function,...
mit
mezz64/home-assistant
homeassistant/components/tasmota/binary_sensor.py
4
2567
"""Support for Tasmota binary sensors.""" from homeassistant.components import binary_sensor from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect import homeassistant.helpers.event as evt fro...
apache-2.0
lijoantony/django-oscar
tests/functional/dashboard/communication_tests.py
44
1647
from django.core.urlresolvers import reverse from django.core import mail from oscar.apps.customer.models import CommunicationEventType from oscar.test.factories import UserFactory from oscar.test.testcases import WebTestCase class TestAnAdmin(WebTestCase): def setUp(self): self.staff = UserFactory(is_s...
bsd-3-clause
linea-it/dri
api/lib/db_sqlite.py
1
1606
from sqlalchemy import create_engine from sqlalchemy.dialects import sqlite class DBSqlite: def __init__(self, db): self.db = db def get_string_connection(self): url = "sqlite:///%s" % self.db['PATH_FILE'] return url def get_engine(self): return create_engine( ...
gpl-3.0
CatsAndDogsbvba/odoo
addons/l10n_ro/__init__.py
187
1243
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Fekete Mihai <feketemihai@gmail.com>, Tatár Attila <atta@nvm.ro> # Copyright (C) 2011-2014 TOTAL PC SYSTEMS (http://www.erpsystems.ro). # Copyright (C) 2014 Fekete Mihai # Copyright (C) 201...
agpl-3.0
varunarya10/nova_test_latest
nova/scheduler/filters/metrics_filter.py
42
1914
# Copyright (c) 2014 Intel, 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 ...
apache-2.0
fossoult/odoo
addons/account_payment/__openerp__.py
261
2925
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
tobacco-mofs/tobacco
connect_nodetonode.py
1
13252
################# # # This file is part of # ToBaCCo - Topologically-Based Crystal Constructor # # Copyright 2017 Yamil J. Colon <yamilcolon2015@u.northwestern.edu> # Diego Gomez-Gualdron <dgomezgualdron@mines.edu> # Ben Bucior <ben.bucior@gmail.com> # # ToBaCCo is free software: ...
lgpl-3.0
wimleers/DistributedManyInARow
src/NetworkLobbyWidget.py
1
6448
from PyQt4 import QtGui, QtCore from datetime import datetime class NetworkLobbyWidget(QtGui.QWidget): #Provides a list of availabe network games and peers #User can click a game to join #Callbacks can be used to add or remove games and peers def __init__(self, win_parent = None): QtGui.QWidget.__i...
unlicense
Debian/openjfx
modules/web/src/main/native/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
3
13827
# Copyright (C) 2012 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
gpl-2.0
todaychi/hue
desktop/core/ext-py/Django-1.6.10/tests/syndication/urls.py
58
1084
from __future__ import absolute_import from django.conf.urls import patterns from . import feeds urlpatterns = patterns('django.contrib.syndication.views', (r'^syndication/complex/(?P<foo>.*)/$', feeds.ComplexFeed()), (r'^syndication/rss2/$', feeds.TestRss2Feed()), (r'^syndication/rss2/guid_ispermalink_...
apache-2.0
DONIKAN/django
tests/shortcuts/urls.py
252
1416
from django.conf.urls import url from . import views urlpatterns = [ url(r'^render_to_response/$', views.render_to_response_view), url(r'^render_to_response/multiple_templates/$', views.render_to_response_view_with_multiple_templates), url(r'^render_to_response/request_context/$', views.render_to_response...
bsd-3-clause
rcharp/toyota-flask
venv/lib/python2.7/site-packages/numpy/distutils/fcompiler/mips.py
229
1825
from __future__ import division, absolute_import, print_function from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler compilers = ['MIPSFCompiler'] class MIPSFCompiler(FCompiler): compiler_type = 'mips' description = 'MIPSpro Fortran Compiler' version_pattern = r'MIPS...
apache-2.0
pavelkang/pomodoro
server/lib/flask/testsuite/ext.py
563
5156
# -*- coding: utf-8 -*- """ flask.testsuite.ext ~~~~~~~~~~~~~~~~~~~ Tests the extension import thing. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys import unittest try: from imp import reload as reload_module except ImportError: reload...
apache-2.0
andydandy74/ClockworkForDynamo
nodes/1.x/python/String.CompileRegularExpression.py
4
1370
import clr import re regexstring = IN[0] flags = IN[1] # process flags if flags == "1111": thisexp = re.compile(regexstring, re.IGNORECASE|re.LOCALE|re.DOTALL|re.MULTILINE) elif flags == "1110": thisexp = re.compile(regexstring, re.IGNORECASE|re.LOCALE|re.DOTALL) elif flags == "1101": thisexp = re.compile(regexstri...
mit
FXITech/kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
AmedeoSapio/scapy
scapy/contrib/ripng.py
26
1336
#!/usr/bin/env python # http://trac.secdev.org/scapy/ticket/301 # scapy.contrib.description = RIPng # scapy.contrib.status = loads from scapy.packet import * from scapy.fields import * from scapy.layers.inet import UDP from scapy.layers.inet6 import * class RIPng(Packet): name = "RIPng header" fields_desc =...
gpl-2.0
lucernae/geonode
geonode/contrib/monitoring/migrations/0008_monitoring_notifications_check.py
8
2789
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import jsonfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('monitoring', '000...
gpl-3.0
stannynuytkens/youtube-dl
youtube_dl/postprocessor/common.py
145
2240
from __future__ import unicode_literals import os from ..utils import ( PostProcessingError, cli_configuration_args, encodeFilename, ) class PostProcessor(object): """Post Processor class. PostProcessor objects can be added to downloaders with their add_post_processor() method. When the dow...
unlicense
jmesteve/openerp
openerp/addons/base/module/report/__init__.py
463
1089
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
Hellowlol/plexpy
lib/unidecode/x0ce.py
253
4708
data = ( 'cwik', # 0x00 'cwit', # 0x01 'cwip', # 0x02 'cwih', # 0x03 'cyu', # 0x04 'cyug', # 0x05 'cyugg', # 0x06 'cyugs', # 0x07 'cyun', # 0x08 'cyunj', # 0x09 'cyunh', # 0x0a 'cyud', # 0x0b 'cyul', # 0x0c 'cyulg', # 0x0d 'cyulm', # 0x0e 'cyulb', # 0x0f 'cyuls', # 0x1...
gpl-3.0
googleapis/gapic-generator-python
tests/integration/goldens/asset/scripts/fixup_asset_v1_keywords.py
3
6810
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 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 requi...
apache-2.0
manipopopo/tensorflow
tensorflow/python/keras/applications/densenet.py
2
1566
# Copyright 2018 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...
apache-2.0
hwbehrens/livecode
gyp/pylib/gyp/generator/analyzer.py
294
21436
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
gpl-3.0
alenz33/conduct
conduct/__init__.py
2
1069
# ***************************************************************************** # conduct - CONvenient Construction Tool # # 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...
gpl-2.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/global_/reference_bandwidth/state/__init__.py
1
12675
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
lanyuwen/openthread
tools/harness-automation/cases/router_5_5_7.py
18
1876
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/pip-7.1.0/pip/_vendor/distlib/manifest.py
559
13598
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re from . import DistlibEx...
mit