repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
rven/odoo
refs/heads/14.0-fix-partner-merge-mail-activity
addons/payment_transfer/__init__.py
15
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import models from . import controllers from odoo.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers from odoo.addons.payment import reset_payment_provider def uninstall_hook(cr, r...
cxxgtxy/tensorflow
refs/heads/master
tensorflow/contrib/graph_editor/tests/edit_test.py
132
# 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...
nouyang/Metrify-Hardware
refs/heads/master
FTDItest eagle+fw/rx.py
1
#!/usr/bin/env python # # rx.py # # rx.py serial_port port_speed # # Neil Gershenfeld # CBA MIT 7/27/07 # # (c) Massachusetts Institute of Technology 2007 # Permission granted for experimental and personal use; # license for commercial sale available from MIT. # import serial, sys if (len(sys.argv) != 3): print "c...
bartvm/powerline
refs/heads/develop
powerline/renderers/shell/zsh.py
38
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline.renderers.shell import ShellRenderer class ZshPromptRenderer(ShellRenderer): '''Powerline zsh prompt segment renderer.''' escape_hl_start = '%{' escape_hl_end = '%}' character_transl...
hsaputra/tensorflow
refs/heads/master
tensorflow/contrib/metrics/python/ops/metric_ops.py
3
# 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...
ppiotr/Invenio
refs/heads/docextract
modules/miscutil/lib/xapianutils_config.py
29
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 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 option) a...
Caio99BR/FalconSSKernel_20.0
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 ...
Pathoschild/stewbot
refs/heads/master
stewbot/components/modules/mechanize/_form.py
1
"""HTML form handling for web clients. HTML form handling for web clients: useful for parsing HTML forms, filling them in and returning the completed forms to the server. This code developed from a port of Gisle Aas' Perl module HTML::Form, from the libwww-perl library, but the interface is not the same. The most us...
qizenguf/MLC-STT
refs/heads/master
src/mem/slicc/ast/StallAndWaitStatementAST.py
26
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # Copyright (c) 2010 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
garyfeng/pybrain
refs/heads/master
pybrain/rl/environments/mazes/tasks/__init__.py
4
from pybrain.rl.environments.mazes.tasks.tiger import TigerTask from pybrain.rl.environments.mazes.tasks.maze import TrivialMaze, MazeTask from pybrain.rl.environments.mazes.tasks.cheesemaze import CheeseMaze from pybrain.rl.environments.mazes.tasks.tmaze import TMaze from pybrain.rl.environments.mazes.tasks.maze4x3 im...
evinstk/TantechEngineOriginal
refs/heads/master
lib/googletest-release-1.7.0/test/gtest_list_tests_unittest.py
1898
#!/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...
hguemar/cinder
refs/heads/master
cinder/scheduler/weights/goodness.py
5
# Copyright (C) 2014 Hewlett-Packard Development Company, L.P. # # 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...
undoware/neutron-drive
refs/heads/master
google_appengine/lib/django_1_2/tests/regressiontests/file_uploads/models.py
110
import tempfile import os from django.db import models from django.core.files.storage import FileSystemStorage temp_storage = FileSystemStorage(tempfile.mkdtemp()) UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload') class FileModel(models.Model): testfile = models.FileField(storage=temp_storage, upload...
TheJJ100100/bedrock
refs/heads/master
bedrock/mozorg/helpers/social_widgets.py
23
# 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/. from __future__ import unicode_literals from datetime import datetime import urllib import jingo from lib.l10n_utils.do...
kwikadi/orange3
refs/heads/master
Orange/widgets/data/owfeatureconstructor.py
2
""" Feature Constructor A widget for defining (constructing) new features from values of other variables. """ import sys import re import copy import functools import builtins import math import random from collections import namedtuple, OrderedDict from itertools import chain, count from PyQt4 import QtGui from PyQ...
jadami10/crossbarexamples
refs/heads/master
rest/needs_cleanup/python/example/flask/__init__.py
12
############################################################################### ## ## Copyright (C) 2012-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 ## ## h...
capstone-rust/capstone-rs
refs/heads/master
capstone-sys/capstone/bindings/python/test_arm.py
9
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * from capstone.arm import * from xprint import to_hex, to_x_32 ARM_CODE = b"\x86\x48\x60\xf4\xED\xFF\xFF\xEB\x04\xe0\x2d\xe5\x00\x00\x00\x00\xe0\x83\x22\xe5\xf1\x02\x...
JamesLinEngineer/RKMC
refs/heads/Jarvis
addons/script.module.requests/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. #...
Just-D/panda3d
refs/heads/master
direct/src/directnotify/DirectNotifyGlobal.py
10
"""instantiate global DirectNotify used in Direct""" __all__ = ['directNotify', 'giveNotify'] import DirectNotify directNotify = DirectNotify.DirectNotify() giveNotify = directNotify.giveNotify
40223204/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_sre.py
622
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 #import ar...
richardcypher/node-gyp
refs/heads/master
gyp/pylib/gyp/win_tool.py
231
#!/usr/bin/env python # Copyright (c) 2012 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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ from ctypes imp...
yelizariev/pos-addons
refs/heads/9.0
tg_pos_packs/__openerp__.py
1
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 - Thierry Godin. All Rights Reserved # @author Thierry Godin <thierry@lapinmoutardepommedauphine.com> # # This program is free software: yo...
Techcable/TechBot
refs/heads/master
plugins/minecraft_wiki.py
32
import re import requests from lxml import html from cloudbot import hook from cloudbot.util import formatting api_url = "http://minecraft.gamepedia.com/api.php?action=opensearch" mc_url = "http://minecraft.gamepedia.com/" @hook.command() def mcwiki(text): """mcwiki <phrase> - gets the first paragraph of the M...
ccn-2m/django
refs/heads/master
tests/regressiontests/generic_inline_admin/urls.py
150
from __future__ import absolute_import from django.conf.urls import patterns, include from . import admin urlpatterns = patterns('', (r'^generic_inline_admin/admin/', include(admin.site.urls)), )
astrobin/astrobin
refs/heads/master
astrobin_apps_groups/tasks.py
1
import logging from celery import shared_task from django.conf import settings from django.contrib.auth.models import User from django.urls import reverse from astrobin_apps_groups.models import Group from astrobin_apps_notifications.utils import push_notification, build_notification_url logger = logging.getLogger('...
spirrello/spirrello-pynet-work
refs/heads/master
applied_python/lib/python2.7/site-packages/pip/commands/list.py
84
from __future__ import absolute_import import logging import warnings from pip.basecommand import Command from pip.exceptions import DistributionNotFound from pip.index import PackageFinder from pip.req import InstallRequirement from pip.utils import get_installed_distributions, dist_is_editable from pip.utils.deprec...
lsiemens/iprocess-projects
refs/heads/master
psipy/animate_analytic.py
1
#### # # Copyright (c) 2015, Jake Vanderplas, Luke Siemens # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list...
HousekeepLtd/django
refs/heads/master
tests/queryset_pickle/tests.py
209
from __future__ import unicode_literals import datetime import pickle import unittest import warnings from django.test import TestCase from django.utils import six from django.utils.encoding import force_text from django.utils.version import get_version from .models import Container, Event, Group, Happening, M2MMode...
rooshilp/CMPUT410Lab5
refs/heads/master
env-lab5/lib/python2.7/site-packages/jinja2/testsuite/doctests.py
532
# -*- coding: utf-8 -*- """ jinja2.testsuite.doctests ~~~~~~~~~~~~~~~~~~~~~~~~~ The doctests. Collects all tests we want to test from the Jinja modules. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest import doctest def suite(): f...
gchp/django
refs/heads/master
tests/template_tests/filter_tests/test_stringformat.py
345
from django.template.defaultfilters import stringformat from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class StringformatTests(SimpleTestCase): """ Notice that escaping is applied *after* any filters, so the string formatting here only needs...
fosfataza/protwis
refs/heads/master
build_gpcr/management/commands/build_human_residues.py
3
from build.management.commands.build_human_residues import Command as BuildHumanResidues class Command(BuildHumanResidues): pass
feilongfl/micropython
refs/heads/master
tests/basics/class_contains.py
117
# A contains everything class A: def __contains__(self, key): return True a = A() print(True in a) print(1 in a) print(() in a) # B contains given things class B: def __init__(self, items): self.items = items def __contains__(self, key): return key in self.items b = B([]) print(1 ...
jbq/uwsgi
refs/heads/master
plugins/mongodb/uwsgiplugin.py
13
NAME='mongodb' CFLAGS = [] LDFLAGS = [] LIBS = ['-Wl,-whole-archive', '-lmongoclient', '-Wl,-no-whole-archive', '-lboost_thread', '-lboost_system', '-lboost_filesystem'] GCC_LIST = ['plugin']
petteyg/intellij-community
refs/heads/master
python/testData/mover/oneStatementInClass.py
83
class B(Exception): pas<caret>s #<---here class C(B): pass
bgammill/namebench
refs/heads/master
cocoa/controller.py
176
# Copyright 2009 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 applicable law or ...
saturnism/kubernetes
refs/heads/master
build/json-extractor.py
413
#!/usr/bin/env python # Copyright 2014 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
dovydas/mezzanine
refs/heads/master
mezzanine/galleries/translation.py
48
from modeltranslation.translator import translator, TranslationOptions from mezzanine.core.translation import TranslatedRichText from mezzanine.galleries.models import GalleryImage, Gallery class TranslatedGallery(TranslatedRichText): fields = () class TranslatedGalleryImage(TranslationOptions): fields = ('...
xfournet/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/languages/zh_tw.py
128
# -*- coding: utf-8 -*- # $Id: zh_tw.py 7119 2011-09-02 13:00:23Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two f...
GenericStudent/home-assistant
refs/heads/dev
tests/components/switch/test_reproduce_state.py
21
"""Test reproduce state for Switch.""" from homeassistant.core import State from tests.common import async_mock_service async def test_reproducing_states(hass, caplog): """Test reproducing Switch states.""" hass.states.async_set("switch.entity_off", "off", {}) hass.states.async_set("switch.entity_on", "o...
odoo-brazil/l10n-brazil-wip
refs/heads/10.0-develop
l10n_br_sale/__manifest__.py
3
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Sale', 'category': 'Localisation', 'license': 'AGPL-3', 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'http://...
IndraVikas/scikit-learn
refs/heads/master
examples/linear_model/plot_sgd_weighted_samples.py
344
""" ===================== SGD: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print(__doc__) import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model # we create 20 points np.random.seed(0) X ...
angad/libjingle-mac
refs/heads/master
scons-2.2.0/engine/SCons/Tool/JavaCommon.py
14
"""SCons.Tool.JavaCommon Stuff for processing Java. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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...
deandunbar/html2bwml
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/formtools/wizard/storage/session.py
426
from django.contrib.formtools.wizard import storage class SessionStorage(storage.BaseStorage): def __init__(self, *args, **kwargs): super(SessionStorage, self).__init__(*args, **kwargs) if self.prefix not in self.request.session: self.init_data() def _get_data(self): self...
lmregus/Portfolio
refs/heads/master
python/design_patterns/env/lib/python3.7/site-packages/setuptools/wheel.py
24
"""Wheels support.""" from distutils.util import get_platform import email import itertools import os import posixpath import re import zipfile import pkg_resources import setuptools from pkg_resources import parse_version from setuptools.extern.packaging.utils import canonicalize_name from setuptools.extern.six impo...
kjw0106/GCM_app_server
refs/heads/master
venv/lib/python2.7/site-packages/pip/wheel.py
145
""" Support for installing and building the "wheel" binary package format. """ from __future__ import with_statement import compileall import csv import functools import hashlib import os import re import shutil import sys from base64 import urlsafe_b64encode from email.parser import Parser from pip.backwardcompat i...
clemensv/qpid-proton
refs/heads/master
examples/python/abstract_server.py
9
#!/usr/bin/env python # # 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 # "...
UXE/local-edx
refs/heads/master
lms/djangoapps/instructor/views/instructor_task_helpers.py
133
""" A collection of helper utility functions for working with instructor tasks. """ import json import logging from util.date_utils import get_default_time_display from bulk_email.models import CourseEmail from django.utils.translation import ugettext as _ from django.utils.translation import ungettext from instructor_...
aljim/deploymentmanager-samples
refs/heads/master
community/cloud-foundation/templates/stackdriver_metric_descriptor/stackdriver_metric_descriptor.py
1
# Copyright 2018 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 applicable law or a...
Junky-Josqu/BleyBley_py
refs/heads/master
game/lib/module.py
1
# -*- coding: iso-8859-1 -*- #For different Modules from os.path import expanduser home = expanduser("~") x = '%s/.mbwarband/last_module_warband' % (home) file = open(x,'r+') def native(): module = 'Native' return module def viking_conquest(): module = 'Viking Conquest' return module def napoleonic...
lukasklein/paymill-python
refs/heads/master
samples/clients/list_clients.py
2
client_service = paymill_context.get_client_service() clients_list = client_service.list()
attente/snapcraft
refs/heads/master
snaps_tests/demos_tests/test_ros.py
2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015, 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed i...
EmadMokhtar/Django
refs/heads/master
django/contrib/sites/__init__.py
808
default_app_config = 'django.contrib.sites.apps.SitesConfig'
selimcr/pilargamboa
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
AlvinPH/StockTool
refs/heads/master
setup.py
1
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='StockTool', version='0.1.0', description='Stock Tool by Alvin Lai', long_description=readme, author='Alvin Lai',...
Theer108/invenio
refs/heads/master
invenio/modules/records/testsuite/functions/sync_meeting_names.py
33
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 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 option) any later...
hlin117/statsmodels
refs/heads/master
statsmodels/graphics/regressionplots.py
20
'''Partial Regression plot and residual plots to find misspecification Author: Josef Perktold License: BSD-3 Created: 2011-01-23 update 2011-06-05 : start to convert example to usable functions 2011-10-27 : docstrings ''' from statsmodels.compat.python import lrange, string_types, lzip, range import numpy as np imp...
dagnir/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/corsenabled.py
187
import time def main(request, response): headers = [("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Credentials", "true"), ("Access-Control-Allow-Methods", "GET, POST, PUT, FOO"), ("Access-Control-Allow-Headers", "x-test, x-foo"), ("Access-Co...
csulb-cecs424-2016sp/Lectures
refs/heads/master
Python/Functions/dictionaries.py
20
# A "dictionary" is a map from keys to values d = {"key1" : 5, "key2" : "Hello", 7 : 100} print(d["key1"]) print(d["key2"]) print(d[7]) emp = {"name": "Neal", "salary": "10000", "age": 93} print(emp) # Iterate through the keys of the dictionary for i in emp: print(emp[i])
jmacmahon/invenio
refs/heads/elasticsearch_logging
modules/miscutil/lib/solrutils_config.py
16
# This file is part of Invenio. # Copyright (C) 2010, 2011 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 option) any later version. # # Inveni...
perryjrandall/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/examples/designer/plugins/python/polygonwidgetplugin.py
20
#!/usr/bin/env python """ polygonwidgetplugin.py A polygon widget custom widget plugin for Qt Designer. Copyright (C) 2006 David Boddie <david@boddie.org.uk> Copyright (C) 2005-2006 Trolltech ASA. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU...
VanirAOSP/external_chromium_org
refs/heads/kk44
tools/telemetry/telemetry/core/backends/chrome/inspector_page_unittest.py
24
# 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. from telemetry.core import util from telemetry.unittest import tab_test_case class InspectorPageTest(tab_test_case.TabTestCase): def __init__(self, *args...
schelleg/PYNQ
refs/heads/master
pynq/pl_server/server.py
2
# Copyright (c) 2016-2021, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list o...
adeepkit01/ns3-dhcp-new
refs/heads/master
bindings/python/ns3modulescan-modular.py
186
#! /usr/bin/env python import sys import os.path import pybindgen.settings from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.decla...
nickhdamico/py
refs/heads/master
lib/unidecode/x0a1.py
253
data = ( 'dit', # 0x00 'dix', # 0x01 'di', # 0x02 'dip', # 0x03 'diex', # 0x04 'die', # 0x05 'diep', # 0x06 'dat', # 0x07 'dax', # 0x08 'da', # 0x09 'dap', # 0x0a 'duox', # 0x0b 'duo', # 0x0c 'dot', # 0x0d 'dox', # 0x0e 'do', # 0x0f 'dop', # 0x10 'dex', # 0x11 'de',...
nervenXC/topical_word_embeddings
refs/heads/master
TWE-1/gensim/test/test_similarities.py
16
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for similarity algorithms (the similarities package). """ import logging import unittest import os import tempfile...
trafi/djinni
refs/heads/master
test-suite/generated-src/python/record_with_derivings_helper.py
1
# AUTOGENERATED FILE - DO NOT MODIFY! # This file generated by Djinni from derivings.djinni from djinni.support import MultiSet # default imported in all files from djinni.exception import CPyException # default imported in all files from djinni.pycffi_marshal import CPyPrimitive, CPyRecord, CPyString from PyCFFIlib_c...
yyjiang/scikit-learn
refs/heads/master
examples/svm/plot_iris.py
225
""" ================================================== Plot different SVM classifiers in the iris dataset ================================================== Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only consider the first 2 features of this dataset: - Sepal length - Se...
memo/tensorflow
refs/heads/master
tensorflow/python/ops/standard_ops.py
21
# 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...
suncycheng/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/DuplicateMultiLine.before.py
75
def bar(): <selection>a = 1 print a</selection> a = 1 print a
pombredanne/marisa-trie
refs/heads/master
tests/test_binary_trie.py
3
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import pickle from collections import Mapping import pytest import hypothesis.strategies as st from hypothesis import given, assume import marisa_trie text = st.binary() @given(st.sets(text), text) def test_init(keys, missing_key):...
Youwotma/portia
refs/heads/master
docs/conf.py
8
# -*- coding: utf-8 -*- # # Portia documentation build configuration file, created by # sphinx-quickstart on Tue Aug 25 13:51:18 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
jvassev/dd-agent
refs/heads/master
checks.d/ntp.py
34
# 3p import ntplib # project from checks import AgentCheck from utils.ntp import get_ntp_args, set_user_ntp_settings DEFAULT_OFFSET_THRESHOLD = 60 # in seconds class NtpCheck(AgentCheck): DEFAULT_MIN_COLLECTION_INTERVAL = 900 # in seconds def check(self, instance): service_check_msg = None ...
Moulde/django-extensions
refs/heads/master
django_extensions/management/commands/sqlcreate.py
27
import socket import sys from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django_extensions.management.utils import signalcommand class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('-R'...
nv8h/PyRattus
refs/heads/master
base/modules/rat/registry.py
1
registry_data = {} def setValue(key, value): registry_data[key] = value return def getValue(key): if (key in registry_data): return registry_data[key] # end if return None def testKey(key): return (key in registry_data)
danstoner/python_experiments
refs/heads/master
playing_with_kivy/kivi-examples/canvas/lines_extended.py
17
from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.widget import Widget from kivy.lang import Builder Builder.load_string(''' <LineEllipse1>: canvas: Color: rgba: 1, .1, .1, .9 Line: width: 2. ellipse: (self.x, self.y, self.width, s...
40223211/logo-toys
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/warnings.py
752
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
bllli/ingress-keys-management
refs/heads/django
backend/admin.py
1
from django.contrib import admin from backend.models import Portal, Comment, Tag, TagType class TagInline(admin.StackedInline): model = Tag class PortalInline(admin.StackedInline): model = Portal @admin.register(Portal) class PortalModelAdmin(admin.ModelAdmin): list_display = ['pk', 'title', 'nicknam...
FedericoCeratto/debian-pymongo
refs/heads/master
pymongo/response.py
17
# Copyright 2014-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
huihoo/reader
refs/heads/master
vendor/paypal/standard/ipn/admin.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.contrib import admin from vendor.paypal.standard.ipn.models import PayPalIPN class PayPalIPNAdmin(admin.ModelAdmin): date_hierarchy = 'payment_date' fieldsets = ( (None, { "fields": [ "flag", "txn_id", "txn_type", "p...
metabrainz/picard
refs/heads/master
picard/ui/ui_options_general.py
2
# -*- coding: utf-8 -*- # Automatically generated - don't edit. # Use `python setup.py build_ui` to update it. from PyQt5 import QtCore, QtGui, QtWidgets class Ui_GeneralOptionsPage(object): def setupUi(self, GeneralOptionsPage): GeneralOptionsPage.setObjectName("GeneralOptionsPage") GeneralOpt...
mbayon/TFG-MachineLearning
refs/heads/master
venv/lib/python3.6/site-packages/numpy/testing/nosetester.py
36
""" Nose test running. This module implements ``test()`` and ``bench()`` functions for NumPy modules. """ from __future__ import division, absolute_import, print_function import os import sys import warnings from numpy.compat import basestring import numpy as np from .utils import import_nose, suppress_warnings d...
nubark/odoo
refs/heads/9.0
addons/base_gengo/ir_translation.py
46
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import api from openerp.osv import fields, osv from openerp.exceptions import UserError LANG_CODE_MAPPING = { 'ar_SY': ('ar', 'Arabic'), 'id_ID': ('id', 'Indonesian'), 'nl_NL': ('nl', 'Dutch'), ...
faywong/FFPlayer
refs/heads/trunk
project/jni/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/QuickDraw_Graphics_Suppleme.py
82
"""Suite QuickDraw Graphics Supplemental Suite: Defines transformations of graphic objects Level 1, version 1 Generated from /Volumes/Sap/System Folder/Extensions/AppleScript AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'qdsp' class QuickDraw_Graphics_Suppleme_Events:...
noahchense/micropython
refs/heads/master
tests/basics/dict_get.py
118
for d in {}, {42:2}: print(d.get(42)) print(d.get(42,2))
chrsrds/scikit-learn
refs/heads/master
examples/tree/plot_tree_regression.py
82
""" =================================================================== Decision Tree Regression =================================================================== A 1D regression with decision tree. The :ref:`decision trees <tree>` is used to fit a sine curve with addition noisy observation. As a result, it learns ...
xychix/nessrest
refs/heads/master
nessrest/credentials.py
3
class WindowsPassword(object): ''' Username and password for a Windows target. ''' category = "Host" name = "Windows" def __init__(self, username, password, domain="", auth_method="Password"): self.username = username self.password = password self.domain = domain ...
cydcowley/Imperial-Visualizations
refs/heads/master
visuals_maths/Linear Algebra/Python/pointslinesplanes/utils.py
1
"""utils.py""" import numpy as np def mesh2d(xlim, ylim, n=5): """Create 2d mesh in sepecifies x and y axes limits, with number of points for every dimension separate.""" if isinstance(n, int): xx = np.linspace(xlim[0],xlim[1],n) yy = np.linspace(ylim[0],ylim[1],n) elif isinstance(n, list): ...
kleinfeld/medpy
refs/heads/master
setup.py
1
#!/usr/bin/env python # version: 0.1.2 import os # setuptools >= 0.7 supports 'python setup.py develop' from ez_setup import use_setuptools use_setuptools() from setuptools import setup, Extension def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # The maxflow graphcut wrapper ...
Klaudit/livestreamer
refs/heads/develop
src/livestreamer/plugins/letontv.py
34
import re from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, validate from livestreamer.stream import RTMPStream PLAYER_URL = "http://leton.tv/player.php" SWF_URL = "http://files.leton.tv/jwplayer.flash.swf" _url_re = re.compile(""" http?://(\w+.)?leton.tv (?: /player\.p...
pechersky/keras-molecules
refs/heads/master
preprocess.py
4
import argparse import pandas import h5py import numpy as np from molecules.utils import one_hot_array, one_hot_index from sklearn.model_selection import train_test_split MAX_NUM_ROWS = 500000 SMILES_COL_NAME = 'structure' def get_arguments(): parser = argparse.ArgumentParser(description='Prepare data for traini...
epiphany27/NewsBlur
refs/heads/master
vendor/readability/htmls.py
12
from lxml.html import tostring import logging import lxml.html import re, sys from .cleaners import normalize_spaces, clean_attributes from .encoding import get_encoding utf8_parser = lxml.html.HTMLParser(encoding='utf-8') def build_doc(page): if isinstance(page, unicode): enc = None page_unicode...
jwalgran/otm-core
refs/heads/develop
opentreemap/otm_comments/migrations/0003_auto_20160923_1413.py
4
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('otm_comments', '0002_auto_20150630_1556'), ] operations = [ migrations.AlterModelOptions( name='enhancedthreaded...
machinebrains/neat-python
refs/heads/master
examples/xor/xor2_array.py
1
""" A parallel version of XOR using neatsociety.parallel with numpy arrays. Since XOR is a simple experiment, a parallel version probably won't run any faster than the single-process version, due to the overhead of inter-process communication. If your evaluation function is what's taking up most of your processing ti...
jbenden/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/composer.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com> # 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_versi...
koobonil/Boss2D
refs/heads/master
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/distributions/python/ops/bijectors/sigmoid_centered_impl.py
104
# 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...
thanhacun/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
292
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
grimmjow8/ansible
refs/heads/devel
lib/ansible/modules/database/mysql/mysql_variables.py
25
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage mysql variables (c) 2013, Balazs Pocze <banyek@gawker.com> Certain parts are taken from Mark Theunissen's mysqldb module This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the GNU G...
astrobin/astrobin
refs/heads/master
astrobin_apps_iotd/api/serializers/hidden_image_serializer.py
1
from rest_framework import serializers from astrobin_apps_iotd.models import IotdHiddenImage class HiddenImageSerializer(serializers.ModelSerializer): user = serializers.PrimaryKeyRelatedField(read_only=True, default=serializers.CurrentUserDefault()) class Meta: model = IotdHiddenImage field...
hynnet/hiwifi-openwrt-HC5661-HC5761
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/curses/panel.py
155
"""curses.panel Module for using panels with curses. """ __revision__ = "$Id$" from _curses_panel import *
DirtyUnicorns/android_external_chromium-org
refs/heads/kitkat
chrome/common/extensions/docs/server2/handler.py
68
# 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. from cron_servlet import CronServlet from instance_servlet import InstanceServlet from patch_servlet import PatchServlet from servlet import Servlet, Req...