repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
David-Estevez/telegram-bots | JukeBot/JukeBot.py | 1 | 3850 | #########################################################################
##
## JukeBot - Telegram bot to control a media player
##
#########################################################################
import ConfigParser
import os
import re, string
from twx.botapi import TelegramBot, ReplyKeyboardMarkup
from Med... | gpl-2.0 |
GenericStudent/home-assistant | homeassistant/components/demo/device_tracker.py | 25 | 1178 | """Demo platform for the Device tracker component."""
import random
from .const import DOMAIN, SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA
def setup_scanner(hass, config, see, discovery_info=None):
"""Set up the demo tracker."""
def offset():
"""Return random offset."""
return (random.randrange(50... | apache-2.0 |
chafique-delli/OpenUpgrade | openerp/cli/server.py | 28 | 5435 | # -*- 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 GNU... | agpl-3.0 |
Soya93/Extract-Refactoring | python/helpers/py2only/docutils/parsers/rst/directives/images.py | 5 | 6329 | # $Id: images.py 5952 2009-05-19 08:45:27Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for figures and simple images.
"""
__docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.nodes import fully_normalize_nam... | apache-2.0 |
charbeljc/OCB | addons/website_partner/__openerp__.py | 383 | 1498 | # -*- 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 |
matthewalbani/scipy | scipy/sparse/linalg/isolve/iterative/test.py | 110 | 4126 | from __future__ import division, print_function, absolute_import
from scipy import *
from iterative import *
def test_fun(alpha, x, beta, y, A, n):
# compute z = alpha*A*x + beta*y
xx = x[:n]
yy = y[:n]
w = dot(A,xx)
z = alpha*w+beta*yy
y[:n] = z
return
def test_fun_t(alpha, x, beta, y,... | bsd-3-clause |
cyril51/Sick-Beard | lib/hachoir_parser/file_system/ext2.py | 90 | 18055 | """
EXT2 (Linux) file system parser.
Author: Victor Stinner
Sources:
- EXT2FS source code
http://ext2fsd.sourceforge.net/
- Analysis of the Ext2fs structure
http://www.nondot.org/sabre/os/files/FileSystems/ext2fs/
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError... | gpl-3.0 |
paolodedios/tensorflow | tensorflow/python/keras/utils/kpl_test_utils.py | 6 | 7275 | # Copyright 2021 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 |
jolyonb/edx-platform | common/lib/chem/chem/miller.py | 1 | 9303 | """ Calculation of Miller indices """
from __future__ import absolute_import
import decimal
import fractions as fr
import json
import math
import numpy as np
from six.moves import map
from six.moves import range
from functools import reduce
def lcm(a, b):
"""
Returns least common multiple of a, b
Args:... | agpl-3.0 |
NeuroVault/NeuroVault | neurovault/apps/statmaps/migrations/0060_auto_20160103_0406.py | 4 | 2687 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('statmaps', '0059_auto_20160101_0410'),
]
operations = [
migrations.AlterField(
model_name='collection',
... | mit |
miloharper/neural-network-animation | matplotlib/tests/test_ticker.py | 9 | 4261 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import nose.tools
from nose.tools import assert_raises
from numpy.testing import assert_almost_equal
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as m... | mit |
marionleborgne/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/contour.py | 69 | 42063 | """
These are classes to support contour plotting and
labelling for the axes class
"""
from __future__ import division
import warnings
import matplotlib as mpl
import numpy as np
from numpy import ma
import matplotlib._cntr as _cntr
import matplotlib.path as path
import matplotlib.ticker as ticker
import matplotlib.cm... | agpl-3.0 |
Desterly/android_kernel_motorola_msm8994 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
tttthemanCorp/CardmeleonAppEngine | django/views/generic/detail.py | 154 | 5498 | import re
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
class SingleObjectMixin(object):
"... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow/source/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... | mit |
numenta/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/colorbar.py | 69 | 27260 | '''
Colorbar toolkit with two classes and a function:
:class:`ColorbarBase`
the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.
:class:`Colorbar`
the derived class ... | agpl-3.0 |
maaaaz/fgpoliciestocsv | fgaddressestocsv.py | 1 | 6306 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of fgpoliciestocsv.
#
# Copyright (C) 2014, 2020, Thomas Debize <tdebize at mail.com>
# All rights reserved.
#
# fgpoliciestocsv is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as pu... | gpl-3.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/google/appengine/api/appinfo_includes.py | 6 | 10829 | #!/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... | mit |
NDManh/numbbo | code-postprocessing/bbob_pproc/comp2/pptable2.py | 3 | 20251 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Rank-sum tests table on "Final Data Points".
That is, for example, using 1/#fevals(ftarget) if ftarget was reached
and -f_final otherwise as input for the rank-sum test, where obviously
the larger the better.
One table per function and dimension.
"""
from __future__... | bsd-3-clause |
s5brown/MLfeatures | assignment_1_Sebastian_Brown.py | 1 | 3964 | """Assignment 1."""
from assignment_1_eval import pairs
vowels = ['a', 'e', 'i', 'o', 'u']
es_sounds = ['ch', 's', 'z']
no_change = [
'economics', 'mathematics', 'statistics', 'luggage',
'baggage', 'furniture', 'information', 'gymnastics', 'news']
always_singular = ['fish', 'barracks', 'deer',... | gpl-3.0 |
cchurch/ansible-modules-extras | cloud/cloudstack/cs_instance.py | 22 | 36186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_3/tests/modeltests/basic/tests.py | 53 | 21594 | from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.db import models, DEFAULT_DB_ALIAS, connection
from django.db.models.fields import FieldDoesNotExist
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from models import Article
class ModelTest(TestC... | mit |
cloudbau/cinder | cinder/tests/test_volume_transfer.py | 2 | 5121 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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/LICENS... | apache-2.0 |
andreparrish/python-for-android | python3-alpha/python3-src/Lib/encodings/cp1257.py | 272 | 13374 | """ Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.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 decode(self,in... | apache-2.0 |
caphrim007/ansible | lib/ansible/modules/cloud/pubnub/pubnub_blocks.py | 84 | 23806 | #!/usr/bin/python
#
# PubNub Real-time Cloud-Hosted Push API and Push Notification Client
# Frameworks
# Copyright (C) 2016 PubNub Inc.
# http://www.pubnub.com/
# http://www.pubnub.com/terms
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_i... | gpl-3.0 |
ncliam/serverpos | openerp/__init__.py | 235 | 3586 | # -*- 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 GNU... | agpl-3.0 |
Work4Labs/lettuce | tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/log.py | 310 | 2270 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | gpl-3.0 |
shenlong3030/asv-django-guestbook | django/db/models/__init__.py | 12 | 1459 | from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.db import connection
from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models
from django.db.models.query import Q
from django.db.models.expressions import ... | bsd-3-clause |
abelkhan/websearch | websearch/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-3.0 |
KontorConsulting/odoo | addons/hr_holidays/tests/test_holidays_flow.py | 338 | 10513 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
qtproject/pyside-pyside | tests/QtQml/registertype.py | 1 | 3725 | #############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commercial ... | lgpl-2.1 |
eclipse-ease-addons/engines | jython/org.jython/Lib/xml/sax/handler.py | 109 | 14076 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id: handler.py,v ... | epl-1.0 |
boneill42/cassandra | pylib/cqlshlib/util.py | 30 | 3401 | # 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 |
neumerance/deploy | .venv/lib/python2.7/site-packages/lesscpy/lessc/lexer.py | 2 | 7140 | """
Lexer for LESSCSS.
http://www.dabeaz.com/ply/ply.html
http://www.w3.org/TR/CSS21/grammar.html#scanner
http://lesscss.org/#docs
Copyright (c)
See LICENSE for details.
<jtm@robot.is>
"""
import re
import ply.lex as lex
from lesscpy.lib import dom
from lesscpy.lib import css
class Less... | apache-2.0 |
cpennington/edx-platform | cms/envs/openstack.py | 11 | 1452 | """
Settings for OpenStack deployments.
"""
from .production import * # pylint: disable=wildcard-import, unused-wildcard-import
SWIFT_AUTH_URL = AUTH_TOKENS.get('SWIFT_AUTH_URL')
SWIFT_AUTH_VERSION = AUTH_TOKENS.get('SWIFT_AUTH_VERSION', 1)
SWIFT_USERNAME = AUTH_TOKENS.get('SWIFT_USERNAME')
SWIFT_KEY = AUTH_TOKENS.g... | agpl-3.0 |
angryrancor/kivy | kivy/uix/slider.py | 35 | 7454 | """
Slider
======
.. image:: images/slider.jpg
The :class:`Slider` widget looks like a scrollbar. It supports horizontal and
vertical orientations, min/max values and a default value.
To create a slider from -100 to 100 starting from 25::
from kivy.uix.slider import Slider
s = Slider(min=-100, max=100, valu... | mit |
GehenHe/Recognize-Face-on-Android | tensorflow/contrib/learn/python/learn/export_strategy.py | 14 | 1195 | # 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 |
nealtodd/django | tests/gis_tests/geo3d/tests.py | 74 | 17246 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... | bsd-3-clause |
gnowxilef/youtube-dl | youtube_dl/extractor/njpwworld.py | 12 | 2682 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
get_element_by_class,
urlencode_postdata,
)
class NJPWWorldIE(InfoExtractor):
_VALID_URL = r'https?://njpwworld\.com/p/(?P<id>[a-z0-9_]+)'
IE... | unlicense |
s20121035/rk3288_android5.1_repo | frameworks/native/opengl/tools/glgen2/registry/genheaders.py | 6 | 23027 | #!/usr/bin/env python
#
# Copyright (c) 2013-2014 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights ... | gpl-3.0 |
yesbox/ansible | lib/ansible/plugins/inventory/script.py | 147 | 1055 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/google/rpc/error_details_pb2.py | 17 | 16360 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/rpc/error_details.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ref... | apache-2.0 |
chirilo/kuma | kuma/core/tests/test_forms.py | 22 | 2547 | from django import forms
from nose.tools import eq_
from pyquery import PyQuery as pq
from kuma.core.tests import KumaTestCase
from ..form_fields import StrippedCharField
class ExampleForm(forms.Form):
"""Example form to test a bunch of Django fields."""
char = forms.CharField(max_length=10)
char_optio... | mpl-2.0 |
Belxjander/Kirito | Python-3.5.0-main/Lib/turtledemo/__main__.py | 12 | 14243 | #!/usr/bin/env python3
"""
----------------------------------------------
turtleDemo - Help
----------------------------------------------
This document has two sections:
(1) How to use the demo viewer
(2) How to add your own demos to the demo repository
(1) How to use the demo viewer.
Select ... | gpl-3.0 |
vmarkovtsev/django-apiblueprint-tests | __main__.py | 1 | 2997 | # -*- coding: utf-8 -*-
"""
Django REST framework tests generator which is based on API Blueprint
(https://apiblueprint.org/) documents.
Released under New BSD License.
Copyright © 2015, Vadim Markovtsev :: AO InvestGroup
All rights reserved.
Redistribution and use in source and binary forms, with or without
modifica... | bsd-3-clause |
lioonline/lantern | src/code.google.com/p/winsvc/codereview.py | 139 | 111664 | # coding=utf-8
# (The line above is necessary so that I can use 世界 in the
# *comment* below without Python getting all bent out of shape.)
# Copyright 2007-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 o... | apache-2.0 |
janusnic/shoop | shoop/addons/reloader.py | 2 | 2984 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import sys
import os
class ReloadMethod(object):
ident... | agpl-3.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/py-numpydoc/package.py | 3 | 1665 | ##############################################################################
# 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 |
beurdouche/RIOT | dist/tools/mcuboot/imgtool/version.py | 50 | 1149 | """
Semi Semantic Versioning
Implements a subset of semantic versioning that is supportable by the image header.
"""
import argparse
from collections import namedtuple
import re
SemiSemVersion = namedtuple('SemiSemVersion', ['major', 'minor', 'revision', 'build'])
version_re = re.compile(r"""^([1-9]\d*|0)(\.([1-9]\... | lgpl-2.1 |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/tools/gyp/test/mac/gyptest-postbuild.py | 345 | 1708 | #!/usr/bin/env python
# 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.
"""
Verifies that postbuild steps work.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['nin... | apache-2.0 |
loele/samba | python/samba/tests/credentials.py | 42 | 3667 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# 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) a... | gpl-3.0 |
googleapis/googleapis-gen | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/campaign_simulation_service/client.py | 1 | 19104 | # -*- 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 required by applicable law or... | apache-2.0 |
bmd/twittrscrapr | twittrscrapr/scrapers/timelinescrapr.py | 1 | 1459 | import logging
from ..parsers import DictParser
from base_scraper import TwittrScrapr
log = logging.getLogger('scrapers.TimelineScrapr')
class TimelineScrapr(TwittrScrapr):
def __init__(self, api_keys, writer):
super(TimelineScrapr, self).__init__(api_keys, writer)
def _fetch_user_timeline(self, us... | mit |
astroclark/BayesSpec | waveforms/waveforms2hdf5.py | 1 | 1186 | #!/usr/bin/env python
"""
waveforms2hdf5.py loops over the list of waveforms defined in this script and
dumps out an hdf5 file for the plus polarisation. The idea is to then compute
the Shannon entropy of the waveforms using Matlab's wentropy.m function.
"""
import h5py
import numpy as np
import pmns_utils
wfs='/Use... | gpl-2.0 |
40223137/2015abc | static/Brython3.1.0-20150301-090019/Lib/pprint.py | 634 | 12757 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | gpl-3.0 |
hsorby/mapclient | src/mapclient/view/workflow/workflowgraphicsitems.py | 2 | 22060 | """
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
Copyright (C) 2012 University of Auckland
This file is part of MAP Client. (http://launchpad.net/mapclient)
MAP Client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | gpl-3.0 |
Edraak/edraak-platform | openedx/features/enterprise_support/utils.py | 9 | 10158 | from __future__ import unicode_literals
import hashlib
import six
from django.conf import settings
from django.utils.translation import ugettext as _
import third_party_auth
from third_party_auth import pipeline
from student.cookies import set_experiments_is_enterprise_cookie
from openedx.core.djangoapps.site_confi... | agpl-3.0 |
Ziqi-Li/bknqgis | pandas/pandas/core/reshape/reshape.py | 1 | 45812 | # pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
from pandas.compat import range, zip
from pandas import compat
import itertools
import re
import numpy as np
from pandas.core.dtypes.common import (
_ensure_platform_int,
is_list_like, is_bool_dtype,
needs_i8_conversion)
from pandas.c... | gpl-2.0 |
Nirvedh/CoarseCoherence | src/arch/x86/isa/insts/simd64/integer/data_transfer/move_non_temporal.py | 88 | 2310 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
genius1611/horizon | openstack-dashboard/setup.py | 7 | 1928 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
PsychoTV/PsychoTeam.repository | plugin.video.PsychoTV/resources/lib/libraries/f4mproxy/utils/keyfactory.py | 208 | 6987 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Factory functions for asymmetric cryptography.
@sort: generateRSAKey, parsePEMKey, parseAsPublicKey
"""
from .compat import *
from .rsakey import RSAKey
from .python_rsakey import Python_RSAKey
from tlslite.utils impo... | gpl-2.0 |
ping/youtube-dl | youtube_dl/extractor/noco.py | 15 | 8443 | # coding: utf-8
from __future__ import unicode_literals
import re
import time
import hashlib
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
float_or_none,
parse_iso8601,
sanitized_Re... | unlicense |
zackw/pelican | pelican/readers.py | 1 | 25554 | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import logging
import os
import re
from collections import OrderedDict
import docutils
import docutils.core
import docutils.io
from docutils.writers.html4css1 import HTMLTranslator, Writer
import six
from six.moves.html_parser import HTM... | agpl-3.0 |
ArthurGarnier/SickRage | lib/pgi/codegen/cffi_backend.py | 19 | 12193 | # Copyright 2012,2013 Christoph Reiter
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
import textwrap
from ... | gpl-3.0 |
kemitchell/npm | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | artistic-2.0 |
feanil/ansible | test/units/module_utils/basic/test_log.py | 38 | 8698 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | gpl-3.0 |
jagguli/intellij-community | python/lib/Lib/csv.py | 87 | 15210 |
"""
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, \
... | apache-2.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/test/test_urllib2net.py | 2 | 12598 | #!/usr/bin/env python
import unittest
from test import test_support
from test.test_urllib2 import sanepathname2url
import socket
import urllib2
import os
import sys
TIMEOUT = 60 # seconds
def _retry_thrice(func, exc, *args, **kwargs):
for i in range(3):
try:
return func(*a... | agpl-3.0 |
ampax/edx-platform-backup | cms/djangoapps/contentstore/management/commands/edit_course_tabs.py | 209 | 4121 | ###
### Script for editing the course's tabs
###
#
# Run it this way:
# ./manage.py cms --settings dev edit_course_tabs --course Stanford/CS99/2013_spring
#
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from .prompt import query_yes_no
from courseware.courses imp... | agpl-3.0 |
tommyip/zulip | zerver/tests/test_camo.py | 4 | 1274 | # -*- coding: utf-8 -*-
from zerver.lib.test_classes import ZulipTestCase
class CamoURLTest(ZulipTestCase):
def test_legacy_camo_url(self) -> None:
# Test with valid hex and url pair
result = self.client_get("/external_content/0f50f0bda30b6e65e9442c83ddb4076c74e75f96/687474703a2f2f7777772e72616e646... | apache-2.0 |
axinging/chromium-crosswalk | tools/perf/page_sets/intl_es_fr_pt-BR.py | 17 | 1656 | # 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class IntlEsFrPtBrPage(page_module.P... | bsd-3-clause |
JamesMGreene/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/postdiffforcommit.py | 147 | 1879 | # 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 th... | bsd-3-clause |
laiyuncong8404/RFAUtils | utils/AppiumServerLib.py | 2 | 3555 | # -*- coding: utf-8 -*-
#author:yanyj
import subprocess,os,time,datetime
import requests
class AppiumServerLib():
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
def __init__(self):
pass
def start_appium_server(self,appium_log_path,appium_log_name,statusUrl,timeout = 20):
"""
start appium server
... | mit |
mozilla/verbatim | vendor/lib/python/translate/convert/test_po2oo.py | 4 | 9955 | #!/usr/bin/env python
import os
import warnings
from py.test import mark
from translate.convert import po2oo
from translate.convert import oo2po
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.storage import po
class TestPO2OO:
def setup_method(self, method):
... | gpl-2.0 |
Wikidata/StrepHit | strephit/commons/date_normalizer.py | 1 | 7746 | from __future__ import absolute_import
import yaml
import re
import os
import logging
logger = logging.getLogger(__name__)
class DateNormalizer(object):
"""
find matches in text strings using regular expressions and transforms them
according to a pattern transformation expression evaluated on the match
... | gpl-3.0 |
be-cloud-be/horizon-addons | server/openerp/report/render/rml2html/rml2html.py | 49 | 14449 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sys
import cStringIO
from lxml import etree
import copy
from openerp.report.render.rml2pdf import utils
class _flowable(object):
def __init__(self, template, doc, localcontext = None):
self._tags = {... | agpl-3.0 |
Zanzibar82/streamondemand.test | servers/alldebrid.py | 20 | 1822 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para AllDebrid
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... | gpl-3.0 |
GitHublong/hue | desktop/core/ext-py/Paste-2.0.1/tests/test_exceptions/test_error_middleware.py | 47 | 3389 | from paste.fixture import *
from paste.exceptions.errormiddleware import ErrorMiddleware
from paste import lint
from paste.util.quoting import strip_html
#
# For some strange reason, these 4 lines cannot be removed or the regression
# test breaks; is it counting the number of lines in the file somehow?
#
def do_reques... | apache-2.0 |
Hasimir/brython | www/src/Lib/posixpath.py | 3 | 13232 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | bsd-3-clause |
fly19890211/edx-platform | pavelib/i18n.py | 29 | 5358 | """
Internationalization tasks
"""
import sys
import subprocess
from path import Path as path
from paver.easy import task, cmdopts, needs, sh
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text # pylint: disable=invalid-name
@task
@needs(
"pavelib.prereqs.i... | agpl-3.0 |
provaleks/o8 | addons/crm_profiling/wizard/__init__.py | 438 | 1080 | # -*- 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... | agpl-3.0 |
divya-csekar/flask-microblog-server | flask/Lib/site-packages/wtforms/ext/appengine/fields.py | 177 | 7574 | from __future__ import unicode_literals
import decimal
import operator
from wtforms import fields, widgets
from wtforms.compat import text_type, string_types
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:par... | bsd-3-clause |
lz1988/django-web | build/lib/django/core/mail/backends/filebased.py | 145 | 2522 | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
from django.utils import six
class EmailBackend(ConsoleEmailBackend)... | apache-2.0 |
40223235/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
adamklawonn/CityCircles | citycircles_iphone/build/iphoneDistribution-iphoneos/CityCircles.app/download_gtiles_and_update_db.py | 15 | 2887 | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.management import setup_environ
from django.db import models, connection
from math import pi, sin, log
import globalmaptiles
import gis2raphael.models
import settings
import urllib
setup_environ(settings)
WIDTH = 320
HEIGHT = 250
#THIS I... | gpl-3.0 |
Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/web/rewrite.py | 83 | 1852 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
from twisted.web import resource
class RewriterResource(resource.Resource):
def __init__(self, orig, *rewriteRules):
resource.Resource.__init__(self)
self.resource = orig
self.rewriteRules = list(rewriteRules)
... | gpl-3.0 |
whip112/Whip112 | vendor/packages/translate/tools/podebug.py | 25 | 13334 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006,2008-2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fou... | mpl-2.0 |
FedericoRessi/networking-odl | networking_odl/ml2/network_topology.py | 1 | 12691 | # Copyright (c) 2015-2016 OpenStack Foundation
# 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
#
# Un... | apache-2.0 |
williamHuang5468/StockServer | venv/lib/python3.5/site-packages/setuptools/msvc.py | 44 | 37034 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64);
Microsoft Windows SDK 7.0 (x86, x64, ia64);
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Visual C++ 10... | mit |
kalxas/geonode | geonode/layers/migrations/0028_auto_20200610_0759.py | 6 | 1314 | # Generated by Django 2.2.13 on 2020-06-10 07:59
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('layers', '0027_auto_20170801_1228_squashed_0033_auto_20180606_1543'),
]
operations = [
migrations.AddField(
... | gpl-3.0 |
Jobava/mirror-pontoon | pontoon/administration/views.py | 3 | 10426 | import base64
import json
import logging
import os
import shutil
import traceback
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.db import transaction
from django.forms.models import inlineformset_factory
from django.http import HttpResponse, HttpResponseRedirect, Http404
... | bsd-3-clause |
wimnat/ansible | lib/ansible/module_utils/distro/_distro.py | 38 | 45100 | # Copyright 2015,2016,2017 Nir Cohen
#
# 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 writi... | gpl-3.0 |
glenn-edgar/local_scda | apps/rabbit_alert_gateway.py | 2 | 6682 | #!/usr/bin/env python
import pika
import json
import base64
import time
import os
import redis
import logging
global connection
class Remote_Interface_server():
def __init__(self, redis_handle ):
self.redis = redis_handle
self.cmds = {}
self.cmds["PING"] = True
se... | mit |
prospwro/odoo | addons/mail/controllers/main.py | 383 | 1733 | import base64
import psycopg2
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import content_disposition
import mimetypes
class MailController(http.Controller):
_cp_path = '/mail'
@http.route('/mail/download_a... | agpl-3.0 |
wooga/airflow | airflow/contrib/sensors/wasb_sensor.py | 5 | 1181 | #
# 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... | apache-2.0 |
scottfisk/django-rest-framework-json-api | example/tests/integration/test_pagination.py | 3 | 1882 | from django.core.urlresolvers import reverse
import pytest
from example.tests.utils import dump_json, redump_json
pytestmark = pytest.mark.django_db
def test_pagination_with_single_entry(single_entry, client):
expected = {
"data": [
{
"type": "posts",
"id": "... | bsd-2-clause |
tedder/ansible | lib/ansible/modules/network/cloudengine/ce_evpn_bd_vni.py | 26 | 39530 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
lpatmo/actionify_the_news | open_connect/middleware/tests/test_handle_ip.py | 2 | 2100 | """Test handle_ip.py middleware"""
# pylint: disable=invalid-name
from django.test import TestCase
from mock import Mock
from open_connect.middleware.handle_ip import SetCorrectIPMiddleware
class TestSetCorrectIPMiddleware(TestCase):
"""Tests for SetCorrectIPMiddleware"""
def setUp(self):
"""Setup th... | mit |
kaushik94/boto | boto/storage_uri.py | 30 | 39005 | # Copyright 2010 Google Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use... | mit |
akretion/l10n-brazil | l10n_br_account_service/models/res_company.py | 4 | 2442 | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
from openerp.addons.l10n_br_account.models.l10n_br_account import (
L10nBrTaxDefinition
)
class ResCompany(models.Model):
_inherit = '... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.