repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
shannpersand/cooper-type
refs/heads/master
workshops/Python Workshop/Just/2016-06-21 Cooper workshop day 2/16 type specimen columns.py
1
txt = """Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in he...
nsoranzo/tools-iuc
refs/heads/master
tools/qiime/qiime_core/beta_diversity_through_plots_html_generation.py
21
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re def generate_index_html(dir_list, args): with open(args.html_file, 'w') as index_html_file: s = "" s += '<html>\n' s += '\t<head><title>PCoA beta diversity results</title></head>\n' s += '\t<body>\n'...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/component/weapon/shared_blaster_barrel_wp_muzzle_sm_s01_lg.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/weapon/shared_blaster_barrel_wp_muzzle_sm_s01_lg.iff" res...
kaulkie/keyczar
refs/heads/master
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/msvs.py
19
"""SCons.Tool.msvs Tool-specific initialization for Microsoft Visual Studio project files. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20...
NASLab/GroundROS
refs/heads/master
src/unittests/pathGenerator_test.py
1
import sys sys.path.insert(0, '..') import path_generator as pthgen import matplotlib.pyplot as plt import time import numpy as np import pylab pylab.ion() def plotPath(pthgen): fig = plt.figure() pthgen.getPosition() plt.plot(pthgen.x_array, pthgen.y_array) plt.xlim(-1.1, 1.1) plt.ylim(-1.1, 1.1)...
illfelder/compute-image-packages
refs/heads/master
packages/python-google-compute-engine/google_compute_engine/metadata_scripts/tests/script_retriever_test.py
2
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
mvidalgarcia/indico
refs/heads/master
indico/legacy/services/implementation/base.py
2
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import g, session from werkzeug.exceptions import Forbidden from indico.core.logger import sen...
Softmotions/edx-platform
refs/heads/master
common/djangoapps/heartbeat/views.py
199
from xmodule.modulestore.django import modulestore from dogapi import dog_stats_api from util.json_request import JsonResponse from django.db import connection from django.db.utils import DatabaseError from xmodule.exceptions import HeartbeatFailure @dog_stats_api.timed('edxapp.heartbeat') def heartbeat(request): ...
bodi000/odoo
refs/heads/master
addons/account/wizard/account_report_common_account.py
371
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
atheed/servo
refs/heads/master
tests/wpt/css-tests/tools/pytest/_pytest/runner.py
173
""" basic collect and runtest protocol implementations """ import bdb import sys from time import time import py import pytest from _pytest._code.code import TerminalRepr, ExceptionInfo def pytest_namespace(): return { 'fail' : fail, 'skip' : skip, 'importorskip' : importo...
jfinkels/networkx
refs/heads/master
networkx/algorithms/tests/test_richclub.py
11
import networkx as nx from nose.tools import * def test_richclub(): G = nx.Graph([(0,1),(0,2),(1,2),(1,3),(1,4),(4,5)]) rc = nx.richclub.rich_club_coefficient(G,normalized=False) assert_equal(rc,{0: 12.0/30,1:8.0/12}) # test single value rc0 = nx.richclub.rich_club_coefficient(G,normalized=Fa...
tensorflow/neural-structured-learning
refs/heads/master
research/carls/candidate_sampling_ops.py
1
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
mattt416/neutron
refs/heads/master
neutron/tests/unit/agent/metadata/test_driver.py
16
# Copyright 2014 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 req...
jallohm/django
refs/heads/master
django/conf/locale/tr/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i' DATETI...
diofeher/django-nfa
refs/heads/master
django/contrib/localflavor/nl/forms.py
2
""" NL-specific Form helpers """ import re from django.newforms import ValidationError from django.newforms.fields import Field, Select, EMPTY_VALUES from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode pc_re = re.compile('^\d{4}[A-Z]{2}$') sofi_re = re.compile('^\d...
buddycloud/buddycloud-iOS-client
refs/heads/master
src/External_Libs/three20/src/scripts/Pbxproj.py
1
#!/usr/bin/env python # encoding: utf-8 """ Pbxproj.py Working with the pbxproj file format is a pain in the ass. This object provides a couple basic features for parsing pbxproj files: * Getting a dependency list * Adding one pbxproj to another pbxproj as a dependency Version 1.0. History: 1.0 - October 20, 2010:...
CatsAndDogsbvba/odoo
refs/heads/8.0
addons/purchase_double_validation/__openerp__.py
260
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gutomaia/nesasm_py
refs/heads/0.0.x
nesasm/tests/code_line_generator_test.py
1
# -*- coding: utf-8 -*- from unittest import TestCase, skip from lexical import code_line_generator from types import GeneratorType from tempfile import NamedTemporaryFile class CodeLineGeneratorTest(TestCase): @skip('TODO') def test_unicode(self): code = u'; Something\nCPY #$11' gen = code_...
Pretio/boto
refs/heads/develop
boto/ec2/autoscale/request.py
152
# Copyright (c) 2009 Reza Lotun http://reza.lotun.name/ # # 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, modify, ...
numenta/nupic.research
refs/heads/master
projects/continuous_learning/sigopt_config.py
3
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
googleapis/googleapis-gen
refs/heads/master
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/ad_group_extension_setting_service.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/distutils/tests/test_cygwinccompiler.py
25
"""Tests for distutils.cygwinccompiler.""" import unittest import sys import os from io import BytesIO from test.support import run_unittest from distutils import cygwinccompiler from distutils.cygwinccompiler import (check_config_h, CONFIG_H_OK, CONFIG_H_NOTOK, ...
HomeRad/TorCleaner
refs/heads/master
tests/http/test_date.py
1
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005-2010 Bastian Kleineidam import unittest import time import wc.http.date class TestDate(unittest.TestCase): def test_rfc1123(self): now = time.time() wc.http.date.get_date_rfc1123(now) s = "Sat, 12 Feb 0005 11:12:13 GMT" t = (0005,...
ngi644/pymimamori
refs/heads/master
setup.py
1
# encoding: utf-8 """ Created by nagai at 15/04/21 """ __author__ = 'nagai' from setuptools import setup, find_packages setup( name='mimamori', description='Mimamori', author='Takashi Nagai', author_email='[email protected]', url='', version='0.1.0', license='AGPL-3.0', keywords=['bl...
huanghao/mic
refs/heads/master
mic/utils/grabber.py
6
#!/usr/bin/python import os import sys import fcntl import struct import termios from mic import msger from mic.utils import runner from mic.utils.errors import CreatorError from mic.utils.safeurl import SafeURL from urlgrabber import grabber from urlgrabber import __version__ as grabber_version def myurlgrab(url, ...
kylewalters18/bcycle_api
refs/heads/master
tests/test_api.py
1
import unittest import json from collections import namedtuple from datetime import datetime from unittest import mock from bcycle import app MockTrip = namedtuple('trip', ['id', 'bike_id', 'duration', 'checkout_kiosk', 'checkout_datetime', 'return_kiosk', 'return_datetime']) MockRid...
olapaola/olapaola-android-scripting
refs/heads/master
python-build/python-libs/gdata/src/atom/http_interface.py
133
#!/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 ...
mancoast/CPythonPyc_test
refs/heads/master
fail/330_test_poplib.py
7
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase from test import support as test_support threading = test_suppo...
aptivate/djangocms_events
refs/heads/master
tests/events/models.py
1
from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext as _ from cms.models.pluginmodel import CMSPlugin class Wossname(models.Model): ...
DeMille/emailhooks
refs/heads/master
django_nonrel/django/contrib/localflavor/ca/forms.py
100
""" Canada-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, CharField, Select from django.utils.encoding import smart_text from django.utils.tran...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-0.96/django/db/backends/mysql/introspection.py
32
from django.db.backends.mysql.base import quote_name from MySQLdb import ProgrammingError, OperationalError from MySQLdb.constants import FIELD_TYPE import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") def get_table_list(cursor): "Returns a li...
uwdata/termite-treetm
refs/heads/master
web2py/gluon/contrib/ordereddict.py
1047
# Copyright (c) 2009 Raymond Hettinger # # 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, modify, merge, # publish,...
chenzeyu/IbPy
refs/heads/master
ib/ext/OrderComboLeg.py
9
#!/usr/bin/env python """ generated source for module OrderComboLeg """ # # Original file copyright original author(s). # This file copyright Troy Melhase, [email protected]. # # WARNING: all changes to this file will be lost. from ib.lib import Double from ib.lib.overloading import overloaded # # * OrderComboLeg.java #...
repodono/repodono.jobs
refs/heads/master
setup.py
1
from setuptools import setup, find_packages version = '0.0' classifiers = """ Development Status :: 4 - Beta Environment :: Console Intended Audience :: Developers License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) Operating System :: OS Independent Programming Language :: Python :: 3.5 Progra...
jokajak/itweb
refs/heads/master
data/env/lib/python2.6/site-packages/SQLAlchemy-0.6.7-py2.6.egg/sqlalchemy/dialects/access/__init__.py
12133432
vfine/webplatform
refs/heads/master
pmModules/__init__.py
12133432
godiard/sugar
refs/heads/master
extensions/cpsection/webaccount/view.py
7
# Copyright (C) 2013, Walter Bender - Raul Gutierrez Segales # # 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 ...
tchernomax/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
crosswalk-project/blink-crosswalk
refs/heads/master
Source/bindings/scripts/generate_event_interfaces.py
22
#!/usr/bin/python # # Copyright (C) 2013 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...
uaarg/missioncommander
refs/heads/suas2017
ui/__init__.py
1
from .ui import UI
sodafree/backend
refs/heads/master
build/lib.linux-i686-2.7/django/contrib/localflavor/uy/forms.py
87
# -*- coding: utf-8 -*- """ UY-specific form helpers. """ from __future__ import absolute_import from django.core.validators import EMPTY_VALUES from django.forms.fields import Select, RegexField from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django.contrib.local...
Dev-Cloud-Platform/Dev-Cloud
refs/heads/master
dev_cloud/cc1/src/clm/views/admin_cm/template.py
2
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
stwunsch/gnuradio
refs/heads/master
gr-filter/python/filter/gui/pyqt_filter_stacked.py
58
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pyqt_filter_stacked.ui' # # Created: Wed Aug 8 11:42:47 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 ex...
NicovincX2/Python-3.5
refs/heads/master
Problèmes divers/Find the missing permutation/find_comparison.py
1
# -*- coding: utf-8 -*- import os from itertools import permutations given = '''ABCD CABD ACDB DACB BCDA ACBD ADCB CDAB DABC BCAD CADB CDBA CBAD ABDC ADBC BDCA DCBA BACD BADC BDAC CBDA DBCA DCAB'''.split() allPerms = [''.join(x) for x in permutations(given[0])] missing = list(set(allPerms) - set(given))...
HaveF/idapython
refs/heads/master
pywraps/py_plgform.py
16
import _idaapi #<pycode(py_plgform)> class PluginForm(object): """ PluginForm class. This form can be used to host additional controls. Please check the PyQt example. """ FORM_MDI = 0x01 """start by default as MDI (obsolete)""" FORM_TAB = 0x02 """attached by def...
abdullah2891/remo
refs/heads/master
vendor-local/lib/python/tablib/packages/yaml/serializer.py
561
__all__ = ['Serializer', 'SerializerError'] from error import YAMLError from events import * from nodes import * class SerializerError(YAMLError): pass class Serializer(object): ANCHOR_TEMPLATE = u'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=No...
HopeFOAM/HopeFOAM
refs/heads/master
ThirdParty-0.1/ParaView-5.0.1/Applications/ParaView/Testing/Python/SaveAnimationMultiView.py
1
#/usr/bin/env python import QtTesting import QtTestingImage import time object1 = 'pqClientMainWindow/menubar/menuSources' QtTesting.playCommand(object1, 'activate', 'Wavelet') object2 = 'pqClientMainWindow/objectInspectorDock/objectInspector/Accept' QtTesting.playCommand(object2, 'activate', '') object6 = 'pqClientM...
abircse06/youtube-dl
refs/heads/master
youtube_dl/extractor/mixcloud.py
11
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) from ..utils import ( ExtractorError, HEADRequest, str_to_int, ) class MixcloudIE(InfoExtractor): _VALID_URL = r'^(?:https?://)?(?:www\.)?mixcloud\.com/([^/]+)/([^/]+...
elkingtonmcb/pattern
refs/heads/master
pattern/server/cherrypy/cherrypy/__init__.py
37
"""CherryPy is a pythonic, object-oriented HTTP framework. CherryPy consists of not one, but four separate API layers. The APPLICATION LAYER is the simplest. CherryPy applications are written as a tree of classes and methods, where each branch in the tree corresponds to a branch in the URL path. Each method is a 'pa...
dgwakeman/mne-python
refs/heads/master
mne/beamformer/__init__.py
24
"""Beamformers for source localization """ from ._lcmv import lcmv, lcmv_epochs, lcmv_raw, tf_lcmv from ._dics import dics, dics_epochs, dics_source_power, tf_dics from ._rap_music import rap_music
fartashf/python-mode
refs/heads/develop
pymode/libs/logilab/common/configuration.py
85
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:[email protected] # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
browseinfo/odoo_saas3_nicolas
refs/heads/master
addons/website_event/__openerp__.py
68
# -*- coding: utf-8 -*- { 'name': 'Online Events', 'category': 'Website', 'summary': 'Schedule, Promote and Sell Events', 'version': '1.0', 'description': """ Online Events """, 'author': 'OpenERP SA', 'depends': ['website', 'website_partner', 'website_mail', 'event'], 'data': [...
brianrodri/oppia
refs/heads/develop
core/domain/rules_registry.py
2
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
skeeso/php-buildpack
refs/heads/master
extensions/composer/extension.py
10
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
BrewPi/firmware
refs/heads/master
platform/spark/firmware/nanopb/nanopb/generator/nanopb_generator.py
4
#!/usr/bin/env python from __future__ import unicode_literals '''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.''' nanopb_version = "nanopb-0.3.9" import sys import re from functools import reduce try: # Add some dummy imports to keep packaging tools happy. import google, distutils.util ...
winzard/django-seo
refs/heads/master
regressiontests/userapp/models.py
11
from django.db import models class Page(models.Model): title = models.CharField(max_length=255, default="", blank=True) type = models.CharField(max_length=50, default="", blank=True) content = models.TextField(default="", blank=True) @models.permalink def get_absolute_url(self): return ('u...
guorendong/iridium-browser-ubuntu
refs/heads/ubuntu/precise
tools/grit/grit/tool/toolbar_postprocess.py
61
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' Toolbar postprocessing class. Modifies the previously processed GRD tree by creating separate message groups for each of the ID...
apache/libcloud
refs/heads/trunk
integration/compute/api/util.py
2
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
ideamark/breadAI
refs/heads/master
breadbot/func/check_data.py
1
#!/usr/bin/env python3 import os import sys import yaml from breadbot.core import common LOG = common.ConsoleLog() class CheckData(object): def __init__(self): pass def _error(self, err, msg): LOG.error('[Error] %s' % msg) raise Exception(err) def do_check(self, data_path_list...
cloudify-cosmo/packman
refs/heads/master
packman/definitions.py
1
# flake8: NOQA # packman base definitions PACKAGER_TEMPLATE_PATH = "package-templates/" # directory which contains config for all modules # packman base params PARAM_NAME = 'name' # a mandatory 'string' representing the package's name PARAM_VERSION = 'version' # a mandatory 'string' representing the package's vers...
cosmicBboy/themis-ml
refs/heads/master
tests/test_counterfactually_fair_models.py
1
"""Unit tests for counterfactually fair models.""" import numpy as np import pytest from themis_ml.linear_model import counterfactually_fair_models from themis_ml.checks import is_binary, is_continuous from conftest import create_random_X, create_y, create_s # random_X_data fixture is in conftest.py def test_get_...
smalls257/VRvisu
refs/heads/master
Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/rexec.py
228
"""Restricted execution facilities. The class RExec exports methods r_exec(), r_eval(), r_execfile(), and r_import(), which correspond roughly to the built-in operations exec, eval(), execfile() and import, but executing the code in an environment that only exposes those built-in operations that are deemed safe. To t...
RPGOne/Skynet
refs/heads/Miho
pytorch-master/torch/legacy/nn/MultiLabelMarginCriterion.py
1
import torch from .Criterion import Criterion class MultiLabelMarginCriterion(Criterion): def __init__(self, sizeAverage=True): super(MultiLabelMarginCriterion, self).__init__() self.sizeAverage = sizeAverage self.isTarget = torch.Tensor() self.output_tensor = None def update...
cbrewster/servo
refs/heads/master
python/servo/lints/wpt_lint.py
28
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
chemelnucfin/tensorflow
refs/heads/master
tensorflow/python/keras/saving/save.py
2
# Copyright 2019 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...
blademainer/intellij-community
refs/heads/master
python/testData/mover/insideStatement_afterUp.py
83
def foo(a, b): if a: pass else: a = 3 if b: pass
lisroach/PyRESTCONF
refs/heads/master
rest_calls/jsonRestClient.py
1
from rest_calls.restClient import RestCalls class JSONRestCalls(RestCalls): Format = 'json' def __repr__(self): return '%s(Session Object%s, Host = %s, Format = %s)' % ( self.__class__.__name__, self._session.headers.items(), self._host, self...
WIPACrepo/iceprod
refs/heads/master
tests/core/data_transfer_test.py
1
""" Test script for core data_transfer """ from tests.util import unittest_reporter, glob_tests import logging logger = logging.getLogger('data_transfer_test') import os import sys import time import shutil import tempfile import random import string import subprocess from functools import partial, reduce try: ...
dirtycold/git-cola
refs/heads/master
test/i18n_test.py
3
from __future__ import absolute_import, division, unicode_literals import unittest from cola import i18n from cola.i18n import N_ from cola.compat import unichr class ColaI18nTestCase(unittest.TestCase): """Test cases for the ColaApplication class""" def tearDown(self): i18n.uninstall() def tes...
Epirex/android_external_chromium_org
refs/heads/cm-11.0
tools/telemetry/telemetry/core/platform/platform_backend.py
23
# Copyright (c) 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. class PlatformBackend(object): def IsRawDisplayFrameRateSupported(self): return False # pylint: disable=W0613 def StartRawDisplayFrameRateMeas...
franramirez688/common
refs/heads/develop
publish/publish_manager.py
2
from biicode.common.exception import (PublishException, UpToDatePublishException, ForbiddenException, AuthenticationException) from biicode.common.edition import changevalidator from biicode.common.diffmerge.compare import compare from biicode.common.model.symbolic.block_version im...
Alexey95/physpy
refs/heads/master
setup.py
1
#!/usr/bin/python2 #-*- coding: utf-8 -*- # # This file is released under the MIT License. # # (C) Copyright 2012 Alessio Colucci # 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 # res...
ChenJunor/hue
refs/heads/master
desktop/core/ext-py/lxml/src/lxml/html/defs.py
36
# FIXME: this should all be confirmed against what a DTD says # (probably in a test; this may not match the DTD exactly, but we # should document just how it differs). # Data taken from http://www.w3.org/TR/html401/index/elements.html try: frozenset except NameError: from sets import Set as frozenset empty_...
jss-emr/openerp-7-src
refs/heads/master
openerp/cli/server.py
3
#!/usr/bin/env python # -*- coding: 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 unde...
daxxi13/CouchPotatoServer
refs/heads/develop
libs/oauthlib/oauth1/rfc5849/__init__.py
112
# -*- coding: utf-8 -*- from __future__ import absolute_import """ oauthlib.oauth1.rfc5849 ~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ import logging import urlparse from oauthlib.common import Request, urlencode from . import par...
nwjs/chromium.src
refs/heads/nw45-log
third_party/blink/tools/blinkpy/third_party/wpt/wpt/tools/third_party/html5lib/html5lib/_inputstream.py
45
from __future__ import absolute_import, division, unicode_literals from six import text_type, binary_type from six.moves import http_client, urllib import codecs import re import webencodings from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import _ReparseException from . im...
AlexanderFabisch/scikit-learn
refs/heads/master
sklearn/utils/graph.py
289
""" Graph utilities and algorithms Graphs are represented with their adjacency matrices, preferably using sparse matrices. """ # Authors: Aric Hagberg <[email protected]> # Gael Varoquaux <[email protected]> # Jake Vanderplas <[email protected]> # License: BSD 3 clause impo...
thaumos/ansible
refs/heads/devel
lib/ansible/plugins/cliconf/enos.py
16
# (C) 2017 Red Hat Inc. # Copyright (C) 2017 Lenovo. # # GNU General Public License v3.0+ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for ...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/encodings/hex_codec.py
528
""" Python 'hex_codec' Codec - 2-digit hex content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg ([email protected]). """ import codecs, binascii ### Codec APIs def hex_encode(...
zengboming/python
refs/heads/master
udp1.py
1
#udp1.py import socket s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) s.bind(('127.0.0.1',9999)) print 'Bind UDP on 9999...' while True: data,addr=s.recvfrom(1024) print 'Received from %s:%s' %addr s.sendto('Hello,%s!'%data,addr)
LumPenPacK/NetworkExtractionFromImages
refs/heads/master
win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/algorithms/centrality/harmonic.py
10
""" Harmonic centrality measure. """ # Copyright (C) 2015 by # Alessandro Luongo # BSD license. from __future__ import division import functools import networkx as nx __author__ = "\n".join(['Alessandro Luongo ([email protected]']) __all__ = ['harmonic_centrality'] def harmonic_centrality(...
javacruft/pylxd
refs/heads/master
pylxd/connection.py
1
# Copyright (c) 2015 Canonical Ltd # # 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 ...
spring01/libPSI
refs/heads/master
tests/testgrendel/grendel_tests/util_tests/test_metaclasses.py
1
import unittest import sys import os # Add the directory containing the 'grendel_tests' package to sys.path #sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir, os.pardir, os.pardir, "lib", "python")) #sys.path.insert(0, "/Users/dhollman/Projects/PyGrendel") from grendel.util.metac...
gisce/OCB
refs/heads/7.0
addons/account/wizard/account_report_general_journal.py
56
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Chromium97/lnmiithackathon
refs/heads/master
website/wsgi.py
3
""" WSGI config for website project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise ...
beezee/GAE-Django-site
refs/heads/master
django/conf/locale/de/formats.py
329
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y H:i:s' YEAR_MONTH...
Donkyhotay/MoonPy
refs/heads/master
zope/testing/testrunner-ex/sample1/sample11/__init__.py
9480
#
broferek/ansible
refs/heads/devel
test/units/modules/network/nso/test_nso_verify.py
40
# # Copyright (c) 2017 Cisco and/or its affiliates. # # 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...
ForestMars/ks
refs/heads/master
sites/all/libraries/fckeditor/editor/filemanager/connectors/py/upload.py
45
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2010 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...
itbabu/django-oscar
refs/heads/master
src/oscar/apps/analytics/reports.py
24
from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class, get_model ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator') ReportCSVFormatter = get_class('dashboard.reports.reports', 'ReportCSVFormatter') ReportHTMLFormatter =...
duducosmos/pgs4a
refs/heads/master
python-install/lib/python2.7/ctypes/test/test_cast.py
82
from ctypes import * import unittest import sys class Test(unittest.TestCase): def test_array2pointer(self): array = (c_int * 3)(42, 17, 2) # casting an array to a pointer works. ptr = cast(array, POINTER(c_int)) self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2]) i...
2014c2g6/c2g6
refs/heads/master
exts/w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/minicompat.py
781
"""Python version compatibility support for minidom.""" # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implementation # # EmptyNodeList -- lightest possible NodeList that is guaranteed to # remain empty...
darktears/chromium-crosswalk
refs/heads/master
third_party/cython/src/Cython/Plex/Transitions.py
99
# # Plex - Transition Maps # # This version represents state sets direcly as dicts # for speed. # from sys import maxint as maxint class TransitionMap(object): """ A TransitionMap maps an input event to a set of states. An input event is one of: a range of character codes, the empty string (representing...
tedsunnyday/SE-Server
refs/heads/master
server/lib/requests/packages/chardet/eucjpprober.py
2918
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
defivelo/db
refs/heads/defivelo-215
apps/user/migrations/0012_userprofile_birthdate.py
1
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('user', '0011_auto_20151009_1532'), ] operations = [ migrations.AddField( model_name='userprofile', name='birthdate', ...
makacodewalker/etsgh
refs/heads/master
djangoappengine/__init__.py
12133432
pasqualguerrero/django
refs/heads/master
tests/forms_tests/tests/__init__.py
12133432
ncrmro/ango
refs/heads/master
server/polls/__init__.py
12133432
Arlefreak/HorchataClub
refs/heads/master
api/migrations/0002_auto_20151018_0550.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ]
tudorian/eden
refs/heads/master
modules/tests/roles/load_data.py
28
from tests.roles.create_role_test_data import create_role_test_data # Define Organisations orgs = ["Org-A", "Org-B", "Org-C", "Org-D", "Org-E", ] branches = [None, "Branch-A", "Branch-B", "Branch-C", "Branch-D", "Branch...