repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
flossmanualsfr/peril-en-daiza | refs/heads/master | game/mouse_set.py | 1 | import bge
def active():
bge.render.showMouse(True)
def inactive():
bge.render.showMouse(False) |
ASCrookes/django | refs/heads/master | tests/file_uploads/models.py | 691 | from django.db import models
class FileModel(models.Model):
testfile = models.FileField(upload_to='test_upload')
|
BlueLens/bl-magi | refs/heads/master | stylelens/dataset/bluehack/text.py | 1 | from stylelens_dataset.texts import Texts
TEXT_DATASET_FILE = './text_data.txt'
text_api = Texts()
def add_text(class_code, keyword):
text = {}
text['class_code'] = class_code
text['text'] = keyword
try:
res = text_api.add_text(text)
except Exception as e:
print(e)
if __name__ == '__main__':
tr... |
sinkovit/ImmunoUtils | refs/heads/master | parse_mhcii.py | 1 | # Program parse_mhcii.py
#
# Description: Parse output from MHC Class II peptide binding
# prediction program (mhc_II_binding.py) and sort peptides with
# affinities below a specified threshold into T cell receptor
# classes. Note that this does not work with the consensus method
# since different algorithms may predic... |
jlopp/statoshi | refs/heads/master | test/functional/mempool_unbroadcast.py | 35 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that the mempool ensures transaction delivery by periodically sending
to peers until a GETDATA is ... |
castlecms/castle.cms | refs/heads/master | castle/cms/cron/_link_report.py | 1 | from AccessControl.SecurityManagement import newSecurityManager
from castle.cms.linkreporter import Reporter
from Products.CMFPlone.interfaces.siteroot import IPloneSiteRoot
from tendo import singleton
def run_link_report(site):
reporter = Reporter(site)
if not reporter.valid:
return
try:
... |
petebachant/scipy | refs/heads/master | scipy/stats/mstats.py | 37 | """
===================================================================
Statistical functions for masked arrays (:mod:`scipy.stats.mstats`)
===================================================================
.. currentmodule:: scipy.stats.mstats
This module contains a large number of statistical functions that can
be... |
coxmediagroup/googleads-python-lib | refs/heads/master | examples/adxbuyer/v201506/basic_operations/add_placements.py | 3 | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
MoKee/android_kernel_xiaomi_msm8226-common | refs/heads/kk_mkt | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
kkochubey1/docker-sikuli-novnc | refs/heads/master | noVNC/utils/websockify/websockify.py | 20 | run |
louispotok/pandas | refs/heads/master | pandas/tests/indexing/test_indexing_slow.py | 5 | # -*- coding: utf-8 -*-
import warnings
import numpy as np
import pandas as pd
from pandas.core.api import Series, DataFrame, MultiIndex
import pandas.util.testing as tm
import pytest
class TestIndexingSlow(object):
@pytest.mark.slow
def test_multiindex_get_loc(self): # GH7724, GH2646
with warnin... |
erjohnso/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_loadbalancer.py | 21 | #!/usr/bin/python
#
# Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.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... |
ogenstad/ansible | refs/heads/devel | lib/ansible/module_utils/exoscale.py | 96 | # -*- coding: utf-8 -*-
# Copyright (c) 2016, René Moser <mail@renemoser.net>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
import os
from ansible.module_utils.six.moves import configparser
from ansible.module_utils.six import integer_types, string_types
fr... |
kubeflow/pipelines | refs/heads/master | samples/contrib/azure-samples/kfp-azure-databricks/setup.py | 3 | from setuptools import setup
import databricks
setup(
name='kfp-azure-databricks',
version=databricks.__version__,
description='Python package to manage Azure Databricks on Kubeflow Pipelines using Azure Databricks operator for Kubernetes',
url='https://github.com/kubeflow/pipelines/tree/master/samples... |
kesre/slask | refs/heads/master | plugins/image.py | 3 | """!image <search term> return a random result from the google image search result for <search term>"""
from urllib import quote
import re
import requests
from random import shuffle, randint, choice
def image(searchterm, unsafe=True):
searchterm = quote(searchterm)
# There's a chance of pandas today
eggs... |
mferenca/HMS-ecommerce | refs/heads/HMSecommerce | ecommerce/extensions/order/tests/test_processing.py | 1 | from oscar.core.loading import get_model
from oscar.test import factories
from ecommerce.extensions.fulfillment.signals import SHIPPING_EVENT_NAME
from ecommerce.extensions.fulfillment.status import LINE
from ecommerce.extensions.order.processing import EventHandler
from ecommerce.tests.testcases import TestCase
Ship... |
SUSE/azure-sdk-for-python | refs/heads/master | azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/export_jobs_operation_result_info.py | 4 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
garnaat/placebo | refs/heads/develop | tests/unit/test_utils.py | 1 | # Copyright (c) 2015-2019 Mitch Garnaat
#
# 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 i... |
EliteTK/qutebrowser | refs/heads/master | tests/unit/mainwindow/test_messageview.py | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Softwa... |
LukasSukenik/faunus | refs/heads/master | src/playground/vacha/sc-moviepdb.py | 2 | #!/usr/bin/env python
#this program convert movie data to atom data = for each spherocylinder make residue
#consiting of two atoms at begining and end then in vmd use cpk to draw cylinders
import os
import sys
import math
import optparse
import commands
import string
import random
import usefulmath
def write_pdb(out... |
sarvex/django | refs/heads/master | tests/template_tests/filter_tests/test_iriencode.py | 388 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import iriencode, urlencode
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class IriencodeTests(SimpleTestCase):
"""
Ensure iriencode keeps safe... |
UrusTeam/android_ndk_toolchain_cross | refs/heads/master | lib/python2.7/json/decoder.py | 51 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF800000000... |
peiyuwang/pants | refs/heads/master | src/python/pants/backend/jvm/targets/unpacked_jars.py | 10 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from... |
samantp/gensimPy3 | refs/heads/develop | gensim/parsing/porter.py | 1 | #!/usr/bin/env python
"""Porter Stemming Algorithm
This is the Porter stemming algorithm, ported to Python from the
version coded up in ANSI C by the author. It may be be regarded
as canonical, in that it follows the algorithm presented in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 1... |
fhorinek/SkyBean | refs/heads/master | vario/convert/main.py | 1 | #!/usr/bin/python
import sys
import serial
from intelhex import IntelHex
import time
import datetime
import base64
def add8(a, b):
return (a + b & 0xFF)
page_size = 255
class Hex2BinConv():
def __init__(self, out):
self.hex = IntelHex()
self.out = out
def load(self, filename)... |
adamjmcgrath/glancydesign | refs/heads/master | src/django-nonrel/django/contrib/gis/shortcuts.py | 317 | import cStringIO, zipfile
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = cStringIO.StringIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('doc.... |
lordmuffin/aws-cfn-plex | refs/heads/master | functions/credstash/pip/_vendor/html5lib/__init__.py | 336 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
g-k/servo | refs/heads/master | components/script/dom/bindings/codegen/BindingGen.py | 20 | # 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 sys
sys.path.append("./parser/")
sys.path.append("./ply/")
import os
import cPickle
from Configuration import Con... |
watchdogpolska/feder | refs/heads/master | feder/institutions/migrations/0015_auto_20170830_1408.py | 1 | # Generated by Django 1.11.4 on 2017-08-30 14:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("institutions", "0014_auto_20170822_1403")]
operations = [
migrations.AlterField(
model_name="institution",
name="parents",
... |
kylon/pacman-fakeroot | refs/heads/upstream | test/pacman/tests/fileconflict006.py | 19 | self.description = "dir->symlink change during package upgrade (conflict)"
p1 = pmpkg("pkg1", "1.0-1")
p1.files = ["test/",
"test/file1",
"test/dir/file1",
"test/dir/file2"]
self.addpkg2db("local", p1)
p2 = pmpkg("pkg2")
p2.files = ["test/dir/file3"]
self.addpkg2db("local", p2)
p3... |
r2k0/flask-apps | refs/heads/master | test/app.py | 1 | from flask import Flask
""" learning and experimenting with Flask """
# create an instance of the Flask class and assigned
# it to the varialbe 'app'
app = Flask(__name__)
# decorators to link the function to a url
@app.route("/")
@app.route("/hello")
# dynamic routes
@app.route("/test")
@app.route("/test/<query>")
... |
teriyakichild/ansible-modules-extras | refs/heads/devel | network/dnsimple.py | 96 | #!/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 distributed... |
RO-ny9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/re.py | 45 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... |
UAlbanyArchives/ua395 | refs/heads/master | ua395.py | 1 | # coding: utf-8
import requests
import json
from lxml import etree as ET
import time
import urllib
import os
import uuid
import shortuuid
import hashlib
import simplejson
import shutil
import traceback
import datetime
from PIL import Image
import sys
from subprocess import Popen, PIPE
import smtplib
... |
ic-hep/DIRAC | refs/heads/rel-v6r15 | Core/scripts/dirac-start-mysql.py | 5 | #!/usr/bin/env python
########################################################################
# File : dirac-start-mysql
# Author : Ricardo Graciani
########################################################################
"""
Start DIRAC MySQL server
"""
__RCSID__ = "$Id$"
#
from DIRAC.Core.Base import Script
Scri... |
wojciechtanski/robotframework | refs/heads/master | src/robot/parsing/restsupport.py | 27 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... |
harshilasu/GraphicMelon | refs/heads/master | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/rds/__init__.py | 645 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
# 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 r... |
szaghi/MaTiSSe | refs/heads/master | release/MaTiSSe-0.3.0/matisse/utils/mdx_mathjax.py | 6 | """md_mathjax is a simple extension of the Python implementation of Markdown
author: Man YUAN
homepage: https://github.com/epsilony/md_mathjax
"""
from markdown.util import AtomicString
from markdown.util import etree
from markdown.inlinepatterns import Pattern
from markdown import Extension
class MathJaxPattern(Patt... |
gablg1/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/deployment/config/config_exceptions.py | 10 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
mne-tools/mne-tools.github.io | refs/heads/main | 0.11/_downloads/plot_ssp_projs_sensitivity_map.py | 18 | """
==================================
Sensitivity map of SSP projections
==================================
This example shows the sources that have a forward field
similar to the first SSP vector correcting for ECG.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause... |
stefanklug/mapnik | refs/heads/master | scons/scons-local-2.3.6/SCons/Tool/hpc++.py | 4 | """SCons.Tool.hpc++
Tool-specific initialization for c++ on HP/UX.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of... |
vitalogy/wiringX | refs/heads/master | python/examples/tmp102.py | 8 | #!/usr/bin/env python
# Copyright (c) 2015 Paul Adams <paul@thoughtcriminal.co.uk>
# 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 lat... |
todotobe1/apprtc | refs/heads/master | build/run_python_tests.py | 22 | #!/usr/bin/python
import os
import optparse
import sys
import unittest
USAGE = """%prog sdk_path test_path webtest_path
Run unit tests for App Engine apps.
sdk_path Path to the SDK installation.
test_path Path to package containing test modules.
webtest_path Path to the webtest library."""
def _WebTestIsIns... |
Achuth17/scikit-bio | refs/heads/master | skbio/stats/tests/test_power.py | 12 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
erjohnso/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/swupd.py | 49 | #!/usr/bin/python
# (c) 2017, Alberto Murillo <alberto.murillo.silva@intel.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
spacewalkproject/spacewalk | refs/heads/master | client/rhel/rhn-client-tools/test/testClientCaps.py | 30 | #!/usr/bin/python
import os
import settestpath
import unittest
from up2date_client import clientCaps
from up2date_client import up2dateAuth
test_clientCaps_d = "etc-sysconfig-rhn/clientCaps.d"
class TestClientCaps(unittest.TestCase):
def setUp(self):
self.__setupData()
def __setupData(self):
... |
Russell-IO/ansible | refs/heads/devel | lib/ansible/modules/clustering/etcd3.py | 31 | #!/usr/bin/python
#
# (c) 2018, Jean-Philippe Evrard <jean-philippe@evrard.me>
# 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',
'st... |
kwailamchan/programming-languages | refs/heads/master | python/gists/super.py | 3 | class Employee(object):
"""Models real-life employees!"""
def __init__(self, employee_name):
self.employee_name = employee_name
def calculate_wage(self, hours):
self.hours = hours
return hours * 20.00
# Add your code below!
class PartTimeEmployee(Employee):
def calculate_wage(... |
zrhans/pythonanywhere | refs/heads/master | .virtualenvs/django19/lib/python3.4/site-packages/django/core/handlers/wsgi.py | 339 | from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_pr... |
team-ferret/pip-in-toto | refs/heads/master | tests/lib/git_submodule_helpers.py | 58 | from __future__ import absolute_import
import textwrap
def _create_test_package_submodule(env):
env.scratch_path.join("version_pkg_submodule").mkdir()
submodule_path = env.scratch_path / 'version_pkg_submodule'
env.run('touch', 'testfile', cwd=submodule_path)
env.run('git', 'init', cwd=submodule_path... |
mifl/android_kernel_pantech_oscar | refs/heads/LA.AF.1.1-oscar | scripts/build-all.py | 1182 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... |
timokoola/timoechobot | refs/heads/master | requests/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 285 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, us... |
chrooter/planbox | refs/heads/staging | src/planbox_ui/decorators.py | 4 | """
ssl_required decorator
----------------------
Redirect requests to the given to to HTTPS if they are not secure already.
Source: https://djangosnippets.org/snippets/1351/
Author: pjs (https://djangosnippets.org/users/pjs/)
"""
try:
# Python 2
import urlparse
except ImportError:
# Python 3
from urll... |
rghe/ansible | refs/heads/devel | test/units/modules/net_tools/nios/test_nios_a_record.py | 11 | # 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 distributed in the hope that ... |
indico/indico | refs/heads/master | indico/util/signals.py | 4 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from itertools import zip_longest
from types import GeneratorType
def values_from_signal(signal_response... |
hrashk/sympy | refs/heads/master | sympy/matrices/matrices.py | 1 | from __future__ import print_function, division
import collections
from sympy.core.add import Add
from sympy.core.basic import Basic, C, Atom
from sympy.core.expr import Expr
from sympy.core.function import count_ops
from sympy.core.power import Pow
from sympy.core.symbol import Symbol, Dummy, symbols
from sympy.core.... |
unho/pootle | refs/heads/master | tests/misc/state.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from po... |
sccn/SNAP | refs/heads/master | src/pylsl/binaries-python2.6-win32/liblsl.py | 24 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... |
idncom/odoo | refs/heads/8.0 | addons/l10n_si/__init__.py | 439 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... |
legrostdg/django-knowledge | refs/heads/master | tests/mock/tests/utils.py | 5 | from mock.tests.base import TestCase
from knowledge.utils import paginate, get_module
class BasicPaginateTest(TestCase):
def test_paginate_helper(self):
paginator, objects = paginate(range(0,1000), 100, 'xcvb')
self.assertEquals(objects.number, 1) # fall back to first page
paginator, obj... |
CINPLA/expipe-dev | refs/heads/master | phy/phy/plot/base.py | 2 | # -*- coding: utf-8 -*-
"""Base VisPy classes."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
from collections import defaultdict
import logging
import re
from vispy import gloo
from vispy.... |
openslack/openslack-crawler | refs/heads/master | crawler/utils/select_result.py | 1 | #!/usr/bin/python
# -*-coding:utf-8-*-
import types
from urlparse import urljoin
from w3lib.html import remove_entities
NULL = [None, 'null']
list_first_item = lambda x: x[0] if x else None
def strip_null(arg, null=None):
"""
strip list,set,tuple,dict null item.
@param:
arg:the va... |
maxziv/SEApp | refs/heads/master | server/lib/flask/_compat.py | 783 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... |
fossoult/odoo | refs/heads/8.0 | addons/website_payment/__openerp__.py | 389 | # -*- coding: utf-8 -*-
{
'name': 'Payment: Website Integration',
'category': 'Website',
'summary': 'Payment: Website Integration',
'version': '1.0',
'description': """Bridge module for acquirers and website.""",
'author': 'OpenERP SA',
'depends': [
'website',
'payment',
... |
mitya57/django | refs/heads/master | tests/utils_tests/test_datastructures.py | 9 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
from django.test import SimpleTestCase
from django.utils.datastructures import (
DictWrapper, ImmutableList, MultiValueDict, MultiValueDictKeyError,
OrderedSet,
)
class OrderedSetTests(SimpleTestCase):
def test_bool(self):
# Re... |
gracefullife/gerrit | refs/heads/master | tools/gitlog2asciidoc.py | 22 | #!/usr/bin/python
from optparse import OptionParser
import re
import subprocess
import sys
"""
This script generates a release note from the output of git log
between the specified tags.
Options:
--issues Show output the commits with issues associated with them.
--issue-numbers Show outputs issue numbers o... |
robobrobro/ballin-octo-shame | refs/heads/master | lib/Python-3.4.3/Lib/multiprocessing/reduction.py | 94 | #
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import copyreg
import functools
import io
import os
import pickle
import socket
import sys
from . import context
__all__ = ['send_handle', 'recv_... |
macosforge/ccs-calendarserver | refs/heads/master | txdav/caldav/datastore/scheduling/ischedule/test/test_localservers.py | 1 | ##
# Copyright (c) 2009-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
epssy/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/aggregation/tests.py | 59 | from __future__ import absolute_import
import datetime
from decimal import Decimal
from django.db.models import Avg, Sum, Count, Max, Min
from django.test import TestCase, Approximate
from .models import Author, Publisher, Book, Store
class BaseAggregateTestCase(TestCase):
fixtures = ["aggregation.json"]
... |
PriceChild/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_cdb.py | 70 | #!/usr/bin/python -tt
# 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 distrib... |
bwrsandman/OpenUpgrade | refs/heads/8.0 | openerp/conf/__init__.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
alexchamberlain/pacman | refs/heads/master | test/pacman/tests/sync044.py | 28 | self.description = "A dependency induces a replacement"
lp1 = pmpkg("pkg1")
self.addpkg2db("local", lp1);
sp2 = pmpkg("pkg2")
sp2.depends = ["pkg3"]
self.addpkg2db("sync", sp2);
sp3 = pmpkg("pkg3")
sp3.conflicts = ["pkg1"]
self.addpkg2db("sync", sp3);
self.args = "-S pkg2 --ask=4"
self.addrule("PACMAN_RETCODE=0")
... |
closeio/flask-admin | refs/heads/master | flask_admin/contrib/sqla/validators.py | 22 | from sqlalchemy.orm.exc import NoResultFound
from wtforms import ValidationError
try:
from wtforms.validators import InputRequired
except ImportError:
from wtforms.validators import Required as InputRequired
class Unique(object):
"""Checks field value unicity against specified table field.
:param ge... |
thedrow/django-rest-framework-1 | refs/heads/master | tests/test_serializer_nested.py | 36 | from django.http import QueryDict
from rest_framework import serializers
class TestNestedSerializer:
def setup(self):
class NestedSerializer(serializers.Serializer):
one = serializers.IntegerField(max_value=10)
two = serializers.IntegerField(max_value=10)
class TestSerial... |
lordblackfox/aircox | refs/heads/master | aircox/forms.py | 2 | from django import forms
from django.forms import ModelForm
from .models import Comment
class CommentForm(ModelForm):
nickname = forms.CharField()
email = forms.EmailField(required=False)
content = forms.CharField(widget=forms.Textarea())
nickname.widget.attrs.update({'class': 'input'})
email.wi... |
MKLab-ITI/news-popularity-prediction | refs/heads/master | reveal_fp7_module/reveal-popularity-prediction/reveal_popularity_prediction/features/extraction.py | 1 | __author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import numpy as np
from reveal_popularity_prediction.features import wrappers
def extract_snapshot_features(comment_tree,
user_graph,
timestamp_list,
tweet_timestamp,
... |
piyush82/icclab-rcb-web | refs/heads/master | virtualenv/lib/python2.7/site-packages/django/contrib/auth/admin.py | 29 | from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm)
from django.contrib.auth.models import User, Group
from django.c... |
dfunckt/django | refs/heads/master | django/template/library.py | 115 | import functools
import warnings
from importlib import import_module
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.html import conditional_escape
from django.utils.inspect import getargspec
from django.utils.itercompat import is_iterable
from .base import... |
victoredwardocallaghan/xen | refs/heads/master | tools/python/xen/xend/xenstore/tests/__init__.py | 45382 | |
Hakuba/youtube-dl | refs/heads/master | youtube_dl/extractor/yourupload.py | 142 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
'''
... |
scottrice/Ice | refs/heads/master | ice/steam_shortcut_synchronizer.py | 1 |
from pysteam import shortcuts
import roms
from consoles import console_roms_directory
from logs import logger
class SteamShortcutSynchronizer(object):
def __init__(self, config, managed_rom_archive):
self.config = config
self.managed_rom_archive = managed_rom_archive
def _guess_whether_shortcut_is_man... |
komsas/OpenUpgrade | refs/heads/master | addons/account_test/__init__.py | 441 | import account_test
import report
|
kwailamchan/programming-languages | refs/heads/master | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/core/cache/backends/db.py | 94 | "Database cache backend."
import base64
import time
from datetime import datetime
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.cache.backends.base import BaseCache
from django.db import connections, router, transaction, DatabaseError
from dj... |
pong3489/TEST_Mission | refs/heads/master | Lib/site-packages/numpy/testing/setupscons.py | 51 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('testing',parent_package,top_path)
return config
if __name__ == '__main__':
... |
yukoba/sympy | refs/heads/master | sympy/physics/tests/test_sho.py | 98 | from sympy.core import symbols, Rational, Function, diff
from sympy.core.compatibility import range
from sympy.physics.sho import R_nl, E_nl
from sympy import simplify
def test_sho_R_nl():
omega, r = symbols('omega r')
l = symbols('l', integer=True)
u = Function('u')
# check that it obeys the Schrodi... |
BuildingLink/sentry | refs/heads/master | src/social_auth/views.py | 8 | """Views
Notes:
* Some views are marked to avoid csrf token check because they rely
on third party providers that (if using POST) won't be sending csrf
token back.
"""
from __future__ import absolute_import
import six
from sudo.utils import is_safe_url
from django.conf import settings
from django.htt... |
hsaputra/tensorflow | refs/heads/master | tensorflow/python/debug/cli/offline_analyzer.py | 162 | # 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... |
jasonbot/django | refs/heads/master | tests/auth_tests/test_basic.py | 328 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.core.exceptions import ImproperlyConfigured
from django.dispatch import... |
istinspring/grablab | refs/heads/master | back/back/wsgi.py | 2 | """
WSGI config for back project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... |
bottompawn/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/encodings/cp1125.py | 213 | """ Python Character Mapping Codec for CP1125
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
return codecs.charmap_decode(input,errors,deco... |
simongoffin/website_version | refs/heads/Multi_fonctionnel | addons/project_issue/__init__.py | 433 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
o3project/odenos | refs/heads/develop | apps/mininet_examples/multi_network_control/start_mininet.py | 6 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in comp... |
gdimitris/ChessPuzzlerBackend | refs/heads/master | Virtual_Environment/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
georgefrank/ansible-modules-extras | refs/heads/devel | database/vertica/vertica_facts.py | 148 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
rahul67/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_feedgenerator.py | 104 | from __future__ import unicode_literals
import datetime
from django.utils import feedgenerator, tzinfo, unittest
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
"""
Test get_tag_uri() correctly genera... |
u-mobo/linux-imx | refs/heads/imx_3.10.17_umobo | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
gwu-libraries/sfm-twitter-harvester | refs/heads/master | twitter_rest_warc_iter.py | 1 | #!/usr/bin/env python3
from __future__ import absolute_import
from sfmutils.warc_iter import BaseWarcIter
from dateutil.parser import parse as date_parse
import json
import sys
SEARCH_URL = "https://api.twitter.com/1.1/search/tweets.json"
TIMELINE_URL = "https://api.twitter.com/1.1/statuses/user_timeline.json"
clas... |
alephdata/ingestors | refs/heads/dependabot/pip/click-8.0.1 | tests/test_audio.py | 1 | # -*- coding: utf-8 -*-
import datetime
from .support import TestCase
class AudioIngestorTest(TestCase):
def test_audio(self):
fixture_path, entity = self.fixture("memo.m4a")
self.manager.ingest(fixture_path, entity)
self.assertEqual(entity.first("processingStatus"), self.manager.STATUS_SU... |
jcpowermac/ansible | refs/heads/devel | lib/ansible/modules/system/aix_lvol.py | 73 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Alain Dejoux <adejoux@djouxtech.net>
# 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',... |
dagmartin/capirca | refs/heads/master | tools/ldpush/cisconx.py | 7 | #!/usr/bin/python
#
# Copyright 2013 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 or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.