repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
RO-ny9/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_structmembers.py
88
from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX, \ PY_SSIZE_T_MAX, PY_SSIZE_T_MIN import unittest from test import support ts=_test...
DarthStrom/python_koans
refs/heads/master
python3/koans/triangle.py
111
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' ...
LockScreen/Backend
refs/heads/master
venv/lib/python2.7/site-packages/boto3/s3/inject.py
10
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
chauhanhardik/populo_2
refs/heads/master
lms/lib/comment_client/comment_client.py
190
"""Import other classes here so they can be imported from here.""" # pylint: disable=unused-import from .comment import Comment from .thread import Thread from .user import User from .commentable import Commentable
40223211/2015cd_midterm2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementTree.py
730
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for ...
bgxavier/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/286_placeholder.py
830
# 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 # d...
bkahlert/seqan-research
refs/heads/master
raw/pmsb13/pmsb13-data-20130530/trunk/misc/seqan_instrumentation/bin/classes/requests/defaults.py
33
# -*- coding: utf-8 -*- """ requests.defaults ~~~~~~~~~~~~~~~~~ This module provides the Requests configuration defaults. Configurations: :base_headers: Default HTTP headers. :verbose: Stream to write request logging to. :max_redirects: Maximum number of redirects allowed within a request.s :keep_alive: Reuse HTTP ...
Ichag/odoo
refs/heads/8.0
addons/mrp_byproduct/__openerp__.py
259
# -*- 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...
GarySparrow/mFlaskWeb
refs/heads/master
venv/Lib/site-packages/httpie/output/processing.py
54
import re from httpie.plugins import plugin_manager from httpie.context import Environment MIME_RE = re.compile(r'^[^/]+/[^/]+$') def is_valid_mime(mime): return mime and MIME_RE.match(mime) class Conversion(object): def get_converter(self, mime): if is_valid_mime(mime): for converte...
datawire/forge
refs/heads/master
forge/tasks.py
2
# Copyright 2017 datawire. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
mdhaman/superdesk-aap
refs/heads/master
server/aap/tests/io/feed_parsers/aap_sportsfixtures_test.py
2
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 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 import os fr...
ehealthafrica-ci/onadata
refs/heads/master
onadata/apps/viewer/tests/test_viewer_tools.py
8
from django.test.client import RequestFactory from onadata.apps.main.tests.test_base import TestBase from onadata.libs.utils.viewer_tools import export_def_from_filename,\ get_client_ip class TestViewerTools(TestBase): def test_export_def_from_filename(self): filename = "path/filename.xlsx" e...
mcodegeeks/OpenKODE-Framework
refs/heads/master
01_Develop/libXMFreeType/Source/tools/docmaker/tohtml.py
34
# ToHTML (c) 2002, 2003, 2005-2008, 2013 # David Turner <david@freetype.org> from sources import * from content import * from formatter import * import time # The following defines the HTML header used by all generated pages. html_header_1 = """\ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "h...
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
refs/heads/master
data/22 starbucks/readCVSstockdata.py
1
from xlrd import open_workbook def readClosingPrice(filename): wb = open_workbook(filename) for sheet in wb.sheets(): number_of_rows = sheet.nrows number_of_columns = sheet.ncols items = [] rows = [] for row in range(1, number_of_rows): values = [] ...
thodoris/djangoPharma
refs/heads/master
djangoPharma/env/Lib/site-packages/django/db/backends/postgresql_psycopg2/operations.py
465
from ..postgresql.operations import * # NOQA
vrenaville/ngo-addons-backport
refs/heads/master
addons/account_budget/report/budget_report.py
57
# -*- 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...
whaleygeek/MyLittleComputer
refs/heads/master
src/python/config.py
1
# config.py 22/07/2016 D.J.Whale # # Placeholder for machine global configuration values. # # May also have code in future to read and parse command line options # and an external config file, to override config settings. # candidates: # assembler.PREFIX_ADDR # io.thebase (DECIMAL, HEXADECIMAL, BINARY) # hexadecima...
localstatic/steep
refs/heads/master
steep.py
1
#!/usr/bin/env python # steep.py # Morgan Terry # November 1, 2008 import gtk import gtk.glade import gobject import logging import string import thread import time import ConfigParser import os.path import timer class Steep: def __init__(self): logging.basicConfig(format="%(asctime)s %(levelname)s %(mes...
coll-gate/collgate
refs/heads/master
server/geonames/__init__.py
1
# -*- coding: utf-8; -*- # # @file __init__.py # @brief # @author Medhi BOULNEMOUR (INRA UMR1095) # @date 2017-01-03 # @copyright Copyright (c) 2017 INRA/CIRAD # @license MIT (see LICENSE file) # @details coll-gate geonames module initialisation # Application Config for startup and more... default_app_config = __name...
zenefits/sentry
refs/heads/master
src/sentry/web/frontend/create_organization.py
6
from __future__ import absolute_import from django import forms from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.translation import ugettext_lazy as _ from sentry import features from sentry.api import client from sentry.web.frontend.base import BaseView cl...
hgiemza/DIRAC
refs/heads/integration
Core/Utilities/Graphs/__init__.py
3
""" DIRAC Graphs package provides tools for creation of various plots to provide graphical representation of the DIRAC Monitoring and Accounting data The DIRAC Graphs package is derived from the GraphTool plotting package of the CMS/Phedex Project by ... <to be added> """ __RCSID__ = "$Id$" # Make su...
spring01/libPSI
refs/heads/master
lib/python/aliases.py
1
# #@BEGIN LICENSE # # PSI4: an ab initio quantum chemistry software package # # 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 ver...
kevinlu1987/hadoop-1.1.2
refs/heads/master
src/contrib/hod/hodlib/RingMaster/__init__.py
1638
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
ProfessorX/Config
refs/heads/master
.PyCharm30/system/python_stubs/-1247971765/gi/_gi/InfoType.py
1
# encoding: utf-8 # module gi._gi # from /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import _gobject as _gobject # <module '_gobject'> import _glib as _glib # <module '_glib'> import gi as __gi import gobject as __gobject from .type import type class...
mszewczy/odoo
refs/heads/8.0
addons/web_graph/controllers/main.py
251
from openerp import http import simplejson from openerp.http import request, serialize_exception as _serialize_exception from cStringIO import StringIO from collections import deque try: import xlwt except ImportError: xlwt = None class TableExporter(http.Controller): @http.route('/web_graph/check_xlwt',...
Propanu/upm
refs/heads/master
examples/python/nlgpio16.py
6
#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 # witho...
le9i0nx/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_config.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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', ...
daweiwu/meta-iotqa-1
refs/heads/master
lib/oeqa/runtime/graphics/test_enable_Intel_Linux_Graphics_lib.py
1
from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag @tag(TestType = 'FVT', FeatureID = 'IOTOS-1546') class Test_Intel_Graphics_lib(oeRuntimeTest): ''' Test Intel Graphics lib integrated ''' lib_info = { "libDRM" : ["/usr/lib/libdrm.so"], "xf86-video-inte...
magicrub/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/lib/_datasource.py
81
"""A file interface for handling local and remote data files. The goal of datasource is to abstract some of the file system operations when dealing with data files so the researcher doesn't have to know all the low-level details. Through datasource, a researcher can obtain and use a file with one function call, regard...
SensSolutions/sens_platform
refs/heads/master
mqttwarn/services/slack.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Jan-Piet Mens <jpmens()gmail.com>' __copyright__ = 'Copyright 2014 Jan-Piet Mens' __license__ = """Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html)""" HAVE_SLACK=True try: from slacker import Slacker except ImportError: ...
qubesuser/qubes-core-admin
refs/heads/master
qubes/tests/integ/backup.py
1
# # The Qubes OS Project, https://www.qubes-os.org/ # # Copyright (C) 2014-2015 # Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> # Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com> # # This library is free software; you can redistribute it and/or # modify it under the term...
renzon/tekton
refs/heads/master
backend/appengine/routes/__init__.py
181
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals
asanfilippo7/osf.io
refs/heads/develop
website/archiver/utils.py
6
import functools from framework.auth import Auth from website.archiver import ( StatResult, AggregateStatResult, ARCHIVER_NETWORK_ERROR, ARCHIVER_SIZE_EXCEEDED, ARCHIVER_FILE_NOT_FOUND, ) from website.archiver.model import ArchiveJob from website import mails from website import settings def send_ar...
junh1024/adt-fork
refs/heads/master
faust/ambi_panner_faust.py
1
# -*- coding: utf-8 -*- """ Created on Tue Sep 8 17:36:42 2015 @author: heller """ from __future__ import division, print_function import symYlm as ssh import faustcode as fc def panner_gain_expressions(order, varname="panner_gains", **kwargs): fc.print_faust_vector(varname, (fc.fau...
bradwoo8621/Swift-Study
refs/heads/master
Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/pylib/gyp/generator/make.py
124
# Copyright (c) 2013 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. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
ibmsoe/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py
42
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
4talesa/rethinkdb
refs/heads/next
test/memcached_workloads/append_stress.py
33
#!/usr/bin/env python # Copyright 2010-2015 RethinkDB, all rights reserved. import os, sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import rdb_workload_common from vcoptparse import * op = rdb_workload_common.option_parser_for_connect() op["n_appends"] = Int...
Ae7flux/pyduino
refs/heads/master
setup.py
10
#! /usr/bin/env python """pyduino - A python library to interface with the firmata arduino firmware. Copyright (C) 2007 Joe Turner <orphansandoligarchs@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...
jameswatt2008/jameswatt2008.github.io
refs/heads/master
python/Python基础/截图和代码/加强/04-给程序传递参数.py
2
import sys print(sys.argv) name = sys.argv[1] print("热烈欢迎 %s的到来"%name)
aronsky/home-assistant
refs/heads/dev
tests/components/fan/test_demo.py
2
"""Test cases around the demo fan platform.""" import unittest from homeassistant.setup import setup_component from homeassistant.components import fan from homeassistant.const import STATE_OFF, STATE_ON from tests.common import get_test_home_assistant from tests.components.fan import common FAN_ENTITY_ID = 'fan.li...
bq-xiao/mongo-python-driver
refs/heads/master
test/high_availability/test_ha.py
18
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
openhatch/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/test/reflect_helper_ZDE.py
101
# Helper module for a test_reflect test 1/0
repetilo-andrey/django-allauth
refs/heads/master
allauth/socialaccount/providers/stackexchange/urls.py
76
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import StackExchangeProvider urlpatterns = default_urlpatterns(StackExchangeProvider)
jkshaver/virtualenv-1.8.2
refs/heads/master
env/lib/python2.7/site-packages/south/tests/fakeapp/migrations/0002_eggs.py
179
from south.db import db from django.db import models class Migration: def forwards(self): Spam = db.mock_model(model_name='Spam', db_table='southtest_spam', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField) db.create_table("southtest_eggs", ( (...
13W/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/pylib/gyp/input.py
137
#!/usr/bin/python # Copyright (c) 2009 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast im...
jscn/django
refs/heads/master
tests/migrations/test_migrations_run_before/0002_second.py
282
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("migrations", "0001_initial"), ] operations = [ migrations.CreateModel( "Book", [ ("...
meerkat-code/meerkat_abacus
refs/heads/development
meerkat_abacus/pipeline_worker/tests/to_codes_test.py
1
import unittest from meerkat_abacus import model from meerkat_abacus.codes.to_codes import to_code from meerkat_abacus.codes.variable import Variable from geoalchemy2.shape import from_shape from shapely.geometry import Polygon # Data for the tests class ToCodeTest(unittest.TestCase): """ Test the to_code fun...
Thhhza/XlsxWriter
refs/heads/master
xlsxwriter/test/comparison/test_repeat04.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): """...
natefoo/ansible-modules-extras
refs/heads/devel
cloud/vmware/vmware_vm_shell.py
55
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, 2016 Ritesh Khadgaray <khadgaray () 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...
jl2012/litecoin
refs/heads/master
contrib/devtools/clang-format-diff.py
90
#!/usr/bin/env python # #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. # # ===========================================================...
bcrochet/python-ironicclient
refs/heads/master
ironicclient/openstack/common/cliutils.py
5
# Copyright 2012 Red Hat, 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 agre...
rodrigc/buildbot
refs/heads/master
master/buildbot/process/build.py
2
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
aliyun/oss-ftp
refs/heads/master
python27/win32/Lib/site-packages/requests/packages/chardet/codingstatemachine.py
2930
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
nutztherookie/django-informix
refs/heads/master
src/django_informix/operations.py
1
import datetime import uuid from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import Aggregate from django.db.backends import utils as backend_utils from django.utils.dateparse import parse_date, parse_datetime, parse_time class DatabaseOperations(BaseDatabaseOperations): ...
retomerz/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/TryContext.after.py
79
def foo(f): x = 1 x = bar(f, x) return x def bar(f_new, x_new): try: x_new = f_new() except Exception: pass return x_new
tmhm/scikit-learn
refs/heads/master
examples/semi_supervised/plot_label_propagation_digits_active_learning.py
294
""" ======================================== Label Propagation digits active learning ======================================== Demonstrates an active learning technique to learn handwritten digits using label propagation. We start by training a label propagation model with only 10 labeled points, then we select the t...
lpedit-devs/lpedit
refs/heads/master
lpedit/AssembleOutNW.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ (1) takes an outfile (i.e. out.txt) and using the original file combines the results into a single latex document. inFileName is a file path to a *.rst | *.Rnw file outFileName is a file path to a out file (i.e. out.txt) USAGE: $ python AssembleOutNW.py...
bdelliott/wordgame
refs/heads/master
web/django/contrib/sitemaps/views.py
232
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.utils.encoding import smart_str from django.core.paginator import EmptyPage, PageNotAnInteger def index(request, sitemaps, template_...
ros2/launch
refs/heads/master
launch_yaml/test/test_copyright.py
4
# Copyright 2017 Open Source Robotics Foundation, 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...
jk1/intellij-community
refs/heads/master
python/testData/refactoring/makeFunctionTopLevel/methodCalledViaClass.after.py
44
class C(): pass def method(foo, bar, x): print(foo, bar, x) c = C() method(c.foo, c.bar, 42) method()
ueshin/apache-spark
refs/heads/master
python/pyspark/pandas/tests/data_type_ops/test_udt_ops.py
13
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
delinhabit/django
refs/heads/master
tests/urlpatterns_reverse/urls_error_handlers.py
560
# Used by the ErrorHandlerResolutionTests test case. urlpatterns = [] handler400 = 'urlpatterns_reverse.views.empty_view' handler404 = 'urlpatterns_reverse.views.empty_view' handler500 = 'urlpatterns_reverse.views.empty_view'
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/boto-2.38.0/boto/cloudfront/exception.py
221
# Copyright (c) 2006,2007 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...
fnugrahendi/saleor
refs/heads/master
tests/utils.py
2
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse def get_redirect_location(response): # Due to Django 1.8 compatibility, we have to handle both cases location = response['Location'] if location.startswith('http'): url = urlparse(location) loc...
mcieslik-mctp/papy
refs/heads/master
doc/examples/grid.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- #python /usr/lib/python2.6/site-packages/rpyc/servers/classic_server.py -m 'forking' from numap import NuMap, imports from papy.core import Piper @imports(['os']) def hello_from(inbox): word = inbox[0] up_pid = os.getpid() return (word, up_pid) somehost = NuM...
tempbottle/ironpython3
refs/heads/master
Src/StdLib/Lib/lib2to3/fixes/fix_numliterals.py
203
"""Fixer that turns 1L into 1, 0755 into 0o755. """ # Copyright 2007 Georg Brandl. # Licensed to PSF under a Contributor Agreement. # Local imports from ..pgen2 import token from .. import fixer_base from ..fixer_util import Number class FixNumliterals(fixer_base.BaseFix): # This is so simple that we don't need ...
pramasoul/micropython
refs/heads/master
tests/basics/builtin_eval.py
23
# builtin eval try: eval except NameError: print("SKIP") raise SystemExit eval('1 + 2') eval('1 + 2\n') eval('1 + 2\n\n#comment\n') x = 4 eval('x') eval('lambda x: x + 10')(-5) y = 6 eval('lambda: y * 2')()
obezpalko/4k
refs/heads/master
e4/database.py
1
#!/usr/bin/env python """ database and tables """ import json from datetime import datetime, timedelta, date from decimal import Decimal from sqlalchemy import ( and_, func, select, Column, Date, String, Integer, Enum, ForeignKey, Numeric, Boolean, ) from sqlalchemy.orm impo...
detrout/telepathy-python
refs/heads/master
examples/roomlist.py
1
from __future__ import print_function import dbus.glib import gobject import logging import sys from time import sleep from account import connection_from_file from telepathy.client.channel import Channel from telepathy.constants import ( CONNECTION_HANDLE_TYPE_NONE as HANDLE_TYPE_NONE, CONNECTION_HANDLE_TYP...
sheepray/volatility
refs/heads/master
volatility/plugins/gui/windowstations.py
44
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
zdary/intellij-community
refs/heads/master
python/testData/inspections/PyDunderSlotsInspection/inheritedClassAttrAssignmentAndInheritedSlots.py
35
class B(object): attr = 'baz' __slots__ = ['foo', 'bar'] class C(B): pass C.attr = 'spam' print(C.attr) c = C() c.attr = 'spam' print(c.attr)
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
refs/heads/master
flask/lib/python2.7/site-packages/sqlparse/engine/statement_splitter.py
9
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from sqlparse import sql, tokens as T class StatementSplitter(object): """Filter that split ...
xiaohan2013/teambition-api
refs/heads/master
teambition/api/webhooks.py
3
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import hashlib from teambition.utils import to_binary from teambition.api.base import TeambitionAPI class Webhooks(TeambitionAPI): def verify_signature(self, sign, timestamp, nonce): """ 校验 webhook 签名 :para...
st135yle/django-site
refs/heads/master
dbenv/lib/python3.4/site-packages/django/contrib/gis/db/backends/base/operations.py
48
class BaseSpatialOperations(object): """ This module holds the base `BaseSpatialBackend` object, which is instantiated by each spatial database backend with the features it has. """ truncate_params = {} # Quick booleans for the type of this spatial backend, and # an attribute for the sp...
lukeiwanski/tensorflow
refs/heads/master
tensorflow/contrib/losses/python/losses/loss_ops.py
19
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
fiber-space/pip
refs/heads/master
pip/_vendor/requests/exceptions.py
155
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
apache/airflow
refs/heads/main
tests/providers/google/cloud/sensors/test_bigtable.py
3
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
ualikhansars/Gwent
refs/heads/master
lib/python2.7/site-packages/django/db/backends/postgresql/operations.py
149
from __future__ import unicode_literals from psycopg2.extras import Inet from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def unification_cast_sql(self, output_field): internal_type = output_field.get...
pgrm/project-euler
refs/heads/master
0001-0050/32-Pandigital_products.py
1
""" We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital. The product 7254 is unusual, as the identity, 39 x 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital. Fin...
tobegit3hub/deep_cnn
refs/heads/master
java_predict_client/src/main/proto/tensorflow/python/kernel_tests/ctc_decoder_ops_test.py
9
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
praekelt/vumi-go
refs/heads/develop
go/billing/management/commands/go_archive_transactions.py
1
from datetime import datetime from optparse import make_option from go.billing.models import Statement, Account from go.billing.tasks import month_range, archive_transactions from go.base.command_utils import BaseGoCommand, get_user_by_email class Command(BaseGoCommand): help = ( "Archive transactions fo...
afloren/nipype
refs/heads/master
nipype/interfaces/freesurfer/tests/test_auto_Binarize.py
9
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.freesurfer.model import Binarize def test_Binarize_inputs(): input_map = dict(abs=dict(argstr='--abs', ), args=dict(argstr='%s', ), bin_col_num=dict(argstr='--bincol', ), bin...
ArcherCraftStore/ArcherVMPeridot
refs/heads/master
Python/Lib/mimetypes.py
83
"""Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=True) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=True) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list ...
JustinWingChungHui/MyFamilyRoot
refs/heads/master
location_api/apps.py
2
from django.apps import AppConfig class LocationApiConfig(AppConfig): name = 'location_api'
aoshiman/email2phone
refs/heads/master
email2phone.py
1
# -*- coding: utf-8 -*- import time from twilio.rest import TwilioRestClient from twilio import TwilioRestException from gmail import GmailChecker from setting import SID, SECRET, TARGET, FROM, ID, PASS, URL from logger import logging @logging def makecall(sid, secret, target, from_, url, timeout=10): try: ...
moijes12/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/test/process_echoer.py
143
"""Write back all data it receives.""" import sys data = sys.stdin.read(1) while data: sys.stdout.write(data) sys.stdout.flush() data = sys.stdin.read(1) sys.stderr.write("byebye") sys.stderr.flush()
dslomov/intellij-community
refs/heads/master
python/testData/completion/classMethod.py
83
class B(object): @classmethod def xyzzy(cls): pass @classmethod def class_method3(cls): cls.x<caret>
s3nk4s/flaskTutorials
refs/heads/master
FlaskApp/FlaskApp/venv/local/lib/python2.7/site-packages/pip/vcs/__init__.py
536
"""Handles all VCS (version control) support""" import os import shutil from pip.backwardcompat import urlparse, urllib from pip.log import logger from pip.util import (display_path, backup_dir, find_command, rmtree, ask_path_exists) __all__ = ['vcs', 'get_src_requirement'] class VcsSupport(...
sebi-hgdata/ansible
refs/heads/expand-variables
lib/ansible/runner/action_plugins/set_fact.py
133
# Copyright 2013 Dag Wieers <dag@wieers.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 later versio...
michellemorales/OpenMM
refs/heads/master
models/slim/nets/inception_v2.py
28
# 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 ...
ajohnson23/depot_tools
refs/heads/master
third_party/logilab/common/__init__.py
64
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
gdi2290/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/werkzeug/testsuite/debug.py
146
# -*- coding: utf-8 -*- """ werkzeug.testsuite.debug ~~~~~~~~~~~~~~~~~~~~~~~~ Tests some debug utilities. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest import sys import re from werkzeug.testsuite import WerkzeugTestCase from werkzeug.deb...
kwarunek/file2py
refs/heads/master
tests/test_converter.py
2
#-*- coding:utf-8 -*- import unittest from mock import patch, Mock, MagicMock from file2py import Converter, templates import sys PY3K = sys.version_info[0] == 3 if not PY3K: builtin_string = '__builtin__' else: builtin_string = 'builtins' if hasattr(unittest.TestCase, 'assertIsInstance'): class _Compat...
JustinWingChungHui/MyFamilyRoot
refs/heads/master
sign_up/migrations/0004_auto_20160424_2119.py
2
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-24 21:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sign_up', '0003_merge'), ] operations = [ migrations.AddField( m...
sgallagher/reviewboard
refs/heads/master
reviewboard/accounts/pages.py
2
from __future__ import unicode_literals import logging from warnings import warn from django.utils.translation import ugettext_lazy as _ from djblets.configforms.mixins import DynamicConfigPageMixin from djblets.configforms.pages import ConfigPage from djblets.configforms.registry import ConfigPageRegistry from djble...
getsentry/raven-python
refs/heads/master
raven/contrib/django/handlers.py
12
""" raven.contrib.django.handlers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from raven.handlers.logging import SentryHandler as BaseSentryHandler fro...
nopjmp/SickRage
refs/heads/master
lib/unidecode/x0bf.py
253
data = ( 'bbess', # 0x00 'bbeng', # 0x01 'bbej', # 0x02 'bbec', # 0x03 'bbek', # 0x04 'bbet', # 0x05 'bbep', # 0x06 'bbeh', # 0x07 'bbyeo', # 0x08 'bbyeog', # 0x09 'bbyeogg', # 0x0a 'bbyeogs', # 0x0b 'bbyeon', # 0x0c 'bbyeonj', # 0x0d 'bbyeonh', # 0x0e 'bbyeod', # 0x0f 'b...
keras-team/keras-io
refs/heads/master
examples/nlp/nl_image_search.py
1
""" Title: Natural language image search with a Dual Encoder Author: [Khalid Salama](https://www.linkedin.com/in/khalid-salama-24403144/) Date created: 2021/01/30 Last modified: 2021/01/30 Description: Implementation of a dual encoder model for retrieving images that match natural language queries. """ """ ## Introduc...
michelts/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/generic_relations_regress/tests.py
102
from django.test import TestCase from django.contrib.contenttypes.models import ContentType from django.db.models import Q from models import * class GenericRelationTests(TestCase): def test_inherited_models_content_type(self): """ Test that GenericRelations on inherited classes use the correct co...
Eric89GXL/vispy
refs/heads/master
vispy/ext/ipy_inputhook.py
23
# coding: utf-8 """ Inputhook management for GUI event loop integration. """ #----------------------------------------------------------------------------- # Source: # https://github.com/ipython/ipython/commits/master/IPython/lib/inputhook.py # Revision: # 29a0deb452d4fa7f59edb7e059c1a46ceb5a124d # Modifications: ...