repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
girving/tensorflow
refs/heads/master
tensorflow/python/keras/applications/densenet.py
12
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
bergercookie/Pump3000
refs/heads/master
python_code/build/bdist.win-amd64/winexe/temp/PyQt4.QtNetwork.py
1
def __load(): import imp, os, sys try: dirname = os.path.dirname(__loader__.archive) except NameError: dirname = sys.prefix path = os.path.join(dirname, 'PyQt4.QtNetwork.pyd') #print "py2exe extension module", __name__, "->", path mod = imp.load_dynamic(__name__, path) ...
ghchinoy/tensorflow
refs/heads/master
tensorflow/contrib/nearest_neighbor/python/kernel_tests/hyperplane_lsh_probes_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...
alrusdi/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/oracle/introspection.py
388
import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, # but it is the only o...
heyglen/sublime-network
refs/heads/master
lib/iana/ripe/objects/poetic_form.py
2
""" Copyright 2019 Glen Harmon POETIC-FORM Object Description https://www.ripe.net/manage-ips-and-asns/db/support/documentation/ripe-database-documentation/rpsl-object-types/4-3-descriptions-of-secondary-objects/4-3-8-description-of-the-poetic-form-object """ from .rpsl import Rpsl class PoeticForm(Rpsl): def...
pap/rethinkdb
refs/heads/next
scripts/VirtuaBuild/smoke_test.py
46
#!/usr/bin/env python # Copyright 2010-2012 RethinkDB, all rights reserved. # usage: ./smoke_test.py --mode OS_NAME --num-keys SOME_NUMBER_HERE import time, sys, os, socket, random, time, signal, subprocess sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'test',...
wangyanxi/web-demos
refs/heads/master
python/arg/arg.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument( 'source_file', nargs='?', type=argparse.FileType('r'), default=sys.stdin ) parser.add_argument( '-v', '--ver...
dlcs/dlcs-client
refs/heads/master
dlcs/queue_response.py
1
from requests import get, auth import settings mapping = { '@context': 'context', '@id': 'id', '@type': 'type', 'errorImages': 'error_images', 'completedImages': 'completed_images', } class Batch: @staticmethod def get_attribute_name(json_name): if json_name in mapping: ...
MechCoder/sympy
refs/heads/master
sympy/polys/domains/modularinteger.py
112
"""Implementation of :class:`ModularInteger` class. """ from __future__ import print_function, division import operator from sympy.polys.polyutils import PicklableWithSlots from sympy.polys.polyerrors import CoercionFailed from sympy.polys.domains.domainelement import DomainElement from sympy.utilities import publi...
explorerwjy/jw_anly502
refs/heads/master
L02/mrjob_salary_max0.py
6
from mrjob.job import MRJob from mrjob.step import MRStep import heapq, csv cols = 'Name,JobTitle,AgencyID,Agency,HireDate,AnnualSalary,GrossPay'.split(",") class salarymax(MRJob): def mapper(self, _, line): row = dict(zip(cols, [ a.strip() for a in csv.reader([line]).next()])) yield "salary", (fl...
goodwinnk/intellij-community
refs/heads/master
python/testData/refactoring/move/packageImport/after/src/lib1/mod1.py
166
def k(x): return lambda y: x
qk4l/Flexget
refs/heads/develop
flexget/plugins/metainfo/assume_quality.py
9
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging from collections import namedtuple import flexget.utils.qualities as qualities from flexget import plugin from flexget....
vladmm/intellij-community
refs/heads/master
python/testData/copyPaste/multiLine/IndentMulti21.dst.py
747
class C: def foo(self): <caret>y = 2
thomask77/nucular-keyboard
refs/heads/master
Tools/hex2dfu/intelhex/__init__.py
10
# Copyright (c) 2005-2013, Alexander Belchenko # 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 condi...
jspraul/bite-project
refs/heads/master
deps/mrtaskman/server/models/events.py
16
# 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 th...
xq262144/hue
refs/heads/master
desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/reader/excel.py
61
# file openpyxl/reader/excel.py # Copyright (c) 2010 openpyxl # # 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, m...
patrickwestphal/owlapy
refs/heads/master
owlapy/model/swrlsameindividualatom.py
1
from .owlobjectvisitor import OWLObjectVisitor, OWLObjectVisitorEx from .swrlbinaryatom import SWRLBinaryAtom from .swrlobjectvisitor import SWRLObjectVisitor, SWRLObjectVisitorEx from owlapy.util import accept_default, accept_default_ex from owlapy.vocab.owlrdfvocabulary import OWLRDFVocabulary class SWRLSameIndivid...
chrxr/wagtail
refs/heads/master
wagtail/wagtaildocs/views/multiple.py
9
from __future__ import absolute_import, unicode_literals from django.core.exceptions import PermissionDenied from django.http import HttpResponseBadRequest, JsonResponse from django.shortcuts import get_object_or_404, render from django.template.loader import render_to_string from django.utils.encoding import force_te...
azaghal/ansible
refs/heads/devel
test/integration/targets/ansible-doc/library/test_docs_removed_precedence.py
38
#!/usr/bin/python from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: test_docs_removed_precedence short_description: Test module description: - Test module author: - Ansible Core Team deprecated: alternative: new_module why: Updated module...
Grirrane/odoo
refs/heads/master
addons/l10n_ma/__init__.py
8
# -*- 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 t...
xiandiancloud/edxplaltfom-xusong
refs/heads/master
common/lib/xmodule/xmodule/modulestore/mixed.py
2
""" MixedModuleStore allows for aggregation between multiple modulestores. In this way, courses can be served up both - say - XMLModuleStore or MongoModuleStore """ import logging from contextlib import contextmanager import itertools import functools from opaque_keys import InvalidKeyError from opaque_keys.edx.key...
CuonDeveloper/cuon
refs/heads/master
cuon_client/CUON/cuon/Databases/xbase.py
7
import struct, datetime, decimal, itertools def dbfreader(f): """Returns an iterator over records in a Xbase DBF file. The first row returned contains the field names. The second row contains field specs: (type, size, decimal places). Subsequent rows contain the data records. If a record is marked...
spark0001/spark2.1.1
refs/heads/master
examples/src/main/python/sql/streaming/structured_network_wordcount_windowed.py
76
# # 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...
neutrongenious/xrt
refs/heads/master
X-Art Parser/beautifulsoup4-4.3.1/bs4/tests/test_docs.py
607
"Test harness for doctests." # pylint: disable-msg=E0611,W0142 __metaclass__ = type __all__ = [ 'additional_tests', ] import atexit import doctest import os #from pkg_resources import ( # resource_filename, resource_exists, resource_listdir, cleanup_resources) import unittest DOCTEST_FLAGS = ( doctes...
40223234/40223234
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testhelpers.py
737
import unittest from unittest.mock import ( call, _Call, create_autospec, MagicMock, Mock, ANY, _CallList, patch, PropertyMock ) from datetime import datetime class SomeClass(object): def one(self, a, b): pass def two(self): pass def three(self, a=None): pass class AnyT...
littlstar/chromium.src
refs/heads/nw
content/test/gpu/page_sets/gpu_process_tests.py
34
# Copyright 2014 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class GpuProcessTestsPage(page_module.Page): def __...
jscott1989/django-allauth
refs/heads/master
allauth/socialaccount/providers/facebook/south_migrations/0004_auto__del_facebookapp__del_facebookaccesstoken__del_unique_facebookacc.py
82
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'FacebookAccessToken', fields ['app', 'account'] db.delete_unique('facebook_facebookaccesstoken', ['app_id', 'account_i...
Itxaka/st2
refs/heads/master
st2common/tests/resources/loadableplugin/plugin/sampleplugin.py
26
import plugin.util.randomutil class SamplePlugin(object): def __init__(self): self.__count = 10 def do_work(self): return plugin.util.randomutil.get_random_numbers(self.__count)
lexyan/SickBeard
refs/heads/master
sickbeard/gh_api.py
8
# Author: Nic Wolfe <[email protected]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
grnet/ac16
refs/heads/master
src/verifier.py
1
import prover from bplib.bp import GTElem def step1(gk, A1, A2, g1_sum, g2_sum): return prover.step1c(gk, A1, A2, g1_sum, g2_sum) def step2(gk, n): p1 = [gk.q.random() for i in range(n)] p2 = [gk.q.random() for j in range(3)] p3 = [[gk.q.random() for j in range(3)] for i in range(n)] p...
benvermaercke/pyqtgraph
refs/heads/develop
pyqtgraph/console/__init__.py
56
from .Console import ConsoleWidget
josephlewis42/autopilot
refs/heads/master
extern/gtest/test/gtest_break_on_failure_unittest.py
2140
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
kaiserroll14/301finalproject
refs/heads/master
testreq/requests/packages/urllib3/exceptions.py
62
## Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): self.pool ...
b0ri5/nishe-googlecode
refs/heads/master
scons/scons-local-1.3.0/SCons/Tool/textfile.py
5
# -*- python -*- # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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, inclu...
eayunstack/nova
refs/heads/develop
nova/compute/task_states.py
96
# Copyright 2010 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...
skylina/test
refs/heads/master
public/BasePage.py
1
 # -*- coding: utf-8 -*- from selenium.webdriver.support.wait import WebDriverWait from selenium import webdriver __author__ = 'lina' import time import sys import xlrd.sheet import time, os class Action: """ BasePage封装所有页面都公用的方法,例如driver, url """ driver = None # 初始化driver、url、等 def __init__(self, base_url=N...
Flimm/linkchecker
refs/heads/master
scripts/update_iana_uri_schemes.py
9
import sys import re import csv import requests iana_uri_schemes = "https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml" # CSV format: URI Scheme,Template,Description,Reference csv_iana_uri_schemes_permanent = 'https://www.iana.org/assignments/uri-schemes/uri-schemes-1.csv' csv_iana_uri_schemes_provisional ...
paplorinc/intellij-community
refs/heads/master
python/testData/testRunner/env/unit/test_file.py
83
import unittest class GoodTest(unittest.TestCase): def test_passes(self): self.assertEqual(2+2, 4) class BadTest(unittest.TestCase): def test_fails(self): self.assertEqual(2+2, 5) if __name__ == '__main__': unittest.main()
olafkrawczyk/pwr_so_lab
refs/heads/master
lab9/ex1.py
1
#Olaf Krawczyk 218164 18.05.2017 # W zadanym pliku tekstowym znalezc wszystkie slowa ktore maja pierwsze trzy litery takie same import os import sys import re if len(sys.argv) != 2: print "Niepoprawna liczba argumentow" print "Podaj jedynie sciezke do pliku" sys.exit(1) if not os.path.isfile(sys.argv[1]):...
omnirom/android_external_chromium-org
refs/heads/android-5.1
build/linux/unbundle/replace_gyp_files.py
36
#!/usr/bin/env python # Copyright 2013 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. """ Replaces gyp files in tree with files from here that make the build use system libraries. """ import optparse import os.path impo...
saradbowman/osf.io
refs/heads/develop
api_tests/osf_groups/views/test_osf_groups_list.py
10
import pytest from waffle.testutils import override_flag from api.base.settings.defaults import API_BASE from osf.models import OSFGroup from osf_tests.factories import ( AuthUserFactory, OSFGroupFactory, ) from osf.features import OSF_GROUPS @pytest.fixture() def user(): return AuthUserFactory() @pytest...
smuser90/Stream-Framework
refs/heads/master
stream_framework/metrics/statsd.py
9
from __future__ import absolute_import from stream_framework.metrics.base import Metrics from statsd import StatsClient class StatsdMetrics(Metrics): def __init__(self, host='localhost', port=8125, prefix=None): self.statsd = StatsClient(host, port, prefix) def fanout_timer(self, feed_class): ...
SoftwareIntrospectionLab/MininGit
refs/heads/master
pycvsanaly2/CVSParser.py
2
# Copyright (C) 2007 LibreSoft # # 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 distributed in the ...
onlinecity/phone-iso3166
refs/heads/master
phone_iso3166/country.py
1
from .e164 import mapping from .e212 import networks from .errors import InvalidPhone, InvalidNetwork, InvalidCountry def phone_country(phone): ''' Really simple function to get the ISO-3166-1 country from a phone number The phone number must be in E.164, aka international format. Returns an ISO-3166-...
ssutee/metageta
refs/heads/master
metageta/formats/ecw.py
2
# -*- coding: utf-8 -*- # Copyright (c) 2013 Australian Government, Department of the Environment # # 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...
Antiun/l10n-spain
refs/heads/8.0
payment_redsys/models/__init__.py
16
# -*- coding: utf-8 -*- from . import redsys
jamalmazrui/InPy
refs/heads/master
WebClient_WeatherCheck.py
1
sLocation = ReadValue('LocationID') if not sLocation: sLocation = ReadValue('ZipCode') sLocation = IniFormDialogInput('Input', 'Location', sLocation) if not sLocation: Exit() WriteValue('LocationID', sLocation) # dYahoo = pywapi.get_weather_from_google(sLocation) ; bFound = True # print dYahoo # Exit() try: d...
mihneadb/suse_bug_reporter
refs/heads/master
bugreporter/util/interact.py
1
''' Copyright (C) 2011 Mihnea Dobrescu-Balaur 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 distributed in ...
phracek/gtk-demos
refs/heads/master
pygtk_textview/textview.py
1
#!/usr/bin/python2 -tt # -*- coding: utf-8 -*- import os import ConfigParser from StringIO import StringIO from gi.repository import Gtk, Gdk from gi.repository import GLib GLADE_FILE = os.path.join(os.path.dirname(__file__), 'textview.glade') class ListViewExample(object): def __init__(self): self.buil...
htzy/bigfour
refs/heads/master
cms/djangoapps/contentstore/management/commands/clone_course.py
119
""" Script for cloning a course """ from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.django import modulestore from student.roles import CourseInstructorRole, CourseStaffRole from opaque_keys.edx.keys import CourseKey from opaque_keys import InvalidKeyError from opaque_keys.edx...
ftomassetti/intellij-community
refs/heads/master
python/helpers/docutils/parsers/rst/states.py
41
# $Id: states.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <[email protected]> # Copyright: This module has been placed in the public domain. """ This is the ``docutils.parsers.restructuredtext.states`` module, the core of the reStructuredText parser. It defines the following: :Classes: - `RSTSt...
pydsigner/wesnoth
refs/heads/master
utils/gdb/register_wesnoth_pretty_printers.py
41
# This file registers pretty printers """ Usage: """ import gdb import re import itertools import wesnoth_type_tools reload(wesnoth_type_tools) from wesnoth_type_tools import strip_all_type class NullPointerPrinter(object): """Print NULL for null pointers""" def __init__(self, val): pass de...
alexsanjoseph/duolingo-save-streak
refs/heads/master
werkzeug/contrib/cache.py
84
# -*- coding: utf-8 -*- """ werkzeug.contrib.cache ~~~~~~~~~~~~~~~~~~~~~~ The main problem with dynamic Web sites is, well, they're dynamic. Each time a user requests a page, the webserver executes a lot of code, queries the database, renders templates until the visitor gets the page he sees. ...
jessrosenfield/pants
refs/heads/master
tests/python/pants_test/tasks/test_jvm_bundle_integration.py
14
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants_test.pant...
pradyu1993/scikit-learn
refs/heads/master
sklearn/manifold/__init__.py
4
""" The :mod:`sklearn.manifold` module implements data embedding techniques. """ from .locally_linear import locally_linear_embedding, LocallyLinearEmbedding from .isomap import Isomap from .mds import MDS
facebookexperimental/eden
refs/heads/master
eden/scm/tests/test-fb-hgext-treemanifest-sparse-t.py
2
# Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from testutil.dott import feature, sh, testtmp # noqa: F401 # test interaction between s...
hiptools/hiptools
refs/heads/master
russ_simp.py
1
#! /usr/bin/python2 # -*- coding: utf-8 -*- import codecs import re import os import sys import chardet import numb_conv n_conv = numb_conv.NumParser() class Mn: def __init__(self, stress=None, color=None, junk=None): '''This module tries to convert hip-encoded text into plain Russian''' # if ar...
mbr0wn/gnuradio
refs/heads/master
gr-blocks/python/blocks/__init__.py
3
# # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # ''' Processing blocks common to many flowgraphs. ''' import os try: from .blocks_python import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file...
wmvanvliet/mne-python
refs/heads/master
mne/coreg.py
1
# -*- coding: utf-8 -*- """Coregistration between different coordinate frames.""" # Authors: Christian Brodbeck <[email protected]> # # License: BSD (3-clause) import configparser import fnmatch from glob import glob, iglob import os import os.path as op import stat import sys import re import shutil from fun...
salv-orlando/MyRepo
refs/heads/bp/xenapi-security-groups
nova/api/openstack/contrib/security_groups.py
1
# Copyright 2011 OpenStack LLC. # 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 b...
YajunQiu/three.js
refs/heads/master
utils/exporters/blender/addons/io_three/exporter/material.py
70
from .. import constants, logger from . import base_classes, utilities, api class Material(base_classes.BaseNode): """Class that wraps material nodes""" def __init__(self, node, parent): logger.debug("Material().__init__(%s)", node) base_classes.BaseNode.__init__(self, node, parent, ...
bbcf/bsPlugins
refs/heads/master
bsPlugins/MergeTracks.py
1
from bsPlugins import * from bbcflib.gfminer.stream import merge_scores from bbcflib.gfminer.numeric import correlation from bbcflib.track import track, FeatureStream from bbcflib import genrep output_opts = ['sql','bed','bedGraph','wig','bigWig','sga'] method_opts = ['mean','min','max','geometric','median','sum'] me...
apelliciari/django-registration-from-bitbucket
refs/heads/master
registration/tests/urls.py
138
""" URLs used in the unit tests for django-registration. You should not attempt to use these URLs in any sort of real or development environment; instead, use ``registration/backends/default/urls.py``. This URLconf includes those URLs, and also adds several additional URLs which serve no purpose other than to test tha...
facundoq/toys
refs/heads/master
cic-fly/src/cic/Processing.py
1
''' Created on 14/05/2013 @author: facuq ''' from numpy import * import os; import matplotlib.pyplot as plt from PeakDetector import peakdetect from ImageReader import imsave, ImageReader import itertools from matplotlib.pyplot import figure from Smoothing import savitzky_golay class Peak(object): (Maximum,M...
infectedmushi/kernel-sony-copyleft
refs/heads/39.2.A.0.xxx
tools/perf/scripts/python/netdev-times.py
1544
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
dfalt974/SickRage
refs/heads/master
lib/future/backports/socket.py
68
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
ShiYw/Sigil
refs/heads/master
3rdparty/python/Lib/test/test_telnetlib.py
84
import socket import selectors import telnetlib import time import contextlib from unittest import TestCase from test import support threading = support.import_module('threading') HOST = support.HOST def server(evt, serv): serv.listen(5) evt.set() try: conn, addr = serv.accept() conn.clos...
gcd0318/django
refs/heads/master
tests/template_tests/filter_tests/test_linebreaksbr.py
331
from django.template.defaultfilters import linebreaksbr from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksbrTests(SimpleTestCase): """ The contents in "linebreaksbr" are escaped according to the current autoescape setting. "...
eromoe/flask-website
refs/heads/master
flask_website/search.py
6
# -*- coding: utf-8 -*- import os from whoosh import highlight, analysis, qparser from whoosh.support.charset import accent_map from flask import Markup from flask_website import app from werkzeug import import_string def open_index(): from whoosh import index, fields as f if os.path.isdir(app.config['WHOOSH_...
michaelyin/im2markup-prep
refs/heads/master
net/wyun/mer/ink/scg.py
1
import json from net.wyun.mer.ink.sample import Sample from net.wyun.mer.ink.stroke import Stroke from net.wyun.mer.ink import scginkparser import numpy as np from net.wyun.mer.ink.stroke import get_bounding_box from scipy import misc class Scg(object): def __init__(self, scg_id, scg_content, truth, request_at, r...
vipins/ccccms
refs/heads/master
env/Lib/encodings/cp1255.py
593
""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
BhupeshGupta/erpnext
refs/heads/develop
erpnext/accounts/page/accounts_browser/accounts_browser.py
34
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import flt from erpnext.accounts.utils import get_balance_on @frappe.whitelist() def get_comp...
alphagov/notify-api
refs/heads/master
app/job/sms_jobs.py
1
import os from datetime import datetime from flask import json from app.connectors.access_queue import get_messages_from_queue from app.models import Notification from app import db, sms_wrapper, create_app from sqlalchemy import asc from app.connectors.sms.clients import ClientException def __update_notification_...
hozn/stravalib
refs/heads/master
examples/strava-oauth/server.py
1
#!flask/bin/python import logging from flask import Flask, render_template, redirect, url_for, request, jsonify from stravalib import Client app = Flask(__name__) app.config.from_envvar('APP_SETTINGS') @app.route("/") def login(): c = Client() url = c.authorization_url(client_id=app.config['STRAVA_CLIENT_ID'...
swieder227/three.js
refs/heads/master
utils/converters/msgpack/msgpack/fallback.py
641
"""Fallback pure Python implementation of msgpack""" import sys import array import struct if sys.version_info[0] == 3: PY3 = True int_types = int Unicode = str xrange = range def dict_iteritems(d): return d.items() else: PY3 = False int_types = (int, long) Unicode = unicode ...
RouxRC/weboob
refs/heads/master
modules/podnapisi/test.py
7
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your op...
ric2b/Vivaldi-browser
refs/heads/master
chromium/third_party/blink/tools/blinkpy/web_tests/controllers/__init__.py
6014
# Required for Python to search this directory for module files
shybovycha/buck
refs/heads/master
test/com/facebook/buck/android/testdata/exopackage_integration/generate.py
6
#!/usr/bin/python import json import os import shutil import zipfile config = json.loads(open('state.config').read()) package = config['package'] data = config['data'] def generate_file(template_path, path, data): with open(template_path, 'r') as template_file: template = template_file.read() wit...
DasIch/django
refs/heads/master
django/contrib/gis/gdal/raster/band.py
28
import math from ctypes import byref, c_double, c_int, c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis.shortcuts import numpy from django.utils import six from django...
CooperLuan/airflow
refs/heads/master
airflow/executors/base_executor.py
30
from builtins import range from builtins import object import logging from airflow.utils import State from airflow.configuration import conf PARALLELISM = conf.getint('core', 'PARALLELISM') class BaseExecutor(object): def __init__(self, parallelism=PARALLELISM): """ Class to derive in order to ...
mengxn/tensorflow
refs/heads/master
tensorflow/python/platform/flags_test.py
79
# 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...
CiscoUcs/Ironic
refs/heads/master
build/lib/ironic/tests/__init__.py
16
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
JioCloud/keystone
refs/heads/master
keystone/tests/test_v3_auth.py
2
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
dbergan/AutobahnPython
refs/heads/master
examples/twisted/wamp/basic/pubsub/complex/__init__.py
561
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
jimberlage/servo
refs/heads/master
components/style/gecko/regen_atoms.py
2
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import re import os import sys from io import BytesIO GECKO_DIR = os.path.dirname(__file__.repl...
AMechler/AliPhysics
refs/heads/master
PWGJE/EMCALJetTasks/Tracks/analysis/base/Helper.py
42
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
thomashaw/SecGen
refs/heads/master
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/lib2to3/fixes/fix_buffer.py
327
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes buffer(...) into memoryview(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name class FixBuffer(fixer_base.BaseFix): BM_compatible = True explicit = True # ...
iiman/mytardis
refs/heads/master
tardis/apps/sync/models.py
1
# -*- coding: utf-8 -*- # # Copyright (c) 2010-2012, Monash e-Research Centre # (Monash University, Australia) # Copyright (c) 2010-2012, VeRSI Consortium # (Victorian eResearch Strategic Initiative, Australia) # All rights reserved. # Redistribution and use in source and binary forms, with or without # modificatio...
nikhilprathapani/python-for-android
refs/heads/master
python3-alpha/python3-src/Tools/msi/msi.py
45
# Python MSI Generator # (C) 2003 Martin v. Loewis # See "FOO" in comments refers to MSDN sections with the title FOO. import msilib, schema, sequence, os, glob, time, re, shutil, zipfile from msilib import Feature, CAB, Directory, Dialog, Binary, add_data import uisample from win32com.client import constants from dist...
acgtun/acgtun.com
refs/heads/master
acgtun/dict/dictionary.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import # Create your views here. from django.http import HttpResponse from django.template.loader import render_to_string from django.conf import settings import os import sys import string import pickle sys.path.append(o...
tovrstra/horton
refs/heads/master
horton/io/test/test_cp2k.py
4
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2017 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
PreludeAndFugue/PySpend
refs/heads/master
setup.py
1
#!/usr/local/bin/python # -*- coding: utf-8 -*- import sys from distutils.core import setup #from cx_Freeze import setup, Executable base = None if sys.platform == "win32": base = "Win32GUI" setup( # py2exe #windows=['pyspend.py'], #cx_Freeze #executables=[Executable('pyspend/pyspend.py', base=b...
Jaiz909/youtube-dl
refs/heads/master
devscripts/gh-pages/add-version.py
174
#!/usr/bin/env python3 from __future__ import unicode_literals import json import sys import hashlib import os.path if len(sys.argv) <= 1: print('Specify the version number as parameter') sys.exit() version = sys.argv[1] with open('update/LATEST_VERSION', 'w') as f: f.write(version) versions_info = jso...
zzqcn/wireshark
refs/heads/zzqcn
test/suite_dfilter/group_scanner.py
3
# Copyright (c) 2013 by Gilbert Ramirez <[email protected]> # # SPDX-License-Identifier: GPL-2.0-or-later import unittest import fixtures from suite_dfilter.dfiltertest import * @fixtures.uses_fixtures class case_scanner(unittest.TestCase): trace_file = "http.pcap" def test_dquote_1(self, checkDFilterCou...
jcrocholl/nxdom
refs/heads/master
dictionaries/english.py
1
# Copyright 2000-2004 by Kevin Atkinson # Python wrapper by Johann C. Rocholl # # Permission to use, copy, modify, distribute and sell these word # lists, the associated scripts, the output created from the scripts, # and its documentation for any purpose is hereby granted without fee, # provided that the above copyrig...
susansalkeld/discsongs
refs/heads/master
discsongs/lib/python2.7/site-packages/flask/testsuite/deprecations.py
563
# -*- coding: utf-8 -*- """ flask.testsuite.deprecations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests deprecation support. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase, catch_warnings class ...
openstack/solum
refs/heads/master
doc/source/conf.py
2
# 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 the...
sestrella/ansible
refs/heads/devel
lib/ansible/modules/cloud/rackspace/rax_dns_record.py
57
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
andreparrish/python-for-android
refs/heads/master
python-build/python-libs/gdata/tests/gdata_tests/youtube/service_test.py
89
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
klinger/volunteer_planner
refs/heads/develop
organizations/migrations/0006_auto_20151022_1445.py
6
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('organizations', '0005_auto_20151021_1153'), ] operations = [ migrations.AlterField( model_name='facilitymembersh...