repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
punchagan/zulip | refs/heads/master | zerver/views/muting.py | 3 | import datetime
from typing import Optional
from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _
from zerver.lib.actions import do_mute_topic, do_mute_user, do_unmute_topic, do_unmute_user
from zerver.lib.request impo... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-65/16-files/sheets/lib/python2.7/site-packages/pip/_vendor/html5lib/_trie/__init__.py | 456 | from __future__ import absolute_import, division, unicode_literals
from .py import Trie as PyTrie
Trie = PyTrie
# pylint:disable=wrong-import-position
try:
from .datrie import Trie as DATrie
except ImportError:
pass
else:
Trie = DATrie
# pylint:enable=wrong-import-position
|
ClovisIRex/Snake-django | refs/heads/master | env/lib/python3.6/site-packages/setuptools/launch.py | 464 | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been... |
superchilli/webapp | refs/heads/master | app/api_1_0/comments.py | 1 | from flask import jsonify, request, g, url_for, current_app
from .. import db
from ..models import Post, Permission, Comment
from . import api
from .decorators import permission_required
@api.route('/comments')
def get_comments():
page = request.args.get('page', 1, type=int)
pagination = Comment.query.order_b... |
bdyetton/prettychart | refs/heads/feature/pretty_charts | scripts/consistency/ensure_wiki_and_files.py | 55 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Adds wiki and osffiles addons to nodes that do not have them.
Log:
Performed on production by sloria on 2014-08-19 at 4:55PM (EST). 2008 projects
without the OSF File Storage Addon were migrated. 2 projects without the
OSF Wiki addon were migrated.
"""
im... |
40223226/2015cdbg80420 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/spur.py | 184 | #coding: utf-8
import math
# 導入數學函式後, 圓周率為 pi
# deg 為角度轉為徑度的轉換因子
deg = math.pi/180.
class Spur(object):
def __init__(self, ctx):
self.ctx = ctx
def create_line(self, x1, y1, x2, y2, width=3, fill="red"):
self.ctx.beginPath()
self.ctx.lineWidth = width
self.ctx.moveTo(x1, y1)
... |
jfantom/incubator-airflow | refs/heads/master | airflow/contrib/hooks/spark_sql_hook.py | 16 | # -*- coding: utf-8 -*-
#
# 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
... |
cschenck/blender_sim | refs/heads/master | fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/xml/dom/minidom.py | 4 | """\
minidom.py -- a lightweight DOM implementation.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
interface
* SAX 2 namespaces
"""
import io
impo... |
kanpol/hk | refs/heads/master | hooker_xp/hooker_xp/report/ReportingConfiguration.py | 3 | # -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| |
#| Android's Hooker |
#| ... |
henkvos/xhtml2pdf | refs/heads/master | demo/cherrypy/demo-cherrypy.py | 154 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
#############################################
## (C)opyright by Dirk Holtwick, 2008 ##
## All rights reserved ##
#############################################
import cherrypy as cp
import sx.pisa3 as pisa
import cStringIO as StringIO
try:
im... |
matthappens/taskqueue | refs/heads/master | taskqueue/TranscodeJobMessage.py | 1 | from AmazonSQSMessage import AmazonSQSMessage
class TranscodeJobMessage (AmazonSQSMessage):
"""
Interface for an TranscodeJobMessage message.
"""
def __init__ (self, name = None, bucket = None, destinationBucket = None, filePath = None, destinationPath = None):
"""
Initializes the mess... |
AustralianSynchrotron/sinspect | refs/heads/master | help.py | 1 | # Routines borrowed from mayavi2
# Authors: Gael Varoquaux <gael.varoquaux[at]normalesup.org>
# Prabhu Ramachandran
# Copyright (c) 2007-2008, Enthought, Inc.
# License: BSD Style.
import os, sys
# To find the html documentation directory, first look under the
# standard place. If that directory do... |
jereze/scikit-learn | refs/heads/master | sklearn/linear_model/logistic.py | 57 | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
imp... |
40223151/2015cd0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/base.py | 603 | #!/usr/bin/env python
## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py
'''Pygame core routines
Contains the core routines that are used by the rest of the
pygame modules. Its routines are merged directly into the pygame
namespace. This mainly includes the auto-initia... |
Weicong-Lin/pymo-global | refs/heads/master | android/pgs4a-0.9.6/python-install/lib/python2.7/distutils/tests/setuptools_build_ext.py | 149 | from distutils.command.build_ext import build_ext as _du_build_ext
try:
# Attempt to use Pyrex for building extensions, if available
from Pyrex.Distutils.build_ext import build_ext as _build_ext
except ImportError:
_build_ext = _du_build_ext
import os, sys
from distutils.file_util import copy_file
from di... |
ecederstrand/django | refs/heads/master | django/contrib/gis/forms/__init__.py | 597 | from django.forms import * # NOQA
from .fields import ( # NOQA
GeometryCollectionField, GeometryField, LineStringField,
MultiLineStringField, MultiPointField, MultiPolygonField, PointField,
PolygonField,
)
from .widgets import BaseGeometryWidget, OpenLayersWidget, OSMWidget # NOQA
|
psachin/swift | refs/heads/master | swift/proxy/controllers/info.py | 7 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
splunk/splunk-webframework | refs/heads/master | contrib/requests/requests/packages/urllib3/util.py | 65 | # urllib3/util.py
# Copyright 2008-2012 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
from base64 import b64encode
from collections import namedtuple
from socket import error as Socke... |
ritikm/googletest | refs/heads/master | test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
mmakmo/python | refs/heads/master | crawling_scraping/chapter03/python_crawler_2.py | 1 | import requests
import lxml.html
response = requests.get('https://gihyo.jp/dp')
root = lxml.html.fromstring(response.content)
root.make_links_absolute(response.url)
for a in root.cssselect('#listBook a[itemprop="url"]'):
url = a.get('href')
print(url)
|
no2a/ansible | refs/heads/devel | lib/ansible/plugins/cache/__init__.py | 62 | # (c) 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) any lat... |
HaiQW/Optimal | refs/heads/master | __init__.py | 1 | __author__ = "HaiQW"
|
safwanrahman/readthedocs.org | refs/heads/master | readthedocs/search/parse_json.py | 2 | # -*- coding: utf-8 -*-
"""Functions related to converting content into dict/JSON structures."""
from __future__ import absolute_import
import logging
import codecs
import fnmatch
import json
import os
from builtins import next, range # pylint: disable=redefined-builtin
from pyquery import PyQuery
log = logging.ge... |
DjangoCalendar/DjangoCalendar | refs/heads/master | DjangoReadyProject/DjangoProject/src/CalendarApp/urls.py | 1 | from django.conf.urls import patterns, url
from django.conf import settings
from CalendarApp import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^(?P<poll_id>\d+)$', views.detail, name='detail'),
url(r'^results/(?P<poll_id>\d+)$', views.results, name='results'),
url(r'^... |
ReachingOut/unisubs | refs/heads/staging | apps/teams/migrations/0042__add_projecdt_model.py | 5 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table('teams_project', (
('name', self.gf('django.db.mo... |
ojengwa/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapyd/sqlite.py | 16 | import sqlite3
import cPickle
from UserDict import DictMixin
from scrapy.utils.py26 import json
class SqliteDict(DictMixin):
"""SQLite-backed dictionary"""
def __init__(self, database=None, table="dict"):
self.database = database or ':memory:'
self.table = table
# about check_same_th... |
wfxiang08/django190 | refs/heads/master | django/conf/locale/cs/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i'
DATET... |
philn/openwebrtc | refs/heads/master | bindings/java/standard_types.py | 32 | # Copyright (c) 2014-2015, Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... |
josiah-wolf-oberholtzer/uqbar | refs/heads/master | tests/test_graphs_Table.py | 1 | from uqbar.graphs import (
Graph,
LineBreak,
Node,
Table,
TableCell,
TableRow,
Text,
)
from uqbar.strings import normalize
def test_graphs_Table():
"""
digraph structs {
node [shape=plaintext]
struct1:f1 -> struct2:f0;
struct1:f2 -> struct3:here;
}
... |
zhufangxing/ndnCDN | refs/heads/cdn | src/core/bindings/modulegen__gcc_ILP32.py | 7 | 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))
... |
guaycuru/gmvault | refs/heads/master | src/gmv/gmvault.py | 1 | '''
Gmvault: a tool to backup and restore your gmail account.
Copyright (C) <since 2011> <guillaume Aubert (guillaume dot aubert at gmail do com)>
This program 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 Fr... |
PanDAWMS/panda-server | refs/heads/master | pandaserver/taskbuffer/SiteSpec.py | 1 | """
site specification
"""
import re
class SiteSpec(object):
# attributes
_attributes = ('sitename', 'nickname', 'dq2url', 'cloud', 'ddm', 'ddm_input', 'ddm_output', 'type',
'releases', 'memory', 'maxtime', 'status', 'space', 'retry', 'setokens_input', 'setokens_output',
... |
abomyi/django | refs/heads/master | tests/admin_inlines/tests.py | 5 | from __future__ import unicode_literals
import datetime
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.... |
Voluntarynet/BitmessageKit | refs/heads/master | BitmessageKit/Vendor/static-python/Lib/test/test_imaplib.py | 48 | from test import test_support as support
# If we end up with a significant number of tests that don't require
# threading, this test module should be split. Right now we skip
# them all if we don't have threading.
threading = support.import_module('threading')
from contextlib import contextmanager
import imaplib
impo... |
incuna/django-extensible-profiles | refs/heads/master | profiles/modules/options/models.py | 1 | from django.db import models
from django.utils.safestring import mark_safe
from orderable.models import Orderable
class Option(Orderable):
"""
User options (op-ins)
"""
name = models.CharField(max_length=150)
class Meta:
app_label = 'profiles'
ordering = ('sort_order',)
... |
dkoudlo/myVagrantBox | refs/heads/master | myKitchen/cookbooks/python/files/default/get-pip.py | 136 | null |
blink1073/pexpect | refs/heads/master | setup.py | 2 | from distutils.core import setup
import os
import re
with open(os.path.join(os.path.dirname(__file__), 'pexpect', '__init__.py'), 'r') as f:
for line in f:
version_match = re.search(r"__version__ = ['\"]([^'\"]*)['\"]", line)
if version_match:
version = version_match.group(1)
... |
lightningwolf/lightningwolf-smp | refs/heads/master | lightningwolf_smp/models/domain_base.py | 1 | #!/usr/bin/env python
# coding=utf8
from lightningwolf_smp.models import Base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship, backref
class Domain(Base):
__tablename__ = 'domain'
id = Column(Integer, primary_key=True)
parent_id = Column(Integer, nullabl... |
mattclay/ansible | refs/heads/devel | lib/ansible/cli/pull.py | 11 | # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import datetime
import os
import ... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/__init__.py | 1 | # 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 may ... |
dlenski/tapiriik | refs/heads/master | manage.py | 16 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tapiriik.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
walletiger/libyuv | refs/heads/master | download_vs_toolchain.py | 187 | #!/usr/bin/env python
#
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All cont... |
CapOM/ChromiumGStreamerBackend | refs/heads/master | build/android/gyp/util/__init__.py | 998 | # 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.
|
SebastianLloret/Clever-Bot | refs/heads/master | future/backports/urllib/response.py | 82 | """Response classes used by urllib.
The base class, addbase, defines a minimal file-like interface,
including read() and readline(). The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
"""
from __future__ import absolut... |
roger-zhao/ardupilot-3.5-dev | refs/heads/master | Tools/ardupilotwaf/cxx_checks.py | 21 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... |
QingChenmsft/azure-cli | refs/heads/master | src/command_modules/azure-cli-servicefabric/azure/cli/command_modules/servicefabric/tests/test_sf_commands.py | 4 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
mlperf/training_results_v0.7 | refs/heads/master | Google/benchmarks/resnet/implementations/resnet-cloud-TF2.0-tpu-v3-32/tf2_common/utils/flags/_misc.py | 2 | # Copyright 2018 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... |
birdland/dlkit-doc | refs/heads/master | dlkit/osid/osid_errors.py | 8 | """Convenience error module pass-through to abstract_osid errors"""
# pylint: disable=wildcard-import, unused-wildcard-import
from dlkit.abstract_osid.osid.errors import *
|
yitian134/chromium | refs/heads/master | media/tools/constrained_network_server/traffic_control_test.py | 187 | #!/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.
"""End-to-end tests for traffic control library."""
import os
import re
import sys
import unittest
import traffic_control
class... |
ZuoGuocai/python | refs/heads/master | Silocean/0001/Test.py | 37 | # -*-coding:utf-8-*-
__author__ = 'Tracy'
import uuid
f = open('keys.txt', 'w')
for i in range(200):
f.write(str(uuid.uuid1())+"\n")
f.close()
|
bromjiri/Presto | refs/heads/master | trainer/tests/stop.py | 1 | import datetime
import trainer.corpora as crp
import trainer.features as ftr
import trainer.classifier_test as cls
import os
# vars
type = "stop-pos"
nltk_run = True
sklearn_run = False
COUNT = 5000
cut = int((COUNT / 2) * 3 / 4)
array = [True]
def run(dataset):
nlt = dict()
skl = dict()
dir = "output/... |
Bulochkin/tensorflow_pack | refs/heads/master | tensorflow/contrib/makefile/downloads/protobuf/python/google/protobuf/internal/api_implementation.py | 82 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
Shaswat27/scipy | refs/heads/master | scipy/stats/tests/test_mstats_basic.py | 29 | """
Tests for the stats.mstats module (support for masked arrays)
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import nan
import numpy.ma as ma
from numpy.ma import masked, nomask
import scipy.stats.mstats as mstats
from scipy import stats
from co... |
Storj/metacore | refs/heads/master | metacore/tests/test_download.py | 1 | import sys
import copy
import json
import os.path
import unittest
from hashlib import sha256
from metacore import storj
from metacore.database import files
from metacore.error_codes import *
from metacore.tests import *
if sys.version_info.major == 3:
from unittest.mock import patch
else:
from mock import pat... |
mpbristol/qualitybots | refs/heads/master | src/appengine/handlers/handle_signup.py | 26 | #!/usr/bin/python2.4
#
# Copyright 2011 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... |
liosha2007/temporary-groupdocs-python3-sdk | refs/heads/master | groupdocs/models/CreateFolderResult.py | 2 | #!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... |
dawran6/zulip | refs/heads/master | tools/lib/html_grep.py | 10 | from __future__ import absolute_import
from __future__ import print_function
from collections import defaultdict
from six.moves import range
from typing import Dict, List, Set
from .html_branches import html_branches, HtmlTreeBranch
def show_all_branches(fns):
# type: (List[str]) -> None
for fn in fns:
... |
BT-astauder/odoo | refs/heads/8.0 | addons/hw_scanner/__openerp__.py | 93 | # -*- 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... |
CforED/Machine-Learning | refs/heads/master | sklearn/linear_model/perceptron.py | 245 | # Author: Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from ..feature_selection.from_model import _LearntSelectorMixin
class Perceptron(BaseSGDClassifier, _LearntSelectorMixin):
"""Perceptron
Read more in the :ref:`User Guide <perceptron>`.
Parameters
-... |
moonbeamxp/ns-3 | refs/heads/master | src/dsr/bindings/modulegen__gcc_ILP32.py | 14 | 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))
... |
jjscarafia/odoo | refs/heads/master | addons/pad/__init__.py | 433 | # -*- coding: utf-8 -*-
import pad
import res_company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
SodaCookie/graphics | refs/heads/master | setup.py | 1 | from setuptools import setup, Extension
import os
os.environ["CC"] = "g++"
include_dirs = ["C:\MinGW\include\SDL", "C:\MinGW\include", "C:\Python32\include"]
library_dirs = ["C:\MinGW\lib", "C:\Python32\libs"]
libraries = ["SDL2", "SDL2main"]
setup(name='graphics',
version='1.0',
author="Eric Zhang",
... |
maestro-hybrid-cloud/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/networks/subnets/views.py | 12 | # Copyright 2012 NEC Corporation
#
# 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... |
gnmiller/craig-bot | refs/heads/master | craig-bot/lib/python3.6/site-packages/googleapiclient/discovery_cache/appengine_memcache.py | 42 | # 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 ... |
xfournet/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_0/_pkg1_0_0_0/_pkg1_0_0_0_1/__init__.py | 30 | from ._mod1_0_0_0_1_0 import *
from ._mod1_0_0_0_1_1 import *
from ._mod1_0_0_0_1_2 import *
from ._mod1_0_0_0_1_3 import *
from ._mod1_0_0_0_1_4 import * |
potatolondon/assetpipe | refs/heads/master | assetpipe/outputters/blobstore.py | 1 | import os
import logging
from django.http import HttpResponse, HttpResponseNotFound
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from ..base import Outputter
try:
#Import the Google App Engine Blobstore if we have it
#but don't die (yet) if we don't.
from google... |
kohnle-lernmodule/exeLearningPlus1_04 | refs/heads/master | exe/xului/propertiespage.py | 2 | # ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
#
# 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... |
Universal-Model-Converter/UMC3.0a | refs/heads/master | data/Python/x86/Lib/site-packages/OpenGL/raw/GL/ARB/texture_compression_rgtc.py | 3 | '''OpenGL extension ARB.texture_compression_rgtc
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_ARB_texture_compression_rgtc'
_DEPRECATED = Fa... |
dydek/django | refs/heads/master | tests/custom_pk/fields.py | 379 | import random
import string
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (sel... |
nexzurt/nexzurt | refs/heads/master | nx-contents/vendor/psy/psysh/test/tools/vis.py | 710 | """
vis.py
======
Ctypes based module to access libbsd's strvis & strunvis functions.
The `vis` function is the equivalent of strvis.
The `unvis` function is the equivalent of strunvis.
All functions accept unicode string as input and return a unicode string.
Constants:
----------
* to select alternate encoding for... |
bohlian/erpnext | refs/heads/develop | erpnext/schools/doctype/student_siblings/student_siblings.py | 53 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class StudentSiblings(Document):
pass
|
edmorley/django | refs/heads/master | tests/migrations/test_migrations_conflict/0001_initial.py | 975 | from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", mode... |
sh4t/Sick-Beard | refs/heads/development | sickbeard/metadata/tivo.py | 49 | # Author: Nic Wolfe <nic@wolfeden.ca>
# Author: Gordon Turner <gordonturner@gordonturner.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... |
shsingh/ansible | refs/heads/devel | test/units/modules/cloud/openstack/test_os_server.py | 7 | import collections
import inspect
import mock
import pytest
import yaml
from ansible.module_utils.six import string_types
from ansible.modules.cloud.openstack import os_server
class AnsibleFail(Exception):
pass
class AnsibleExit(Exception):
pass
def params_from_doc(func):
'''This function extracts th... |
stelfrich/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/src/runTables.py | 15 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Tables Runner
# Copyright 2009 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
if __name__ == "__main__":
import sys
import Ice
import omero
import omero.clients
import omero.tables
... |
hasteur/g13bot_tools_new | refs/heads/master | scripts/__init__.py | 8 | # -*- coding: utf-8 -*-
"""THIS DIRECTORY IS TO HOLD BOT SCRIPTS FOR THE NEW FRAMEWORK."""
|
gusai-francelabs/datafari | refs/heads/master | windows/python/Lib/idlelib/CallTips.py | 35 | """CallTips.py - An IDLE Extension to Jog Your Memory
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import __main__
import re
import sys
import textwrap
imp... |
pulinagrawal/nupic | refs/heads/master | src/nupic/data/generators/__init__.py | 50 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... |
sonnyhu/scikit-learn | refs/heads/master | sklearn/feature_extraction/stop_words.py | 166 | # This list of English stop words is taken from the "Glasgow Information
# Retrieval Group". The original list can be found at
# http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words
ENGLISH_STOP_WORDS = frozenset([
"a", "about", "above", "across", "after", "afterwards", "again", "against",
"all", "almo... |
mwhahaha/gluebox | refs/heads/master | gluebox/release.py | 1 | import logging
import os
import shutil
import ruamel.yaml
from gluebox.base import GlueboxCommandBase
from gluebox.base import GlueboxModuleCommandBase
from gluebox.utils.metadata import MetadataManager
import gluebox.utils.git as gitutils
RELEASE_REPO = 'https://git.openstack.org/openstack/releases'
class GlueboxRe... |
albertomurillo/ansible | refs/heads/devel | test/runner/retry.py | 177 | #!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Automatically retry failed commands."""
from __future__ import absolute_import, print_function
# noinspection PyCompatibility
import argparse
import errno
import os
import sys
import time
from lib.util import (
display,
raw_command,
ApplicationError,
A... |
Edraak/edx-platform | refs/heads/master | common/djangoapps/util/date_utils.py | 54 | """
Convenience methods for working with datetime objects
"""
from datetime import datetime, timedelta
import re
from pytz import timezone, UTC, UnknownTimeZoneError
from django.utils.translation import pgettext, ugettext
def get_default_time_display(dtime):
"""
Converts a datetime to a string representatio... |
wikimedia/operations-debs-contenttranslation-hfst | refs/heads/upstream | test/tools/fsmbook-tests/python-scripts/BetterColaMachine.hfst.py | 2 | exec(compile(open('CompileOptions.py', "rb").read(), 'CompileOptions.py', 'exec'))
tr = hfst.regex(' [ D -> N^2, Q -> N^5 ] ')
tr.write_to_file('Result')
|
kenshay/ImageScript | refs/heads/master | ProgramData/Android/ADB/platform-tools/systrace/catapult/common/eslint/eslint/__init__.py | 11 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
_CATAPULT_PATH = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.path.pardir, os.path.pardir, o... |
prakxys/flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/flask/testsuite/deprecations.py | 563 | # -*- coding: utf-8 -*-
"""
flask.testsuite.deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests deprecation support.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase, catch_warnings
class ... |
xconverge/xbmc | refs/heads/master | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsoleMulticast.py | 202 | #!/usr/bin/env python
from struct import *
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_MULTICAST_ADDR = "239.255.255.100"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ... |
julian-seward1/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... |
adit-chandra/tensorflow | refs/heads/master | tensorflow/python/keras/preprocessing/text_test.py | 15 | # -*- coding: utf-8 -*-
# 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
#
# Un... |
thjashin/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/stack_op_test.py | 65 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
classmember/proof_of_concept | refs/heads/master | python/events/lib/python3.4/site-packages/pip/_vendor/cachecontrol/_cmd.py | 70 | import logging
from pip._vendor import requests
from pip._vendor.cachecontrol.adapter import CacheControlAdapter
from pip._vendor.cachecontrol.cache import DictCache
from pip._vendor.cachecontrol.controller import logger
from argparse import ArgumentParser
def setup_logging():
logger.setLevel(logging.DEBUG)
... |
mathspace/python-social-auth | refs/heads/master | social/backends/vimeo.py | 83 | from social.backends.oauth import BaseOAuth1, BaseOAuth2
class VimeoOAuth1(BaseOAuth1):
"""Vimeo OAuth authentication backend"""
name = 'vimeo'
AUTHORIZATION_URL = 'https://vimeo.com/oauth/authorize'
REQUEST_TOKEN_URL = 'https://vimeo.com/oauth/request_token'
ACCESS_TOKEN_URL = 'https://vimeo.com/... |
cecedille1/PDF_generator | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import sys
try:
import paver.tasks
except ImportError:
from os.path import exists
if exists("paver-minilib.zip"):
sys.path.insert(0, "paver-minilib.zip")
import paver.tasks
sys.argv.insert(1, 'setup_options')
paver.tasks.main()
|
ruippeixotog/beets | refs/heads/master | test/test_datequery.py | 25 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... |
tfroehlich82/EventGhost | refs/heads/master | plugins/OSE/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# plugins/OSE/__init__.py
# Copyright (C) 2010 Pako (lubos.ruckl@quick.cz)
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU ... |
hgiemza/DIRAC | refs/heads/integration | DataManagementSystem/scripts/dirac-dms-show-se-status.py | 4 | #!/usr/bin/env python
from DIRAC import S_OK
from DIRAC.Core.Base import Script
__RCSID__ = "$Id$"
Script.setUsageMessage( """
Get status of the available Storage Elements
Usage:
%s [<options>]
""" % Script.scriptName )
vo = None
def setVO( arg ):
global vo
vo = arg
return S_OK()
allVOsFlag = False
def se... |
teeebs/pyxboxapi | refs/heads/master | xboxapitools/clip.py | 2 | import requests
import datetime
import os
from tqdm import tqdm
class GameClip(object):
def __init__(self, json_data, gamertag, download_root=os.getcwd()):
self.json_data = json_data
self.game_title = json_data["titleName"] # Name of game clips is from, i.e. "Battlefield 4"
self.clip_id =... |
android-ia/platform_external_chromium-trace | refs/heads/master | trace-viewer/third_party/closure_linter/closure_linter/closurizednamespacesinfo.py | 135 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... |
babyliynfg/cross | refs/heads/master | tools/project-creator/Python2.6.6/Lib/distutils/tests/test_register.py | 1 | """Tests for distutils.command.register."""
import sys
import os
import unittest
from distutils.command.register import register
from distutils.core import Distribution
from distutils.tests import support
from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
class RawInputs(object):
"... |
zhan-xiong/buck | refs/heads/master | test/com/facebook/buck/cli/testdata/external_test_runner/dir/test_simple.py | 33 | import unittest
import simple
class TestSimple(unittest.TestCase):
def test_simple(self):
self.assertEqual(1, simple.foo())
|
burzillibus/RobHome | refs/heads/master | venv/lib/python2.7/site-packages/docutils/parsers/rst/directives/tables.py | 7 | # $Id: tables.py 8039 2017-02-28 12:19:20Z milde $
# Authors: David Goodger <goodger@python.org>; David Priest
# Copyright: This module has been placed in the public domain.
"""
Directives for table elements.
"""
__docformat__ = 'reStructuredText'
import sys
import os.path
import csv
from docutils import io, nodes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.