repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
obreitwi/dota2vgs
refs/heads/master
dota2vgs/vgs.py
1
#!/usr/bin/env python # encoding: utf-8 # Copyright (c) 2013-2014 Oliver Breitwieser # # 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 ...
mrichart/ns-3-dev-git
refs/heads/rpc
src/lte/bindings/modulegen_customizations.py
120
import os def post_register_types(root_module): enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',') if 'EmuFdNetDevice' not in enabled_features: if 'ns3::EmuEpcHelper'in root_module: root_module.classes.remove(root_module['ns3::EmuEpcHelper'])
ghchinoy/tensorflow
refs/heads/master
tensorflow/tools/common/traverse_test.py
60
# 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...
econchick/heroku-buildpack-python
refs/heads/master
vendor/distribute-0.6.34/setuptools/dist.py
65
__all__ = ['Distribution'] import re from distutils.core import Distribution as _Distribution from setuptools.depends import Require from setuptools.command.install import install from setuptools.command.sdist import sdist from setuptools.command.install_lib import install_lib from distutils.errors import DistutilsOpt...
desenho-sw-g5/service_control
refs/heads/devel
Trabalho_1/manage.py
1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "service_control.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure t...
krikru/tensorflow-opencl
refs/heads/master
tensorflow/compiler/tests/clustering_test.py
123
# 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...
xrmx/django
refs/heads/master
tests/admin_inlines/test_templates.py
285
from __future__ import unicode_literals from django.template.loader import render_to_string from django.test import SimpleTestCase class TestTemplates(SimpleTestCase): def test_javascript_escaping(self): context = { 'inline_admin_formset': { 'formset': {'prefix': 'my-prefix'},...
nokia-wroclaw/innovativeproject-dbshepherd
refs/heads/master
test_ssh.py
1
import unittest import connection from ssh_tunnelmanager import TunnelManager from configmanager import ConfigManager, ConfigManagerError from getpass import getpass from kp import KeePassError, get_password conn = None master = None def setUpModule(): global master global conn print("SShTest") master = "test" ...
alfredodeza/boto
refs/heads/develop
boto/s3/key.py
72
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
ericfc/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex/1_auto.py
1155
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): operations = [ migrations.RunPython(migrations.RunPython.noop) ]
Samsung/TizenRT
refs/heads/master
external/protobuf/python/google/protobuf/pyext/__init__.py
401
try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__)
wemanuel/smry
refs/heads/master
server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/bigquery/lib/__init__.py
12
# Copyright 2014 Google Inc. All Rights Reserved. """A helper library for this command group."""
gauravbose/digital-menu
refs/heads/master
digimenu2/restaurant/urls.py
2
from django.conf.urls import url from . import views #urlpatterns += static_files_urlpatterns() #urlpatterns +=static(settings.MEDIA_URL,document_root = settings.MEDIA_ROOT) urlpatterns=[ # url(r'^polls/', include('restaurant.urls', namespace="restaurant")), # url(r'^$',views.index,name='index'), # url(r'^$...
shweta97/pyta
refs/heads/master
nodes/Assert.py
2
""" Assert astroid node An assertion. Attributes: - test (Expr) - This holds the condition, such as a Compare node, to be evaluated True or False - fail (Node | None) - Usually a str; the message shown if condition is False. If None, only AssertionError is shown. Example...
skotin/EW
refs/heads/master
sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/py/fckoutput.py
25
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2009 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.or...
IATI/IATI-Website-Tests
refs/heads/master
tests/test_query_builder.py
1
import pytest from utility import utility from web_test_base import WebTestBase class TestQueryBuilder(WebTestBase): requests_to_load = { 'IATI Query Builder': { 'url': 'http://datastore.iatistandard.org/query/' }, 'POST Example': { 'url': 'http://datastore.iatistan...
eunchong/build
refs/heads/master
third_party/twisted_10_2/twisted/trial/itrial.py
61
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Interfaces for Trial. Maintainer: Jonathan Lange """ import zope.interface as zi from zope.interface import Attribute class ITestCase(zi.Interface): """ The interface that a test case must implement in order to be used in...
tillahoffmann/tensorflow
refs/heads/master
tensorflow/python/ops/distributions/dirichlet_multinomial.py
39
# 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...
jeetsukumaran/supertramp
refs/heads/master
bin/supertramp-generate-jobs.py
1
#! /usr/bin/env python import sys import os import json import random import argparse general_job_template = """\ #! /bin/bash #$ -cwd #$ -V #$ -S /bin/bash #$ -l h_vmem=8G #$ -l virtual_free=8G {queue} {commands} """ def main(): """ ### 2014-09-27 b = birth-rate d = "global" dispersal rate...
inonit/wagtail
refs/heads/master
wagtail/wagtaildocs/models.py
2
from __future__ import unicode_literals import os.path from taggit.managers import TaggableManager from django.db import models from django.db.models.signals import pre_delete from django.dispatch.dispatcher import receiver from django.dispatch import Signal from django.core.urlresolvers import reverse from django.c...
sfiera/gyp
refs/heads/master
PRESUBMIT.py
12
# Copyright 2010, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
philippze/django-cms
refs/heads/develop
cms/south_migrations/0022_login_required_added.py
1680
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
rscnt/django-cms
refs/heads/develop
cms/south_migrations/0033_auto__del_field_title_publisher_is_draft__del_field_title_publisher_st.py
1680
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
zoho/projects-python-wrappers
refs/heads/master
projects/model/Tasklog.py
1
#$Id$ from projects.model.Log import Log class Tasklog(Log): """This class is used to create object for task log.""" def __init__(self): """Initialize parameters for task logs.""" Log.__init__(self) self.task_id = 0 self.task_name = "" def set_task_id(sel...
kived/python-for-android
refs/heads/master
tests/test_graph.py
1
from pythonforandroid.build import Context from pythonforandroid.graph import get_recipe_order_and_bootstrap from pythonforandroid.bootstrap import Bootstrap from itertools import product import pytest ctx = Context() name_sets = [['python2'], ['kivy']] bootstraps = [None, Bootstrap.get_...
cgstudiomap/cgstudiomap
refs/heads/develop
main/eggs/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/graphics/samples/scatter_lines.py
42
#Autogenerated by ReportLab guiedit do not edit from reportlab.graphics.charts.legends import Legend from reportlab.graphics.charts.lineplots import ScatterPlot from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String from reportlab.graphics.charts.textlabels import Label from reportlab.graphics.sampl...
marco-mariotti/selenoprofiles
refs/heads/master
libraries/annotations/GO/__init__.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ A package to work with the Gene Ontology. """ __author__ = 'Chris Lasher' __email__ = 'chris DOT lasher <AT> gmail DOT com' import ontology
betoesquivel/fil2014
refs/heads/master
filenv/lib/python2.7/site-packages/django/conf/urls/i18n.py
228
from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver def i18n_patterns(prefix, *args): """ Adds the language code prefix to every URL pattern within this function. This may only be used in the root URLconf, not in an include...
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/interpolate/tests/test_gil.py
27
from __future__ import division, print_function, absolute_import import itertools import threading import time import numpy as np from numpy.testing import assert_equal import pytest import scipy.interpolate class TestGIL(object): """Check if the GIL is properly released by scipy.interpolate functions.""" ...
hefen1/chromium
refs/heads/master
tools/cygprofile/check_orderfile_unittest.py
49
#!/usr/bin/python # Copyright 2015 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 unittest import check_orderfile import symbol_extractor class TestCheckOrderFile(unittest.TestCase): _SYMBOL_INFOS = [symbol_ex...
paragbaxi/qualysguard_host_list_detection
refs/heads/master
src/qualysguard_host_list_detection.py
1
from __future__ import print_function __author__ = 'Parag Baxi' # System modules import argparse import ast import ConfigParser import datetime import logging import os import sys import time from Queue import Queue from threading import Thread # Local modules import qualysapi from lxml import objectify, etree def...
ant9000/RIOT
refs/heads/master
tests/pbkdf2/tests/01-rfc.py
8
#!/usr/bin/env python3 # Copyright (C) 2019 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # # Author: Juan Carrano <j.carrano@fu-berlin.de> """Vector from RFC 7914 section...
UbuntuBudgie/budgie-extras
refs/heads/master
budgie-app-launcher/src/budgie-app-launcher/SortHelper.py
1
#!/usr/bin/python3 # This file is part of App Launcher # Copyright © 2018-2021 Ubuntu Budgie Developers # 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 # (...
binghongcha08/pyQMD
refs/heads/master
GWP/2D/1.0.8/phase.py
14
##!/usr/bin/python import numpy as np import pylab as plt import seaborn as sns sns.set_context('poster',font_scale=1.5) sns.set_style({'font.family':'Times New Roman'}) #with open("traj.dat") as f: # data = f.read() # # data = data.split('\n') # # x = [row.split(' ')[0] for row in data] # y = [row.spli...
cc13ny/Allin
refs/heads/master
lintcode/239-[DUP]-Sliding-Window-Maximum/SlidingWindowMaximum_001.py
10
class Solution(object): def maxSlidingWindow(self, nums, k): """ :type nums: List[int] :type k: int :rtype: List[int] """ if nums == []: return [] dq = [(nums[0], 0)] for i in range(1, k): while dq != [] and nums[i] > dq[-1][0]:...
curtacircuitos/pcb-tools
refs/heads/master
examples/pcb_example.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Hamilton Kibbe <ham@hamiltonkib.be> # 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/LICEN...
vvv1559/intellij-community
refs/heads/master
python/testData/resolve/TypeDunderDocWithInheritedClassAttr.py
35
class A(object): __doc__ = 17 class B(A): pass print(B.__doc__) # <ref>
elioth010/lugama
refs/heads/master
activate/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
asyan4ik/hwp6s-kernel
refs/heads/master
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
JFLABO/three.js
refs/heads/master
utils/exporters/blender/2.65/scripts/addons/io_mesh_threejs/__init__.py
28
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
GunoH/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/Assignment.py
13
def f(): x1: int = <warning descr="Expected type 'int', got 'str' instead">'foo'</warning> x2: str = 'bar' x3: int = 0 x4: str = <warning descr="Expected type 'str', got 'int' instead">1</warning>
gitenberg-dev/pg-epubmaker
refs/heads/master
epubmaker/HTMLChunker.py
1
#!/usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- coding: iso-8859-1 -*- """ HTMLChunker.py Copyright 2009 by Marcello Perathoner Distributable under the GNU General Public License Version 3 or newer. Splits a HTML file into chunks. """ from __future__ import with_statement import urlparse i...
AndrewGrossman/django
refs/heads/master
tests/template_backends/apps/good/templatetags/subpackage/tags.py
1426
from django.template import Library register = Library()
JCA-Developpement/Odoo
refs/heads/master
openerp/addons/base/tests/test_mail_examples.py
17
#!/usr/bin/env python # -*- coding: utf-8 -*- MISC_HTML_SOURCE = """ <font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font> <div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo...
defzzd/UserDataBase-Heroku
refs/heads/master
venv/Lib/encodings/cp932.py
817
# # cp932.py: Python Unicode Codec for CP932 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('cp932') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrement...
simbha/GAE-appswell
refs/heads/master
appspot/framework/vendor/tweepy/cache.py
6
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. import time import threading import os import cPickle as pickle try: import hashlib except ImportError: # python 2.4 import md5 as hashlib try: import fcntl except ImportError: # Probably on a windows system # TODO: us...
ethers/btcrelay
refs/heads/f2
test/test_btcBulkStoreHeaders.py
1
from ethereum import tester from datetime import datetime, date import pytest slow = pytest.mark.slow from utilRelay import makeMerkleProof, dblSha256Flip, disablePyethLogging disablePyethLogging() class TestBtcBulkStoreHeaders(object): CONTRACT = 'test/btcBulkStoreHeaders_debug.se' BTC_ETH_CONTRACT = 'te...
m-messiah/dzzzzr-bot
refs/heads/master
useragents.py
1
# coding=utf-8 USERAGENTS = ( '(Windows NT 6.2; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) ' 'Chrome/25.0.1364.172 YaBrowser/1.7.1364.22194 Safari/537.22', '(X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3', '(X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Ubu...
robocoder/zaproxy
refs/heads/wip/socks-proxy
python/api/src/zapv2/params.py
1
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2014 the ZAP development team # # 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...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization.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 ...
DanForever/TimeSync
refs/heads/master
GAE/lib/requests/packages/urllib3/packages/ordered_dict.py
1093
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
taaviteska/django
refs/heads/master
tests/i18n/contenttypes/tests.py
75
import os from django.contrib.contenttypes.models import ContentType from django.test import TestCase, override_settings from django.utils import translation @override_settings( USE_I18N=True, LOCALE_PATHS=[ os.path.join(os.path.dirname(__file__), 'locale'), ], LANGUAGE_CODE='en', LANGUAG...
rajsadho/django
refs/heads/master
tests/forms_tests/widget_tests/test_radioselect.py
161
from django.forms import RadioSelect from .base import WidgetTest class RadioSelectTest(WidgetTest): widget = RadioSelect() def test_render(self): self.check_html(self.widget, 'beatle', 'J', choices=self.beatles, html=( """<ul> <li><label><input checked="checked" type="radio"...
chidaobanjiu/MANA2077
refs/heads/master
routes/__init__.py
3
from flask import session from models.user import User def current_user(): uid = session.get('user_id', '') u = User.find_by(id=uid) return u def admin(): uid = session.get('user_id', '') u = User.find_by(id=uid) return u
zenodo/invenio
refs/heads/zenodo-master
invenio/utils/washers.py
20
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio 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 o...
sushengyang/CoreNLP
refs/heads/master
scripts/arabic-segmenter/output_to_tedeval.py
41
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import sys import codecs import re def convert(untok_filename, tok_filename): with uopen(untok_filename, 'r') as input, \ uopen(tok_filename, 'r') as output, \ uopen(tok_filename + '.segmentation', 'w') as seg, \ uopen(tok_filename + '.ftree', 'w') a...
faithsws/WWR
refs/heads/master
RouterIF.py
1
import socket import Utils import threading import time class Connection(threading.Thread): def __init__(self,conn,addr,parent): threading.Thread.__init__(self) self.conn = conn self.addr = addr self.parent = parent self.mac = "" self.info = "" pass def run(self): #self.conn.settimeout(5) #self.file...
bboalimoe/keras
refs/heads/master
examples/mnist_irnn.py
70
from __future__ import absolute_import from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.initializations import normal, identity from keras....
protochron/carbon
refs/heads/master
lib/carbon/aggregator/receiver.py
3
from carbon.instrumentation import increment from carbon.aggregator.rules import RuleManager from carbon.aggregator.buffers import BufferManager from carbon.rewrite import RewriteRuleManager from carbon import events, log def process(metric, datapoint): increment('datapointsReceived') for rule in RewriteRuleMana...
bkpathak/HackerRank-Problems
refs/heads/master
python/sorting/merge_using_heap.py
2
import heapq def addtoheap(h, i, it): try: heapq.heappush(h, (next(it), i)) except StopIteration: pass def mergek(*lists): its = map(iter, lists) h = [] for i, it in enumerate(its): addtoheap(h, i, it) while h: v, i = heapq.heappop(h) addtoheap(h, i, its...
pridemusvaire/yowsup
refs/heads/master
yowsup/layers/protocol_groups/protocolentities/iq_groups_create.py
41
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_groups import GroupsIqProtocolEntity class CreateGroupsIqProtocolEntity(GroupsIqProtocolEntity): ''' <iq type="set" id="{{id}}" xmlns="w:g2", to="g.us"> <create subject="{{subject}}"> <participant jid="{{jid}}"></participa...
ybellavance/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/distutils/tests/test_config_cmd.py
47
"""Tests for distutils.command.config.""" import unittest import os import sys from test.support import run_unittest from distutils.command.config import dump_file, config from distutils.tests import support from distutils import log class ConfigTestCase(support.LoggingSilencer, support.TempdirMa...
drammock/mne-python
refs/heads/main
tutorials/intro/50_configure_mne.py
7
# -*- coding: utf-8 -*- """ .. _tut-configure-mne: Configuring MNE-Python ====================== This tutorial covers how to configure MNE-Python to suit your local system and your analysis preferences. We begin by importing the necessary Python modules: """ import os import mne ###################################...
mibexsoftware/alfred-stash-workflow
refs/heads/master
workflow/src/lib/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
Mic92/ansible
refs/heads/devel
lib/ansible/utils/hashing.py
28
# (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...
rspavel/spack
refs/heads/develop
var/spack/repos/builtin/packages/libxfont2/package.py
5
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libxfont2(AutotoolsPackage, XorgPackage): """libXfont provides the core of the legacy X11 ...
xpansa/purchase-workflow
refs/heads/8.0
purchase_requisition_transport_document/__init__.py
253
# -*- coding: utf-8 -*- from . import model
gitprouser/appengine-bottle-skeleton
refs/heads/master
lib/requests_toolbelt/auth/_digest_auth_compat.py
33
"""Provide a compatibility layer for requests.auth.HTTPDigestAuth.""" import requests class _ThreadingDescriptor(object): def __init__(self, prop, default): self.prop = prop self.default = default def __get__(self, obj, objtype=None): return getattr(obj._thread_local, self.prop, self....
darjeeling/django
refs/heads/master
tests/migrations/migrations_test_apps/conflicting_app_with_dependencies/migrations/0002_conflicting_second.py
133
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("conflicting_app_with_dependencies", "0001_initial"), ] operations = [ migrations.CreateModel( "Something", [ ("id", models.AutoField(primary_key=True...
ljrepos/hypertable
refs/heads/master
src/py/ThriftClient/gen-py/hyperthrift/gen2/ttypes.py
3
# # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TException, TApplicationException import hyperthrift.gen.ttypes from thrift.transport import TTransport from thrift.prot...
aakar77/DockSeatResourIsoCompr
refs/heads/master
docker-python-sdk/DockerApiClass.py
1
''' Author: Aakar Jinwala Description: This class is an abstraction layer over Docker Python methods and its methods. It provides automating the tasks for docker container methods using Docker API. Get the log stream from the container. Get the log from the container. Get the container ID. Get the stat...
xujun10110/golismero
refs/heads/master
thirdparty_libs/nltk/inference/__init__.py
17
# Natural Language Toolkit: Inference # # Copyright (C) 2001-2012 NLTK Project # Author: Dan Garrette <dhgarrette@gmail.com> # Ewan Klein <ewan@inf.ed.ac.uk> # # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Classes and interfaces for theorem proving and model building. """ from a...
0x0all/scikit-learn
refs/heads/master
sklearn/decomposition/tests/test_truncated_svd.py
240
"""Test truncated SVD transformer.""" import numpy as np import scipy.sparse as sp from sklearn.decomposition import TruncatedSVD from sklearn.utils import check_random_state from sklearn.utils.testing import (assert_array_almost_equal, assert_equal, assert_raises, assert_greater, ...
Alshak/clowdflows
refs/heads/master
workflows/mysql/db_test.py
4
import mysql.connector as sql # Widget 1 con = sql.connect(user='root', password='', host='localhost', database='test') # Widget 2 # Tole bo DB Context Object # - izberi relacije # - izberi stolpce # - povezi kljuce cursor = con.cursor() cursor.execute('SHOW tables') tables = [table for (table,) in cursor] cols = {} ...
dfang/odoo
refs/heads/10.0
addons/calendar/models/__init__.py
23
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ir_attachment import ir_http import res_partner import mail_message import calendar
youdonghai/intellij-community
refs/heads/master
python/testData/refactoring/rename/renameImportModuleAs/before/a.py
83
import f<caret>oo as foo foo.f()
tgckpg/wenku10
refs/heads/unsigned-master
unittest.py
1
#!/usr/bin/env python3 import re import socket import collections import sys # Symbolic name meaning all available interfaces HOST = "" # Arbitrary non-privileged port PORT = 9730 # TCP: SOCK_STREAM s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) print( "Listening on: " + str(P...
daeseokyoun/youtube-dl
refs/heads/youtube_search
youtube_dl/extractor/afreecatv.py
16
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, xpath_element, xpath_text, ) class AfreecaTVIE(InfoExtractor): IE...
bbc/kamaelia
refs/heads/master
Code/Python/Kamaelia/Kamaelia/Apps/Compose/GUI.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
jakobsa/wolfssl
refs/heads/master
wrapper/python/wolfcrypt/ciphers.py
4
# ciphers.py # # Copyright (C) 2006-2016 wolfSSL Inc. # # This file is part of wolfSSL. (formerly known as CyaSSL) # # wolfSSL 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, o...
fonea/velon
refs/heads/master
themes/frontend/assets/vendor/node_modules/node-sass/node_modules/node-gyp/gyp/gyp_main.py
1452
#!/usr/bin/env 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. import os import sys # Make sure we're using the version of pylib in this repo, not one installed # elsewhere on the system. sys.path.inser...
pbrod/numpy
refs/heads/master
benchmarks/benchmarks/bench_scalar.py
11
from .common import Benchmark, TYPES1 import numpy as np class ScalarMath(Benchmark): # Test scalar math, note that each of these is run repeatedly to offset # the function call overhead to some degree. params = [TYPES1] param_names = ["type"] def setup(self, typename): self.num = np.dtyp...
joshfriend/werkzeug
refs/heads/master
examples/plnt/database.py
45
# -*- coding: utf-8 -*- """ plnt.database ~~~~~~~~~~~~~ The database definitions for the planet. :copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ from sqlalchemy import MetaData, Table, Column, ForeignKey, Boolean, \ Integer, String, DateTime from sq...
etalab/udata
refs/heads/master
udata/tests/cli/test_cli_base.py
2
def test_cli_help(cli): '''Should display help without errors''' cli() cli('-?') cli('-h') cli('--help') def test_cli_log_and_printing(cli): '''Should properly log and print''' cli('test log') def test_cli_version(cli): '''Should display version without errors''' cli('--version')...
amenonsen/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_user.py
21
#!/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', ...
omni5cience/django-inlineformfield
refs/heads/master
.tox/py27/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/models.py
110
from django.contrib.gis.db import models from django.contrib.gis import admin from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class City(models.Model): name = models.CharField(max_length=30) point = models.PointField() objects = models.GeoManager() class Me...
MSeifert04/numpy
refs/heads/master
numpy/f2py/tests/test_parameter.py
11
from __future__ import division, absolute_import, print_function import os import pytest import numpy as np from numpy.testing import assert_raises, assert_equal from . import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestParameters(util.F2PyTest): # Check that in...
xyzy/androguard
refs/heads/master
demos/geinimi_analysis.py
38
#!/usr/bin/env python import sys import hashlib import pyDes PATH_INSTALL = "./" sys.path.append(PATH_INSTALL + "./") sys.path.append(PATH_INSTALL + "/core") sys.path.append(PATH_INSTALL + "/core/bytecodes") sys.path.append(PATH_INSTALL + "/core/analysis") from androguard import * import analysis TEST = "./geinimi...
TOCyna/tabelinha
refs/heads/master
flask/lib/python2.7/site-packages/passlib/handlers/pbkdf2.py
19
"""passlib.handlers.pbkdf - PBKDF2 based hashes""" #============================================================================= # imports #============================================================================= # core from binascii import hexlify, unhexlify from base64 import b64encode, b64decode import re impo...
kubeflow/pipelines
refs/heads/master
sdk/python/tests/compiler/testdata/uri_artifacts.py
1
# Copyright 2020 The Kubeflow Authors # # 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...
jpshort/odoo
refs/heads/8.0
addons/lunch/report/order.py
377
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
bbiiggppiigg/NTHUOJ_web
refs/heads/master
contest/forms.py
3
''' The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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,...
funtoo/portage-funtoo
refs/heads/2013-06-07
pym/portage/package/ebuild/_config/special_env_vars.py
1
# Copyright 2010-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals __all__ = ( 'case_insensitive_vars', 'default_globals', 'env_blacklist', \ 'environ_filter', 'environ_whitelist', 'environ_whitelist_re', ) import re # Blacklisted var...
deeplook/bokeh
refs/heads/master
examples/plotting/file/iris.py
45
from bokeh.sampledata.iris import flowers from bokeh.plotting import figure, show, output_file colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'} flowers['color'] = flowers['species'].map(lambda x: colormap[x]) output_file("iris.html", title="iris.py example") p = figure(title = "Iris Morpholog...
tomz/ruby-spark
refs/heads/master
benchmark/comparison/python.py
2
import os import math from time import time from random import random from operator import add from pyspark import SparkContext sc = SparkContext(appName="Python", master="local[*]") log_file = open(os.environ.get('PYTHON_LOG'), 'w') def log(*values): values = map(lambda x: str(x), values) log_file.write(';'.joi...
jaimahajan1997/sympy
refs/heads/master
sympy/polys/domains/realfield.py
63
"""Implementation of :class:`RealField` class. """ from __future__ import print_function, division from sympy.polys.domains.field import Field from sympy.polys.domains.simpledomain import SimpleDomain from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.domains.mpelements import MPCo...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.5/django/contrib/formtools/tests/wizard/wizardtests/urls.py
319
from django.conf.urls import patterns, url from django.contrib.formtools.tests.wizard.wizardtests.forms import ( SessionContactWizard, CookieContactWizard, Page1, Page2, Page3, Page4) urlpatterns = patterns('', url(r'^wiz_session/$', SessionContactWizard.as_view( [('form1', Page1), ('form2', P...
leohmoraes/tablib
refs/heads/develop
tablib/packages/odf/attrconverters.py
64
# -*- coding: utf-8 -*- # Copyright (C) 2006-2010 Søren Roug, European Environment Agency # # 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 you...
rsvip/Django
refs/heads/master
tests/postgres_tests/models.py
50
from django.db import connection, models from .fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HStoreField, IntegerRangeField, JSONField, ) class PostgreSQLModel(models.Model): class Meta: abstract = True required_db_vendor = 'postgre...
0359xiaodong/libgdx
refs/heads/master
extensions/gdx-freetype/jni/freetype-2.4.10/src/tools/docmaker/utils.py
515
# Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org> # import string, sys, os, glob # current output directory # output_dir = None # This function is used to sort the index. It is a simple lexicographical # sort, except that it places capital letters before lowercase ones. # def index_sort( s1, ...