repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
yash-nisar/coala-bears | refs/heads/master | bears/python/PyCommentedCodeBear.py | 24 | import eradicate
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.Diff import Diff
from coalib.results.Result import Result
class PyCommentedCodeBear(LocalBear):
LANGUAGES = {'Python', 'Python 2', 'Python 3'}
REQUIRE... |
XTAv2/Enigma2 | refs/heads/master | lib/python/Components/Ipkg.py | 4 | import os
from enigma import eConsoleAppContainer
from Components.Harddisk import harddiskmanager
opkgDestinations = []
opkgStatusPath = ''
def opkgExtraDestinations():
global opkgDestinations
return ''.join([" --add-dest %s:%s" % (i,i) for i in opkgDestinations])
def opkgAddDestination(mountpoint):
global opkgDe... |
wfxiang08/django190 | refs/heads/master | tests/template_tests/syntax_tests/test_cache.py | 299 | from django.core.cache import cache
from django.template import Context, Engine, TemplateSyntaxError
from django.test import SimpleTestCase, override_settings
from ..utils import setup
class CacheTagTests(SimpleTestCase):
libraries = {
'cache': 'django.templatetags.cache',
'custom': 'template_tes... |
shastikk/youtube-dl | refs/heads/master | youtube_dl/extractor/myvidster.py | 146 | from __future__ import unicode_literals
from .common import InfoExtractor
class MyVidsterIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?myvidster\.com/video/(?P<id>\d+)/'
_TEST = {
'url': 'http://www.myvidster.com/video/32059805/Hot_chemistry_with_raw_love_making',
'md5': '95296d0231c136... |
pwoodworth/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_imports.py | 326 | """Fix incompatible imports and module references."""
# Authors: Collin Winter, Nick Edds
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {'StringIO': 'io',
'cStringIO': 'io',
'cPickle': 'pickle',
'__builtin__' : 'builtins',
'c... |
darrencheng0817/AlgorithmLearning | refs/heads/master | Python/leetcode/StrobogrammaticNumberIii.py | 1 | '''
Created on 1.12.2016
@author: Darren
'''
'''
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
Write a function to count the total strobogrammatic numbers that exist in the range of low <= num <= high.
For example,
Given low = "50", high = "100", return 3.... |
mytliulei/Scapy | refs/heads/master | scapy/tools/UTscapy.py | 6 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Unit testing infrastructure for Scapy
"""
import sys,getopt,imp
import bz2, base64, os.path, time, traceback, zlib, ... |
golden1232004/webrtc_new | refs/heads/master | chromium/src/build/android/gyp/apk_obfuscate.py | 18 | #!/usr/bin/env python
#
# 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.
"""Generates the obfuscated jar and test jar for an apk.
If proguard is not enabled or 'Release' is not in the configuration name,
o... |
MphasisWyde/eWamSublimeAdaptor | refs/heads/master | POC/v0_3_POC_with_project_aborted/third-party/simplejson/scanner.py | 153 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner', 'JSONDecodeError']
NUMBER_RE = re.compile(
r... |
lmorchard/django | refs/heads/master | tests/known_related_objects/tests.py | 363 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Organiser, Pool, PoolStyle, Tournament
class ExistingRelatedInstancesTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.t1 = Tournament.objects.create(name='Tourney 1')
cls.t2 = Tournament.ob... |
zhaishaomin/LDS-prefetcher-research | refs/heads/master | gem5_src/sim/DVFSHandler.py | 55 | # Copyright (c) 2013-2014 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
meteoswiss-mdr/monti-pytroll | refs/heads/master | scripts/test_forecast.py | 1 | from __future__ import division
from __future__ import print_function
from datetime import datetime, timedelta
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from mpop.imageo.TRTimage import fig2img
from mpop.imageo.HRWimage impo... |
Daniex/horizon | refs/heads/stable/kilo | openstack_dashboard/usage/base.py | 64 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
sirMackk/ZeroNet | refs/heads/master | src/Test/TestTranslate.py | 5 | import os
from Translate import Translate
class TestTranslate:
def testTranslateStrict(self):
translate = Translate()
data = """
translated = _("original")
not_translated = "original"
"""
data_translated = translate.translateData(data, {"_(original)": "trans... |
Azure/azure-linux-extensions | refs/heads/master | OSPatching/azure/http/batchclient.py | 47 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... |
saintbird/mezzanine | refs/heads/master | mezzanine/utils/tests.py | 26 | from __future__ import unicode_literals
from future.builtins import open, range, str
from _ast import PyCF_ONLY_AST
import os
from shutil import copyfile, copytree
from django.contrib.auth import get_user_model
from django.db import connection
from django.template import Context, Template
from django.test import Test... |
mlorbetske/PTVS | refs/heads/master | Python/Product/BuildTasks/ptvs_virtualenv_proxy.py | 19 | # ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution... |
gqwest-erp/server | refs/heads/master | openerp/addons/account_asset/wizard/__init__.py | 445 | # -*- 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... |
microcom/odoo | refs/heads/9.0 | openerp/addons/base/ir/ir_ui_menu.py | 30 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import operator
import re
import threading
import openerp
from openerp.osv import fields, osv
from openerp import api, tools
from openerp.http import request
from openerp.tools.safe_eval import safe_eval a... |
PiscesDream/Ideas | refs/heads/master | ML/co-evaluate/ann_bck.py | 1 | '''
special:
plot, plot_interval
'''
import theano
import theano.tensor as T
import gzip
import cPickle
import numpy
import time
class HiddenLayer(object):
def __init__(self, rng, input, n_in, n_out, W=None, b=None,
activation=T.tanh):
self.input = input
if W is None:... |
mohamed/trap-gen | refs/heads/master | trap/tests/coding.py | 2 | # -*- coding: iso-8859-1 -*-
####################################################################################
# ___ ___ ___ ___
# / /\ / /\ / /\ / /\
# / /:/ / /::\ / /::\ / /::\
# / /:/ / /:/\:\ / /:/\:\ ... |
rahushen/ansible | refs/heads/devel | lib/ansible/module_utils/facts/hardware/base.py | 172 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
09zwcbupt/ryu | refs/heads/master | ryu/lib/packet/tcp.py | 1 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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... |
kalrey/swift | refs/heads/master | test/unit/common/middleware/test_slo.py | 4 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 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 appl... |
ahojjati/grr | refs/heads/master | client/client_actions/__init__.py | 9 | #!/usr/bin/env python
"""A module to load all client plugins."""
# pylint: disable=unused-import,g-bad-import-order
import platform
import logging
# These imports populate the Action registry
from grr.lib import rdfvalue
from grr.lib import rdfvalues
from grr.client import actions
from grr.client.client_actions imp... |
yunstanford/sanic-transmute | refs/heads/master | tests/conftest.py | 1 | import pytest
from sanic import Sanic, Blueprint
from sanic_transmute import (
describe, add_swagger, add_route, route,
APIException,
Response
)
from sanic.response import HTTPResponse
from sanic.exceptions import ServerError
from .utils import User
@pytest.fixture
def app():
app = Sanic('sanic_test_a... |
robdennis/sideboard | refs/heads/master | tests/plugins/simple/one/env/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/extension.py | 72 | import sys
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext... |
spskeen/skeeno | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... |
wuga214/Django-Wuga | refs/heads/master | reading/apps.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ReadingConfig(AppConfig):
name = 'reading'
|
lexotero/try-it | refs/heads/master | apps/congress/migrations/0003_auto_20161103_0140.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-03 01:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('congress', '0002_auto_20161103_0139'),
]
operations = [
migrations.AlterFie... |
vincentbernat/wiremaps | refs/heads/master | wiremaps/collector/database.py | 1 | from wiremaps.collector.datastore import ILocalVlan, IRemoteVlan
class DatabaseWriter:
"""Write an equipment datastore to the database."""
def __init__(self, equipment, config):
"""Create an instance of database writer.
@param equipment: equipment to dump to the database
"""
s... |
gsnbng/erpnext | refs/heads/develop | erpnext/healthcare/doctype/patient_assessment_detail/patient_assessment_detail.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PatientAssessmentDetail(Document):
pass
|
40223125/w16btest1 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/_struct.py | 726 | #
# This module is a pure Python version of pypy.module.struct.
# It is only imported if the vastly faster pypy.module.struct is not
# compiled in. For now we keep this version for reference and
# because pypy.module.struct is not ootype-backend-friendly yet.
#
# this module 'borrowed' from
# https://bitbucket.org/p... |
bruderstein/PythonScript | refs/heads/master | PythonLib/full/email/header.py | 26 | # Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... |
highweb-project/highweb-webcl-html5spec | refs/heads/highweb-20160310 | tools/android/loading/deprecated/log_requests.py | 3 | #! /usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Loads a URL on an Android device, logging all the requests made to do it
to a JSON file using DevTools.
"""
import contextlib
import h... |
sdecoder/CMDS-HDFS | refs/heads/master | common/src/contrib/hod/hodlib/ServiceRegistry/serviceRegistry.py | 182 | #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 thi... |
dennisding/build | refs/heads/master | test/src/freetype-2.7.1/src/tools/docmaker/docmaker.py | 45 | #!/usr/bin/env python
#
# docmaker.py
#
# Convert source code markup to HTML documentation.
#
# Copyright 2002-2016 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing ... |
deepakrana47/DT-RAE | refs/heads/master | RAE_adam_trainning8_v2.py | 1 | import os
import pickle
import random
import sys
from random import shuffle
import numpy as np
from Global import get_word_vect
from RAE_adam_herical import rae_trainning_normal
from utility1 import get_words_id, get_parents, get_dep, pdep_2_deporder_dep, dep_2_hid_var, save2pickle, get_weight_matrices, init_weight, ... |
hkariti/ansible | refs/heads/devel | lib/ansible/playbook/task_include.py | 27 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
okorach/audio-video-tools | refs/heads/master | mediatools/shake.py | 1 | #!python3
#
# media-tools
# Copyright (C) 2019-2021 Olivier Korach
# mailto:olivier.korach AT gmail DOT com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the Lic... |
scorphus/mock | refs/heads/master | mock/tests/support.py | 11 | import sys
info = sys.version_info
import unittest2
try:
callable = callable
except NameError:
def callable(obj):
return hasattr(obj, '__call__')
inPy3k = sys.version_info[0] == 3
with_available = sys.version_info[:2] >= (2, 5)
def is_instance(obj, klass):
"""Version of is_instance that doesn... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-cognitiveservices-search-newssearch/azure/cognitiveservices/search/newssearch/models/image_object.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
ol-loginov/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/ContainsArguments.py | 79 | class C(object):
def __contains__(self, item):
"""
:type item: int
"""
return False
def test():
c = C()
i = 10
s = 'string'
c in i
i in c
<warning descr="Expected type 'int', got 'str' instead">s</warning> in c
|
PourroyJean/performance_modelisation | refs/heads/master | script/data visualisation/venv/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/_compat.py | 1177 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3... |
etashjian/ECE757-final | refs/heads/master | ext/ply/test/yacc_nodoc.py | 174 | # -----------------------------------------------------------------------------
# yacc_nodoc.py
#
# Rule with a missing doc-string
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tok... |
pombredanne/pants | refs/heads/master | pants-plugins/src/python/internal_backend/utilities/register.py | 12 | # coding=utf-8
# Copyright 2015 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)
import os
from twit... |
acshan/odoo | refs/heads/8.0 | addons/point_of_sale/wizard/pos_confirm.py | 343 | # -*- 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... |
mike2151/virus-prediction | refs/heads/master | Main Package/H3N2sample/main.py | 1 | import sys, time, os, argparse,shutil,subprocess, glob
sys.path.append('src')
sys.setrecursionlimit(10000)
from Bio import SeqIO, AlignIO,Phylo
import numpy as np
from itertools import izip
import jsonpickle
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
import dendropy
from frequency_calculator import v... |
cgranade/qutip | refs/heads/master | qutip/tests/test_metrics.py | 4 | # -*- coding: utf-8 -*-
"""
Simple tests for metrics and pseudometrics implemented in
the qutip.metrics module.
"""
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and... |
meetvaruni/GitFiles | refs/heads/master | pywsd-master/pywsd-master/consistency_test.py | 1 | #!/usr/bin/env python -*- coding: utf-8 -*-
#
# Python Word Sense Disambiguation (pyWSD): Consistency test on all-words WSD
#
# Copyright (C) 2014-2015 alvations
# URL:
# For license information, see LICENSE.md
from string import punctuation
from nltk import word_tokenize, pos_tag
from nltk.corpus import wordnet as w... |
WaveBlocks/WaveBlocks | refs/heads/master | demos/demo_morse/demo_morse_fourier.py | 1 | algorithm = "fourier"
potential = "morse"
D = 3
a = 0.3
T = 10
dt = 0.005
eps = 0.2
f = 4.0
ngn = 4096
basis_size = 4
leading_component = 0
P = 1.0j
Q = 1
S = 0.0
p = 0.0
q = 1.5
parameters = [ (P, Q, S, p, q) ]
coefficients = [[(0, 1.0)]]
write_nth = 20
|
gromez/Sick-Beard | refs/heads/development | lib/jsonrpclib/__init__.py | 77 | from config import Config
config = Config.instance()
from history import History
history = History.instance()
from jsonrpc import Server, MultiCall, Fault
from jsonrpc import ProtocolError, loads, dumps
|
kun--hust/SDSCloud | refs/heads/master | test/probe/test_object_expirer.py | 14 | #!/usr/bin/python -u
# 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
# ... |
TheDarkestObscrurity/mako | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
indictranstech/focal-erpnext | refs/heads/develop | erpnext/hr/doctype/earning_type/earning_type.py | 41 | # 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
from frappe.model.document import Document
class EarningType(Document):
pass |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/module_utils/source_control/bitbucket.py | 38 | # -*- coding: utf-8 -*-
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
import json
from ansible.module_utils._text import to_text
from ansible.module_utils.ba... |
jonparrott/gcloud-python | refs/heads/master | bigtable/google/cloud/bigtable/column_family.py | 3 | # Copyright 2015 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 agreed to in writing, s... |
ChristosChristofidis/h2o-3 | refs/heads/master | h2o-py/h2o/model/clustering.py | 11 | """
Clustering Models
"""
from metrics_base import *
class H2OClusteringModel(ModelBase):
def __init__(self, dest_key, model_json):
super(H2OClusteringModel, self).__init__(dest_key, model_json,H2OClusteringModelMetrics)
def size(self, train=False, valid=False, xval=False):
"""
Get the sizes of eac... |
eayunstack/nova | refs/heads/develop | nova/virt/configdrive.py | 9 | # Copyright 2012 Michael Still and Canonical 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
#
# ... |
liaoyao/oms | refs/heads/master | installed/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
signed/intellij-community | refs/heads/master | python/testData/quickFixes/PyRenameElementQuickFixTest/renameAwaitFunctionInPy36_after.py | 54 | def a():
pass |
MatthieuBizien/scikit-learn | refs/heads/master | examples/neural_networks/plot_mlp_training_curves.py | 56 | """
========================================================
Compare Stochastic learning strategies for MLPClassifier
========================================================
This example visualizes some training loss curves for different stochastic
learning strategies, including SGD and Adam. Because of time-constrai... |
nitin-cherian/LifeLongLearning | refs/heads/master | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/IPython/external/mathjax.py | 19 | #!/usr/bin/python
"""
`IPython.external.mathjax` is deprecated with IPython 4.0+
mathjax is now install by default with the notebook package
"""
import sys
if __name__ == '__main__' :
sys.exit("IPython.external.mathjax is deprecated, Mathjax is now installed by default with the notebook package")
|
elkingtonmcb/sympy | refs/heads/master | sympy/matrices/immutable.py | 60 | from __future__ import print_function, division
from sympy.core import Basic, Integer, Tuple, Dict, S, sympify
from sympy.core.sympify import converter as sympify_converter
from sympy.matrices.matrices import MatrixBase
from sympy.matrices.dense import DenseMatrix
from sympy.matrices.sparse import SparseMatrix, Mutab... |
yt752/theano_exercises | refs/heads/master | 02_advanced/01_symbolic/04_two_step_backprop.py | 13 | import numpy as np
from theano import config
from theano import function
from theano import shared
from theano import tensor as T
raise NotImplementedError("TODO: add any imports you need.")
num_vis = 2
class SimpleMLP(object):
"""
An MLP with one sigmoid hidden layer and one linear output layer
(for so... |
Affix/CouchPotatoServer | refs/heads/master | libs/tornado/platform/windows.py | 387 | # NOTE: win32 support is currently experimental, and not recommended
# for production use.
from __future__ import absolute_import, division, print_function, with_statement
import ctypes
import ctypes.wintypes
# See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx
SetHandleInformation = ctypes.windll.ker... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/communication/azure-communication-chat/azure/communication/chat/_generated/__init__.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
legoktm/pywikipedia-scripts | refs/heads/master | r_til_watcher.py | 1 | #!/usr/bin/env python
"""
Copyright (C) 2012 Legoktm
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, publi... |
tyleryasaka/game-theory-modeling | refs/heads/master | python/matrix.py | 1 | # matrix
'''
Class: player
Description:
representation of a player in a game
'''
class player:
def __init__(self,Utility=None,Likelihood=None):
self.Likelihood = Likelihood
self.Utility = Utility
def setUtility(self,Utility):
self.Utility = Utility
def getUtility(self):
return self.Utility
def setLikel... |
coder006/BinPy | refs/heads/develop | BinPy/tests/expr_tests.py | 6 | from BinPy import *
from nose.tools import with_setup, nottest
def parse_test():
assert Expr('A & B').parse() == 'AND(B, A)'
assert Expr('(A & B)').parse() == 'AND(B, A)'
assert Expr('(~A) & B').parse() == 'AND(B, NOT(A))'
assert Expr('~(A & B)').parse() == 'NAND(B, A)'
assert E... |
Micronaet/micronaet-script | refs/heads/master | EDI/csv2txt.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
#
# This program is free software: you can redistribute it and/or modify
#... |
twiest/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/test/elasticsearch_test.py | 49 | import pytest
import json
from openshift_checks.logging.elasticsearch import Elasticsearch, OpenShiftCheckExceptionList
task_vars_config_base = dict(openshift=dict(common=dict(config_base='/etc/origin')))
def canned_elasticsearch(task_vars=None, exec_oc=None):
"""Create an Elasticsearch check object with stubb... |
PaddlePaddle/models | refs/heads/develop | PaddleCV/3d_vision/SMOKE/smoke/utils/progbar.py | 1 | # Copyright (c) 2020 PaddlePaddle 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 applic... |
uberamd/NGECore2 | refs/heads/master | scripts/object/building/kashyyyk/poi_kash_slave_camp_fence_piece_s02.py | 85615 | import sys
def setup(core, object):
return |
Hellowlol/HTPC-Manager | refs/heads/master2 | libs/requests/packages/urllib3/poolmanager.py | 678 | import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValue... |
reinaH/osf.io | refs/heads/develop2 | website/addons/github/routes.py | 36 | # -*- coding: utf-8 -*-
from framework.routing import Rule, json_renderer
from website.addons.github import views
settings_routes = {
'rules': [
# Configuration
Rule(
[
'/project/<pid>/github/settings/',
'/project/<pid>/node/<nid>/github/settings/',
... |
biolab/orange | refs/heads/master | docs/reference/rst/code/discretization-table-method.py | 6 | import Orange
iris = Orange.data.Table("iris.tab")
disc = Orange.data.discretization.DiscretizeTable()
disc.method = Orange.feature.discretization.EqualFreq(numberOfIntervals=2)
disc_iris = disc(iris)
print "Original data set:"
for e in iris[:3]:
print e
print "Discretized data set:"
for e in disc_iris[:3]:
p... |
warner83/micropython | refs/heads/master | tests/bytecode/pylib-tests/base64.py | 22 | #! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... |
MillionIntegrals/image-data-encode | refs/heads/master | encoder/constants.py | 1 | __author__ = 'jrx'
BITS_PER_BYTE = 8
BYTES_PER_UINT64 = 8
|
wdv4758h/ZipPy | refs/heads/master | lib-python/3/subprocess.py | 1 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... |
Freeseer/freeseer | refs/heads/master | src/freeseer/plugins/audiomixer/audiopassthrough/widget.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
freeseer - vga/presentation capture software
Copyright (C) 2013 Free and Open Source Software Learning Centre
http://fosslc.org
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 ... |
2uller/LotF | refs/heads/master | App/Lib/genericpath.py | 77 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a p... |
eugena/django | refs/heads/master | tests/template_tests/test_parser.py | 288 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Library, TemplateSyntaxError
from django.template.base import (
TOKEN_BLOCK, FilterExpression, Parser, To... |
pmarks-net/grpc | refs/heads/master | src/python/grpcio_tests/tests/stress/test_runner.py | 23 | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
pybee/toga-cocoa | refs/heads/master | toga_cocoa/widgets/label.py | 2 | from toga.interface import Label as LabelInterface
from ..libs import NSTextField, NSTextAlignment
from .base import WidgetMixin
from toga.constants import LEFT_ALIGNED
class Label(LabelInterface, WidgetMixin):
def __init__(self, text, id=None, style=None, alignment=LEFT_ALIGNED):
super().__init__(id=id,... |
OpusVL/odoo | refs/heads/master | addons/mrp/report/mrp_report.py | 8 | # -*- 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... |
yugang/crosswalk-test-suite | refs/heads/master | webapi/webapi-speechapi-xwalk-tests/inst.xpk.py | 176 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... |
JimCircadian/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_configsync_action.py | 6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
nickoala/telepot | refs/heads/master | examples/callback/datecalca.py | 1 | import sys
import asyncio
from datetime import datetime, timedelta
from functools import reduce
from telepot import glance, peel
import telepot.aio
from telepot.aio.loop import MessageLoop
from telepot.aio.helper import (
InlineUserHandler, AnswererMixin, InterceptCallbackQueryMixin, Editor)
from telepot.namedtuple... |
vitiral/micropython | refs/heads/master | tests/wipy/skipped/rtc_irq.py | 69 | '''
RTC IRQ test for the CC3200 based boards.
'''
from machine import RTC
import machine
import os
import time
mch = os.uname().machine
if not 'LaunchPad' in mch and not 'WiPy' in mch:
raise Exception('Board not supported!')
def rtc_ticks_ms(rtc):
timedate = rtc.now()
return (timedate[5] * 1000) + (timed... |
mlalic/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/echo-query_wsh.py | 266 | #!/usr/bin/python
from mod_pywebsocket import msgutil, util
def web_socket_do_extra_handshake(request):
pass # Always accept.
def web_socket_transfer_data(request):
msgutil.send_message(request, request.unparsed_uri.split('?', 1)[1] or '')
|
0x0mar/Empire | refs/heads/master | lib/modules/situational_awareness/network/find_localadmin_access.py | 6 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-FindLocalAdminAccess',
'Author': ['@harmj0y'],
'Description': ('Finds machines on the local domain where the current user has '
... |
M4gn4tor/mastercard-api-python | refs/heads/master | Tests/services/locations/merchantcategoriesservicetest.py | 1 | import unittest
from tests import testutils
from common import environment
from tests import testconstants
from services.locations.merchants.services import merchantcategoriesservice
class MerchantCategoriesServiceTest(unittest.TestCase):
def setUp(self):
test_utils = testutils.TestUtils(environment.Envir... |
odejesush/tensorflow | refs/heads/master | tensorflow/tools/test/__init__.py | 207 | # 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... |
mark-burnett/code-scientist | refs/heads/master | tests/database/test_file.py | 1 | # Copyright (C) 2012 Mark Burnett
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... |
krisys/django | refs/heads/master | django/contrib/gis/db/backends/mysql/schema.py | 138 | import logging
from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.mysql.schema import DatabaseSchemaEditor
from django.db.utils import OperationalError
logger = logging.getLogger('django.contrib.gis')
class MySQLGISSchemaEditor(DatabaseSchemaEditor):
sql_add_spatial_index = 'C... |
jholloman/node-gyp | refs/heads/master | gyp/test/mac/gyptest-framework-dirs.py | 342 | #!/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.
"""
Verify that it is possible to build an object that depends on a
PrivateFramework.
"""
import os
import sys
import TestGyp
if sys.platf... |
swannapa/erpnext | refs/heads/develop | erpnext/selling/doctype/installation_note/test_installation_note.py | 79 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Installation Note')
class TestInstallationNote(unittest.TestCase):
pass
|
IronLanguages/ironpython2 | refs/heads/master | Tests/interop/net/loadorder/t7e.py | 2 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from iptest.assert_util import *
import module
AreEqual(module.flag, "python")
add_clr_assemblies("load... |
j00bar/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/slackpkg.py | 71 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kim Nørgaard
# Written by Kim Nørgaard <jasen@jasen.dk>
# Based on pkgng module written by bleader <bleader@ratonland.org>
# that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <htt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.