repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
goose3/goose3
goose3/extractors/authors.py
2
2390
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
norlanliu/proctrl
test/googletest/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-3.0
emk/pyjamas
library/pyjamas/chart/Axis.py
3
80103
""" * Copyright 2007,2008,2009 John C. Gunther * Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> * * 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...
apache-2.0
brendancsmith/cohort-facebook
lib/word_cloud-master/doc/conf.py
17
9715
# -*- coding: utf-8 -*- # # wordcloud documentation build configuration file, created by # sphinx-quickstart on Fri May 3 17:14:50 2013. # # 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
vismartltd/edx-platform
common/djangoapps/student/migrations/0021_remove_askbot.py
188
11582
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models ASKBOT_AUTH_USER_COLUMNS = ( 'website', 'about', 'gold', 'email_isvalid', 'real_name', 'location', 'reputation', 'gravatar', 'bronze', 'last_seen', ...
agpl-3.0
Liam3851/fredapi
fredapi/fred.py
1
19208
import os import sys import xml.etree.ElementTree as ET if sys.version_info[0] >= 3: import urllib.request as url_request import urllib.parse as url_parse import urllib.error as url_error else: import urllib2 as url_request import urllib as url_parse import urllib2 as url_error import pandas a...
apache-2.0
HBehrens/puncover
tests/test_backtrace_helper.py
1
4593
import unittest from mock import MagicMock from puncover.backtrace_helper import BacktraceHelper from puncover import collector class TestBacktraceHelper(unittest.TestCase): class FakeCollector(): def __init__(self, symbol_names): self.symbol_names = symbol_names def symbol(self, nam...
mit
paulrouget/servo
tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/packages/rfc3986/api.py
47
3383
# -*- coding: utf-8 -*- # Copyright (c) 2014 Rackspace # 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...
mpl-2.0
CAFans/android_kernel_lge_msm8974
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
OpusVL/odoo
addons/mrp/mrp.py
1
70571
# -*- 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
justajeffy/arsenalsuite
cpp/lib/PyQt4/examples/designer/calculatorform/ui_calculatorform.py
18
5739
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'calculatorform.ui' # # Created: Mon Jan 23 13:21:45 2006 # by: PyQt4 UI code generator vsnapshot-20060120 # # WARNING! All changes made in this file will be lost! import sys from PyQt4 import QtCore, QtGui class Ui_CalculatorForm(obje...
gpl-2.0
isrohutamahopetechnik/MissionPlanner
Lib/encodings/cp1026.py
93
13676
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def de...
gpl-3.0
ckoepp/TwitterSearch
tests/test_ts.py
7
11946
from TwitterSearch import * import unittest import httpretty class TwitterSearchTest(unittest.TestCase): def createTSO(self): """ Returns a default TwitterSearchOrder instance """ tso = TwitterSearchOrder() tso.set_keywords(['foo']) return tso def createTUO(self, username="fo...
mit
Chris7/django-messages
django_messages/management.py
7
1297
from django.db.models import get_models, signals from django.conf import settings from django.utils.translation import ugettext_noop as _ if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True): from notification import models as notification def create_notice_types(...
bsd-3-clause
delighted/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
124
3032
# Copyright (C) 2010 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...
bsd-3-clause
ibjohansen/acando-react-boilerplate-extended
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
moto-timo/ironpython3
Src/StdLib/Lib/asyncio/windows_utils.py
37
6844
""" Various Windows specific bits and pieces """ import sys if sys.platform != 'win32': # pragma: no cover raise ImportError('win32 only') import _winapi import itertools import msvcrt import os import socket import subprocess import tempfile import warnings __all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', '...
apache-2.0
t-tran/libcloud
libcloud/container/utils/docker.py
12
6227
# 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 ...
apache-2.0
SurfasJones/icecream-info
icecream/lib/python2.7/site-packages/sphinx/errors.py
16
1711
# -*- coding: utf-8 -*- """ sphinx.errors ~~~~~~~~~~~~~ Contains SphinxError and a few subclasses (in an extra module to avoid circular import problems). :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ class SphinxError(Exception): ...
mit
cfogelberg/postgres-fiddle
src/scripts/install.py
1
10130
''' Installs the application to a server Installs the application to a server, using the current location of the extracted files as their final location (so extract the files from any install archive to where they should be installed first). - Guides user through configuration file changes - Sets up and configures the...
mit
her0e1c1/click
click/types.py
29
17490
import os import sys import stat from ._compat import open_stream, text_type, filename_to_ui, \ get_filesystem_encoding, get_streerror from .exceptions import BadParameter from .utils import safecall, LazyFile class ParamType(object): """Helper for converting values through types. The following is neces...
bsd-3-clause
bobobox/ansible
lib/ansible/modules/network/netvisor/pn_ospf.py
18
8828
#!/usr/bin/python """ PN-CLI vrouter-ospf-add/remove """ # # 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...
gpl-3.0
slank/ansible
lib/ansible/plugins/lookup/csvfile.py
63
3508
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
fergalbyrne/nupic
tests/unit/nupic/regions/anomaly_region_test.py
27
4336
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditio...
agpl-3.0
SivilTaram/edx-platform
cms/djangoapps/contentstore/views/tests/test_library.py
114
9392
""" Unit tests for contentstore.views.library More important high-level tests are in contentstore/tests/test_libraries.py """ from contentstore.tests.utils import AjaxEnabledTestClient, parse_json from contentstore.utils import reverse_course_url, reverse_library_url from contentstore.views.component import get_compon...
agpl-3.0
Salat-Cx65/python-for-android
python-build/python-libs/gdata/build/lib/atom/mock_http_core.py
135
11149
#!/usr/bin/env python # # Copyright (C) 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 ...
apache-2.0
qrkourier/ansible
lib/ansible/plugins/terminal/iosxr.py
49
1889
# # (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 d...
gpl-3.0
pomegranited/edx-platform
lms/djangoapps/student_account/test/test_views.py
20
20748
# -*- coding: utf-8 -*- """ Tests for student account views. """ import re from unittest import skipUnless from urllib import urlencode import json import mock import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.core import mail from django.contrib import messages from...
agpl-3.0
Freso/botbot-web
botbot/apps/kudos/migrations/0001_initial.py
2
11323
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Kudos' db.create_table(u'kudos_kudos', ( (u'i...
mit
dellysunnymtech/bitbake
lib/bb/cache_extra.py
14
3113
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Extra RecipeInfo will be all defined in this file. Currently, # Only Hob (Image Creator) Requests some extra fields. So # HobRecipeInfo is defined. It's named HobRecipeInfo because it # is introduced by 'hob'. Users could also ...
gpl-2.0
followloda/PornGuys
FlaskServer/venv/Lib/encodings/__init__.py
406
5698
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
gpl-3.0
anvil8/django-admin-tools
admin_tools/dashboard/registry.py
14
1751
#coding: utf-8 class Registry(object): """ Registry for application dashboards. """ registry = {} def register(cls, klass, app_name): from admin_tools.dashboard.dashboards import Dashboard if not issubclass(klass, Dashboard): raise ValueError('%s is not an instance of D...
mit
pauljxtan/pystuff
pymahjong/yaku.py
1
5711
from tile import (NumberedTile, ManTile, PinTile, SouTile, WindTile, DragonTile, TERMINALS, HONOURS, WIND_TILES, DRAGONS, NUMBERS, SUITS, NUMBERED_TILE_TYPES, Sequence, Pair, Triplet) from utils import (flatten_groups, group_concealed_tiles_and_convert, get_sequenc...
mit
PhilLidar-DAD/geonode
geonode/base/templatetags/base_tags.py
1
5332
from django import template from agon_ratings.models import Rating from django.contrib.contenttypes.models import ContentType from django.contrib.auth import get_user_model from django.db.models import Count from guardian.shortcuts import get_objects_for_user #from geonode import settings from django.conf import sett...
gpl-3.0
jherico/qtwebkit
Tools/Scripts/webkitpy/tool/bot/feeders_unittest.py
118
4454
# Copyright (c) 2010 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 ...
lgpl-3.0
sursum/buckanjaren
buckanjaren/lib/python3.5/site-packages/pip/_vendor/webencodings/labels.py
512
8979
""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { 'unicode-1-1-utf-8': 'utf-8', 'utf-...
mit
SebDieBln/QGIS
python/plugins/processing/modeler/MultilineTextPanel.py
24
2656
# -*- coding: utf-8 -*- """ *************************************************************************** MultilineTextPanel.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *******************...
gpl-2.0
ak2703/edx-platform
common/djangoapps/track/tests/test_shim.py
111
4737
"""Ensure emitted events contain the fields legacy processors expect to find.""" from mock import sentinel from django.test.utils import override_settings from openedx.core.lib.tests.assertions.events import assert_events_equal from track.tests import EventTrackingTestCase, FROZEN_TIME LEGACY_SHIM_PROCESSOR = [ ...
agpl-3.0
Bogh/django-oscar
src/oscar/apps/payment/bankcards.py
22
2684
from django.utils.six.moves import map VISA, VISA_ELECTRON, MASTERCARD, AMEX, MAESTRO, DISCOVER = ( 'Visa', 'Visa Electron', 'Mastercard', 'American Express', 'Maestro', 'Discover') DINERS_CLUB = 'Diners Club' CHINA_UNIONPAY = 'China UnionPay' JCB = 'JCB' LASER = 'Laser' SOLO = 'Solo' SWITCH = 'Switch' # List...
bsd-3-clause
rongdede/shadowsocks
shadowsocks/udprelay.py
924
11154
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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
lostatc/retain-sync
zielen/commands/init.py
2
8108
"""A class for the 'init' command. Copyright © 2016-2018 Garrett Powell <garrett@gpowell.net> This file is part of zielen. zielen 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,...
gpl-3.0
eamontoyaa/pyCSS
functions/defineslipcircle.py
1
6612
# Import modules import numpy as np from circleby2ptsradius import circleby2ptsradius from unitvector import unitvector from azimuthangle import azimuthangle ''' # Description. Define the values of the slip circle arc (i.e. arc center point, radius and initial and final angles ) by giving two extreme points...
bsd-2-clause
mandeepdhami/neutron
neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py
4
5313
# Copyright 2014 Mellanox Technologies, Ltd # # 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...
apache-2.0
podemos-info/odoo
addons/delivery/partner.py
10
1466
# -*- 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
magopian/django-runcommands
runcommands/tests.py
1
1393
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division from django.core.exceptions import ImproperlyConfigured from django.utils.unittest import TestCase from .views import RunCommandView, run_command class RunCommandTest(TestCase): def test_run_command(self): """ru...
bsd-3-clause
felipenaselva/felipe.repository
script.module.resolveurl/lib/resolveurl/plugins/vidics.py
1
2286
""" Kodi resolveurl plugin Copyright (C) 2017 script.module.resolveurl 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) an...
gpl-2.0
edx/edx-platform
openedx/core/lib/grade_utils.py
9
2509
""" Helpers functions for grades and scores. """ import math def compare_scores(earned1, possible1, earned2, possible2, treat_undefined_as_zero=False): """ Returns a tuple of: 1. Whether the 2nd set of scores is higher than the first. 2. Grade percentage of 1st set of scores. 3. Grade ...
agpl-3.0
rhlobo/bigtempo
bigtempo/processors/dataframe_task.py
1
3801
# -*- coding: utf-8 -*- import pandas import datetime import bigtempo.utils as utils _DEFAULT_FREQUENCY = 'B' _KNOWN_FREQUENCIES = ['U', 'L', 'S', 'T', 'H', 'B', 'W', 'BMS', 'BM', 'MS', 'M', 'BQS', 'BQ', 'QS', 'Q', 'BAS', 'BA', 'AS', 'A'] _FREQUENCY_ENUMERATION_DICT = dict((y, x) for x, y in enumerate(_KNOWN_FREQU...
mit
bairuiworld/cuda-convnet2
python_util/data.py
180
7803
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
Workday/OpenFrame
build/android/pylib/remote/device/remote_device_uirobot_test_run.py
26
2952
# 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. """Run specific test on specific environment.""" import logging from pylib.base import base_test_result from pylib.remote.device import appurify_sanitized ...
bsd-3-clause
openhatch/oh-missions-oppia-beta
core/domain/fs_domain.py
2
10316
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
morelab/weblabdeusto
server/src/weblab/db/upgrade/scheduling/env.py
3
2051
from __future__ import print_function, unicode_literals from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config ...
bsd-2-clause
Split-Screen/android_kernel_motorola_otus
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
WillGuan105/django
tests/template_tests/syntax_tests/test_i18n.py
245
23356
# coding: utf-8 from __future__ import unicode_literals from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import translation from django.utils.safestring import mark_safe from ..utils import setup class I18nTagTests(SimpleTestCase): libraries = { 'c...
bsd-3-clause
punchagan/zulip
zerver/webhooks/deskdotcom/view.py
6
1047
# Webhooks for external integrations. from django.http import HttpRequest, HttpResponse from zerver.decorator import authenticated_rest_api_view from zerver.lib.request import REQ, has_request_variables from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from ...
apache-2.0
Gchorba/Ask
lib/python2.7/site-packages/pip/_vendor/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...
mit
bmatheny/gtest
test/gtest_help_test.py
2968
5856
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
benoitsteiner/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/ops/losses_ops.py
39
3358
# 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
Flowdalic/bitcoin
test/functional/wallet_listtransactions.py
2
10588
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the listtransactions API.""" from decimal import Decimal from io import BytesIO from test_framewo...
mit
mattias-ohlsson/anaconda
pyanaconda/installclass.py
1
11061
# # installclass.py: This is the prototypical class for workstation, server, and # kickstart installs. The interface to BaseInstallClass is *public* -- # ISVs/OEMs can customize the install by creating a new derived type of this # class. # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Red Hat...
gpl-2.0
tkhsu/quick-qemu
scripts/tracetool/format/h.py
98
1039
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trace/generated-tracers.h """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi...
gpl-2.0
kurtrwall/wagtail
wagtail/wagtailimages/tests/test_models.py
2
17102
from __future__ import absolute_import, unicode_literals 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.core.urlresolvers import reverse from django.db.utils import Integr...
bsd-3-clause
rapidhere/rpbtman_autosign
pytz/zoneinfo/NZ.py
9
6854
'''tzinfo timezone information for NZ.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class NZ(DstTzInfo): '''NZ timezone definition. See datetime.tzinfo for details''' zone = 'NZ' _utc_transition_times = [ d(1,1,1,0,0,0)...
gpl-3.0
zhaochao/fuel-web
nailgun/nailgun/api/v1/handlers/logs.py
1
15272
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
apache-2.0
SickGear/SickGear
lib/hachoir_py2/parser/archive/bzip2_parser.py
2
9443
""" BZIP2 archive file Author: Victor Stinner, Robert Xiao """ from hachoir_py2.parser import Parser from hachoir_py2.core.tools import paddingSize from hachoir_py2.field import (Field, FieldSet, GenericVector, ParserError, String, PaddingBits, Bit, Bits, ...
gpl-3.0
sanjeevtripurari/hue
apps/beeswax/src/beeswax/migrations/0008_auto__add_field_queryhistory_query_type.py
37
7995
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): needed_by = ( ("desktop", "0007_auto__add_documentpermission__add_documenttag__add_document"), ) def forwards(self, orm): # Adding...
apache-2.0
kelvinhammond/beets
test/test_replaygain.py
2
5021
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2015, Thomas Scholtes # # 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 t...
mit
dendisuhubdy/tensorflow
tensorflow/contrib/receptive_field/python/util/parse_layer_parameters_test.py
44
6026
# Copyright 2017 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
rsoulliere/Evergreen_Mohawk
build/i18n/tests/testSQL.py
11
1833
#!/usr/bin/env python # # Perform the following tests: # 1. Generate a POT file from a set of marked SQL statements # 2. Generate an SQL file from a translated PO file import filecmp import os import subprocess import testhelper import unittest class TestSQLFramework(unittest.TestCase): basedir = os.path.dirna...
gpl-2.0
mastizada/kuma
vendor/packages/sqlalchemy/test/dialect/test_sqlite.py
7
22296
"""SQLite-specific tests.""" from sqlalchemy.test.testing import eq_, assert_raises, \ assert_raises_message import datetime from sqlalchemy import * from sqlalchemy import exc, sql, schema from sqlalchemy.dialects.sqlite import base as sqlite, \ pysqlite as pysqlite_dialect from sqlalchemy.test import * cla...
mpl-2.0
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/account/__openerp__.py
41
7694
# -*- 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
egabancho/invenio
invenio/modules/search/testsuite/test_search_engine_summarizer.py
4
1335
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012, 2013 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 yo...
gpl-2.0
jayme-github/headphones
lib/cherrypy/_cprequest.py
58
37180
import os import sys import time import warnings import cherrypy from cherrypy._cpcompat import basestring, copykeys, ntob, unicodestr from cherrypy._cpcompat import SimpleCookie, CookieError, py3k from cherrypy import _cpreqbody, _cpconfig from cherrypy._cperror import format_exc, bare_error from cherrypy.lib import...
gpl-3.0
cjvogl/seismic
tsunami/1d/pwlinear1/pwlin_topo.py
2
1984
from pylab import * plot_profile = False x0 = -150e3 # left boundary (meters) x0_slope = -65e3 # start of slope x0_shelf = -45e3 # start of shelf x0_beach = -5e3 # start of beach x0_shore = 0. # initial shoreline x1 = x0_shore + 2e3 # right boundary z0_ocean = -3000. # depth ...
bsd-2-clause
MarkusAlexander/makken
node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
mit
GoogleCloudPlatform/professional-services
examples/cloudml-energy-price-forecasting/data_preparation/data_prep.py
2
9966
#!/usr/bin/env python #Copyright 2018 Google LLC # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed...
apache-2.0
nagyistoce/edx-platform
common/djangoapps/student/tests/test_recent_enrollments.py
63
7937
""" Tests for the recently enrolled messaging within the Dashboard. """ import datetime from django.conf import settings from django.core.urlresolvers import reverse from opaque_keys.edx import locator from pytz import UTC import unittest import ddt from shoppingcart.models import DonationConfiguration from student.te...
agpl-3.0
onitake/ansible
test/units/modules/network/f5/test_bigip_snmp_trap.py
21
6376
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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 import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
ljgabc/lfs
usr/lib/python2.7/code.py
256
10189
"""Utilities needed to emulate Python's interactive interpreter. """ # Inspired by similar code by Jeff Epler and Fredrik Lundh. import sys import traceback from codeop import CommandCompiler, compile_command __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"] def ...
gpl-2.0
ar4s/django
django/db/models/sql/where.py
8
16821
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import collections import datetime from itertools import repeat from django.conf import settings from django.db.models.fields import DateTimeField, Field from django.db.models.sql.datastructures import EmptyResultSet, Empty from django.db.m...
bsd-3-clause
manipopopo/tensorflow
tensorflow/contrib/layers/python/layers/initializers.py
1
6214
# 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...
apache-2.0
yvaucher/bank-payment
__unported__/account_banking_payment/model/payment_order_create.py
7
1795
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). # (C) 2011 - 2013 Therp BV (<http://therp.nl>). # (C) 2014 ACSONE SA/NV (<http://acsone.eu>). # # All other contributions ...
agpl-3.0
techdragon/django
django/contrib/postgres/search.py
22
7827
from django.db.models import Field, FloatField from django.db.models.expressions import CombinedExpression, Func, Value from django.db.models.functions import Coalesce from django.db.models.lookups import Lookup class SearchVectorExact(Lookup): lookup_name = 'exact' def process_rhs(self, qn, connection): ...
bsd-3-clause
aarchiba/numpy
numpy/lib/stride_tricks.py
57
6761
""" Utilities that manipulate strides to achieve desirable effects. An explanation of strides can be found in the "ndarray.rst" file in the NumPy reference guide. """ from __future__ import division, absolute_import, print_function import numpy as np __all__ = ['broadcast_to', 'broadcast_arrays'] class DummyArray...
bsd-3-clause
AMOboxTV/AMOBox.LegoBuild
plugin.video.specto/resources/lib/resolvers/googledocs.py
23
2319
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/tests/indexes/period/test_construction.py
6
19404
import pytest import numpy as np import pandas as pd import pandas.util.testing as tm import pandas.core.indexes.period as period from pandas.compat import lrange, PY3, text_type, lmap from pandas import (Period, PeriodIndex, period_range, offsets, date_range, Series, Index) class TestPeriodIndex...
mit
wavelets/zulip
zerver/lib/cache.py
115
11742
from __future__ import absolute_import from functools import wraps from django.core.cache import cache as djcache from django.core.cache import get_cache from django.conf import settings from django.db.models import Q from zerver.lib.utils import statsd, statsd_key, make_safe_digest import time import base64 import ...
apache-2.0
direvus/ansible
lib/ansible/modules/cloud/amazon/ec2_placement_group.py
53
6407
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module...
gpl-3.0
2014c2g3/w16b_test
static/Brython3.1.3-20150514-095342/Lib/operator.py
674
7736
#!/usr/bin/env python3 """ Operator Interface This module exports a set of functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y. The function names are those used for special methods; variants without leading and trailing '__' are also p...
agpl-3.0
hwjworld/xiaodun-platform
cms/djangoapps/contentstore/features/course-export.py
10
1659
# disable missing docstring #pylint: disable=C0111 from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem from nose.tools import assert_true, assert_equal @step('I export the course$') def i_export_the_course(step): world.click_tools() link_css = 'li.nav-c...
agpl-3.0
att-comdev/drydock
drydock_provisioner/orchestrator/validations/hostname_validity.py
1
1295
# Copyright 2018 AT&T Intellectual Property. All other 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
CyanogenMod/android_external_chromium-trace
trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/_stream_hybi.py
29
30984
# Copyright 2012, 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...
bsd-3-clause
alaski/nova
nova/servicegroup/drivers/base.py
71
1052
# 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...
apache-2.0
ilyes14/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
AnthonyBroadCrawford/servo
tests/wpt/web-platform-tests/tools/six/six.py
426
27961
"""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...
mpl-2.0
Hackplayers/Empire-mod-Hpys-tests
lib/modules/powershell/situational_awareness/network/get_sql_instance_domain.py
2
4763
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name' : 'Get-SQLInstanceDomain', 'Author': ['@_nullbind', '@0xbadjuju'], 'Description': ('Returns a list of SQL Server instances discovered by querying ' ...
bsd-3-clause
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/test/time_hashlib.py
167
2887
# It's intended that this script be run by hand. It runs speed tests on # hashlib functions; it does not test for correctness. import sys, time import hashlib def creatorFunc(): raise RuntimeError("eek, creatorFunc not overridden") def test_scaled_msg(scale, name): iterations = 106201/scale * 20 longSt...
apache-2.0
Shine-/xbmc
lib/libUPnP/Neptune/Build/Tools/SCons/gcc-generic.py
199
1249
import os def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None): if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning'] ### compiler flags if gcc_strict: env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long']) ...
gpl-2.0
vaygr/ansible
lib/ansible/modules/network/illumos/flowadm.py
23
14817
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # 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', ...
gpl-3.0
tkuhrt/fabric
bddtests/steps/orderer_util.py
1
10865
# Copyright IBM Corp. 2016 All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0