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 |
|---|---|---|---|---|---|
chrishas35/django-travis-ci | django/contrib/databrowse/plugins/calendars.py | 86 | 5742 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
from django.utils.encoding import force_unicode
from dja... | bsd-3-clause |
Elnya/aosproject | 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 |
ruba9/HotelChatbot | my_env/lib/python3.6/site-packages/wheel/signatures/__init__.py | 565 | 3779 | """
Create and verify jws-js format Ed25519 signatures.
"""
__all__ = [ 'sign', 'verify' ]
import json
from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary
ed25519ll = None
ALG = "Ed25519"
def get_ed25519ll():
"""Lazy import-and-test of ed25519 module"""
global ed25519ll
if not ... | mit |
joariasl/odoo | addons/crm/crm_segmentation.py | 333 | 9067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
richardxia/asp-multilevel-debug | tests/codegen_test.py | 3 | 2288 | import unittest2 as unittest
from asp.codegen.ast_tools import *
class ReplacerTests(unittest.TestCase):
def test_num(self):
a = ast.BinOp(ast.Num(4), ast.Add(), ast.Num(9))
result = ASTNodeReplacer(ast.Num(4), ast.Num(5)).visit(a)
self.assertEqual(a.left.n, 5)
def test_Name(self):
a = ast.BinOp(ast.Num(4)... | bsd-3-clause |
jantman/awslimitchecker | awslimitchecker/tests/test_utils.py | 1 | 19953 | """
awslimitchecker/tests/test_utils.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
##############################################################################
Copyright 2015-2018 Jason Antman <jason@jasonantman.com>
This file is part of awslimitchecker, al... | agpl-3.0 |
glaubitz/fs-uae-debian | arcade/OpenGL/raw/GLX/EXT/import_context.py | 8 | 1202 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
import ctype... | gpl-2.0 |
onebit0fme/conveyance-tornado | examples.py | 1 | 4899 |
PAYLOAD_GET_EXAMPLE = {
"compose": {
"body": {
"type": "object",
"value": {
"response_code": {
"type": "integer",
"value": "@question.$resp.$$status_code",
},
"answer_ids": {
... | gpl-2.0 |
nipunbatra/bayespy | bayespy/inference/vmp/nodes/dot.py | 2 | 18959 | ######################################################################
# Copyright (C) 2011-2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
###############... | gpl-3.0 |
dkerwin/ansible-modules-core | web_infrastructure/apache2_module.py | 35 | 3232 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013-2014, Christian Berendt <berendt@b1-systems.de>
#
# This module 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 o... | gpl-3.0 |
sestrella/ansible | lib/ansible/module_utils/facts/compat.py | 147 | 4115 | # 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 |
clairetang6/bokeh | examples/plotting/file/unemployment.py | 2 | 1774 | from math import pi
from bokeh.models import HoverTool
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.sampledata.unemployment1948 import data
data['Year'] = [str(x) for x in data['Year']]
years = list(data['Year'])
months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oc... | bsd-3-clause |
vijayanandnandam/youtube-dl | youtube_dl/extractor/playfm.py | 207 | 2599 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
)
class PlayFMIE(InfoExtractor):
IE_NAME = 'play.fm'
_VALID_URL = r'https?://(?:www\.)?play\.fm/(?... | unlicense |
RomainBrault/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
EmreAtes/spack | var/spack/repos/builtin/packages/r-shortread/package.py | 3 | 2764 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
WhileLoop/ansible-modules-extras | network/ipify_facts.py | 9 | 3185 | #!/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 |
aboutsajjad/Bridge | app_packages/youtube_dl/extractor/pinkbike.py | 62 | 3446 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
remove_end,
remove_start,
str_to_int,
unified_strdate,
)
class PinkbikeIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkb... | mit |
rajashreer7/autotest-client-tests | linux-tools/harfbuzz/harfbuzz.py | 4 | 1246 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class harfbuzz(test.test):
"""
Autotest module for testing basic functionality
of harfbuzz
@author Ramesh YR, rameshyr@linux.vnet.ibm.com ##
"""
... | gpl-2.0 |
lodemo/CATANA | src/face_recognition/youtube_dl/extractor/daum.py | 52 | 11802 | # coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_unquote,
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
int_or_none,
str_to_int,
xpath_... | mit |
brettc/bricolage | tests/test_core.py | 1 | 6385 | import bricolage.core as T
import cPickle as pickle
import pathlib
import numpy
def make_target1(a, b, c):
f1 = 0.5 if a and b or not c else 1.0
f2 = 1 if ((a or c) and not (a and b)) and b else 0
return f1, f2
def make_target2(a, b, c):
f1 = 0.25 if (a or b) and (not a and not c) else 1.0
f2 = ... | gpl-3.0 |
DavidLP/home-assistant | homeassistant/components/fibaro/climate.py | 6 | 10044 | """Support for Fibaro thermostats."""
import logging
from homeassistant.components.climate.const import (
STATE_AUTO, STATE_COOL, STATE_DRY,
STATE_ECO, STATE_FAN_ONLY, STATE_HEAT,
STATE_MANUAL, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_OPERATION_MODE, SUPPORT_FAN_MODE)
from homeassistant.components.climate ... | apache-2.0 |
NicholasPace/android_kernel_motorola_msm8226 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
dharmabumstead/ansible | contrib/inventory/infoblox.py | 110 | 3600 | #!/usr/bin/env python
#
# (c) 2018, 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 v... | gpl-3.0 |
pratapvardhan/pandas | pandas/tests/io/json/test_normalize.py | 6 | 16358 | import pytest
import numpy as np
import json
import pandas.util.testing as tm
from pandas import compat, Index, DataFrame
from pandas.io.json import json_normalize
from pandas.io.json.normalize import nested_to_record
@pytest.fixture
def deep_nested():
# deeply nested data
return [{'country': 'USA',
... | bsd-3-clause |
sitexa/foobnix | test/test_vk_service.py | 3 | 1820 | #-*- coding: utf-8 -*-
'''
Created on 21 нояб. 2010
@author: ivan
'''
import unittest
from foobnix.gui.service.vk_service import VKService
from foobnix.util.url_utils import get_url_type
class TestVKService(unittest.TestCase):
vk_service = VKService(True)
def test_login(self):
self.assertTrue(sel... | gpl-3.0 |
Antiun/odoo | addons/account/project/report/quantity_cost_ledger.py | 358 | 6204 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
HerlanAssis/Django-AulaOsvandoSantana | lib/python2.7/site-packages/pip/wheel.py | 145 | 20120 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import with_statement
import compileall
import csv
import functools
import hashlib
import os
import re
import shutil
import sys
from base64 import urlsafe_b64encode
from email.parser import Parser
from pip.backwardcompat i... | mit |
open-falcon/portal | web/model/template.py | 6 | 3335 | # -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
from .bean import Bean
from frame.config import MAINTAINERS
from frame.api import uic
from .strategy import Strategy
from .action import Action
class Template(Bean):
_tbl = 'tpl'
_cols = 'id, tpl_name, parent_id, action_id, create_user'
def __init__(self, _... | apache-2.0 |
40223119/w17test | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/locals.py | 603 | 1141 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License... | gpl-3.0 |
mbedmicro/pyOCD | pyocd/probe/pydapaccess/interface/interface.py | 3 | 1719 | # pyOCD debugger
# Copyright (c) 2006-2013,2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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 |
DOAJ/doaj | portality/forms/application_processors.py | 1 | 46290 | import uuid
from datetime import datetime
import portality.notifications.application_emails as emails
from portality.core import app
from portality import models, constants, app_email
from portality.lib.formulaic import FormProcessor
from portality.ui.messages import Messages
from portality.crosswalks.application_form... | apache-2.0 |
jenmud/behave-graph | behave_graph/__init__.py | 1 | 2422 | """
Setup the environment by parsing the command line options and staring
a ruruki http server.
"""
import argparse
import logging
import os
from behave.configuration import Configuration
from behave.runner import Runner, parse_features
from ruruki_eye.server import run
from behave_graph.scrape import GRAPH
from behave... | mit |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/db/models/aggregates.py | 26 | 5554 | """
Classes to represent the definitions of aggregate functions.
"""
from django.core.exceptions import FieldError
from django.db.models.expressions import Func, Star
from django.db.models.fields import FloatField, IntegerField
__all__ = [
'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance',
]
... | apache-2.0 |
brainix/social-butterfly | channels.py | 1 | 6608 | #-----------------------------------------------------------------------------#
# channels.py #
# #
# Copyright (c) 2010-2012, Code A La Mode, original authors. #
... | gpl-3.0 |
frankyrumple/ope | libs/gluon/packages/dal/pydal/adapters/ingres.py | 23 | 6571 | # -*- coding: utf-8 -*-
from .._globals import IDENTITY
from ..drivers import pyodbc
from .base import BaseAdapter
# NOTE invalid database object name (ANSI-SQL wants
# this form of name to be a delimited identifier)
INGRES_SEQNAME='ii***lineitemsequence'
class IngresAdapter(BaseAdapter):
drivers = ('pyodb... | mit |
supertylerc/trigger | trigger/utils/xmltodict.py | 13 | 9350 | #!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: # pragma no cover
from cStringIO import StringIO
except ImportError: # pragma no cover
try:
from S... | bsd-3-clause |
Jumpscale/core9 | JumpScale9/tools/develop/CodeDirs.py | 1 | 5548 | from js9 import j
JSBASE = j.application.jsbase_get_class()
class CodeDirs(JSBASE):
def __init__(self):
JSBASE.__init__(self)
self.path = j.dirs.CODEDIR
self.load()
def load(self):
data = j.core.state.stateGetFromDict("develop", "codedirs", "")
self.tree = j.data.tre... | apache-2.0 |
Fusion-Rom/android_external_chromium_org | native_client_sdk/src/tools/lib/quote.py | 106 | 2116 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
def quote(input_str, specials, escape='\\'):
"""Returns a quoted version of |str|, where every character in the
iterable... | bsd-3-clause |
PLXDev/PLX | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
marioaugustorama/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_promote.py | 61 | 1130 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity
class PromoteParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}">
<promote>
<part... | gpl-3.0 |
pchauncey/ansible | lib/ansible/module_utils/ovirt.py | 16 | 25727 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | gpl-3.0 |
sogelink/ansible | lib/ansible/utils/module_docs_fragments/nxos.py | 87 | 4041 | #
# (c) 2015, Peter Sprygada <psprygada@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 late... | gpl-3.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 102 | 14122 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mit |
naturali/tensorflow | tensorflow/python/summary/impl/event_file_loader_test.py | 18 | 3171 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
RO-ny9/python-for-android | python-modules/twisted/twisted/protocols/dict.py | 61 | 10737 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Dict client protocol implementation.
@author: Pavel Pergamenshchik
"""
from twisted.protocols import basic
from twisted.internet import defer, protocol
from twisted.python import log
from StringIO import StringIO
def parseParam(l... | apache-2.0 |
ChromiumWebApps/chromium | build/android/pylib/cmd_helper.py | 26 | 3711 | # 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.
"""A wrapper for subprocess to make calling shell commands easier."""
import logging
import pipes
import signal
import subprocess
import tempfile
from ... | bsd-3-clause |
eykd/fuzzy-octo-bear | tests/test_map_loader.py | 1 | 1227 | from unittest import TestCase
from ensure import ensure
from path import path
from fuzzy.map import load_game_map
from fuzzy.rooms import Room
from fuzzy.exits import Exit
PATH = path(__file__).abspath().dirname()
class MapLoaderTests(TestCase):
def setUp(self):
self.filename = PATH / 'rooms.yaml'
... | gpl-2.0 |
M0nica/python-foundations-hw | 04/04-homework_graded.py | 1 | 46139 | ########
#Graded = 25/25
# Homework 3
#
# MAKE SURE YOU ARE RUNNING THIS WITH PYTHON 3!
# Python 2 will give a "Non-ASCII character" error
#
# Either use workon/mkvirtualenv to create an
# environment or use the python3 command
#
########
########
#
# Here is a programmer!
#
########
programmer = {
'name': 'Christi... | mit |
huaweiswitch/neutron | neutron/tests/unit/mlnx/test_defaults.py | 25 | 1508 | # 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
cg31/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/series_test.py | 29 | 2390 | # 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 |
blerer/cassandra-dtest | token_generator_test.py | 4 | 6631 | import os
import subprocess
import time
import pytest
import parse
import logging
from cassandra.util import sortedset
from ccmlib import common
from dtest import Tester
from tools.data import rows_to_list
since = pytest.mark.since
logger = logging.getLogger(__name__)
@since('2.2', max_version='3.0.0')
class TestT... | apache-2.0 |
malmiron/incubator-airflow | tests/www_rbac/api/experimental/test_dag_runs_endpoint.py | 14 | 4885 | # -*- 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
#... | apache-2.0 |
bdestombe/flopy-1 | flopy/modpath/mpbas.py | 3 | 5551 | """
mpbas module. Contains the ModpathBas class. Note that the user can access
the ModpathBas class as `flopy.modflow.ModpathBas`.
Additional information for this MODFLOW/MODPATH package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?bas6.htm>`_.
""... | bsd-3-clause |
mwmuni/LIGGGHTS_GUI | networkx/generators/geometric.py | 30 | 11734 | # -*- coding: utf-8 -*-
"""
Generators for geometric graphs.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
... | gpl-3.0 |
sgraham/nope | v8/build/detect_v8_host_arch.py | 53 | 2703 | #!/usr/bin/env python
# Copyright 2014 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice... | bsd-3-clause |
wagtail/wagtail | wagtail/contrib/redirects/base_formats.py | 7 | 6511 | """
Copyright (c) Bojan Mihelac and individual contributors.
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 notice,
this lis... | bsd-3-clause |
njwilson23/scipy | scipy/linalg/tests/test_solve_toeplitz.py | 94 | 3975 | """Test functions for linalg._solve_toeplitz module
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg._solve_toeplitz import levinson
from scipy.linalg import solve, toeplitz, solve_toeplitz
from numpy.testing import (run_module_suite, assert_equal, assert_allclos... | bsd-3-clause |
adamsd5/yavalath | memorycontrol.py | 1 | 4959 | """This holds a routine for restricting the current process memory on Windows."""
import multiprocessing
import ctypes
def set_memory_limit(memory_limit):
"""Creates a new unnamed job object and assigns the current process to it.
The job object will have the given memory limit in bytes: the given process
... | mit |
ryuunosukeyoshi/PartnerPoi-Bot | lib/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... | gpl-3.0 |
xiaolonginfo/decode-Django | Django-1.5.1/django/contrib/gis/tests/geoapp/models.py | 112 | 1877 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
from django.utils.encoding import python_2_unicode_compatible
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
@python_2_unicode_compatible
class Country(models.Model):
name = models.Ch... | gpl-2.0 |
nichdu/duplicity-onedrive | duplicity/commandline.py | 2 | 45676 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
redhat-openstack/django | django/contrib/gis/maps/google/gmap.py | 174 | 9102 | from django.conf import settings
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.six.moves import xrange
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
class GoogleMapExcepti... | bsd-3-clause |
espadrine/opera | chromium/src/third_party/python_26/Lib/types.py | 65 | 2323 | """Define names for all type symbols known in the standard interpreter.
Types that are part of optional modules (e.g. array) are not listed.
"""
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... | bsd-3-clause |
AnimationInVR/avango | avango-python/src/tests/TestFieldContainer.py | 6 | 5337 | # -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | lgpl-3.0 |
safwanrahman/mozillians | vendor-local/lib/python/unidecode/x05b.py | 252 | 4668 | data = (
'Gui ', # 0x00
'Deng ', # 0x01
'Zhi ', # 0x02
'Xu ', # 0x03
'Yi ', # 0x04
'Hua ', # 0x05
'Xi ', # 0x06
'Hui ', # 0x07
'Rao ', # 0x08
'Xi ', # 0x09
'Yan ', # 0x0a
'Chan ', # 0x0b
'Jiao ', # 0x0c
'Mei ', # 0x0d
'Fan ', # 0x0e
'Fan ', # 0x0f
'Xian ', # 0x10
'Yi '... | bsd-3-clause |
tuffery/Frog2 | frowns/build/lib/frowns/Chirality/TetraHedral.py | 2 | 2462 | """TetraHedral.T(order, chirality)
order = atoms in the input order of the smiles string.
chirality = @ anti-clockwise @@ clockwise
TetraHedral.T.getChirality(neworder) -> return the chirality
of the new order of the atoms
order -> atom order of the molecules
around the center.
If the number of atom... | gpl-3.0 |
Zelgadis87/Sick-Beard | sickbeard/metadata/generic.py | 6 | 37135 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
yewang15215/django | tests/validation/test_unique.py | 28 | 6775 | from __future__ import unicode_literals
import datetime
import unittest
from django.apps.registry import Apps
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import (
CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrors... | bsd-3-clause |
j-dasilva/COMP4350 | apartment/messaging/message.py | 1 | 1169 | from django.conf import settings
import time
class Message(object):
def __init__(self, *args, **kwargs):
vals = self.process_args(args, kwargs)
self.sender = vals['sender']
self.recipient = vals['recipient']
self.urgency = int(vals['urgency'])
self.content = vals['content']... | gpl-2.0 |
ran5515/DeepDecision | tensorflow/python/debug/__init__.py | 16 | 2580 | # 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 |
inovtec-solutions/OpenERP | openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/Repeatln.py | 90 | 13231 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
benthomasson/ansible | lib/ansible/modules/windows/win_firewall.py | 27 | 2296 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Michael Eaton <meaton@iforium.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 Li... | gpl-3.0 |
ThirdProject/android_external_chromium_org | tools/telemetry/telemetry/page/page_set_archive_info.py | 23 | 6197 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import os
import re
import shutil
import sys
from telemetry.page import cloud_storage
class PageSetArchiveInfo(object):
d... | bsd-3-clause |
nature-python/youcai-contest | application/utils/cipherutils.py | 1 | 1513 | #!/usr/bin/python
#encoding:utf-8
#
#author:xin.xin
#since:14-5-19上午10:35
#
#
from binascii import b2a_hex, a2b_hex
from Crypto.Cipher import AES
from application import app
class CipherUtils(object):
#加密函数,如果text不足16位就用空格补足为16位,
#如果大于16当时不是16的倍数,那就补足为16的倍数。
@staticmethod
def encrypt(text):
... | apache-2.0 |
gmalik9/voicex | http_handler/views.py | 5 | 2428 | """
Copyright (c) 2012 Anant Bhardwaj
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, copy, modify, merge, publish,
distribute,... | mit |
ujenmr/ansible | lib/ansible/plugins/shell/sh.py | 63 | 4012 | # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: sh
plugin_ty... | gpl-3.0 |
abenzbiria/clients_odoo | addons/l10n_ve/__openerp__.py | 119 | 3056 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
##############################################################################
# Modu... | agpl-3.0 |
openstack/python-openstacksdk | openstack/tests/unit/load_balancer/test_health_monitor.py | 3 | 4075 | # Copyright 2017 Rackspace, US Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 |
CoolCloud/flask-admin | flask_admin/tests/test_model.py | 7 | 19165 | import wtforms
from nose.tools import eq_, ok_
from flask import Flask, session
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.test import Client
from wtforms import fields
from flask_admin import Admin, form
from flask_admin._compat import iteritems, itervalues
from flask_admin.model import base, fi... | bsd-3-clause |
gobstones/PyGobstones | pygobstones/gui/views/gobstonesMain.py | 1 | 21498 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gobstonesMain.ui'
#
# Created by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import sys
import resources
sys.path.append('..')
from pygobstones.commons.i18n import ... | gpl-3.0 |
tophua/spark1.52 | examples/src/main/python/sql.py | 8 | 3097 | #
# 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 |
timlinux/geonode | docs/conf.py | 5 | 8711 | # -*- coding: utf-8 -*-
#
# GeoNode documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 3 16:20:38 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | gpl-3.0 |
forkbong/qutebrowser | tests/unit/browser/webkit/network/test_filescheme.py | 1 | 9313 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2018 Antoni Boucher (antoyo) <bouanto@zoho.com>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the ter... | gpl-3.0 |
securestate/king-phisher | tests/plugins.py | 4 | 2944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/sms.py
#
# 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 condit... | bsd-3-clause |
davy39/eric | Helpviewer/AdBlock/AdBlockSubscription.py | 1 | 24766 | # -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the AdBlock subscription class.
"""
from __future__ import unicode_literals
import os
import re
import hashlib
import base64
from PyQt5.QtCore import pyqtSignal, Qt, QObject, QByteArray, QDateT... | gpl-3.0 |
mozilla/bedrock | bedrock/mozorg/tests/test_views.py | 4 | 3290 | # -*- coding: utf-8 -*-
# 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 http://mozilla.org/MPL/2.0/.
import os
from django.test.client import RequestFactory
from bedrock.base.urlresolvers import r... | mpl-2.0 |
linuxdemon1/hexchat-plugins | znc-snofilter.py | 2 | 1427 | # coding=utf-8
from fnmatch import fnmatch
import hexchat
__module_name__ = "ZNC-snofilter"
__module_author__ = "linuxdaemon"
__module_version__ = "0.0.1"
__module_description__ = "Companion script to my snofilter module for ZNC, moves all notices from the module in to query windows"
def get_net_name():
for ctx... | gpl-3.0 |
mjabri/topographica | topo/transferfn/misc.py | 2 | 22352 | """
Transfer functions with more complex dependencies.
$Id: basic.py 10790 2009-11-21 17:51:33Z antolikjan $
"""
import copy
import numpy as np
import param
import imagen
from holoviews import Image
import topo
import topo.base.functionfamily
from topo.base.arrayutil import clip_lower,array_argmax
from topo.base.b... | bsd-3-clause |
sephii/django | tests/template_tests/syntax_tests/test_ssi.py | 3 | 3103 | import os
from django.test import ignore_warnings, SimpleTestCase
from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
from ..utils import ROOT, setup
@ignore_warnings(category=RemovedInDjango20Warning)
class SsiTagTests(SimpleTestCase):
# Test normal behavior
@setup({'ss... | bsd-3-clause |
tersmitten/ansible | lib/ansible/modules/cloud/openstack/os_server_group.py | 52 | 4701 | #!/usr/bin/python
# Copyright (c) 2016 Catalyst IT Limited
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': [... | gpl-3.0 |
lokik/sfepy | tests/test_io.py | 5 | 2368 | from __future__ import absolute_import
from sfepy.base.base import assert_
from sfepy.base.testing import TestCommon
import numpy as nm
import scipy.sparse as sp
import os.path as op
##
# 02.07.2007, c
class Test( TestCommon ):
##
# 02.07.2007, c
def from_conf( conf, options ):
return Test( conf =... | bsd-3-clause |
SexualHealthInnovations/callisto-core | callisto_core/accounts/migrations/0004_encrypt_user_data.py | 2 | 1490 | # Generated by Django 2.0.4 on 2018-04-11 21:12
import logging
from hashlib import sha256
import bcrypt
from django.db import migrations, models
from callisto_core.accounts.auth import index
logger = logging.getLogger(__name__)
def encrypt_user_data(apps, schema_editor):
Account = apps.get_model("accounts.Acc... | agpl-3.0 |
tjanez/ansible | lib/ansible/inventory/__init__.py | 32 | 34639 | # (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 |
DirtyUnicorns/android_external_chromium-org | build/android/gyp/proguard.py | 26 | 1813 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import fnmatch
import optparse
import os
import sys
from util import build_utils
def DoProguard(options):
injars = options.input_... | bsd-3-clause |
sekikn/incubator-airflow | tests/providers/amazon/aws/operators/test_s3_delete_objects.py | 7 | 3919 | #
# 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 |
invisiblek/android_external_skia | tools/skp/page_sets/skia_googlespreadsheet_desktop.py | 33 | 1238 | # 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
CubicComet/exercism-python-solutions | rotational-cipher/rotational_cipher_test.py | 4 | 1544 | import unittest
import rotational_cipher
# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
class RotationalCipher(unittest.TestCase):
def test_rotate_a_by_1(self):
self.assertEqual(rotational_cipher.rotate('a', 1), 'b')
def test_rotate_a_by_26(self):
self.assertEqua... | agpl-3.0 |
paasmaker/paasmaker | paasmaker/common/stats/base.py | 2 | 1797 | #
# Paasmaker - Platform as a Service
#
# 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 http://mozilla.org/MPL/2.0/.
#
import paasmaker
import tornado.testing
import colander
class BaseStatsConfi... | mpl-2.0 |
swt30/beets | test/test_vfs.py | 3 | 1740 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | mit |
linked67/p2pool-jug | SOAPpy/Server.py | 289 | 27143 | from __future__ import nested_scopes
"""
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.