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
mireianievas/enrico
script/ConvertTime.py
2
2030
#!/usr/bin/env python import time,sys epoch_ref = 1331679600+3600 mjd_ref = 56000. met_ref = 353376002.000 def MJDtoJD(MJD): return MJD+2400000.5 def JDtoMJD(JD): return JD-2400000.5 def EpochToMeT(epoch): # Work only on Linux Machine depoch = epoch-epoch_ref return depoch + met_ref+3600 def DateToMet(d...
bsd-3-clause
metacloud/percona-xtrabackup
test/kewpie/lib/util/mysql_methods.py
21
9772
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
ric03uec/boto
boto/dynamodb/exceptions.py
185
1687
""" Exceptions that are specific to the dynamodb module. """ from boto.exception import BotoServerError, BotoClientError from boto.exception import DynamoDBResponseError class DynamoDBExpiredTokenError(BotoServerError): """ Raised when a DynamoDB security token expires. This is generally boto's (or the us...
mit
hcs/mailman
src/mailman/utilities/interact.py
3
3047
# Copyright (C) 2006-2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
vipins/ccccms
env/Lib/site-packages/django/contrib/localflavor/pl/forms.py
86
7601
""" Polish-specific form helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.pl.pl_administrativeunits import ADMINISTRATIVE_UNIT_CHOICES from django.contrib.localflavor.pl.pl_voivodeships import VOIVODESHIP_CHOICES from django.core.validators import EMPTY_VALUES from django....
bsd-3-clause
supergis/QGIS
python/plugins/processing/algs/qgis/MeanCoords.py
10
4806
# -*- coding: utf-8 -*- """ *************************************************************************** MeanCoords.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
gpl-2.0
jhroot/elife-bot
tests/activity/test_activity_verify_image_server.py
2
3442
import unittest import settings_mock from activity.activity_VerifyImageServer import activity_VerifyImageServer import test_activity_data as test_data from mock import patch, MagicMock from classes_mock import FakeSession from ddt import ddt, data class FakeStorageContext: def list_resources(self, resource): ...
mit
Avinash-Raj/appengine-django-skeleton
lib/django/contrib/gis/geos/prototypes/topology.py
338
2145
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ from ctypes import c_double, c_int from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_string...
bsd-3-clause
forseti-security/forseti-security
google/cloud/forseti/common/util/replay.py
1
6796
# Copyright 2017 The Forseti Security 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 ap...
apache-2.0
mmauroy/SickRage
lib/sqlalchemy/events.py
75
35368
# sqlalchemy/events.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core event interfaces.""" from . import event, exc from .pool import Pool fro...
gpl-3.0
open-power-sdk/migration-advisor
ma/problem_reporter.py
1
5434
# -*- coding: utf-8 -*- """ Copyright (C) 2017 IBM Corporation 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 agre...
apache-2.0
srluge/SickRage
tests/name_parser_tests.py
1
17619
import sys, os.path sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib'))) sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import datetime import unittest from tests import test_lib as test import sickbeard from sickbeard import tv from sickbeard.na...
gpl-3.0
2014c2g3/0623exam
static/Brython3.1.1-20150328-091302/Lib/keyword_1.py
761
2049
#! /usr/bin/env python3 """Keywords (from "graminit.c") This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: ./python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] k...
gpl-3.0
CauldronDevelopmentLLC/OpenSCAM
examples/python/camotics_python_example.py
1
7363
#!/usr/bin/env python3 # # CAMotics is an Open-Source simulation and CAM software. # Copyright (C) 2011-2021 Joseph Coffland <joseph@cauldrondevelopment.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 ...
gpl-2.0
steventimberman/masterDebater
venv/lib/python2.7/site-packages/markdown/extensions/smarty.py
62
10360
# -*- coding: utf-8 -*- ''' Smarty extension for Python-Markdown ==================================== Adds conversion of ASCII dashes, quotes and ellipses to their HTML entity equivalents. See <https://pythonhosted.org/Markdown/extensions/smarty.html> for documentation. Author: 2013, Dmitry Shachnev <mitya57@gmail.c...
mit
4022321818/40223218w11
static/Brython3.1.0-20150301-090019/Lib/datetime.py
628
75044
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max.toordinal()...
gpl-3.0
simvisage/oricreate
oricreate/fu/fu_target_face.py
1
13873
# ------------------------------------------------------------------------- # # Copyright (c) 2009, IMB, RWTH Aachen. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in simvisage/LICENSE.txt and may be redistributed only # under the conditions describe...
gpl-3.0
jmcbailey/django-cached-hitcount
cached_hitcount/south_migrations/0003_auto__add_index_hit_added.py
2
2090
# -*- 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 index on 'Hit', fields ['added'] db.create_index('cached_hitcoun...
gpl-3.0
daenamkim/ansible
lib/ansible/module_utils/network/aruba/aruba.py
2
4597
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
redhat-openstack/trove
trove/tests/api/versions.py
8
3296
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
mtrbean/scipy
scipy/__init__.py
62
4048
""" SciPy: A scientific computing package for Python ================================================ Documentation is available in the docstrings and online at http://docs.scipy.org. Contents -------- SciPy imports all the functions from the NumPy namespace, and in addition provides: Subpackages ----------- Using a...
bsd-3-clause
DickJC123/mxnet
python/mxnet/symbol/numpy/linalg.py
9
35356
# 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 u...
apache-2.0
SurfasJones/icecream-info
icecream/lib/python2.7/site-packages/PIL/WebPImagePlugin.py
8
1946
from PIL import Image from PIL import ImageFile from io import BytesIO from PIL import _webp _VALID_WEBP_MODES = { "RGB": True, "RGBA": True, } _VP8_MODES_BY_IDENTIFIER = { b"VP8 ": "RGB", b"VP8X": "RGBA", b"VP8L": "RGBA", # lossless } def _accept(prefix): is_riff_file_format = pref...
mit
kikocorreoso/brython
www/src/Lib/test/test_cgitb.py
5
2565
from test.support import temp_dir from test.support.script_helper import assert_python_failure import unittest import sys import cgitb class TestCgitb(unittest.TestCase): def test_fonts(self): text = "Hello Robbie!" self.assertEqual(cgitb.small(text), "<small>{}</small>".format(text)) self...
bsd-3-clause
ZachLiuGIS/django-allauth
allauth/socialaccount/providers/odnoklassniki/provider.py
64
1383
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class OdnoklassnikiAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('link') de...
mit
RichardLitt/wyrd-django-dev
tests/modeltests/update_only_fields/tests.py
7
9587
from __future__ import absolute_import from django.db.models.signals import pre_save, post_save from django.test import TestCase from .models import Person, Employee, ProxyEmployee, Profile, Account class UpdateOnlyFieldsTests(TestCase): def test_update_fields_basic(self): s = Person.objects.create(name...
bsd-3-clause
praekelt/txtalert
txtalert/apps/therapyedge/management/commands/te_import_test.py
1
3299
from datetime import datetime, timedelta from django.utils import timezone from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.conf import settings from optparse import make_option from txtalert.apps.general.settings.models import Setting from txtalert.apps.therap...
gpl-3.0
fhaoquan/kbengine
kbe/src/lib/python/Lib/binhex.py
89
13708
"""Macintosh binhex compression/decompression. easy interface: binhex(inputfilename, outputfilename) hexbin(inputfilename, outputfilename) """ # # Jack Jansen, CWI, August 1995. # # The module is supposed to be as compatible as possible. Especially the # easy interface should work "as expected" on any platform. # XXX...
lgpl-3.0
40223119/w16b_test
static/Brython3.1.0-20150301-090019/Lib/abc.py
765
8057
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or der...
gpl-3.0
shyamalschandra/scikit-learn
sklearn/utils/random.py
234
10510
# Author: Hamzeh Alsalhi <ha258@cornell.edu> # # License: BSD 3 clause from __future__ import division import numpy as np import scipy.sparse as sp import operator import array from sklearn.utils import check_random_state from sklearn.utils.fixes import astype from ._random import sample_without_replacement __all__ =...
bsd-3-clause
rbaumg/trac
trac/wiki/formatter.py
1
63756
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2019 Edgewall Software # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> # Copyright (C) 2005-2007 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described ...
bsd-3-clause
ned14/MaidSafe
src/third_party_libs/googlemock/scripts/generator/cpp/keywords.py
1157
2004
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions 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...
gpl-3.0
cslzchen/osf.io
api/requests/views.py
4
6017
from __future__ import unicode_literals from rest_framework import generics from rest_framework import permissions from rest_framework.exceptions import NotFound from api.actions.serializers import PreprintRequestActionSerializer from api.base.views import JSONAPIBaseView from api.base import permissions as base_perm...
apache-2.0
BT-csanchez/hr
__unported__/hr_report_turnover/report/employee_turnover.py
21
5031
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com> # # This program 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 Free Software Foundation, either version 3 of the Licens...
agpl-3.0
movmov/cc
nova/endpoint/api.py
2
11345
#!/usr/bin/python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright [2010] [Anso Labs, 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/lic...
apache-2.0
Codefans-fan/odoo
addons/base_import_module/tests/test_module/__openerp__.py
377
1290
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
ajvpot/CTFd
CTFd/forms/setup.py
2
2479
from wtforms import ( FileField, HiddenField, PasswordField, RadioField, SelectField, StringField, TextAreaField, ) from wtforms.fields.html5 import EmailField from wtforms.validators import InputRequired from CTFd.constants.themes import DEFAULT_THEME from CTFd.forms import BaseForm from C...
apache-2.0
pinterest/thrift
lib/py/src/transport/THttpClient.py
20
6619
# # 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 u...
apache-2.0
barbuza/django
tests/template_tests/syntax_tests/test_verbatim.py
521
1658
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class VerbatimTagTests(SimpleTestCase): @setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'}) def test_verbatim_tag01(self): output = self.engine.render_to_string('verb...
bsd-3-clause
marratj/ansible
lib/ansible/modules/network/vyos/vyos_logging.py
15
7782
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
benhoff/vex
vexbot/adapters/irc/__main__.py
2
3015
import sys import atexit import signal from vexbot._version import __version__ as version from vexbot.adapters.irc import IrcInterface """ try: pkg_resources.get_distribution('irc3') except pkg_resources.DistributionNotFound: _IRC3_INSTALLED = False if _IRC3_INSTALLED: import irc3 else: pass """ im...
gpl-3.0
gluke77/rally
tests/unit/plugins/openstack/context/not_for_production/test_tempest.py
13
4489
# Copyright 2014: 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
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/encodings/cp860.py
593
34937
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.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_map) def decode(self,input,errors='strict'): ...
apache-2.0
jart/tensorflow
tensorflow/python/grappler/graph_placer.py
23
4478
# 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
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/requests/tests.py
65
34729
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import time from datetime import datetime, timedelta from io import BytesIO from itertools import chain from django.core.exceptions import SuspiciousOperation from django.core.handlers.wsgi import LimitedStream, WSGIRequest from django.http import ( ...
mit
mvo5/snapcraft
tests/unit/test_common.py
3
6507
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
avoinsystems/odoo
openerp/addons/base/tests/test_orm.py
149
18110
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ def setUp(self):...
agpl-3.0
avoinsystems/odoo
addons/hr_holidays/hr_holidays.py
159
33482
# -*- coding: utf-8 -*- ################################################################################## # # Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com) # and 2004-2010 Tiny SPRL (<http://tiny.be>). # # $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $ # # This program is free software: you can redistri...
agpl-3.0
aboutsajjad/Bridge
app_packages/youtube_dl/extractor/ketnet.py
27
3490
from __future__ import unicode_literals from .canvas import CanvasIE from .common import InfoExtractor class KetnetIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ketnet\.be/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://www.ketnet.be/kijken/zomerse-filmpjes', 'md5': '6bdeb6599...
mit
erelsgl/economics
double-auction-simulations/main.AAAI18-submission.py
1
15070
#!python3 """ Simulation of single-type multi-unit double-auction mechanisms. Author: Erel Segal-Halevi Since : 2017-07 """ import numpy as np import pandas as pd from pandas import DataFrame from pandas.tools import plotting import matplotlib.pyplot as plt import math import os import random from doubleauction im...
lgpl-2.1
papouso/odoo
addons/resource/faces/timescale.py
263
3899
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
probcomp/crosscat
scripts/mi_tests/test_mutual_information.py
2
6434
# # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # Lead Developers: Dan Lovell and Jay Baxter # Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
apache-2.0
kawamon/hue
desktop/core/ext-py/Django-1.11.29/tests/admin_utils/test_logentry.py
5
11611
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from datetime import datetime from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry from django.contrib.admin.utils import quote from django.contrib.auth.models import User from django.contrib.contenttypes.models import...
apache-2.0
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/gnome_sudoku/main.py
1
40160
# -*- coding: utf-8 -*- import os.path import threading import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk,GdkPixbuf,GObject,Pango,Gdk from gi.repository import LaunchpadIntegration from gettext import gettext as _ from gettext import ngettext import cairo import dialog_swallower import game_se...
gpl-3.0
emorozov/django-basic-apps
basic/invitations/models.py
10
2238
import random from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.contrib.sites.models import Site from django.utils.hashcompat import sha_constructor INVITATION_ALLOTMENT = getattr(settings, 'INVITATION_ALLOTMENT', 5) INVITATION_STATUS_SENT = 0 INVIT...
bsd-3-clause
jhamrick/cogsci-proceedings-analysis
scraper.py
1
2997
import urllib2 import pandas as pd from bs4 import BeautifulSoup, element def load_html(url): response = urllib2.urlopen(url) html = response.read().replace("&nbsp;", "") return html def get_papers_table(year): url = "https://mindmodeling.org/cogsci{}/".format(year) soup = BeautifulSoup(load_htm...
mit
xyuanmu/XX-Net
python3.8.2/Lib/site-packages/pip/_vendor/distlib/wheel.py
17
40437
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from...
bsd-2-clause
mohamedhagag/community-addons
openeducat_erp/op_achievement/op_achievement.py
1
1565
# -*- coding: utf-8 -*- ############################################################################### # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
HellerCommaA/cookiecutter-django
{{cookiecutter.repo_name}}/config/settings/common.py
8
9680
# -*- coding: utf-8 -*- """ Django settings for {{cookiecutter.project_name}} project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolu...
bsd-3-clause
qedi-r/home-assistant
homeassistant/components/eddystone_temperature/sensor.py
2
5793
""" Read temperature information from Eddystone beacons. Your beacons must be configured to transmit UID (for identification) and TLM (for temperature) frames. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.eddystone_temperature/ """ import loggi...
apache-2.0
blighj/django
tests/transaction_hooks/tests.py
64
6900
from django.db import connection, transaction from django.test import TransactionTestCase, skipUnlessDBFeature from .models import Thing class ForcedError(Exception): pass class TestConnectionOnCommit(TransactionTestCase): """ Tests for transaction.on_commit(). Creation/checking of database object...
bsd-3-clause
Immortalin/python-for-android
python-build/python-libs/gdata/build/lib/gdata/exif/__init__.py
253
6981
# -*-*- encoding: utf-8 -*-*- # # This is gdata.photos.exif, implementing the exif namespace in gdata # # $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $ # # Copyright 2007 Håvard Gulldahl # Portions copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
apache-2.0
urdh/streck
streck/controller/stats.py
1
1319
# -*- coding: utf-8 -*- from collections import deque from streck import app from streck.models.stats import * from streck.models.product import * from flask import render_template, Response, stream_with_context @app.route('/stats') def stats(): return render_template('stats.html', stats=Stats, categories=Product.cat...
isc
EricMountain-1A/openshift-ansible
roles/lib_openshift/src/class/oc_obj.py
16
7575
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-instance-attributes class OCObject(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint allows 5. we need 6 # pylint: disable=too-many-arguments def __init__(self, kind, namespace, ...
apache-2.0
juoceano/ThinkStats2
code/chap08soln.py
65
6172
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import thinkstats2 import thinkplot import math import random import numpy as np fr...
gpl-3.0
cloudbase/neutron
neutron/tests/unit/objects/test_router.py
1
2160
# Copyright (c) 2016 Intel Corporation. # # 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...
apache-2.0
BlackPole/bp-enigma2
lib/python/Tools/ISO639.py
79
23367
# -*- coding: iso-8859-2 -*- LanguageCodes = { } LanguageCodes["aar"] = LanguageCodes["aa"] = ("Afar", "Hamitic") LanguageCodes["abk"] = LanguageCodes["ab"] = ("Abkhazian", "Ibero-caucasian") LanguageCodes["ace"] = ("Achinese", "") LanguageCodes["ach"] = ("Acoli", "") LanguageCodes["ada"] = ("Adangme", "") LanguageCod...
gpl-2.0
marcelocure/django
django/contrib/gis/gdal/prototypes/errcheck.py
586
4229
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import ( GDALException, SRSException, check_err, ) from django.contrib.gis.gdal.libgdal import lgdal from django.utils import six # Helper routine...
bsd-3-clause
sergiosvieira/ns3-dtn
src/config-store/bindings/modulegen__gcc_LP64.py
34
54509
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
rikima/spark
python/pyspark/mllib/tree.py
24
24125
# # 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 us...
apache-2.0
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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
Azeret/galIMF
plot_stellar_yield_table.py
1
38495
import time import math import matplotlib.pyplot as plt import numpy as np from scipy import interpolate import element_abundances_solar reference_name = 'Anders1989' H_abundances_solar = element_abundances_solar.function_solar_element_abundances(reference_name, 'H') # He_abundances_solar = element_abundances_solar.fu...
gpl-3.0
superdesk/superdesk-core
superdesk/io/registry.py
2
6016
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license """Superdesk...
agpl-3.0
sangwook236/SWDT
sw_dev/python/ext/test/high_performance_computing/spark/pyspark_database.py
2
5564
#!/usr/bin/env python from pyspark.sql import SparkSession import pyspark.sql.types as types import pyspark.sql.functions as func import traceback, sys # REF [site] >> https://spark.apache.org/docs/latest/sql-programming-guide.html#jdbc-to-other-databases def sqlite_jdbc(): spark = SparkSession.builder.appName('sql...
gpl-3.0
lasalesi/erpnext
erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
4
3812
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint, getdate, get_first_day, get_last_day, date_diff, add_days from frappe import msgprint, _ from calenda...
gpl-3.0
Huskerboy/startbootstrap-freelancer
freelancer_env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py
2715
30098
"""Utilities for writing code that runs on Python 2 and 3""" # Copyright (c) 2010-2015 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...
mit
andredalton/bcc
2014/MAC0242/Projeto/pokemon/pokemon.py
1
8640
# Usado pra receber arquivos XML import sys # Usado para validar e manipular XML from lxml import etree from lxml.etree import XMLSyntaxError, Element, SubElement # Os tipos foram ordenados em kind_list e kind_dict é utilizado para retornar o objeto através de um nome. from .kind import kind_list, kind_dict, blank,...
apache-2.0
moxon6/chemlab
build/lib/chemlab/mviewer/representations/ballandstick.py
6
13485
import numpy as np import itertools from .obsarray import obsarray as obsarray from .state import SystemHiddenState, SystemSelectionState, ArrayState from .state import Selection from ...graphics.renderers import (SphereImpostorRenderer, CylinderImpostorRenderer, AtomRenderer, ...
gpl-3.0
KimNorgaard/ansible-modules-extras
system/capabilities.py
79
6980
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Nate Coraor <nate@bx.psu.edu> # # 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...
gpl-3.0
timlinux/QGIS
python/plugins/processing/algs/grass7/ext/v_sample.py
45
1398
# -*- coding: utf-8 -*- """ *************************************************************************** v_sample.py ----------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************************************...
gpl-2.0
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/requests-2.10.0/requests/exceptions.py
352
2776
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
apache-2.0
Mhynlo/SickRage
lib/bencode/__init__.py
13
3301
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
gpl-3.0
rcarauta/rcarauta-projects
node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
mzl9039/YouCompleteMe
python/ycm/diagnostic_interface.py
9
8419
#!/usr/bin/env python # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
jkstrick/samba
python/samba/tdb_util.py
46
1491
# Unix SMB/CIFS implementation. # tdb util helpers # # Copyright (C) Kai Blin <kai@samba.org> 2011 # Copyright (C) Amitay Isaacs <amitay@gmail.com> 2011 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2013 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
twitter/pants
tests/python/pants_test/engine/scheduler_test_base.py
1
3880
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import shutil from builtins import object from pants.base.file_system_project_...
apache-2.0
sunpeak/MITMf
core/netcreds.py
3
33934
import logging import binascii import struct import base64 import threading import binascii from core.logger import logger from os import geteuid, devnull from sys import exit from urllib import unquote from collections import OrderedDict from BaseHTTPServer import BaseHTTPRequestHandler from StringIO import StringIO ...
gpl-3.0
beezee/GAE-Django-base-app
django/db/backends/postgresql/operations.py
229
9420
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(Databas...
bsd-3-clause
mancoast/CPythonPyc_test
fail/311_test_print.py
8
3846
"""Test correct operation of the print function. """ # In 2.6, this gives us the behavior we want. In 3.0, it has # no function, but it still must parse correctly. from __future__ import print_function import unittest from test import support import sys try: # 3.x from io import StringIO except ImportError...
gpl-3.0
bjoshua/ansible
lib/ansible/playbook/role/metadata.py
51
3177
# (c) 2014 Michael DeHaan, <michael@ansible.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 ve...
gpl-3.0
DirectXMan12/nova-hacking
nova/tests/compute/test_virtapi.py
5
5056
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
J861449197/edx-platform
lms/djangoapps/shoppingcart/migrations/0027_add_invoice_history.py
102
22387
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'InvoiceHistory' db.create_table('shoppingcart_invoicehistory', ( ('id', self.gf(...
agpl-3.0
gitcoinco/web
app/dashboard/tests/test_bounty_state.py
1
2398
# -*- coding: utf-8 -*- """Test BountyState and BountyEvent interactions and FSM Copyright (C) 2021 Gitcoin Core This program 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 Free Software Foundation, either version 3 of the Licens...
agpl-3.0
Manuel4131/youtube-dl
youtube_dl/extractor/tumblr.py
79
3285
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class TumblrIE(InfoExtractor): _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])' _TESTS = [{ 'url': 'http://tatianamaslanydaily.tumblr.com/post/54...
unlicense
uzh/msregistry
app/api_1_0/user.py
1
4643
# Copyright (C) 2016 University of Zurich. All rights reserved. # # This file is part of MSRegistry Backend. # # MSRegistry Backend is free software: you can redistribute it and/or # modify it under the terms of the version 3 of the GNU Affero General # Public License as published by the Free Software Foundation, or a...
agpl-3.0
TinEye/tineyeservices_python
tineyeservices/image.py
1
1973
# -*- coding: utf-8 -*- # Copyright (c) 2018 TinEye. All rights reserved worldwide. import contextlib import os class Image(object): """ Class representing an image. Image on filesystem: >>> from tineyeservices import Image >>> image = Image(filepath='/path/to/image.jpg', collection_fil...
mit
svenstaro/ansible
test/units/modules/network/ios/test_ios_command.py
59
4059
# (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
weolar/miniblink49
v8_7_5/tools/dev/gm.py
3
13334
#!/usr/bin/env python # Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """\ Convenience wrapper for compiling V8 with gn/ninja and running tests. Sets up build output directories if they don't exist. Produ...
apache-2.0
shhui/nova
nova/tests/virt/baremetal/db/base.py
53
1689
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
apache-2.0
epitron/youtube-dl
youtube_dl/extractor/ndr.py
17
14346
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, parse_iso8601, qualities, ) class NDRBaseIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) di...
unlicense