repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Nu3001/external_chromium_org | refs/heads/master | tools/win/link_limiter/build_link_limiter.py | 169 | #!/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.
import glob
import os
import shutil
import subprocess
import sys
import tempfile
BUILD_DIR = 'build'
def run_with_vsvars(cmd, tm... |
Natim/sentry | refs/heads/master | src/sentry/management/commands/createuser.py | 22 | """
sentry.management.commands.createuser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import getpass
import sys
from django.conf import settings
from django.core.ex... |
jonnary/keystone | refs/heads/master | keystone/common/sql/migrate_repo/versions/066_fixup_service_name_value.py | 14 | # 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... |
qqshfox/protobuf-with-as3 | refs/heads/pb-2.3.0-pbas3-2.3 | gtest/test/gtest_filter_unittest.py | 69 | #!/usr/bin/env python
#
# Copyright 2005 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... |
tschorsch/nstor | refs/heads/master | src/buildings/bindings/callbacks_list.py | 664 | callback_classes = [
['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
]
|
crafty78/ansible | refs/heads/devel | contrib/inventory/lxc_inventory.py | 89 | #!/usr/bin/env python
#
# (c) 2015-16 Florian Haas, hastexo Professional Services GmbH
# <florian@hastexo.com>
# Based in part on:
# libvirt_lxc.py, (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the... |
FHannes/intellij-community | refs/heads/master | python/testData/mover/lastComment1_afterDown.py | 10 | def f():
if True:
a = 1
else:
a = 2
#comment <caret> |
ktosiek/spacewalk | refs/heads/debian-repos | client/solaris/smartpm/smart/backends/rpm/header.py | 3 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... |
yuanming-hu/taichi | refs/heads/master | python/taichi/lang/ops.py | 1 | import builtins
import ctypes
import functools
import math
import operator as _bt_ops_mod # bt for builtin
import traceback
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, matrix
from taichi.lang.exception import TaichiSyntaxError
from taichi.lang.expr import Expr, make_expr_group
from ... |
af1rst/bite-project | refs/heads/master | tools/bugs/server/appengine/models/bugs/bug.py | 17 | # Copyright 2010 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... |
KaiRo-at/socorro | refs/heads/master | webapp-django/crashstats/manage/tests/test_views.py | 2 | import json
import datetime
import os
import re
import urlparse
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group, Permission
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
import mock
from nos... |
kursitet/edx-ora2 | refs/heads/master | openassessment/xblock/message_mixin.py | 7 | """
Message step in the OpenAssessment XBlock.
"""
import datetime as dt
import pytz
from xblock.core import XBlock
class MessageMixin(object):
"""
Message Mixin introduces all handlers for displaying the banner message
MessageMixin is a Mixin for the OpenAssessmentBlock. Functions in the
MessageM... |
Reat0ide/plugin.video.pelisalacarta | refs/heads/master | lib/mechanize/_urllib2_fork.py | 130 | """Fork of urllib2.
When reading this, don't assume that all code in here is reachable. Code in
the rest of mechanize may be used instead.
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python
Software Foundation; All Rights Reserved
Copyright 2002-2009 John J Lee <jjl@pobox.com>
This code is f... |
cjcjameson/gpdb | refs/heads/master | src/test/tinc/tincrepo/mpp/gpdb/tests/package/compat/test_compatibility.py | 9 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
GiladE/birde | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/sessions/management/commands/clearsessions.py | 79 | from importlib import import_module
from django.conf import settings
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = "Can be run as a cronjob or directly to clean out expired sessions (only with the database backend at the moment)."
def handle_noargs(self, **option... |
joerocklin/gem5 | refs/heads/master | src/cpu/ozone/OzoneCPU.py | 26 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... |
google/skia | refs/heads/main | infra/bots/recipe_modules/checkout/__init__.py | 3 | # 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.
DEPS = [
'depot_tools/bot_update',
'depot_tools/gclient',
'depot_tools/git',
'depot_tools/tryserver',
'recipe_engine/context',
'recipe_engine/fil... |
mammique/django | refs/heads/tp_alpha | django/contrib/gis/gdal/field.py | 214 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_text
# For more information, see the OGR ... |
google-code/android-scripting | refs/heads/master | python/src/Lib/lib2to3/fixes/fix_raw_input.py | 53 | """Fixer that changes raw_input(...) into input(...)."""
# Author: Andre Roberge
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixRawInput(fixer_base.BaseFix):
PATTERN = """
power< name='raw_input' trailer< '(' [any] ')' > any* >
"""
def transform(... |
bsmrstu-warriors/Moytri--The-Drone-Aider | refs/heads/master | Lib/argparse.py | 111 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... |
agry/NGECore2 | refs/heads/master | scripts/object/waypoint/base/waypoint_default.py | 85615 | import sys
def setup(core, object):
return |
wimnat/ansible | refs/heads/devel | test/lib/ansible_test/_internal/io.py | 30 | """Functions for disk IO."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno
import io
import json
import os
from . import types as t
from .encoding import (
ENCODING,
to_bytes,
to_text,
)
def read_json_file(path): # type: (t.AnyStr) -> t.Any
""... |
rebost/django | refs/heads/master | tests/regressiontests/localflavor/fi/tests.py | 13 | from __future__ import unicode_literals
from django.contrib.localflavor.fi.forms import (FIZipCodeField,
FISocialSecurityNumber, FIMunicipalitySelect)
from django.test import SimpleTestCase
class FILocalFlavorTests(SimpleTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipalitySelect()
... |
mattvick/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/xvfbdriver.py | 117 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
liaowang11/alifuse | refs/heads/master | oss_xml_handler.py | 4 | #coding=utf8
from xml.dom import minidom
def get_tag_text(element, tag):
nodes = element.getElementsByTagName(tag)
if len(nodes) == 0:
return ""
else:
node = nodes[0]
rc = ""
for node in node.childNodes:
if node.nodeType in ( node.TEXT_NODE, node.CDATA_SECTION_NODE):
... |
klahnakoski/MoDevETL | refs/heads/master | pyLibrary/sql/redshift.py | 4 | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from _... |
DmitryADP/diff_qc750 | refs/heads/master | external/webkit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py | 15 | #!/usr/bin/env python
# Copyright (C) 2011 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 ... |
mlperf/training_results_v0.7 | refs/heads/master | NVIDIA/benchmarks/transformer/implementations/pytorch/tests/utils.py | 6 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
from fairseq import ... |
dkentw/robotframework | refs/heads/master | utest/model/test_testsuite.py | 25 | import unittest
from robot.utils.asserts import assert_equal, assert_true, assert_raises
from robot.model import TestSuite
class TestTestSuite(unittest.TestCase):
def setUp(self):
self.suite = TestSuite(metadata={'M': 'V'})
def test_modify_medatata(self):
self.suite.metadata['m'] = 'v'
... |
dharmabumstead/ansible | refs/heads/devel | lib/ansible/plugins/lookup/nios_next_ip.py | 30 | #
# Copyright 2018 Red Hat | Ansible
#
# 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 version.
#
# ... |
napkindrawing/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_gtm_pool.py | 33 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# 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
# ... |
Mitali-Sodhi/CodeLingo | refs/heads/master | Dataset/python/test_main.py | 8 | from __future__ import with_statement
import copy
from functools import partial
from operator import isMappingType
import os
import sys
from contextlib import contextmanager
from fudge import Fake, patched_context, with_fakes
from nose.tools import ok_, eq_
from fabric.decorators import hosts, roles, task
from fabri... |
proversity-org/edx-platform | refs/heads/master | openedx/tests/xblock_integration/test_recommender.py | 4 | """
This test file will run through some XBlock test scenarios regarding the
recommender system
"""
import itertools
import json
import StringIO
import unittest
from copy import deepcopy
from django.conf import settings
from django.core.urlresolvers import reverse
from ddt import data, ddt
from lms.djangoapps.course... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.3/tests/unit/modules/win_disk_test.py | 2 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON
)
from salttesting.helpers imp... |
salguarnieri/intellij-community | refs/heads/master | python/testData/quickFixes/PyAugmentAssignmentQuickFixTest/references_after.py | 83 | v = 0
f = 1
v += f
|
trabucayre/gnuradio | refs/heads/master | gr-blocks/python/blocks/parse_file_metadata.py | 1 | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import gr, blocks
import pmt
'''
sr Sample rate (samples/second)
time Time as uint64(secs), double(fractional secs)
type Type of d... |
hbrunn/OCB | refs/heads/8.0 | openerp/addons/base/tests/test_acl.py | 338 | import unittest2
from lxml import etree
import openerp
from openerp.tools.misc import mute_logger
from openerp.tests import common
# test group that demo user should not have
GROUP_TECHNICAL_FEATURES = 'base.group_no_one'
class TestACL(common.TransactionCase):
def setUp(self):
super(TestACL, self).setU... |
orosp/ddiskit | refs/heads/master | setup.py | 1 | #!/usr/bin/python
from setuptools import setup
setup(
name="ddiskit",
version="3.6",
author="Petr Oros",
author_email="poros@redhat.com",
description=("Red Hat tool for Driver Update Disk creation"),
license="GPLv3",
url="https://github.com/orosp/ddiskit.git",
data_files=[('/usr/share/... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/genericpath.py | 246 | """
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 path exist?
#... |
hazrpg/calibre | refs/heads/master | src/calibre/ebooks/oeb/transforms/htmltoc.py | 19 | '''
HTML-TOC-adding transform.
'''
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
from calibre.ebooks.oeb.base import XML, XHTML, XHTML_NS
from calibre.ebooks.oeb.base import XHTML_MIME, CSS_MIME
from calibre.ebooks.oeb.base import ele... |
google/material-design-icons | refs/heads/master | update/venv/lib/python3.9/site-packages/pip/_internal/commands/check.py | 6 | import logging
from optparse import Values
from typing import Any, List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.operations.check import (
check_package_set,
create_package_set_from_installed,
)
from pip._internal.utils.misc... |
Dark-Hacker/horizon | refs/heads/master | openstack_dashboard/enabled/_1840_data_processing_jobs_panel.py | 17 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
txomon/SpockBot | refs/heads/master | spock/plugins/loader.py | 1 | """
Provides reasonably not-awful plugin loading
"""
import logging
from spock.plugins.core.settings import SettingsPlugin
logger = logging.getLogger('spock')
base_warn = "PluginLoader could not satisfy %s dependency for %s"
pl_warn = base_warn + ": %s"
class PluginLoader(object):
def __init__(self, **kwargs):... |
lavish205/olympia | refs/heads/master | src/olympia/bandwagon/views.py | 1 | import functools
import hashlib
import os
from django import http
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.shortcuts import get_object_or_404
... |
ilyes14/scikit-learn | refs/heads/master | examples/svm/plot_svm_anova.py | 250 | """
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature before running a SVC
(support vector classifier) to improve the classification scores.
"""
print(__doc__)
import... |
kanagasabapathi/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/myrebuilder1.py | 162 |
class A:
def a(self):
return 'a'
try:
object
except NameError:
pass
else:
class B(object, A):
def b(self):
return 'b'
class Inherit(A):
def a(self):
return 'c'
|
zhangqiking/Data-Structure-Zoo | refs/heads/master | 1-Algorithm Analysis/algorithms.py | 6 | """ 2: Algorithms
thomas moll 2015
"""
import time, random
def find_sequentially(arr, item):
""" Sequential Search
Complexity: O(n)
"""
for value, i in enumerate(arr):
# Check each item in the list
if item == value: #Runs N number of times
... |
samueljohn/pelican-plugins | refs/heads/master | asciidoc_reader/__init__.py | 72 | from .asciidoc_reader import *
|
piyush82/icclab-rcb-web | refs/heads/master | virtualenv/lib/python2.7/site-packages/django/contrib/gis/geos/error.py | 641 | """
This module houses the GEOS exceptions, specifically, GEOSException and
GEOSGeometryIndexError.
"""
class GEOSException(Exception):
"The base GEOS exception, indicates a GEOS-related error."
pass
class GEOSIndexError(GEOSException, KeyError):
"""
This exception is raised when an invalid index is... |
debugger22/sympy | refs/heads/master | sympy/physics/quantum/tests/test_constants.py | 130 | from sympy import Float
from sympy.physics.quantum.constants import hbar
def test_hbar():
assert hbar.is_commutative is True
assert hbar.is_real is True
assert hbar.is_positive is True
assert hbar.is_negative is False
assert hbar.is_irrational is True
assert hbar.evalf() == Float(1.05457162e... |
thundernet8/WRGameVideos-API | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2cffi.py | 54 | # testing/engines.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+psycopg2cffi
:name: psycopg2cffi
:dbapi: psyco... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/network/check_point/cp_mgmt_publish.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... |
HLFH/CouchPotatoServer | refs/heads/develop | libs/pyasn1/type/constraint.py | 382 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... |
lisael/pg-django | refs/heads/master | tests/regressiontests/admin_inlines/tests.py | 23 | from __future__ import absolute_import
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
# lo... |
dex4er/django | refs/heads/1.6.x | django/core/files/base.py | 147 | from __future__ import unicode_literals
import os
from io import BytesIO, StringIO, UnsupportedOperation
from django.utils.encoding import smart_text
from django.core.files.utils import FileProxyMixin
from django.utils import six
from django.utils.encoding import force_bytes, python_2_unicode_compatible
@python_2_un... |
darkwing/kuma | refs/heads/master | vendor/packages/pyflakes/test/test_api.py | 6 | """
Tests for L{pyflakes.scripts.pyflakes}.
"""
import os
import sys
import shutil
import subprocess
import tempfile
from pyflakes.messages import UnusedImport
from pyflakes.reporter import Reporter
from pyflakes.api import (
checkPath,
checkRecursive,
iterSourceCode,
)
from pyflakes.test.harness import T... |
rezasafi/spark | refs/heads/master | examples/src/main/python/mllib/multi_class_metrics_example.py | 55 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
kblok/TelegramBotFriend | refs/heads/master | markovify_provider.py | 1 | """Text provider based on Marcovify"""
import re
import markovify
import nltk
class MarkovifyProvider(object):
"""Text provider based on Marcovify"""
def __init__(self, language, text_provider):
self.text_provider = text_provider
self.load()
self.language = language
def load(self):... |
defionscode/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_ospf_vrf.py | 43 | #!/usr/bin/python
#
# 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 version.
#
# Ansible is distribut... |
petteyg/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/builtinDerivedClassAttribute.py | 83 | class C(dict):
def foo(self):
pass
def bar(self):
self.foo() #pass |
areski/django | refs/heads/master | django/contrib/gis/utils/wkt.py | 589 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated t... |
evandavid/dodolipet | refs/heads/master | yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_remove_success.py | 4 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessRemoveParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<remove type="success" participant="{{jid}}"></remove... |
woqer/kappa | refs/heads/develop | kappa/__init__.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Mitch Garnaat
#
# 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... |
thu-ml/zhusuan | refs/heads/master | examples/toy_examples/gaussian.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import tensorflow as tf
import zhusuan as zs
@zs.meta_bayesian_net()
def gaussian(n_x,... |
blaquee/volatility | refs/heads/master | volatility/plugins/overlays/windows/win10_x64_1AC738FB_vtypes.py | 4 | ntkrnlmp_types = {
'LIST_ENTRY64' : [ 0x10, {
'Flink' : [ 0x0, ['unsigned long long']],
'Blink' : [ 0x8, ['unsigned long long']],
} ],
'LIST_ENTRY32' : [ 0x8, {
'Flink' : [ 0x0, ['unsigned long']],
'Blink' : [ 0x4, ['unsigned long']],
} ],
'_KUSER_SHARED_DATA' : [ 0x708, {
'TickCountLowDepreca... |
reinaH/osf.io | refs/heads/develop2 | scripts/dev_populate_conferences.py | 19 | #!/usr/bin/env python
# encoding: utf-8
import os
import sys
import argparse
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
def parse... |
projectchrono/chrono | refs/heads/develop | src/demos/python/irrlicht/demo_IRR_earthquake.py | 3 | #------------------------------------------------------------------------------
# Name: pychrono example
# Purpose:
#
# Author: Alessandro Tasora
#
# Created: 1/01/2019
# Copyright: (c) ProjectChrono 2019
#
#
# This file shows how to
# - create a small stack of bricks,
# - create a support that sh... |
ibinti/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/hgweb/protocol.py | 93 | #
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import cgi, cStringIO, zlib, urllib
from mercurial import util, w... |
sinkuri256/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/dummy_threading.py | 210 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` w... |
cts2/pyjxslt | refs/heads/master | pyjxslt-python/tests/testXMLtoJSON.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Mayo Clinic
# 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... |
partofthething/home-assistant | refs/heads/dev | tests/components/template/test_alarm_control_panel.py | 14 | """The tests for the Template alarm control panel platform."""
from homeassistant import setup
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMING,
STATE_ALARM_DISARMED,
STATE_ALARM_PENDING,
STATE_ALARM_TRIGGERED,
)
f... |
pwoodworth/intellij-community | refs/heads/master | python/lib/Lib/hashlib.py | 82 | # $Id: hashlib.py 66095 2008-08-31 16:36:21Z gregory.p.smith $
#
# Copyright (C) 2005 Gregory P. Smith (greg@electricrain.com)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string='') - returns a new hash object implementing t... |
yoer/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/cache/backends/memcached.py | 104 | "Memcached cache backend"
import time
import pickle
from threading import local
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.utils import six
from django.utils.encoding import force_str
class BaseMemcachedCache(BaseCache):
def __init__(self, server, params, library, value_n... |
evgeni/dak | refs/heads/master | dak/split_done.py | 1 | #!/usr/bin/env python
""" Split queue/done into date based subdirectories """
# Copyright (C) 2004, 2005, 2006 James Troup <james@nocrew.org>
# Copyright (C) 2008 Joerg Jaspert <joerg@debian.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
alexDeCastroAtGit/belkin_challenge | refs/heads/master | data/animate_hf_data.py | 1 | """
simple example of an animated plot
"""
## always start the project as a virtual environment
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
data_dir = '/Users/alex.decastro/development/gitlab/belkin_challenge/data/CSV_OUT/Tagged_Training_02_15_13609... |
Fanarim/test_case_monkey | refs/heads/master | test_case_monkey/tcm/migrations/0006_make_attributes_values_optional.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-20 17:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tcm', '0005_add_uniquetogether_to_project'),
]
operations = [
migrations.Alt... |
qianwenming/mapnik | refs/heads/master | tests/python_tests/render_grid_test.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import execution_path, run_all
import os, mapnik
try:
import json
except ImportError:
import simplejson as json
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need... |
oomlout/oomlout-OOMP | refs/heads/master | OOMPpart_RESE_0402_X_O000_67.py | 1 | import OOMP
newPart = OOMP.oompItem(9216)
newPart.addTag("oompType", "RESE")
newPart.addTag("oompSize", "0402")
newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "O000")
newPart.addTag("oompIndex", "67")
OOMP.parts.append(newPart)
|
repotvsupertuga/tvsupertuga.repository | refs/heads/master | plugin.video.youtube/resources/lib/youtube_plugin/kodion/items/__init__.py | 1 | __all__ = ['BaseItem', 'AudioItem', 'DirectoryItem', 'VideoItem', 'AudioVideoItem', 'ImageItem', 'WatchLaterItem', 'FavoritesItem',
'SearchItem', 'NewSearchItem', 'SearchHistoryItem', 'NextPageItem', 'UriItem',
'from_json', 'to_json', 'to_jsons']
from utils import to_json, from_json, to_jsons
fr... |
idaholab/civet | refs/heads/master | ci/Stats.py | 2 |
# Copyright 2016 Battelle Energy Alliance, 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 agr... |
larusx/yunmark | refs/heads/master | site-packages/markdown/extensions/footnotes.py | 13 | """
Footnotes Extension for Python-Markdown
=======================================
Adds footnote handling to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/footnotes.html>
for documentation.
Copyright The Python Markdown Project
License: [BSD](http://www.opensource.org/licenses/bsd-license.php... |
hnzProjects/myBlog | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... |
dbo/selenium | refs/heads/master | py/test/selenium/__init__.py | 40 | #!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
jlmadurga/permabots-www | refs/heads/master | permabots_www/users/admin.py | 183 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... |
mthxx/Comms | refs/heads/master | database.py | 1 | #!/usr/bin/python3.3
from gui import GUI
from config import Config
import mysql.connector
class Database:
DB = ""
def establish_connection():
Database.DB = mysql.connector.connect(host=Config.c['DB IP'],
user=Config.c['DB User'],
password=Config.... |
gdementen/pycel | refs/heads/master | src/pycel/tokenizer.py | 1 | #========================================================================
# Description: Tokenise an Excel formula using an implementation of
# E. W. Bachtal's algorithm, found here:
#
# http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
#
# Tested with Python v... |
electronpass/electronpass-desktop | refs/heads/develop | .builder/prepare_cryptopp.py | 1 | import os
import zipfile
import urllib
def change_runtime_library(folder, filename):
with open(folder + os.sep + filename) as f:
data = f.readlines()
for i in range(len(data)):
if '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>' in data[i]:
data[i] = data[i].replace('MultiThreaded'... |
aperigault/ansible | refs/heads/devel | lib/ansible/module_utils/network/junos/facts/lldp_interfaces/lldp_interfaces.py | 2 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The junos lldp_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based... |
odicraig/kodi2odi | refs/heads/master | addons/plugin.video.exabytetv/main.py | 1 | # -*- coding: utf-8 -*-
import urllib
import urllib2
import re
import os
import xbmcplugin
import xbmcgui
import xbmcaddon
import xbmcvfs
import traceback
import cookielib,base64
from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP
viewmode=None
try:
from xml.sax.saxutils import escape
except:... |
billyevans/prefix_storage | refs/heads/master | check.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib2
import sys
import md5
if __name__ == '__main__':
count = 0
for line in sys.stdin:
conn = httplib2.HTTPConnectionWithTimeout("localhost", int(sys.argv[1]))
key = line.rstrip()
val = md5.md5(key)
conn.request("GET", "... |
piensa/geonode | refs/heads/wm-develop | geonode/base/management/commands/lib/gn24_to_24.py | 11 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
sencha/chromium-spacewalk | refs/heads/master | tools/cr/cr/actions/action.py | 56 | # 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.
"""A module for the Action plugin base class."""
import cr
class Action(cr.Plugin):
"""Base class for cr actions.
This provides the standard interfac... |
jammerful/buildbot | refs/heads/master | master/buildbot/test/unit/test_test_util_gpo.py | 7 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
vietpn/ghost_nodejs | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/terminal.py | 363 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for terminal output with ANSI sequences.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Format... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/build/android/pylib/results/flakiness_dashboard/results_uploader.py | 20 | # 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.
"""Uploads the results to the flakiness dashboard server."""
# pylint: disable=E1002,R0201
import logging
import os
import shutil
import tempfile
import... |
ceos-seo/Data_Cube_v2 | refs/heads/master | agdc-v2/examples/ndexpr/ndvi_mask.py | 1 | # ------------------------------------------------------------------------------
# Name: ndvi_mask.py
# Purpose: ndvi mask example for ndexpr
# pre-integration into Analytics Engine & Execution Engine.
# post-integration with Data Access API.
#
# Author: Peter Wang
#
# Created: 2... |
alexm92/sentry | refs/heads/master | src/sentry/celery.py | 5 | from __future__ import absolute_import
from django.conf import settings
from celery import Celery
from celery.app.task import Task
from sentry.utils import metrics
DB_SHARED_THREAD = """\
DatabaseWrapper objects created in a thread can only \
be used in that same thread. The object with alias '%s' \
was created i... |
yourcelf/btb | refs/heads/master | scanblog/subscriptions/migrations/0002_auto_20150429_1721.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='notificationblacklist',
... |
2014c2g14/2014c2 | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/Lib/xml/etree/ElementInclude.py | 784 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... |
efortuna/AndroidSDKClone | refs/heads/master | ndk/prebuilt/linux-x86_64/lib/python2.7/test/test_pipes.py | 134 | import pipes
import os
import string
import unittest
from test.test_support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr %s %s'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.