repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jnerin/ansible | refs/heads/devel | lib/ansible/modules/cloud/vultr/vr_server.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.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',
... |
JorgeCoock/django | refs/heads/master | tests/version/tests.py | 352 | from unittest import TestCase
from django import get_version
from django.utils import six
class VersionTests(TestCase):
def test_development(self):
ver_tuple = (1, 4, 0, 'alpha', 0)
# This will return a different result when it's run within or outside
# of a git clone: 1.4.devYYYYMMDDHHM... |
focode/buddy2 | refs/heads/master | src/buddy/forms.py | 1 | from __future__ import unicode_literals
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from django.contrib.auth import get_user_model
from . impo... |
pynag/pynag | refs/heads/master | pynag/Utils/checkresult.py | 1 | # !/usr/bin/python
#
# NagiosCheckResult- Class that creates Nagios checkresult file and
# writes Passive Host and Service checks to it
#
# 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 v... |
Incrediblewheat/PterodactylAttack | refs/heads/master | project/bg/extractSvgLayers.py | 2 | #!/usr/bin/env python
import sys
usage = """
extractSvgLayers.py <svg file>
Given an SVG file, extract the top level groups into individual two-digit numbered layers (e.g. 00.svg, 01.svg, 02.svg)
"""
if __name__ == "__main__":
args = sys.argv[1:]
if len(args) != 1:
print usage
sys.exit(1)
filename = arg... |
patathor/django-paypal | refs/heads/master | paypal/standard/ipn/south_migrations/0003_auto__add_field_paypalipn_mp_id.py | 12 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PayPalIPN.mp_id'
db.add_column(u'paypal_ipn', 'mp_id',
... |
mnahm5/django-estore | refs/heads/master | Lib/site-packages/braintree/merchant_account/individual_details.py | 5 | from braintree.attribute_getter import AttributeGetter
from braintree.merchant_account.address_details import AddressDetails
class IndividualDetails(AttributeGetter):
detail_list = [
"first_name",
"last_name",
"email",
"phone",
"date_of_birth",
"ssn_last_4",
... |
veikman/cbg | refs/heads/master | cbg/svg/tag.py | 1 | # -*- coding: utf-8 -*-
'''Tag presentation support.'''
# This file is part of CBG.
#
# CBG 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 ver... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/google/appengine/api/channel/channel_service_stub.py | 3 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
chengduoZH/Paddle | refs/heads/develop | python/paddle/fluid/transpiler/details/vars_distributed.py | 5 | # Copyright (c) 2018 PaddlePaddle 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 appli... |
40223249-1/-w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/heapq.py | 628 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/surface/compute/instance_groups/managed/delete_instances.py | 3 | # Copyright 2015 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 ag... |
kai5263499/networkx | refs/heads/master | networkx/algorithms/graphical.py | 32 | # -*- coding: utf-8 -*-
"""Test sequences for graphiness.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from collections import defaultdict
import heapq
import networkx as nx
_... |
gi11es/thumbor | refs/heads/master | thumbor/filters/convolution.py | 4 | # -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from thumbor.ext.filters import _convolution
from thumbor.filters import BaseFilter, f... |
sstone/bitcoin | refs/heads/master | test/functional/feature_uacomment.py | 46 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 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 the -uacomment option."""
import re
from test_framework.test_framework import BitcoinTestFramewo... |
savoirfairelinux/django | refs/heads/master | tests/shortcuts/urls.py | 113 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^render_to_response/$', views.render_to_response_view),
url(r'^render_to_response/multiple_templates/$', views.render_to_response_view_with_multiple_templates),
url(r'^render_to_response/content_type/$', views.render_to_response_vi... |
aykol/pymatgen | refs/heads/master | pymatgen/entries/tests/test_exp_entries.py | 2 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
'''
Created on Jun 27, 2012
'''
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "S... |
sivel/ansible-modules-extras | refs/heads/devel | infrastructure/foreman/katello.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Eric D Helms <ericdhelms@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 Li... |
heijingjie/fs_linux_3.10.58 | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
SMALLplayer/smallplayer-image-creator | refs/heads/master | storage/.xbmc/addons/script.xbmc.subtitles/resources/lib/services/PTSubs/service.py | 1 | # -*- coding: utf-8 -*-
# Service PT-SUBS.NET version 0.1.5
# Code based on Undertext service
# Coded by HiGhLaNdR@OLDSCHOOL
# Help by VaRaTRoN
# Bugs & Features to highlander@teknorage.com
# http://www.teknorage.com
# License: GPL v2
#
# NEW on Service PT-SUBS.NET v0.1.6:
# Added uuid for better file handling, no mor... |
lanhel/viperaccept | refs/heads/master | viperaccept/__init__.py | 1 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""Expanded unit and acceptance test system for setuptools."""
__author__ = ('Lance Finn Helsten',)
__version__ = '0.0'
__copyright__ = """Copyright (C) 2014 Lance Helsten"""
__docformat__ = "... |
GuillaumeDerval/INGInious-containers | refs/heads/master | default/inginious/feedback.py | 1 | #!/usr/bin/python
import os
import sys
import json
def load_feedback():
""" Open existing feedback file """
result = {}
if os.path.exists('/.__output/__feedback.json'):
f = open('/.__output/__feedback.json', 'r')
cont = f.read()
f.close()
else:
cont = '{}'
try:
... |
prutseltje/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_customipamdnsprofile.py | 41 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... |
nickleefly/youtube-dl | refs/heads/master | youtube_dl/extractor/miomio.py | 15 | # coding: utf-8
from __future__ import unicode_literals
import random
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
xpath_text,
int_or_none,
ExtractorError,
sanitized_Request,
)
class MioMioIE(InfoExtractor):
IE_NAME = 'miomio.tv'
_VALID_URL = r... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/migrations/migrations_test_apps/unspecified_app_with_conflict/migrations/0002_second.py | 425 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("unspecified_app_with_conflict", "0001_initial")]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Auth... |
Ictp/indico | refs/heads/master | bin/utils/fileArchiveStats.py | 2 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... |
odyaka341/pyglet | refs/heads/master | tools/genmpkg/bdist_mpkg_pyglet/util.py | 26 | import os, sys
try:
set
except NameError:
from sets import Set as set
def fsencoding(s, encoding=sys.getfilesystemencoding()):
if isinstance(s, unicode):
s = s.encode(encoding)
return s
SCMDIRS = ['CVS', '.svn']
def skipscm(ofn):
ofn = fsencoding(ofn)
fn = os.path.basename(ofn)
if ... |
SeleniumHQ/buck | refs/heads/master | test/com/facebook/buck/testrunner/check-allowed-entries-in-archive.py | 2 | #!/usr/bin/env python
# Copyright 2017-present Facebook, 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 applica... |
canvasnetworks/canvas | refs/heads/master | common/boto/ec2/buyreservation.py | 56 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
sursum/buckanjaren | refs/heads/master | buckanjaren/lib/python3.5/site-packages/django/contrib/sites/migrations/0002_alter_domain_unique.py | 379 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='... |
jacobajit/ion | refs/heads/master | intranet/apps/eighth/migrations/0023_auto_20150530_0026.py | 1 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('eighth', '0022_schedactivity_comments_to_title')]
operations = [
migrations.AddField(model_name='eighthscheduledactivity',
name='comments',
... |
OscarSwanros/swift | refs/heads/master | utils/pass-pipeline/src/passes.py | 22 |
from pass_pipeline import Pass
# TODO: This should not be hard coded. Create a tool in the compiler that knows
# how to dump the passes and the pipelines themselves.
AADumper = Pass('AADumper')
ABCOpt = Pass('ABCOpt')
AddressLowering = Pass('AddressLowering')
AllocBoxToStack = Pass('AllocBoxToStack')
CFGPrinter = Pas... |
bgxavier/nova | refs/heads/master | nova/cmd/novncproxy.py | 38 | # Copyright (c) 2012 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 ... |
Algomorph/gpxanalyzer | refs/heads/master | perf_test.py | 1 | '''
Created on Mar 7, 2014
@author: algomorph
'''
import gpxanalyzer.utils.tilecombiner as tc
import gpxanalyzer.utils.data as dm
import gpxanalyzer.filters.cl_manager as clm
import gpxanalyzer.filters.color_structure as cs
import gpxanalyzer.utils.system as system
import pyopencl as cl
import libMPEG7 as mp7
import ... |
lamer547/suncoin | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
lexyan/SickBeard | refs/heads/master | autoProcessTV/hellaToSickBeard.py | 57 | #!/usr/bin/env python
# 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, eithe... |
robert-digit/superset | refs/heads/master | superset/migrations/versions/db0c65b146bd_update_slice_model_json.py | 9 | """update_slice_model_json
Revision ID: db0c65b146bd
Revises: f18570e03440
Create Date: 2017-01-24 12:31:06.541746
"""
# revision identifiers, used by Alembic.
revision = 'db0c65b146bd'
down_revision = 'f18570e03440'
from alembic import op
import json
from sqlalchemy.ext.declarative import declarative_base
from sql... |
orsonwang/shadowsocks | refs/heads/master | shadowsocks/encrypt.py | 990 | #!/usr/bin/env python
#
# Copyright 2012-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
twamarc/schemaorg | refs/heads/master | lib/markdown/extensions/sane_lists.py | 67 | """
Sane List Extension for Python-Markdown
=======================================
Modify the behavior of Lists in Python-Markdown to act in a sane manor.
See <https://pythonhosted.org/Markdown/extensions/sane_lists.html>
for documentation.
Original code Copyright 2011 [Waylan Limberg](http://achinghead.com)
All c... |
CenterForOpenScience/waterbutler | refs/heads/develop | waterbutler/auth/osf/handler.py | 2 | import logging
import datetime
import jwe
import jwt
import aiohttp
from aiohttp.client_exceptions import ClientError, ContentTypeError
from waterbutler.core import exceptions
from waterbutler.auth.osf import settings
from waterbutler.core.auth import AuthType, BaseAuthHandler
from waterbutler.settings import MFR_IDE... |
unaizalakain/django | refs/heads/master | tests/template_tests/filter_tests/test_unordered_list.py | 204 | from django.template.defaultfilters import unordered_list
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import python_2_unicode_compatible
from django.utils.safestring import mark_safe
from ..utils import setup
class ... |
Pretagonist/Flexget | refs/heads/develop | tests/test_crossmatch.py | 2 | from __future__ import unicode_literals, division, absolute_import
class TestCrossmatch(object):
config = """
tasks:
test_title:
mock:
- title: entry 1
- title: entry 2
crossmatch:
from:
- mock:
- title: e... |
ofrobots/grpc | refs/heads/master | src/python/grpcio/grpc/framework/face/implementations.py | 38 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
ml-lab/NearPy | refs/heads/master | nearpy/engine.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# 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,... |
PyFilesystem/pyfilesystem | refs/heads/master | fs/expose/xmlrpc.py | 12 | """
fs.expose.xmlrpc
================
Server to expose an FS via XML-RPC
This module provides the necessary infrastructure to expose an FS object
over XML-RPC. The main class is 'RPCFSServer', a SimpleXMLRPCServer subclass
designed to expose an underlying FS.
If you need to use a more powerful server than SimpleXML... |
scorphus/thefuck | refs/heads/master | tests/rules/test_git_stash.py | 5 | import pytest
from thefuck.rules.git_stash import match, get_new_command
from thefuck.types import Command
cherry_pick_error = (
'error: Your local changes would be overwritten by cherry-pick.\n'
'hint: Commit your changes or stash them to proceed.\n'
'fatal: cherry-pick failed')
rebase_error = (
'C... |
umitproject/tease-o-matic | refs/heads/master | django/contrib/gis/sitemaps/views.py | 250 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.contrib.gis.db.models.fields import GeometryField
from django.db import... |
firebitsbr/infernal-twin | refs/heads/master | build/reportlab/build/lib.linux-i686-2.7/reportlab/graphics/widgets/table.py | 32 | #!/usr/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/grids.py
__version__=''' $Id$ '''
from reportlab.graphics.widgetbase import Widget
from reportlab.graphics.char... |
Francis-Liu/animated-broccoli | refs/heads/master | nova/api/openstack/compute/legacy_v2/contrib/extended_ips.py | 79 | # Copyright 2013 Nebula, 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... |
aimejeux/enigma2 | refs/heads/master | lib/python/Screens/VideoWizard.py | 2 | from boxbranding import getBoxType, getMachineName
from Screens.Wizard import WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Rc import Rc
from Components.AVSwitch import iAVSwitch
from Screens.Screen import Screen
from Components.Pixmap import Pixmap
from Components.config import config, ... |
JulianVolodia/Politikon | refs/heads/master | accounts/migrations/0007_auto_20151107_0037.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0006_userprofile_reputation'),
]
operations = [
migrations.AddField(
model_name='userprofile',
... |
code-google-com/openshadinglanguage | refs/heads/master | testsuite/spline/run.py | 4 | #!/usr/bin/python
import os
import sys
path = ""
command = ""
if len(sys.argv) > 2 :
os.chdir (sys.argv[1])
path = sys.argv[2] + "/"
# A command to run
command = path + "oslc/oslc test.osl > out.txt"
command = command + "; " + path + "testshade/testshade -g 256 256 -od uint8 -o Cspline color.tif -o DxCsplin... |
bealdav/OCB | refs/heads/patch-1 | openerp/fields.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
piran9/Project | refs/heads/master | src/flow-monitor/bindings/modulegen__gcc_ILP32.py | 4 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
chloerh/avocado-vt | refs/heads/master | virttest/utils_sasl.py | 5 | """
tools to manage sasl.
"""
import logging
import aexpect
from avocado.core import exceptions
from avocado.utils import path
from avocado.utils import process
from virttest import propcan
from virttest import remote
from virttest import virsh
from virttest.compat_52lts import decode_to_text
class SASL(propcan.Pr... |
flowdas/meta | refs/heads/master | tests/test_primitives.py | 1 | # coding=utf-8
from __future__ import print_function
import cmath
import datetime
import decimal
import math
import time
import uuid
import pytest
from flowdas import meta
from flowdas.meta.compat import *
from tests import *
class SimpleEntity(meta.Entity):
a = meta.Boolean()
entity = SimpleEntity()
entity.a... |
zapier/evernote-sdk-python | refs/heads/master | lib/evernote/edam/notestore/__init__.py | 30 | __all__ = ['ttypes', 'constants', 'NoteStore']
|
willdavidc/piel | refs/heads/master | catkin_ws/src/piel/scripts/venv/lib/python2.7/site-packages/pip/commands/hash.py | 514 | from __future__ import absolute_import
import hashlib
import logging
import sys
from pip.basecommand import Command
from pip.status_codes import ERROR
from pip.utils import read_chunks
from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
class HashCommand(Command):
""... |
gfyoung/pandas | refs/heads/master | pandas/tests/arrays/test_timedeltas.py | 2 | import numpy as np
import pytest
import pandas as pd
from pandas import Timedelta
import pandas._testing as tm
from pandas.core import nanops
from pandas.core.arrays import TimedeltaArray
class TestTimedeltaArrayConstructor:
def test_only_1dim_accepted(self):
# GH#25282
arr = np.array([0, 1, 2, 3... |
claudep/pootle | refs/heads/master | pootle/apps/pootle_log/apps.py | 2 | # -*- 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 importlib
from django.apps import Ap... |
ClovisIRex/Snake-django | refs/heads/master | env/lib/python3.6/site-packages/django/utils/module_loading.py | 145 | import copy
import os
import sys
from importlib import import_module
from django.utils import six
def import_string(dotted_path):
"""
Import a dotted module path and return the attribute/class designated by the
last name in the path. Raise ImportError if the import failed.
"""
try:
module... |
LEPT-Development/aura_kernel_lge_c50 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/django/contrib/gis/tests/geo3d/tests.py | 100 | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from django.test import TestCase
from djan... |
mysql/mysql-utilities | refs/heads/master | mysql-test/t/mylogin_clone_db.py | 1 | #
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in th... |
tetherless-world/ecoop | refs/heads/master | pyecoop/docs/sphinxext/ipython_console_highlighting.py | 112 | """reST directive for syntax-highlighting ipython interactive sessions.
XXX - See what improvements can be made based on the new (as of Sept 2009)
'pycon' lexer for the python console. At the very least it will give better
highlighted tracebacks.
"""
#-----------------------------------------------------------------... |
openstack/heat | refs/heads/master | heat/tests/openstack/neutron/test_neutron_port.py | 1 | #
# 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 writing, software
# ... |
jmcbailey/django-cached-hitcount | refs/heads/master | hitcount_example/manage.py | 2 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hitcount_example.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
Sir-Henry-Curtis/Ironworks | refs/heads/master | modules/home/latestNews.py | 1 | """Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit https://code.google.com/p/feedparser/ for the latest version
Visit http://packages.python.org/feedparser/ for the latest documentation
Required: Python 2.4 or later
Recommended: iconv_codec <http://cjkpython.i18n.org... |
SDX2000/UniShell-Python | refs/heads/master | lib/prologue.py | 1 | prologue = """\
"""
|
wolfram74/numerical_methods_iserles_notes | refs/heads/master | venv/lib/python2.7/site-packages/numpy/f2py/tests/test_mixed.py | 69 | from __future__ import division, absolute_import, print_function
import os
import math
from numpy.testing import *
from numpy import array
import util
import textwrap
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestMixed(util.F2PyTest):
sources = [_path('src', 'mixed', 'fo... |
chongtianfeiyu/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/shlex.py | 80 | """A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), string arguments, and
# iterato... |
oscaro/django | refs/heads/oscaro-backports-1.7.10 | tests/generic_views/test_forms.py | 453 | from __future__ import unicode_literals
from django import forms
from .models import Author
class AuthorForm(forms.ModelForm):
name = forms.CharField()
slug = forms.SlugField()
class Meta:
model = Author
fields = ['name', 'slug']
class ContactForm(forms.Form):
name = forms.CharFie... |
ckolumbus/mikidown | refs/heads/ckol | mikidown/mikitree.py | 1 | """
Naming convention:
* item - the visual element in MikiTree
* page - denoted by item hierarchy e.g. `foo/bar` is a subpage of `foo`
* file - the actual file on disk
"""
import os
import datetime
from PyQt4.QtCore import Qt, QDir, QFile, QIODevice, QSize, QTextStream
from PyQt4.QtGui import (QAbstractIt... |
e-gob/plataforma-kioscos-autoatencion | refs/heads/master | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/module_utils/facts/network/openbsd.py | 232 | # 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 ... |
ZhiweiWang/django-categories | refs/heads/master | categories/editor/templatetags/admin_tree_list_tags.py | 8 | import django
from django.db import models
from django.template import Library
from django.contrib.admin.templatetags.admin_list import result_headers, _boolean_icon
try:
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
except ImportError:
from categories.editor.utils impor... |
cstipkovic/spidermonkey-research | refs/heads/master | testing/puppeteer/firefox/firefox_puppeteer/ui/deck.py | 1 | # 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/.
from firefox_puppeteer.ui_base_lib import UIBaseLib
class Panel(UIBaseLib):
def __eq__(self, other):
retu... |
Metaswitch/gmock-upstream | refs/heads/master | gtest/test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
akhmadMizkat/odoo | refs/heads/master | addons/sale_timesheet/models/__init__.py | 2 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sale_timesheet
import sale_service
|
bjori/grpc | refs/heads/master | src/python/grpcio_test/setup.py | 3 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
Spe1/android | refs/heads/master | user_manual/conf.py | 58 | # -*- coding: utf-8 -*-
#
# ownCloud Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 22 23:16:40 2012.
#
# 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
# autogenerate... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/site-packages/django/contrib/localflavor/au/au_states.py | 544 | """
An alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('ACT', 'Australian Capital Territory'),
('NSW', 'New South Wales'),
('NT', 'Northern Territory'),
('QLD', 'Q... |
vincent-fei/cobbler | refs/heads/master | cobbler/configgen.py | 16 | """
configgen.py: Generate configuration data.
Copyright 2010 Kelsey Hightower
Kelsey Hightower <kelsey.hightower@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 of the L... |
qantravon/gamers-galore | refs/heads/master | GUI/urllib3/contrib/ntlmpool.py | 714 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... |
longmen21/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py | 21 | import sys
import logging
from contracts import contract, new_contract
from fs.osfs import OSFS
from lazy import lazy
from xblock.runtime import KvsFieldData, KeyValueStore
from xblock.fields import ScopeIds
from xblock.core import XBlock
from opaque_keys.edx.locator import BlockUsageLocator, LocalId, CourseLocator, L... |
marwoodandrew/superdesk-core | refs/heads/master | apps/publish/publish_service_tests.py | 7 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 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
from b... |
gusai-francelabs/datafari | refs/heads/master | windows/python/Lib/idlelib/FileList.py | 123 | import os
from Tkinter import *
import tkMessageBox
class FileList:
# N.B. this import overridden in PyShellFileList.
from idlelib.EditorWindow import EditorWindow
def __init__(self, root):
self.root = root
self.dict = {}
self.inversedict = {}
self.vars = {} # For EditorW... |
HippieStation/HippieStation | refs/heads/master | tools/linux_build.py | 4 | #!/usr/bin/env python
import subprocess
import os
import sys
import argparse
import time
from subprocess import PIPE, STDOUT
null = open("/dev/null", "wb")
def wait(p):
rc = p.wait()
if rc != 0:
p = play("sound/misc/compiler-failure.ogg")
p.wait()
assert p.returncode == 0
sys.... |
CloudNcodeInc/django-celery | refs/heads/3.1-dev | tests/someappwotask/views.py | 6027 | # Create your views here.
|
archen/django | refs/heads/master | django/contrib/redirects/tests.py | 112 | from django import http
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, modify_settings, override_settings
from django.utils import six
from .middleware import RedirectFallbackMiddleware
from .models... |
enixdark/10gen-Courses | refs/heads/master | Relational-SQL/DjangoBlog/Blog/forms.py | 1 | from .models import *
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.core import validators
class UserForm(ModelForm):
password = forms.CharField(widget=forms.PasswordInput(),required=True)
password_confirmation = forms.CharField(widget=forms.Pa... |
clumsy/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/substringBeforeFormatTuple.py | 83 | print("<selection>Hello</selection> %s" % ("World",)) |
ed-/solum | refs/heads/master | solum/objects/sqlalchemy/migration/alembic_migrations/versions/450600086a09_add_user_logs_table.py | 1 | # Copyright 2014 - Rackspace
#
# 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 writing, ... |
qpxu007/Flask-AppBuilder | refs/heads/master | examples/oauth/run.py | 28 | from app import app
app.run(host='0.0.0.0', port=8080, debug=True)
|
wfxiang08/changes | refs/heads/master | changes/api/source_details.py | 2 | from __future__ import absolute_import, division, unicode_literals
from changes.api.base import APIView
from changes.models import Source
from changes.lib.coverage import get_coverage_by_source_id
import logging
class SourceDetailsAPIView(APIView):
# this is mostly copy-pasted from ProjectSourceDetails :(
d... |
ewdurbin/sentry | refs/heads/master | tests/sentry/api/endpoints/test_project_rules.py | 8 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import Rule
from sentry.testutils import APITestCase
class ProjectRuleListTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
team = self.create_team()
project1 = s... |
jmesteve/openerp | refs/heads/master | openerp/addons/sale_crm/__openerp__.py | 54 | # -*- 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... |
jjingrong/PONUS-1.2 | refs/heads/master | venv/build/django/django/views/decorators/csrf.py | 228 | from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import decorator_from_middleware, available_attrs
from functools import wraps
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds ... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_LightGBM_Scipy_nightly/source/numpy/distutils/numpy_distribution.py | 263 | # XXX: Handle setuptools ?
from __future__ import division, absolute_import, print_function
from distutils.core import Distribution
# This class is used because we add new files (sconscripts, and so on) with the
# scons command
class NumpyDistribution(Distribution):
def __init__(self, attrs = None):
# A l... |
shubhdev/openedx | refs/heads/master | lms/djangoapps/notifier_api/tests.py | 115 | import itertools
import ddt
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
from django_comment_common.models import Role, Permission
from lang_pref import LANGUAGE_K... |
illume/numpy3k | refs/heads/master | numpy/doc/performance.py | 100 | """
===========
Performance
===========
Placeholder for Improving Performance documentation.
"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.