repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
hendradarwin/VTK
refs/heads/master
ThirdParty/Twisted/twisted/internet/endpoints.py
23
# -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. This also implements an exte...
oihane/odoo-addons
refs/heads/12.0
analytic_usability/tests/test_analytic_usability.py
2
# Copyright 2019 Oihane Crucelaegui - AvanzOSC # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests import common @common.at_install(False) @common.post_install(True) class TestAnalyticUsability(common.SavepointCase): @classmethod def setUpClass(cls): super(TestAnaly...
ingenioustechie/zamboni
refs/heads/master
mkt/extensions/models.py
6
# -*- coding: utf-8 -*- import json import os.path from datetime import datetime from django.conf import settings from django.core.urlresolvers import reverse from django.db import models, IntegrityError, transaction from django.dispatch import receiver import commonware.log from django_extensions.db.fields.json impo...
xianggong/m2c_unit_test
refs/heads/master
test/operator/pre_decrement_uint8/compile.py
1861
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...
caveman-dick/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_snmp_location.py
27
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
dean0x7d/pybinding
refs/heads/master
pybinding/pltutils.py
1
"""Collection of utility functions for matplotlib""" import warnings from contextlib import contextmanager, suppress import numpy as np import matplotlib as mpl import matplotlib.style as mpl_style import matplotlib.pyplot as plt from .utils import with_defaults __all__ = ['cm2inch', 'colorbar', 'despine', 'despine_...
tdsimao/tt
refs/heads/master
django/views/defaults.py
291
from django import http from django.views.decorators.csrf import requires_csrf_token from django.template import Context, RequestContext, loader # This can be called when CsrfViewMiddleware.process_view has not run, therefore # need @requires_csrf_token in case the template needs {% csrf_token %}. @requires_csrf_toke...
maazkhan/kubernetes
refs/heads/master
examples/selenium/selenium-test.py
173
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
OCA/l10n-spain
refs/heads/12.0
l10n_es_ticketbai_api/__init__.py
1
from . import utils from . import ticketbai from . import models
cltk/cltk
refs/heads/master
src/cltk/corpora/grc/tlg/author_geo.py
4
AUTHOR_GEO = { "Mesopotamia": ["2109"], "Panormus [vel Panormum]": ["2393"], "Hierapolis": ["0557", "1163", "1558"], "Caloe+": ["3069"], "Chonai": ["3094"], "Theangela": ["1590"], "Iconium": ["2112"], "Mallos [vel Mallus]": ["2298"], "Aspendos [vel Aspendus]": ["2681"], "Elea": [...
numerigraphe/odoo
refs/heads/8.0
addons/website_quote/models/order.py
29
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
Akrog/sqlalchemy
refs/heads/master
test/dialect/mssql/test_compiler.py
7
# -*- encoding: utf-8 from sqlalchemy.testing import eq_ from sqlalchemy import schema from sqlalchemy.sql import table, column from sqlalchemy.databases import mssql from sqlalchemy.dialects.mssql import mxodbc from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import sql from sqlalchemy impor...
tommyip/zulip
refs/heads/master
zerver/migrations/0061_userprofile_timezone.py
16
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-15 11:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0060_move_avatars_to_be_uid_based'), ] operations = [ migrations.AddField( model_name='userpro...
kevinmel2000/sl4a
refs/heads/master
python/src/Lib/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...
jbmorse/catkin_ws
refs/heads/master
build/catkin_generated/installspace/_setup_util.py
23
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, 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 mu...
lenovor/bosen
refs/heads/release_1.1
app/NMF/script/kill.py
14
#!/usr/bin/env python import os, sys if len(sys.argv) != 2: print "usage: %s <hostfile>" % sys.argv[0] sys.exit(1) host_file = sys.argv[1] prog_name = "nmf_main" # Get host IPs with open(host_file, "r") as f: hostlines = f.read().splitlines() host_ips = [line.split()[1] for line in hostlines] ssh_cmd = ( ...
SportySpice/Collections
refs/heads/master
src/videosource/Video.py
1
from src.tools.enum import enum #VideoType = enum(PLUGIN=0, YOUTUBE=1) OnVideoClick = enum (PLAY_ONLY=1, PLAY_QUEUE_REST=2) class Video(object): def __init__(self, videoId, source, position, title, description, thumb, date, duration, rating, watchedDic): self.id = videoId #self.type = videoType...
zhuwenping/python-for-android
refs/heads/master
python-build/python-libs/gdata/src/atom/auth.py
297
#!/usr/bin/env python # # Copyright (C) 2009 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...
agry/NGECore2
refs/heads/master
scripts/object/static/particle/particle_newbie_wall_mech_lights_yellow.py
85615
import sys def setup(core, object): return
zzgvh/django-permissions
refs/heads/master
permissions/models.py
1
# python imports import sets # django imports from django.db import models from django.contrib.auth.models import User from django.contrib.auth.models import Group from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_la...
ejeschke/ginga
refs/heads/master
ginga/examples/qt/example2_qt.py
2
#! /usr/bin/env python # # example2_qt.py -- Simple, configurable FITS viewer. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys from ginga.qtw.QtHelp import QtGui, QtCore, set_default_opengl_context from ginga import colors from ginga.qtw.Image...
2uller/LotF
refs/heads/master
App/Lib/site-packages/pygame/tests/sndarray_test.py
8
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
szaghi/MaTiSSe
refs/heads/master
release/MaTiSSe-0.3.1/matisse/theme/heading.py
10
#!/usr/bin/env python """ heading.py, module definition of Heading class. This defines the theme of the headings. """ # modules loading # standard library modules: these should be present in any recent python distribution # MaTiSSe.py modules from .theme_element import ThemeElement # default size of each heading of the...
yanchen036/tensorflow
refs/heads/master
tensorflow/contrib/cluster_resolver/python/training/__init__.py
65
# 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 applicable ...
Sabayon/entropy
refs/heads/master
lib/tests/standalone/webserv.py
6
# -*- coding: utf-8 -*- import sys import os import tempfile import unittest sys.path.insert(0, '../') sys.path.insert(0, '../../') from entropy.client.interfaces import Client from entropy.services.client import WebService from entropy.client.services.interfaces import Document, DocumentFactory, \ DocumentList, C...
rnikiforova/GuruTubeProject
refs/heads/master
GuruTube/libraries/django/utils/formats.py
103
import decimal import datetime import unicodedata from django.conf import settings from django.utils import dateformat, numberformat, datetime_safe from django.utils.importlib import import_module from django.utils.encoding import force_str from django.utils.functional import lazy from django.utils.safestring import m...
gunan/tensorflow
refs/heads/master
tensorflow/python/training/sync_replicas_optimizer.py
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 # # Unless required by applica...
miteshvp/fabric8-analytics-worker
refs/heads/master
f8a_worker/workers/repo_dependency_finder.py
1
"""Output: List of direct and indirect dependencies.""" import requests import traceback from f8a_worker.base import BaseTask from f8a_worker.errors import TaskError from f8a_worker.graphutils import GREMLIN_SERVER_URL_REST from f8a_worker.workers.mercator import MercatorTask from f8a_worker.workers.dependency_parser...
beeftornado/sentry
refs/heads/master
src/sentry/plugins/sentry_urls/__init__.py
2878
from __future__ import absolute_import
Suwmlee/XX-Net
refs/heads/python3
gae_proxy/server/lib/google/appengine/api/channel/channel.py
1
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
loco-odoo/localizacion_co
refs/heads/master
openerp/addons-extra/odoo-pruebas/odoo-server/addons/account_analytic_default/__init__.py
445
# -*- 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...
ging/fi-ware-chef_validator
refs/heads/master
chef_validator/tests/unit/clients/test_chef_client_ssh.py
2
# -*- 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, ...
normanmaurer/autobahntestsuite-maven-plugin
refs/heads/master
src/main/resources/twisted/trial/_dist/test/__init__.py
57
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Distributed trial test runner tests. """
nortikin/sverchok
refs/heads/master
utils/modules/polygon_utils.py
1
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import numpy as np from mathutils ...
shaananc/security-proj2
refs/heads/master
bindings/python/apidefs/gcc-LP64/ns3_module_v4ping.py
10
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## v4ping.h: ns3::V4Ping [class] module.add_class('V4Ping', parent=root_module['ns3::Application']) ## Register a nested module for the namespace Confi...
j-griffith/cinder
refs/heads/master
cinder/backup/drivers/google.py
3
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 TrilioData, Inc # Copyright (c) 2015 EMC Corporation # Copyright (C) 2015 Kevin Fox <kevin@efox.cc> # Copyright (C) 2015 Tom Barron <tpb@dyncloud.net> # Copyright (C) 2016 Vedams Inc. # Copyright (C) 2016 Google Inc. # All Rights Reserv...
argriffing/numpy
refs/heads/master
numpy/distutils/pathccompiler.py
264
from __future__ import division, absolute_import, print_function from distutils.unixccompiler import UnixCCompiler class PathScaleCCompiler(UnixCCompiler): """ PathScale compiler compatible with an gcc built Python. """ compiler_type = 'pathcc' cc_exe = 'pathcc' cxx_exe = 'pathCC' def _...
daviddrysdale/python-phonenumbers
refs/heads/dev
python/phonenumbers/shortdata/region_CR.py
1
"""Auto-generated file, do not edit by hand. CR metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_CR = PhoneMetadata(id='CR', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[1359]\\d{2,3}', possible_length=(3, 4)...
marqueedev/django
refs/heads/master
django/contrib/gis/forms/fields.py
504
from __future__ import unicode_literals from django import forms from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.utils.translation import ugettext_lazy as _ from .widgets import OpenLayersWidget class GeometryField(forms.Field): """ This is the basic form field for a Geometry. A...
MinerKasch/dd-agent
refs/heads/master
daemon.py
8
""" *** Modified generic daemon class *** Author: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ www.boxedice.com www.datadoghq.com License: http://creativecommons.org/licenses/by-sa/3.0/ """ # Core modules import atexit import e...
when30/namebench
refs/heads/master
nb_third_party/jinja2/meta.py
406
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
civisanalytics/ansible-modules-core
refs/heads/forked-20160606
files/fetch.py
40
# this is a virtual module that is entirely implemented server side # 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 op...
michel-slm/obnam
refs/heads/fix-py26-compat
obnamlib/fmt_6/__init__.py
4
# Copyright 2014 Lars Wirzenius # # 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...
andmarios/ansible-modules-core
refs/heads/devel
cloud/amazon/ec2_ami.py
19
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
douggeiger/gnuradio
refs/heads/master
gr-uhd/examples/python/usrp_spectrum_sense.py
36
#!/usr/bin/env python # # Copyright 2005,2007,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
abomyi/django
refs/heads/master
tests/admin_inlines/models.py
276
""" Testing of admin inline formsets. """ from __future__ import unicode_literals import random from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @pyt...
tomszilagyi/SiK
refs/heads/master
Firmware/tools/update_mode.py
26
#!/usr/bin/env python # put a HopeRF into update mode import serial, sys, optparse, time, fdpexpect parser = optparse.OptionParser("update_mode") parser.add_option("--baudrate", type='int', default=57600, help='baud rate') parser.add_option("--rtscts", action='store_true', default=False, help='enable rtscts') parser....
GNOME/pygobject
refs/heads/wip/type-object-concurrency-fix
tests/test_ossig.py
1
# Copyright 2017 Christoph Reiter # # 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.1 of the License, or (at your option) any later version. # # This library is distrib...
Arno-Nymous/pyload
refs/heads/stable
module/plugins/hoster/FileomCom.py
8
# -*- coding: utf-8 -*- # # Test links: # http://fileom.com/gycaytyzdw3g/random.bin.html from ..internal.XFSHoster import XFSHoster class FileomCom(XFSHoster): __name__ = "FileomCom" __type__ = "hoster" __version__ = "0.11" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?fileom\.com/\w...
jacknjzhou/neutron
refs/heads/master
neutron/tests/api/base_security_groups.py
48
# Copyright 2013 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...
WillisXChen/django-oscar
refs/heads/master
oscar/lib/python2.7/site-packages/django/db/backends/base/base.py
103
import time import warnings from collections import deque from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import utils from django.db.backends.signals import connection_created from django.db.transaction import TransactionManagementE...
lysol/pgcsv
refs/heads/master
pgcsv.py
1
#!/usr/bin/env python import sys import csv import _csv import psycopg2 import math import cStringIO import re import traceback csv.field_size_limit(524288000) byte_counter = 0 type_rank = [ 'decimal', 'character varying' ] def try_type(anystring, existing): def current_type(): if anystring ...
dssmex/dssmex-GB-ICS
refs/heads/master
arch/ia64/scripts/unwcheck.py
916
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
mtremmel/Simpy
refs/heads/master
Simpy/BlackHoles/bhacc_hist.py
1
import numpy as np import pynbody def track_halo_bh_acc(simname, endstep, halonum, bhorbit, active=1e42, type='Central'): import halo_db as db if type not in ['Central', 'All']: print("WARNING type argument not understood (Central or All). Assuming type to be All") type = 'All' hcur = db.get_halo(simname+'/%'+...
gsnbng/erpnext
refs/heads/develop
erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
5
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import getdate def execute(filters=None): filters["invoices"] = frappe.cache().hget("invoices", frappe.se...
hoosteeno/fjord
refs/heads/master
vendor/packages/Babel-2.1.1/babel/localtime/__init__.py
153
# -*- coding: utf-8 -*- """ babel.localtime ~~~~~~~~~~~~~~~ Babel specific fork of tzlocal to determine the local timezone of the system. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import sys import pytz import time from datetime import timedelta,...
pombredanne/pythran
refs/heads/master
pythran/tests/cases/matmul.py
4
#runas a=[ [ float(i) for i in xrange(60)] for j in xrange(60)] ; matrix_multiply(a,a) #skip.bench a=[ [ float(i) for i in xrange(600)] for j in xrange(400)] ; matrix_multiply(a,a) SEGFAULT #pythran export matrix_multiply(float list list, float list list) def zero(n,m): return [[0 for row in xrange(n)] for col in xrang...
kogotko/carburetor
refs/heads/master
openstack_dashboard/dashboards/project/instances/panel.py
43
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
hfp/tensorflow-xsmm
refs/heads/master
tensorflow/contrib/boosted_trees/python/kernel_tests/split_handler_ops_test.py
25
# 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...
FederatedAI/FATE
refs/heads/master
python/federatedml/nn/backend/tf_keras/nn_model.py
1
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
jelugbo/hebs_repo
refs/heads/master
lms/djangoapps/lms_migration/migrate.py
30
# # migration tools for content team to go from stable-edx4edx to LMS+CMS # import json import logging import os import xmodule.modulestore.django as xmodule_django from xmodule.modulestore.django import modulestore from django.http import HttpResponse from django.conf import settings import track.views try: fro...
Universal-Model-Converter/UMC3.0a
refs/heads/master
data/Python/x86/Lib/abc.py
488
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" import types from _weakrefset import WeakSet # Instance of old-style class class _C: pass _InstanceType = type(_C()) def abstractmethod(funcobj): """A d...
labsanmartin/Bika-LIMS
refs/heads/master
bika/lims/tests/test_AnalysisRequest_retract.py
2
from Products.CMFCore.WorkflowCore import WorkflowException from Products.CMFPlone.utils import _createObjectByType from Products.CMFCore.utils import getToolByName from bika.lims.utils import tmpID from bika.lims.testing import BIKA_FUNCTIONAL_TESTING from bika.lims.tests.base import BikaFunctionalTestCase from bika.l...
bringsvor/account-financial-tools
refs/heads/8.0
account_credit_control/line.py
32
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright 2012-2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
js0701/chromium-crosswalk
refs/heads/master
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/phystokens.py
67
"""Better tokenizing for coverage.py.""" import keyword, re, token, tokenize from coverage.backward import StringIO # pylint: disable=W0622 def phys_tokens(toks): """Return all physical tokens, even line continuations. tokenize.generate_tokens() doesn't return a token for the backslash that ...
sprax/python
refs/heads/master
emo/emo_old_tup.py
1
'''old version''' COL_TO_IDX = ['order', 'flags', 'len', 'chr', 'monosyls', 'shortname', 'alternates', 'polysyls', 'category'] EMO_TUPLES = [ ('1f600', 1, 1, 1, '😀', [], ':grinning:', [], ['grinning', 'smirking'], 'people'), ('1f603', 2, 1, 1, '😃', [], ':smiley:', [], ['smiley', 'smile ee'], 'people'), (...
DarthMaulware/EquationGroupLeaks
refs/heads/master
Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/file/cmd/diskspace/tasking.py
30
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: tasking.py import mcl_platform.tasking from tasking_dsz import * _fw = mcl_platform.tasking.GetFramework() if _fw == 'dsz': RPC_INFO_QUERY = dsz....
ariddell/pystan
refs/heads/develop
pystan/experimental/pickling_tools.py
1
"""Experimental module to load fit without model instance.""" from distutils.core import Extension from Cython.Build.Inline import _get_build_extension from Cython.Build.Dependencies import cythonize import tempfile import logging import io import os import string import numpy as np import pickle import pystan import p...
marcos-sb/hacker-rank
refs/heads/master
artificial-intelligence/bot-building/saveprincess2/Solution.py
1
import sys def dist(a,b): return abs(a[0]-b[0]) + abs(a[1]-b[1]) def valid(m,n): return True if m[0] >= 0 and m[0] < n and m[1] >= 0 and m[1] < n else False def end_conditions(m,p,n, current_dist): return valid(m,n) and dist(m,p) < current_dist def nextMove(m,p,n): current_dist = dist(m,p) _m =...
gareging/SDN_Framework
refs/heads/master
ryu/lib/stringify.py
3
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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:...
cmbiwer/pycbc
refs/heads/master
pycbc/inference/burn_in.py
1
# Copyright (C) 2017 Collin Capano # 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 t...
mozilla/captain
refs/heads/master
vendor/lib/python/django/forms/extras/__init__.py
324
from __future__ import absolute_import from django.forms.extras.widgets import *
carquois/blobon
refs/heads/master
blobon/blogs/migrations/0098_auto__add_field_post_soundcloud_id__add_field_post_soundcloud_url.py
1
# -*- coding: 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 field 'Post.soundcloud_id' db.add_column('blogs_post', 'soundcloud_id', self....
Distrotech/intellij-community
refs/heads/master
python/testData/completion/importInMiddleOfHierarchy/a.py
83
from xyzzy.cont<caret>
froyobin/horizon
refs/heads/our_branch
openstack_dashboard/dashboards/project/data_processing/job_executions/tests.py
3
# 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 # distributed under t...
RevansChen/online-judge
refs/heads/master
Codefights/arcade/python-arcade/level-2/13.Cat-Walk/Python/test.py
1
# Python3 from solution1 import catWalk as f qa = [ ('def m e gaDifficu ltFun ction(x):', 'def m e gaDifficu ltFun ction(x):'), (' for i in ra nge(x, 29):', 'for i in ra nge(x, 29):'), ('r e t u r n True', 'r e t u r n True'), (' re turn...
atosatto/ansible
refs/heads/devel
test/units/executor/test_playbook_executor.py
60
# (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...
ZhaoCJ/django
refs/heads/master
django/contrib/gis/tests/geo3d/tests.py
5
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import postgis from django.test import TestCase from django.utils._os import upath if HAS_GEOS: ...
mne-tools/mne-tools.github.io
refs/heads/main
0.19/_downloads/f32a43d5ff22f0bd4aa430d2d5d4de0b/plot_compute_mne_inverse_raw_in_label.py
1
""" ============================================= Compute sLORETA inverse solution on raw data ============================================= Compute sLORETA inverse solution on raw dataset restricted to a brain label and stores the solution in stc files for visualisation. """ # Author: Alexandre Gramfort <alexandre.g...
rgommers/numpy
refs/heads/dependabot/pip/mypy-0.910
tools/linter.py
1
import os import sys import subprocess from argparse import ArgumentParser from git import Repo, exc CONFIG = os.path.join( os.path.abspath(os.path.dirname(__file__)), 'lint_diff.ini', ) class DiffLinter: def __init__(self, branch): self.branch = branch self.repo = Repo('.') ...
rajul/Pydev
refs/heads/development
plugins/org.python.pydev/pysrc/third_party/wrapped_for_pydev/ctypes/util.py
106
#@PydevCodeAnalysisIgnore import sys, os import ctypes # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def find_library(name): # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory...
pansapiens/process-aviv
refs/heads/master
aviv/__init__.py
1
__all__ = ["base","instruments","experiments","parsers"]
Praveen-1987/devstack-Quantumleap
refs/heads/master
files/pip-1.4.1/build/lib.linux-x86_64-2.7/pip/vendor/html5lib/filters/inject_meta_charset.py
1730
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
supergis/micropython
refs/heads/master
tests/basics/builtin_round.py
103
# test round() with integral values tests = [ False, True, 0, 1, -1, 10 ] for t in tests: print(round(t))
krader1961/python-mode
refs/heads/develop
pymode/libs/logilab/common/optparser.py
92
# -*- coding: utf-8 -*- # 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 Genera...
blaxter/samba
refs/heads/master
source4/heimdal/lib/wind/rfc3454.py
88
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
TonyApuzzo/fuzzyjoin
refs/heads/master
fuzzyjoin-hadoop/src/test/scripts/util/parselog.py
1
#!/usr/bin/env python # # Copyright 2010-2011 The Regents of the University of California # # 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 #...
2mny/mylar
refs/heads/master
lib/js2py/constructors/jsdate.py
6
from ..base import * from .time_helpers import * TZ_OFFSET = (time.altzone//3600) ABS_OFFSET = abs(TZ_OFFSET) TZ_NAME = time.tzname[1] ISO_FORMAT = '%s-%s-%sT%s:%s:%s.%sZ' @Js def Date(year, month, date, hours, minutes, seconds, ms): return now().to_string() Date.Class = 'Date' def now(): return PyJsDate(int...
KhronosGroup/SPIRV-Cross
refs/heads/master
test_shaders.py
2
#!/usr/bin/env python3 # Copyright 2015-2021 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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-...
kohnle-lernmodule/KITexe201based
refs/heads/master
nevow/flat/flatstan.py
14
# Copyright (c) 2004 Divmod. # See LICENSE for details. from __future__ import generators from types import StringTypes import types import warnings from nevow import util from nevow.stan import Proto, Tag, xml, directive, Unset, invisible from nevow.inevow import IRenderer, IRendererFactory, IGettable, IData, IMacro...
Adam5Wu/Arduino
refs/heads/adam5wu/master
tests/device/test_WiFiServer/test_WiFiServer.py
5
from mock_decorators import setup, teardown from threading import Thread import socket import time stop_client_thread = False client_thread = None @setup('Simple echo server') def setup_echo_server(e): global stop_client_thread global client_thread def echo_client_thread(): server_address = socket...
jsteemann/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_iter.py
80
# Test iterators. import unittest from test.test_support import run_unittest, TESTFN, unlink, have_unicode # Test result of triple loop (too big to inline) TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2), (0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1), (0, 2, 2), (1, 0, 0), (1,...
olemis/brython
refs/heads/master
www/src/Lib/test/mp_fork_bomb.py
38
import multiprocessing, sys def foo(): print("123") # Because "if __name__ == '__main__'" is missing this will not work # correctly on Windows. However, we should get a RuntimeError rather # than the Windows equivalent of a fork bomb. p = multiprocessing.Process(target=foo) p.start() p.join() sys.exit(p.exitcod...
dlakata/linear-algebra
refs/heads/master
app/lib/parser.py
3
from matrix import Matrix from functools import wraps import random import numpy def latex(f): """Custom decorator to output result in LaTeX using latexify""" @wraps(f) def decorated(*args, **kwargs): return latexify(f(*args, **kwargs)) return decorated @latex def produce_output(s): """O...
kbsezginel/tee_mof
refs/heads/master
tests/test_read_trial.py
1
""" Tests reading thermal flux and calculating thermal conductivity for trials with multiple runs """ import os import yaml import numpy as np from thermof.read import read_trial from thermof.parameters import k_parameters k_ref_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'thermal-conductivity.yam...
sparkslabs/kamaelia_
refs/heads/master
Sketches/AM/xxtea/python/setup.py
3
# # (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General Public License, V2.1 # # (1) Kam...
HiSPARC/station-software
refs/heads/master
user/python/Lib/encodings/iso2022_jp_1.py
816
# # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_1') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
druuu/django
refs/heads/master
tests/staticfiles_tests/settings.py
147
from __future__ import unicode_literals import os.path from django.utils._os import upath TEST_ROOT = os.path.dirname(upath(__file__)) TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') TEST_SETTINGS = { 'DEBUG': True, 'MEDIA_URL': '/media/', 'STATIC_URL': '/static/', 'MEDIA...
sloria/osf.io
refs/heads/develop
tests/test_registrations/test_views.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import datetime as dt import mock import httplib as http import pytz from django.utils import timezone import pytest from nose.tools import * # noqa PEP8 asserts from framework.exceptions import HTTPError from osf.models import Me...
CoDEmanX/ArangoDB
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/ctypes/test/test_returnfuncptrs.py
66
import unittest from ctypes import * import _ctypes_test class ReturnFuncPtrTestCase(unittest.TestCase): def test_with_prototype(self): # The _ctypes_test shared lib/dll exports quite some functions for testing. # The get_strchr function returns a *pointer* to the C strchr function. dll =...