code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# ยฉ Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
import csv
from django.contrib import admin
fro... | andrewebdev/django-adzone | adzone/admin.py | Python | bsd-3-clause | 4,723 |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | LeZhang2016/openthread | tests/toranj/test-603-channel-manager-announce-recovery.py | Python | bsd-3-clause | 4,783 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# TEST_UNICODE_LITERALS
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from ...tests.helper import pytest
from .. import FlagCollection
def test_init():
FlagCollect... | joergdietrich/astropy | astropy/nddata/tests/test_flag_collection.py | Python | bsd-3-clause | 1,629 |
# encoding: utf-8
import re
import logging
from datetime import datetime, timedelta, date
from django.db import models
from django.db.models.query_utils import Q
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.text import Truncator
from django.contrib.contenttypes import generic
from... | OriHoch/Open-Knesset | committees/models.py | Python | bsd-3-clause | 22,034 |
import datetime
import os
from django.conf import settings
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import amo
import amo.tests
from amo.tests import req_factory_factory
from mkt.comm.models import CommunicationNote
from mkt.constants.applications import DEVICE_TYPES
from mkt.dev... | ngokevin/zamboni | mkt/developers/tests/test_views_versions.py | Python | bsd-3-clause | 30,543 |
# -*- encoding: UTF-8 -*-
from __future__ import unicode_literals
from HTMLParser import HTMLParser
from pelican import signals, contents
_MAX_SUMMARY_POS = 45
class FirstParagraphParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.paragraphTag = 'p'
self.data = ''
... | mawenbao/pelican-blog-content | plugins/summary/summary.py | Python | bsd-3-clause | 1,503 |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | Nikea/VisTrails | vistrails/db/versions/v0_9_3/persistence/xml/auto_gen.py | Python | bsd-3-clause | 66,772 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
RANGE = 150
MAX_ITERATIONS_1 = RANGE
MAX_ITERATIONS_2 = RANGE
XRAD = 200
YRAD = 200
mandelbrot1 = vtk.vtkImageMandelbrotSource()
mandelbrot1.SetMaximumNumberOfIterations... | hlzz/dotfiles | graphics/VTK-7.0.0/Imaging/Core/Testing/Python/TestMapToWindowLevelColors.py | Python | bsd-3-clause | 933 |
import funcy as fn
from magnum.mpc import echo_env_mpc
def test_mpc_smoke():
from magnum.examples.feasible_example import feasible_example as g
results = list(fn.take(10, echo_env_mpc(g)))
assert len(results) == 10
| mvcisback/py-blustl | magnum/test_mpc.py | Python | bsd-3-clause | 231 |
from django.conf.urls.defaults import url, patterns
from kaleo.views import invite
urlpatterns = patterns("",
url(r"^invite/$", invite, name="kaleo_invite"),
)
| justhamade/kaleo | kaleo/urls.py | Python | bsd-3-clause | 167 |
# -*- coding: utf-8 -*-
"""Functions for generating a project from a project template."""
from __future__ import unicode_literals
from collections import OrderedDict
import fnmatch
import io
import json
import logging
import os
import shutil
from jinja2 import FileSystemLoader
from cookiecutter.environment import Str... | stevepiercy/cookiecutter | cookiecutter/generate.py | Python | bsd-3-clause | 13,178 |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
def printLegend(rowLabels,colLabels,params):
fig = plt.figure()
col_labels=colLabels
row_labels=rowLabels
table_vals=params
the_table = plt.table(cellText=table_vals,
colWidths = [0.2]*4,
rowLabels=row_labels,
colLabels=col_labels,... | ehudmagal/robotqcapp | Utils/RobotQAUtils/graphics/drawTable.py | Python | bsd-3-clause | 435 |
# License: BSD 3 clause
from .model_hawkes import ModelHawkes
__all__ = ["ModelHawkes"]
| X-DataInitiative/tick | tick/hawkes/model/base/__init__.py | Python | bsd-3-clause | 90 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import wagtail.wagtailcore.models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0026_group_collection_permission'),
('wagtailimages', '0010_change_on_delete_behavio... | gogobook/wagtail | wagtail/wagtailimages/migrations/0011_image_collection.py | Python | bsd-3-clause | 657 |
"""
EGADS transforms algorithms. See EGADS Algorithm Documentation for more info.
"""
__author__ = "mfreer, ohenry"
__date__ = "2017-01-08 11:42"
__version__ = "1.2"
import logging
try:
from interpolation_linear import *
from isotime_to_elements import *
from isotime_to_seconds import *
from seconds_t... | eufarn7sp/egads-eufar | egads/algorithms/transforms/__init__.py | Python | bsd-3-clause | 547 |
# -*- coding: utf-8 -*-
"""
===============================================================================
Generating a stimulus from a video
===============================================================================
*This example shows how to use videos as input stimuli for a retinal implant.*
Loading a video
... | uwescience/pulse2percept | examples/stimuli/plot_video_stim.py | Python | bsd-3-clause | 5,013 |
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.sprite import Sprite
import pyglet
import random
class TestLayer(cocos.layer.Layer):
def _... | adamwiggins/cocos2d | test/test_schedule.py | Python | bsd-3-clause | 1,034 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import pygame
from pygame.locals import *
import util
class Tile:
def __init__(self, color, image = None):
self.color = color
self.image = image
class Shape(object):
SHAPE_WIDTH = 4
SHAPE_HEIGHT = 4
SHAPES = (
... | kwailamchan/programming-languages | python/pygame/tetris/lib/shape.py | Python | mit | 8,684 |
#!/usr/bin/env python
# Jenkins server UDP based discovery
# Based on original work by Gordon McGregor gordon.mcgregor@verilab.com
#
# Author Aske Olsson aske.olsson@switch-gears.dk
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.inter... | knupouls/extremefeedbacklamp | jenkins_discovery.py | Python | mit | 1,818 |
# Copyright 2009-2011 by Max Bane
#
# 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 later version.
#
# This program is distributed in ... | daskol/ml-cipher-cracker | sgt.py | Python | mit | 7,861 |
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, absolute_import, division)
import os as os_module
import xbmc
from lib.constants import *
userdatafolder = os_module.path.join(xbmc.translatePath("special://profile").decode("utf-8"), "addon_data", addonid, "test data")
libpath... | eirki/script.service.koalahbonordic | tests/mock_constants.py | Python | mit | 370 |
import sys
import numpy as np
import scipy.optimize as opt
class Symbol(object):
"""
A class representing a single unit in the boolean SAT problem. This can either refer to an atomic boolean, or a
constraint based on integer variables
"""
pass
class Boolean(Symbol):
def __init__(self, name):
... | JWageM/planet-wars | bots/smt/kb.py | Python | mit | 19,880 |
#!/usr/bin/env python
import sys, time, string
# -----------------------------------------------------------
# write message to log file and shell
def log(file,message,verbose):
if (verbose):
# print to shell
print (message)
# print to log file
if (file):
output = open(file,'a')
output.write(mes... | barentsen/dave | extractDetrend/K2photo/kepmsg.py | Python | mit | 1,999 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_consumergroup_test.py | Python | mit | 3,921 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Media(models.Model):
code = models.CharField(_(u'Code'), max_length=128, null=False,
blank=False, primary_key=True)
name = models.CharField(_('Name'), max_length=128, null=True,
blank=True)
class Me... | jonashaag/django-autocomplete-light | test_project/charfield_pk_autocomplete/models.py | Python | mit | 590 |
#!/usr/bin/env python
__author__ = 'waroquiers'
import unittest
import os
import json
import numpy as np
import shutil
from monty.tempfile import ScratchDir
from pymatgen.util.testing import PymatgenTest
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import StructureEnvironments
fr... | dongsenfo/pymatgen | pymatgen/analysis/chemenv/coordination_environments/tests/test_structure_environments.py | Python | mit | 12,696 |
from __future__ import absolute_import, print_function, division
import operator
from collections import OrderedDict
from itertools import islice
from petl.compat import izip_longest, text_type, next
from petl.util.base import asindices, Table
def listoflists(tbl):
return [list(row) for row in tbl]
Table.li... | psnj/petl | petl/util/materialise.py | Python | mit | 3,854 |
# https://www.hackerrank.com/challenges/sherlock-and-anagrams
def nCr(n, r):
# To cancel the (n-r)! part of (n)! with the highest
# value possible. (n)! / (n-r)! == (n)*(n-1)*(...)*(n-r+1)
r = min(r, n-r)
# nC1 or nCn is 1.
if r == 0: return 1
# nCr is...
# (n)! / ((n-r)! * r!)
# ((n)! ... | Zubieta/CPP | HackerRank/Algorithms/04_Strings/20_Sherlock_And_Anagrams.py | Python | mit | 1,211 |
#!/usr/bin/python
# coding=utf-8
import datetime
import mock
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from test import run_only
from mock import Mock
from diamond.collector import Collector
from elb import ElbCollector
def run_only_if... | MichaelDoyle/Diamond | src/collectors/elb/test/testelb.py | Python | mit | 8,325 |
import logging
import os
import urllib2
import json
import time
import datetime
from base_controller import CacheableHandler, LoggedInHandler
from consts.client_type import ClientType
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
from google.a... | verycumbersome/the-blue-alliance | controllers/ajax_controller.py | Python | mit | 11,365 |
from flask import Flask, request
import logging
logging.basicConfig(level=logging.INFO)
app = Flask(__name__)
@app.route("/MessageStatus", methods=['POST'])
def incoming_sms():
message_sid = request.values.get('MessageSid', None)
message_status = request.values.get('MessageStatus', None)
logging.info('S... | TwilioDevEd/api-snippets | rest/messages/sms-handle-callback/sms-handle-callback.7.x.py | Python | mit | 452 |
#####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyรถstilรค ... | fofix/fofix | fofix/core/View.py | Python | gpl-2.0 | 10,496 |
# XBMC modules
import xbmc
import xbmcaddon
import xbmcgui
# STANDARD library modules
import os
import random
import requests
import subprocess
import sys
import threading
import traceback
import xml.etree.ElementTree as ET
sys.path.append(xbmc.translatePath(os.path.join(xbmcaddon.Addon().getAddonInfo('path'), 'res... | diraimondo/osmc | package/mediacenter-addon-osmc/src/service.osmc.settings/resources/lib/osmc_walkthru.py | Python | gpl-2.0 | 25,696 |
#!/usr/bin/env python
'''
Copyright (C) 2013, Digium, Inc.
Matt Jordan <mjordan@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import sys
import logging
sys.path.append("lib/python")
from version import AsteriskVersion
LOGGER = logging.getLogg... | auntieNeo/asterisk-testsuite | tests/bridge/atxfer_nominal/transfer.py | Python | gpl-2.0 | 4,667 |
# Copyright (C) 2017 Red Hat, Inc. Jake Hunsaker <jhunsake@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU Gener... | slashdd/sos | sos/report/plugins/docker_distribution.py | Python | gpl-2.0 | 1,334 |
"""Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
__revision__ = "$Id$"
import string, re
# Do the right thing with boolean values for all known Python versions
# (so this module can be copied... | playingaround2017/test123 | gamera/backport/textwrap.py | Python | gpl-2.0 | 13,844 |
"""
Config.py is a repository of the Cobbler object model
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of th... | remotesyssupport/cobbler-1 | cobbler/config.py | Python | gpl-2.0 | 8,992 |
#
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | alikins/subscription-manager | src/subscription_manager/identitycertlib.py | Python | gpl-2.0 | 3,028 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | MSusik/invenio | invenio/ext/template/extensions.py | Python | gpl-2.0 | 1,614 |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2012 He Jian <hejian.he@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2,... | ruud-v-a/rhythmbox | plugins/lyrics/JlyricParser.py | Python | gpl-2.0 | 2,517 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | Passtechsoft/TPEAlpGen | blender/release/scripts/addons_contrib/ewoc_projects_tools/mesh_selproject.py | Python | gpl-3.0 | 12,081 |
# coding=UTF-8
# URL: https://github.com/SickRage/SickRage
#
# This file is part of SickRage.
#
# SickRage 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)... | jackkiej/SickRage | tests/notifier_tests.py | Python | gpl-3.0 | 10,384 |
# -*- coding: utf-8 -*-
#
from .base import *
from .logging import *
from .libs import *
from .auth import *
from .custom import *
from ._xpack import *
| jumpserver/jumpserver | apps/jumpserver/settings/__init__.py | Python | gpl-3.0 | 153 |
# Copyright (C) 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 your opt... | hcs/mailman | src/mailman/rest/templates.py | Python | gpl-3.0 | 2,043 |
# 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... | Vagab0nd/SiCKRAGE | lib3/bencode/__init__.py | Python | gpl-3.0 | 1,155 |
#! /usr/bin/env python
# encoding: utf-8
"""
Force the execution output to be synchronized
May deadlock with a lot of output (subprocess limitation)
"""
import sys
from waflib.Build import BuildContext
from waflib import Utils, Logs
def exec_command(self, cmd, **kw):
subprocess = Utils.subprocess
kw['shell'] = isi... | Gnomescroll/Gnomescroll | server/waflib/extras/sync_exec.py | Python | gpl-3.0 | 777 |
from octopus.plugins.plugin import OctopusPlugin
class VSA(OctopusPlugin):
def __init__(self, executor):
super().__init__(executor)
self._pluginname = 'vsa.jar'
self._classname = 'bjoern.plugins.vsa.VSAPlugin'
def __setattr__(self, key, value):
if key == "project":
... | octopus-platform/bjoern | python/bjoern-tools/bjoern/plugins/vsa.py | Python | gpl-3.0 | 414 |
# sort
def sort(layout, option):
# separate
layout.separator()
# row
row = layout.row(align=True)
# sub
sub = row.row(align=True)
# scale x
sub.scale_x = 0.2
# sort
sub.prop(option, 'sort', toggle=True)
# sub sub
subsub = sub.row(align=True)
# active
subsub.ac... | proxeIO/name-panel | addon/interface/operator/shared.py | Python | gpl-3.0 | 1,967 |
# (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... | aperigault/ansible | test/units/executor/test_task_executor.py | Python | gpl-3.0 | 18,912 |
"""Unit tests for the ``usergroups`` paths.
Each ``APITestCase`` subclass tests a single URL. A full list of URLs to be
tested can be found here:
http://theforeman.org/api/1.11/apidoc/v2/usergroups.html
:Requirement: Usergroup
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: Functi... | elyezer/robottelo | tests/foreman/api/test_usergroup.py | Python | gpl-3.0 | 10,650 |
"""
The Signal class and its specilized subclasses:
BaseSignal
For generic data with arbitrary signal_dimension. All other signal
classes inherit from this one. It should only be used with none of
the others is appropriated.
Signal1D
For generic data with signal_dimension equal ... | magnunor/hyperspy | hyperspy/signals.py | Python | gpl-3.0 | 2,490 |
'''manipulate ndarray list'''
from itertools import imap,starmap,izip
from operator import mul,add,sub
def check_list(v1,v2):
'''check if the length of two list is same'''
if v1.size != v2.size:
raise ValueError,"the lenght of both arrays must be the same"
pa... | dnanexus/rseqc | rseqc/lib/qcmodule/twoList.py | Python | gpl-3.0 | 2,098 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | elfnor/sverchok | nodes/modifier_make/polygons_adaptative.py | Python | gpl-3.0 | 5,472 |
# -*- coding: utf-8 -*-
# Demandlib
import logging
import oemof.solph as solph
import reegis_hp.berlin_hp.electricity as electricity
import pandas as pd
import demandlib.bdew as bdew
import demandlib.particular_profiles as pprofiles
import reegis_hp.berlin_hp.prepare_data as prepare_data
def heating_systems(esyst... | oemof/reegis-hp | reegis_hp/berlin_hp/create_objects.py | Python | gpl-3.0 | 4,813 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
orm.MonitorItem.objects.filter(pk='users_reported').delete()
def backwards(self, orm):
raise RuntimeError("C... | tanglu-org/tgl-misago | misago/migrations/0015_remove_users_reported.py | Python | gpl-3.0 | 33,856 |
# This file is part of gnome-tweak-tool.
#
# Copyright (c) 2011 John Stowers
#
# gnome-tweak-tool 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 late... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/gtweak/__init__.py | Python | gpl-3.0 | 742 |
###############################################################################
# Name: vbscript.py #
# Purpose: Define VBScript syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | 163gal/Time-Line | libs/wx/tools/Editra/src/syntax/_vbscript.py | Python | gpl-3.0 | 3,982 |
# Copyright 2014-2018 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""A simple example to get started with SPDH... | kohr-h/odl | odl/contrib/solvers/spdhg/examples/get_started.py | Python | mpl-2.0 | 2,277 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2014 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This progra... | Vauxoo/account-payment | account_vat_on_payment/account_journal.py | Python | agpl-3.0 | 1,470 |
# -*- 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... | odoousers2014/odoo | addons/account/account.py | Python | agpl-3.0 | 190,066 |
# -*- 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
import super... | marwoodandrew/superdesk-aap | server/aap/data_consistency/compare_repositories.py | Python | agpl-3.0 | 9,289 |
# -*- coding: utf-8 -*-
import re
import urllib.parse
from ..base.simple_downloader import SimpleDownloader
def decode_cloudflare_email(value):
email = ""
key = int(value[:2], 16)
for i in range(2, len(value), 2):
email += chr(int(value[i : i + 2], 16) ^ key)
return email
class UpleaCom(... | vuolter/pyload | src/pyload/plugins/downloaders/UpleaCom.py | Python | agpl-3.0 | 2,715 |
# -*- coding: utf-8 -*-
from pprint import pprint
from genshi.filters import Transformer
from genshi.builder import tag
from trac.core import *
from trac.util.html import html
from trac.web import IRequestHandler, HTTPInternalError
from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet... | bountyfunding/bountyfunding | plugin/trac/bountyfunding/trac/bountyfunding.py | Python | agpl-3.0 | 27,871 |
#####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | NinjaMSP/crossbar | crossbar/adapter/mqtt/_events.py | Python | agpl-3.0 | 21,416 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | emgirardin/compassion-modules | partner_communication/models/email.py | Python | agpl-3.0 | 908 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Nicstat(MakefilePackage, SourceforgePackage):
"""
Nicstat is a Solaris and Linux comma... | iulian787/spack | var/spack/repos/builtin/packages/nicstat/package.py | Python | lgpl-2.1 | 962 |
from triton import *
import smt2lib
#
# This example breaks a simple hash routine.
#
# Check the ./samples/crackmes/crackme_hash.c file. This file builds
# a 'hash' and checks the checksum 0xad6d.
#
# The needed password is 'elite'. Example:
# $ ./samples/crackmes/crackme_hash elite
# Win
#
# This Triton code will ... | code4bones/Triton | examples/crackme_hash_collision.py | Python | lgpl-3.0 | 5,246 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016, 2017, 2018 Guenter Bartsch
#
# 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... | gooofy/voxforge | zamiaai/skills/sports/__init__.py | Python | lgpl-3.0 | 735 |
'''
Jan Camenisch, Markulf Kohlweiss, Alfredo Rial, and Caroline Sheedy (Pairing-based)
| From: "Blind and Anonymous Identity-Based Encryption and
Authorised Private Searches on Public Key Encrypted Data".
| Published in: PKC 2009
| Available from: http://www.iacr.org/archive/pkc2009/54430202/54430202.pdf
| Notes: s... | lferr/charm | charm/schemes/ibenc/ibenc_ckrs09.py | Python | lgpl-3.0 | 4,080 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ZOCP documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 5 17:56:43 2015.
#
# 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
# autog... | z25/pyZOCP | docs/conf.py | Python | lgpl-3.0 | 8,197 |
"""KBEWebConsole URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | aabbox/kbengine | kbe/tools/server/webconsole/WebConsole/urls.py | Python | lgpl-3.0 | 4,443 |
def glTypesNice(types):
"""Make types into English words"""
return types.replace('_',' ').title()
def getLatLong(latitude, longitude):
"""returns the combination of latitude and longitude as required for ElasticSearch"""
return latitude+", "+longitude | rajagopal067/testrepo | karma/python/google.py | Python | apache-2.0 | 258 |
# coding: utf-8
from .default import Config
class ProductionConfig(Config):
# Site domain
SITE_DOMAIN = "http://www.twtf.com"
# Db config
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://dbuser:dbpass@localhost/databasename"
# Sentry
SENTRY_DSN = ''
| SCUT16K/SmsSender | server/config/production_sample.py | Python | apache-2.0 | 272 |
# Copyright 2014 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
#
# Unless requ... | Mirantis/tempest | tempest/services/database/json/versions_client.py | Python | apache-2.0 | 1,231 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 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
#
# Unless required... | takeshineshiro/nova | nova/tests/functional/v3/test_keypairs.py | Python | apache-2.0 | 9,503 |
# Copyright (c) 2015 Red Hat, 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 require... | bswartz/manila | manila/tests/share/drivers/glusterfs/test_layout.py | Python | apache-2.0 | 12,949 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy.py | Python | apache-2.0 | 13,731 |
import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
from http.server import SimpleHTTPRequestHandler
import socketserver
import docker
from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrationTest, TEST_... | docker/docker-py | tests/integration/api_image_test.py | Python | apache-2.0 | 12,869 |
# 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... | jwlawson/tensorflow | tensorflow/contrib/py2tf/pyct/parser.py | Python | apache-2.0 | 1,152 |
# 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... | kamcpp/tensorflow | tensorflow/python/lib/io/file_io.py | Python | apache-2.0 | 13,774 |
#
# 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... | chenc10/Spark-PAF | examples/src/main/python/mllib/gradient_boosting_regression_example.py | Python | apache-2.0 | 2,443 |
"""Ensures that account.identifier is unique.
Revision ID: ea2739ecd874
Revises: 5bd631a1b748
Create Date: 2017-09-29 09:16:09.436339
"""
# revision identifiers, used by Alembic.
revision = 'ea2739ecd874'
down_revision = '5bd631a1b748'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### comman... | stackArmor/security_monkey | migrations/versions/ea2739ecd874_.py | Python | apache-2.0 | 646 |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
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 later version.
Th... | mrknow/filmkodi | script.mrknow.urlresolver/lib/urlresolver9/lib/net.py | Python | apache-2.0 | 12,168 |
metadata = {
"sample_name": "",
"group_name": "",
"file_names": "",
"sequencing_platform": "",
"sequencing_type": "",
"pre_assembled": "",
"sample_type": "",
"organism": "",
"strain": "",
"subtype": {},
"country": "",
"region": "",
"city": "",
"zip_code": "",
... | josl/ASM_challenge | isolates/template.py | Python | apache-2.0 | 1,025 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... | lukecwik/incubator-beam | sdks/python/apache_beam/examples/dataframe/wordcount_test.py | Python | apache-2.0 | 2,150 |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.1.4'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 2.
'''
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import gzip, time, json, hmac, base64, has... | YuepengGuo/sina_weibo_crawler | crawler/toolkit/weibo.py | Python | apache-2.0 | 11,860 |
# Copyright 2016-2017 Capital One Services, 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 ... | FireballDWF/cloud-custodian | c7n/resources/ecr.py | Python | apache-2.0 | 11,773 |
from collections import OrderedDict
from django.contrib import admin
from django.core.exceptions import PermissionDenied
class SetOfEverything(list):
def __contains__(self, other):
return True
## adopted from http://mike.hostetlerhome.com/blog/2012/11/13/add-a-read-only-role-to-django-admin/
class Read... | laurenbarker/SHARE | share/readonlyadmin.py | Python | apache-2.0 | 1,404 |
# -*- coding: UTF-8 -*-
from django.core.cache import cache
from django.db.models.signals import post_delete, post_save
import functools
import hashlib
WEEK = 7 * 24 * 60 * 60 # 1 week
def cache_me(key=None, ikey=None, signals=(), models=(), timeout=WEEK):
def hashme(k):
if isinstance(k, unicode):
... | matrixise/epcon | microblog/dataaccess.py | Python | bsd-2-clause | 5,734 |
from .tester import Tester, MPITest, MPIWorld, nompi, MPITestFixture
| rainwoodman/mpi4py_test | runtests/mpi/__init__.py | Python | bsd-2-clause | 69 |
import unittest
from pyramid.compat import PY3
class Test_InstancePropertyMixin(unittest.TestCase):
def _makeOne(self):
cls = self._getTargetClass()
class Foo(cls):
pass
return Foo()
def _getTargetClass(self):
from pyramid.util import InstancePropertyMixin
r... | danielpronych/pyramid-doxygen | pyramid/tests/test_util.py | Python | bsd-2-clause | 21,474 |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... | bthirion/nipy | nipy/fixes/nibabel/orientations.py | Python | bsd-3-clause | 3,877 |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | mbox/django | django/db/backends/mysql/base.py | Python | bsd-3-clause | 23,435 |
# Copyright 2015 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 __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
import unittest
import mock
import... | catapult-project/catapult | dashboard/dashboard/edit_anomalies_test.py | Python | bsd-3-clause | 6,510 |
from __future__ import unicode_literals
import ast
import os.path
import dj_database_url
import dj_email_url
from django.contrib.messages import constants as messages
import django_cache_url
DEBUG = ast.literal_eval(os.environ.get('DEBUG', 'True'))
SITE_ID = 1
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.... | itbabu/saleor | saleor/settings.py | Python | bsd-3-clause | 12,155 |
# -*- coding: utf-8 -*-
import json
import os
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.forms import ValidationError
from mock import patch
from nose.tools import eq_, ok_
from lib.crypto.packaged import SigningError
from mkt.files.helpers import co... | clouserw/zamboni | mkt/langpacks/tests/test_models.py | Python | bsd-3-clause | 13,411 |
"""Solvers of systems of polynomial equations. """
from sympy.polys import Poly, groebner, roots
from sympy.polys.polytools import parallel_poly_from_expr
from sympy.polys.polyerrors import (ComputationFailed,
PolificationFailed, CoercionFailed)
from sympy.utilities import postfixes
from sympy.simplify import rcol... | flacjacket/sympy | sympy/solvers/polysys.py | Python | bsd-3-clause | 9,192 |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.translation import ugettext as _
from filer.admin.fileadmin import FileAdmin
from filer.models import Image
class ImageAdminForm(forms.ModelForm):
subject_location = forms.Ch... | mkoistinen/django-filer | filer/admin/imageadmin.py | Python | bsd-3-clause | 1,629 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import subprocess
import sys
import tarfile
import tempfile
import test_server
import unittest
import zipfile
... | zcbenz/cefode-chromium | native_client_sdk/src/build_tools/tests/sdktools_test.py | Python | bsd-3-clause | 8,659 |
from dipy.align.transforms import regtransforms, Transform
import numpy as np
from numpy.testing import (assert_array_equal,
assert_array_almost_equal,
assert_almost_equal,
assert_equal,
assert_raises)
def test... | FrancoisRheaultUS/dipy | dipy/align/tests/test_transforms.py | Python | bsd-3-clause | 8,834 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.