repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
uclouvain/osis | refs/heads/dev | base/models/learning_achievement.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
d2emon/generator-pack | refs/heads/master | src/fixtures/en/__init__.py | 1 | from fixtures.space.multiverse import multiverse
from fixtures.names import en as names_en
en = {
'multiverse': multiverse,
'names': names_en,
}
|
sander76/home-assistant | refs/heads/dev | homeassistant/components/buienradar/util.py | 5 | """Shared utilities for different supported platforms."""
import asyncio
from datetime import datetime, timedelta
import logging
import aiohttp
import async_timeout
from buienradar.buienradar import parse_data
from buienradar.constants import (
ATTRIBUTION,
CONDITION,
CONTENT,
DATA,
FORECAST,
H... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/bandolier/mercenary_bandolier.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/npc_dressed_corellia_faye_patrick.py | 85615 | import sys
def setup(core, object):
return |
asgard-lab/neutron | refs/heads/master | neutron/plugins/ml2/drivers/hyperv/constants.py | 17 | # Copyright (c) 2015 Thales Services SAS
# 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 r... |
google/loaner | refs/heads/master | loaner/web_app/backend/api/messages/bootstrap_messages.py | 1 | # Copyright 2018 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 a... |
MaxTyutyunnikov/lino | refs/heads/master | docs/tutorials/polls/manage.py | 2 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "mysite.settings"
#~ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
jyejare/robottelo | refs/heads/master | tests/foreman/api/test_operatingsystem.py | 1 | """Unit tests for the ``operatingsystems`` paths.
References for the relevant paths can be found on your Satellite:
* http://<sat6>/apidoc/v2/operatingsystems.html
* http://<sat6>/apidoc/v2/parameters.html
:Requirement: Operatingsystem
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: ContentManag... |
looker/sentry | refs/heads/master | src/sentry/utils/distutils/commands/__init__.py | 2878 | from __future__ import absolute_import
|
hoogenm/compose | refs/heads/master | compose/cli/docker_client.py | 6 | from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import ssl
from docker import APIClient
from docker.errors import TLSParameterError
from docker.tls import TLSConfig
from docker.utils import kwargs_from_env
from ..const import HTTP_TIMEOUT
from .errors import UserError
fr... |
KAMI911/loec | refs/heads/master | examples/Sharpen/binaries-windows-python26/WmfImagePlugin.py | 3 | #
# The Python Imaging Library
# $Id: WmfImagePlugin.py 2134 2004-10-06 08:55:20Z fredrik $
#
# WMF stub codec
#
# history:
# 1996-12-14 fl Created
# 2004-02-22 fl Turned into a stub driver
# 2004-02-23 fl Added EMF support
#
# Copyright (c) Secret Labs AB 1997-2004. All rights reserved.
# Copyright ... |
acgx/ooi-hack | refs/heads/master | oh_discussion/admin.py | 1 | from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from .models import ONode, OTopic, OReply
admin.site.register(ONode, MPTTModelAdmin)
admin.site.register(OTopic)
admin.site.register(OReply)
|
willprice/weboob | refs/heads/master | modules/orange/module.py | 4 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Nicolas Duhamel
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
b0ri5/fssw-googlecode | refs/heads/master | third-party/gtest-1.5.0/test/gtest_list_tests_unittest.py | 1068 | #!/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... |
thedrow/django-rest-framework-1 | refs/heads/master | rest_framework/status.py | 110 | """
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.org/html/rfc6585
"""
from __future__ import unicode_literals
def is_informational(code):
return code >= 100 and code <= 199
def is_success(code):
r... |
isnnn/Sick-Beard-TPB | refs/heads/ThePirateBay | lib/hachoir_core/text_handler.py | 90 | """
Utilities used to convert a field to human classic reprentation of data.
"""
from lib.hachoir_core.tools import (
humanDuration, humanFilesize, alignValue,
durationWin64 as doDurationWin64,
deprecated)
from types import FunctionType, MethodType
from lib.hachoir_core.field import Field
def textHandler(... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/django_extensions/management/commands/admin_generator.py | 23 | # -*- coding: utf-8 -*-
'''
The Django Admin Generator is a project which can automatically generate
(scaffold) a Django Admin for you. By doing this it will introspect your
models and automatically generate an Admin with properties like:
- `list_display` for all local fields
- `list_filter` for foreign keys with fe... |
maxalbert/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/styling_glyph_properties.py | 39 | from bokeh.plotting import figure, output_file, show
output_file("axes.html")
p = figure(plot_width=400, plot_height=400)
r = p.circle([1,2,3,4,5], [2,5,8,2,7])
glyph = r.glyph
glyph.size = 60
glyph.fill_alpha = 0.2
glyph.line_color = "firebrick"
glyph.line_dash = [6, 3]
glyph.line_width = 2
show(p)
|
nharraud/b2share | refs/heads/master | invenio/b2share/modules/b2deposit/b2share_model/metadata/__init__.py | 26 | """
B2SHARE
"""
|
samukasmk/smkcpanel | refs/heads/master | smkcpanel_django/manage.py | 2 | #!/Users/samukasmk/Projects/django_examples/smkcpanel/venv/bin/python
#
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smkcpanel_django.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
mosbasik/buzhug | refs/heads/master | javasrc/lib/Jython/Lib/sre_constants.py | 349 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
anisyonk/pilot | refs/heads/master | EventRanges.py | 3 | #
import json
import os
import traceback
from pUtil import httpConnect, tolog
from EventRangesPandaProxy import downloadEventRangesPandaProxy, updateEventRangePandaProxy, updateEventRangesPandaProxy
def downloadEventRanges(jobId, jobsetID, taskID, pandaProxySecretKey=None, numRanges=10, url="https://pandaserver.cern.... |
shaon/eutester | refs/heads/master | eutester/sshconnection.py | 3 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... |
Edraak/circleci-edx-platform | refs/heads/circleci-master | common/lib/xmodule/xmodule/hidden_module.py | 114 | from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
class HiddenModule(XModule):
HIDDEN = True
def get_html(self):
if self.system.user_is_staff:
return u"ERROR: This module is unknown--students will not see it at all"
else:
return u""
c... |
acquia/Diamond | refs/heads/master | src/collectors/monit/monit.py | 25 | # coding=utf-8
"""
Collect the monit stats and report on cpu/memory for monitored processes
#### Dependencies
* monit serving up /_status
"""
import urllib2
import base64
from xml.dom.minidom import parseString
import diamond.collector
from diamond.collector import str_to_bool
class MonitCollector(diamond.col... |
ZachRiegel/scriptbin | refs/heads/master | pypyjs/modules/pty.py | 173 | """Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
from select import select
imp... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/htmllib.py | 312 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from warnings import warnpy3k
warnpy3k("the htmllib module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
import sgmllib
from formatter import AS_IS
__all__ = ["HTMLPars... |
tturpen/django-csaesrapp | refs/heads/version01 | apps/common/exceptions.py | 1 | # Copyright (C) 2014 Taylor Turpen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in th... |
stifoon/navitia | refs/heads/dev | source/tyr/setup.py | 14 | #!/usr/bin/env python
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobi... |
v-legoff/croissant | refs/heads/master | croissant/language/keyword/scenario_title.py | 1 | # Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... |
SIfoxDevTeam/wireshark | refs/heads/master | tools/dftestlib/__init__.py | 40 | #
# Copyright (C) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
... |
jeremytubbs/presidial | refs/heads/master | presidial/photos/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
webmasterraj/FogOrNot | refs/heads/master | flask/lib/python2.7/site-packages/pandas/sparse/tests/test_sparse.py | 2 | # pylint: disable-msg=E1101,W0612
import operator
from datetime import datetime
import functools
import nose
from numpy import nan
import numpy as np
import pandas as pd
dec = np.testing.dec
from pandas.util.testing import (assert_almost_equal, assert_series_equal,
assert_frame_equa... |
AhmedHani/Bioinformatics | refs/heads/master | CS614/Week5/__init__.py | 23 | ___author__ = 'Ahmed Hani Ibrahim' |
springer-math/Mathematics-of-Epidemics-on-Networks | refs/heads/master | docs/examples/arbitrary_dynamics/Compete.py | 1 | r'''We consider two diseases that compete in the sense that if an individual has
recovered from one disease, then if it is infected with the other disease it
transmits with lower rate and it recovers faster.'''
import EoN
import networkx as nx
from collections import defaultdict
import matplotlib.pyplot as plt
N = 100... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/weapon/wpn_spacestation_rebel_turret_s01.py | 85615 | import sys
def setup(core, object):
return |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | script.module.resolveurl/lib/resolveurl/plugins/zevera.py | 3 | """
resolveurl XBMC Addon
Copyright (C) 2013 Bstrdsmkr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
klahnakoski/MySQL-to-S3 | refs/heads/master | vendor/jx_python/jx.py | 1 | # encoding: 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
hassanabidpk/django | refs/heads/master | django/contrib/gis/db/backends/oracle/operations.py | 307 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... |
mayankcu/Django-social | refs/heads/master | venv/Lib/site-packages/django/contrib/localflavor/uy/uy_departaments.py | 396 | # -*- coding: utf-8 -*-
"""A list of Urguayan departaments as `choices` in a formfield."""
DEPARTAMENT_CHOICES = (
('G', u'Artigas'),
('A', u'Canelones'),
('E', u'Cerro Largo'),
('L', u'Colonia'),
('Q', u'Durazno'),
('N', u'Flores'),
('O', u'Florida'),
('P', u'Lavalleja'),
('B', u'M... |
benoitsteiner/tensorflow-opencl | refs/heads/master | tensorflow/python/estimator/inputs/queues/feeding_queue_runner_test.py | 116 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
bio-tools/biotoolsregistry | refs/heads/master | backend/elixir/serialization/resource_serialization/resourceRequest.py | 1 | from rest_framework import serializers
from elixir.models import *
from elixir.validators import *
from elixir.request_handling import ResourceRequestHandler
class ResourceRequestSerializer(serializers.ModelSerializer):
username = serializers.CharField(allow_blank=False, max_length=25, min_length=1, source="user.use... |
nilsonmorales/Badass | refs/heads/master | Packages_POU/pre-paquetes/20140430/20140430.pet/usr/share/lib/ROX-Lib2/python/rox/fileutils.py | 1 | """Utilities to perform various operations on paths, with support for
opening the ROX filer to examine locations if things go wrong.
Typical usage:
import rox.fileutils
rox.fileutils.makedirs('/path/for/new/directory')
"""
import os
from rox import _
def report_patherror(message, path):
"""Display a <Cancel>/<Re... |
israeleriston/scientific-week | refs/heads/master | backend/venv/lib/python3.5/site-packages/setuptools/sandbox.py | 80 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import textwrap
from setuptools.extern import six
from setuptools.extern.six.moves import builtins, map
import pkg_resources.py31compat
if sys.platform.startswith('java'):
import org.p... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/DefinedInTryElse.py | 83 | def f(g):
x = 1
try:
pass
except Exception:
pass
else:
x = g()
print(x) #pass
|
liqd/adhocracy4 | refs/heads/master | tests/exports/test_export_view.py | 1 | import pytest
from adhocracy4.exports.views import AbstractXlsxExportView
from adhocracy4.exports.views import BaseExport
@pytest.mark.django_db
def test_base_export(idea_factory, module, category_factory):
idea0 = idea_factory(module=module)
idea1 = idea_factory(module=module)
idea1.category = category_... |
hgl888/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | tools/swig/swig.py | 133 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper around swig.
Sets the SWIG_LIB environment var to point to Lib dir
and defers control to the platform-specific swig bin... |
cognitiveclass/edx-platform | refs/heads/master | lms/djangoapps/instructor/views/instructor_task_helpers.py | 35 | """
A collection of helper utility functions for working with instructor
tasks.
"""
import json
import logging
from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from instructor_... |
madhukar01/coala-bears | refs/heads/master | bears/python/VultureBear.py | 11 | import re
from shutil import which
from coalib.bears.GlobalBear import GlobalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.misc.Shell import run_shell_command
from coalib.results.Result import Result
class VultureBear(GlobalBear):
LANGUAGES = {'Python', 'Python 3'}... |
TNT-Samuel/Coding-Projects | refs/heads/master | DNS Server/Source/Lib/site-packages/winpython/_vendor/qtpy/_version.py | 4 | version_info = (1, 4, 2)
__version__ = '.'.join(map(str, version_info))
|
SamuelToh/pixelated-user-agent | refs/heads/master | service/test/unit/adapter/test_draft_service.py | 7 | import unittest
from twisted.internet import defer
from pixelated.adapter.mailstore.leap_mailstore import LeapMail
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.services.draft_service import DraftService
import test.support.test_helper as test_helper
from mockito import mock, verify, inorde... |
kzvyahin/cfme_tests | refs/heads/master | cfme/tests/containers/test_containers_summary.py | 1 | import pytest
from cfme.web_ui import StatusBox
from utils import testgen, version
from utils.version import current_version
pytestmark = [
pytest.mark.uncollectif(
lambda: current_version() < "5.6"),
pytest.mark.usefixtures('has_no_container_providers'),
pytest.mark.usefixtures('setup_provider'),
... |
youprofit/phantomjs | refs/heads/master | src/qt/qtbase/util/local_database/enumdata.py | 102 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License... |
ttyangf/pdfium_gyp | refs/heads/master | test/lib/TestGyp.py | 46 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
TestGyp.py: a testing framework for GYP integration tests.
"""
import collections
from contextlib import contextmanager
import itertools
import os
import ran... |
sauloal/arduino | refs/heads/master | shields/xbee/python-xbee/examples/receive_samples.py | 39 | #! /usr/bin/python
"""
receive_samples.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
This example continuously reads the serial port and processes IO data
received from a remote XBee.
"""
from xbee import XBee
import serial
PORT = '/dev/ttyUSB0'
BAUD_RATE = 9600
# Open serial port
ser = serial.Serial(PORT, BAUD_R... |
RayMick/scikit-learn | refs/heads/master | sklearn/linear_model/randomized_l1.py | 68 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... |
fengbaicanhe/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/backends/postgresql/version.py | 317 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL 8.3.6
# EnterpriseDB 8.3
# PostgreSQL 8.3 beta4
# PostgreSQL 8.4beta1
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_v... |
werkt/bazel | refs/heads/master | third_party/py/concurrent/__init__.py | 475 | from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
simod/geonode | refs/heads/master | geonode/services/migrations/0034_auto_20180309_0917.py | 7 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-09 09:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0033_merge'),
]
operations = [
migrations.AlterField(
... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/ifInElifBranchUnwrap_before.py | 249 | if "1":
print 1
elif "2":
print<caret> 2
else:
print 3 |
JTCunning/sentry | refs/heads/master | src/sentry/services/__init__.py | 41 | """
sentry.services
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
|
Russell-IO/ansible | refs/heads/devel | test/units/module_utils/facts/test_ansible_collector.py | 35 | # -*- coding: utf-8 -*-
#
#
# 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 it wi... |
appsembler/edx-platform | refs/heads/appsembler/tahoe/master | lms/djangoapps/commerce/admin.py | 19 | """ Admin site bindings for commerce app. """
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .models import CommerceConfiguration
admin.site.register(CommerceConfiguration, ConfigurationModelAdmin)
|
zammitjames/pyo | refs/heads/master | examples/sequencing/02_random_score.py | 12 | #!/usr/bin/env python
# encoding: utf-8
"""
Calling Python function from an audio stream with the Score object.
"""
from pyo import *
import random
s = Server(sr=44100, nchnls=2, buffersize=256, duplex=0).boot()
# Frequency of event generation in Hz
GEN_FREQ = .25
aamp = Linseg([(0,0),(1./GEN_FREQ,1),(2./GEN_FREQ,... |
ammaradil/fibonacci | refs/heads/master | Lib/site-packages/pip/_vendor/six.py | 878 | """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... |
finfish/scrapy | refs/heads/master | scrapy/commands/parse.py | 9 | from __future__ import print_function
import json
import logging
from w3lib.url import is_url
from scrapy.commands import ScrapyCommand
from scrapy.http import Request
from scrapy.item import BaseItem
from scrapy.utils import display
from scrapy.utils.conf import arglist_to_dict
from scrapy.utils.spider import iterat... |
gromaudio/linux-imx6 | refs/heads/vline-r13.4ga | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... |
kiyoto/statsmodels | refs/heads/master | statsmodels/examples/ex_inter_rater.py | 33 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 10 08:54:02 2012
Author: Josef Perktold
"""
from __future__ import print_function
import numpy as np
from numpy.testing import assert_almost_equal
from statsmodels.stats.inter_rater import fleiss_kappa, cohens_kappa, KappaResults
table0 = np.asarray('''\
1 0 0 0 ... |
jgmize/nucleus | refs/heads/master | vendor-local/lib/python/requests/sessions.py | 12 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .compat import cookielib, OrderedDict, urljoin, urlparse, urlu... |
googleads/googleads-python-lib | refs/heads/master | examples/ad_manager/v202011/targeting_preset_service/__init__.py | 3 | #!/usr/bin/env python
#
# Copyright 2019 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 requir... |
iagapov/ocelot | refs/heads/master | lib/genera/src/cpp/undulator/compile.py | 3 | # for windows - important to add this file to PATH ..\Pre-built.2\lib\pthreadGC2.dll
# otherwise xcode will not work.
import subprocess
import shlex
import os
from sys import platform
print "platform = ", platform, " os.name = ", os.name
if os.name == "nt":
cmd = 'c:/MinGW/bin/mingw32-make -f Makefile'
else:
cm... |
ai-se/Transfer-Learning | refs/heads/master | src/tools/axe/fi.py | 2 | from __future__ import division
import sys
sys.dont_write_bytecode = True
from lib import *
from demos import *
from counts import *
from table import *
@demo
def _discreteTable(f="data.dat/weather2.csv"):
for row in discreteTable(f)._rows:
rprint(row)
def ediv(lst, lvl=0,tiny=The.tree.min,
dull... |
pombreda/swarming | refs/heads/master | appengine/isolate/third_party/mapreduce/lib/graphy/bar_chart.py | 77 | #!/usr/bin/env python
#
# Copyright 2008 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 ... |
jwhui/openthread | refs/heads/cli | tests/toranj/test-005-discover-scan.py | 7 | #!/usr/bin/env python3
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
miminus/youtube-dl | refs/heads/master | youtube_dl/extractor/atttechchannel.py | 155 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_strdate
class ATTTechChannelIE(InfoExtractor):
_VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)'
_TEST = {
'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27... |
tchx84/debian-pkg-sugar-toolkit-gtk3 | refs/heads/master | src/sugar3/activity/webkit1.py | 8 | # Copyright (C) 2013 Gonzalo Odiard
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distrib... |
biddisco/VTK | refs/heads/master | Utilities/vtkTclTest2Py/info.py | 13 | """Selective implementation of tcl info command.
This script is used while running python tests translated from Tcl."""
import re
def command (caller_globals, caller_locals, pattern):
return commands(caller_globals, caller_locals, pattern)
def commands (caller_globals, caller_locals, pattern):
print "pattern... |
hfercc/mese2014 | refs/heads/master | webboard/permissions.py | 1 | from common.permissions import IsSubClass
from .mixins import CanWriteMixin
__all__ = ['CanWrite']
CanWrite = IsSubClass(CanWriteMixin, safe_methods = True)
|
maxalbert/ansible | refs/heads/devel | lib/ansible/parsing/yaml/constructor.py | 174 | # (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... |
dokipen/whoosh | refs/heads/trunk | src/whoosh/lang/wordnet.py | 10 | #===============================================================================
# Copyright 2009 Matt Chaput
#
# 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/li... |
gnmiller/craig-bot | refs/heads/master | craig-bot/lib/python3.6/site-packages/discord/ext/tasks/__init__.py | 1 | import asyncio
import aiohttp
import websockets
import discord
import inspect
from discord.backoff import ExponentialBackoff
MAX_ASYNCIO_SECONDS = 3456000
class Loop:
"""A background task helper that abstracts the loop and reconnection logic for you.
The main interface to create this is through :func:`loop`... |
jameslittle/python-social-auth | refs/heads/master | social/apps/django_app/__init__.py | 70 | """
Django framework support.
To use this:
* Add 'social.apps.django_app.default' if using default ORM,
or 'social.apps.django_app.me' if using mongoengine
* Add url('', include('social.apps.django_app.urls', namespace='social')) to
urls.py
* Define SOCIAL_AUTH_STORAGE and SOCIAL_AUTH_STRATEGY, default v... |
seocam/django | refs/heads/master | tests/view_tests/tests/test_i18n.py | 8 | # -*- coding:utf-8 -*-
import gettext
import json
import os
import unittest
from os import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import (
LiveServerTestCase, TestCase, modify_settings, override_settings,
)
from django.utils import six
from django.utils.... |
lilferraro/android_kernel_samsung_lt02ltespr | refs/heads/f4k | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
varunarya10/python-glanceclient | refs/heads/master | glanceclient/v1/client.py | 3 | # Copyright 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 requ... |
doom369/FrameworkBenchmarks | refs/heads/master | frameworks/Python/pyramid/frameworkbenchmarks/__init__.py | 71 | """
App config and initialization.
"""
from pyramid.request import Request
from pyramid.config import Configurator
from frameworkbenchmarks.models import sqlalchemy_encoder_factory
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(setting... |
supriyantomaftuh/pip | refs/heads/develop | pip/_vendor/packaging/__about__.py | 441 | # Copyright 2014 Donald Stufft
#
# 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, so... |
kaiserroll14/301finalproject | refs/heads/master | main/pandas/io/tests/test_wb.py | 9 | import nose
import pandas
from pandas.compat import u
from pandas.util.testing import network
from pandas.util.testing import assert_frame_equal
from numpy.testing.decorators import slow
import pandas.util.testing as tm
# deprecated
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
from pand... |
rew4332/tensorflow | refs/heads/rew4332-patch-1 | tensorflow/contrib/slim/python/slim/nets/vgg.py | 4 | # 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 applicable ... |
OpenHumans/open-humans | refs/heads/master | data_import/__init__.py | 2 | default_app_config = "data_import.apps.DataImportConfig"
|
DONIKAN/django | refs/heads/master | tests/invalid_models_tests/test_models.py | 66 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.conf import settings
from django.core.checks import Error
from django.db import connections, models
from django.test.utils import override_settings
from .base import IsolatedModelsTestCase
def get_max_column_name_length()... |
KISSMonX/micropython | refs/heads/master | tests/basics/string_escape.py | 118 | a = "a\1b"
print(len(a))
print(ord(a[1]))
print(len("a\123b"))
a = "a\12345b"
print(len(a))
print(ord(a[1]))
a = "a\xffb"
print(len(a))
print(ord(a[1]))
|
ziirish/burp-ui | refs/heads/master | migrations/versions/4445080944ee_hidden_hosts_management.py | 1 | """hidden hosts management
Revision ID: 4445080944ee
Revises: 695dcbd29d4f
Create Date: 2018-10-03 11:47:20.028686
"""
# revision identifiers, used by Alembic.
revision = "4445080944ee"
down_revision = "695dcbd29d4f"
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated b... |
rschroen/django-xfeed | refs/heads/master | xfeed/admin.py | 1 | from django.contrib import admin
from models import Feed, Tweet, RSSItem, RSSChannelData
class RSSChannelDataInline(admin.StackedInline):
model = RSSChannelData
class FeedAdmin(admin.ModelAdmin):
inlines = [RSSChannelDataInline]
def get_formsets_with_inlines(self, request, obj=None):
for inline i... |
mchaperc/experiment | refs/heads/master | node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... |
yangrongwei/gyp | refs/heads/master | test/rules/gyptest-special-variables.py | 321 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Verifies that VS variables that require special variables are expanded
correctly. """
import sys
import TestGyp
if sys.platform == 'wi... |
liukaijv/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_types04.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
ahawker/decorstate | refs/heads/master | setup.py | 1 | """
decorstate
~~~~~~~~~~
Simple "state machines" with Python decorators.
:copyright: (c) 2015-2017 Andrew Hawker
:license: Apache 2.0, see LICENSE for more details.
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='decorstate',
... |
Cog-Creators/Red-DiscordBot | refs/heads/V3/develop | redbot/cogs/audio/core/commands/llset.py | 3 | import logging
from pathlib import Path
import discord
from redbot.core import commands
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import box
from ..abc import MixinMeta
from ..cog_utils import CompositeMetaClass
log = logging.getLogger("red.cogs.Audio.cog.Commands.lavalink_setup... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.