repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Workday/OpenFrame | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/vpc/__init__.py | 129 | """
Test package for VPC
"""
|
asedunov/intellij-community | refs/heads/master | python/lib/Lib/encodings/big5.py | 816 | #
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_tw, codecs
import _multibytecodec as mbc
codec = _codecs_tw.getcodec('big5')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalE... |
BrainDamage/Flexget | refs/heads/develop | flexget/plugins/urlrewrite_newzleech.py | 8 | from __future__ import unicode_literals, division, absolute_import
import urllib
import urllib2
import logging
import re
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.soup import get_soup
from flexget.utils.tools import urlopener
log = logging.getLogger(... |
wfarner/aurora | refs/heads/master | src/test/python/apache/aurora/executor/common/test_health_checker.py | 5 | #
# 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 ... |
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/crypto/openssl_csr_info.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... |
batermj/algorithm-challenger | refs/heads/master | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/lib2to3/fixes/fix_sys_exc.py | 203 | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... |
freedomofpress/fingerprint-securedrop | refs/heads/master | fpsd/sorter.py | 2 | #!/usr/bin/env python3.5
#
# Call scrape_directories() on any number of hidden service directories and
# then call sort_onions() on a dict, the keys of which are class names and the
# values boolean lambda expressions that operate on the object reference "text"
# (the HTML text of a web page), returning True when the p... |
srowen/spark | refs/heads/master | examples/src/main/python/ml/min_max_scaler_example.py | 27 | #
# 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... |
suyashphadtare/gd-erp | refs/heads/develop | erpnext/setup/doctype/supplier_type/__init__.py | 37694 | from __future__ import unicode_literals
|
TaskEvolution/Task-Coach-Evolution | refs/heads/master | taskcoach/tests/sikuli/windows/taskcoach-run/TaskcoachDriveBackup.sikuli/TaskcoachDriveBackup.py | 1 | sleep(2)
if exists ("1386056187843.png"):
click("1386056206027.png")
sleep(1)
assert exists ("1385718239031.png")
sleep(1)
type('c', KEY_ALT)
sleep(5)
#Requires that you delete your authentication .dat first, since this is the interesting part.
if exists("1386012148519.png"):
click("1386012178591.png")
slee... |
drglove/SickRage | refs/heads/master | lib/hachoir_parser/audio/mod.py | 90 | """
Parser of FastTrackerII Extended Module (XM) version 1.4
Documents:
- Modplug source code (file modplug/soundlib/Load_mod.cpp)
http://sourceforge.net/projects/modplug
- Dumb source code (files include/dumb.h and src/it/readmod.c
http://dumb.sf.net/
- Documents on "MOD" format on Wotsit
http://www.wotsit.org
... |
gamechanger/kafka-python | refs/heads/master | kafka/partitioner/base.py | 41 |
class Partitioner(object):
"""
Base class for a partitioner
"""
def __init__(self, partitions):
"""
Initialize the partitioner
Arguments:
partitions: A list of available partitions (during startup)
"""
self.partitions = partitions
def partition(... |
windyuuy/opera | refs/heads/master | chromium/src/ppapi/generators/idl_c_header.py | 31 | #!/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.
""" Generator for C style prototypes and definitions """
import glob
import os
import re
import sys
from idl_log import ErrOut, I... |
dendisuhubdy/tensorflow | refs/heads/master | tensorflow/contrib/mixed_precision/python/loss_scale_manager_test.py | 3 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Lib/test/test_ntpath.py | 20 | # coding: utf-8
import ntpath
import os
import sys
from test.test_support import TestFailed
from test import test_support, test_genericpath
import unittest
def tester0(fn, wantResult):
gotResult = eval(fn)
if wantResult != gotResult:
raise TestFailed, "%s should return: %r but returned: %r" \
... |
x111ong/odoo | refs/heads/8.0 | addons/account_budget/wizard/__init__.py | 444 | # -*- 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... |
martndj/DaleyMenard1993 | refs/heads/master | DM93/__init__.py | 1 | #-------------------------- LICENCE BEGIN ---------------------------
# This file is part of DaleyMenard93.
#
# DaleyMenard93 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... |
dabit3/react-native | refs/heads/master | ReactAndroid/src/main/android_res/android/support/v7/appcompat-orig/res-unpacker.py | 12 | import contextlib
import os
import shutil
import sys
import tempfile
import zipfile
# Helper that unpacks the contents of the res folder of an .aar file
# into given destination.
@contextlib.contextmanager
def cleanup(path):
yield path
shutil.rmtree(path)
if __name__ == '__main__':
with zipfile.ZipFile(s... |
thequbit/mc911feedwatcher | refs/heads/master | src/mcsafetyfeed-server/mcsafetyfeedserver/scripts/initializedb.py | 1 | import os
import sys
import transaction
from sqlalchemy import engine_from_config
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from pyramid.scripts.common import parse_vars
from ..models import (
DBSession,
#MyModel,
Base,
AgencyTypes,
Agencies,
)
def usage(ar... |
jvrsantacruz/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_unicode_shift_jis.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
import codecs
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparison... |
npawelek/rpc-maas | refs/heads/master | playbooks/files/rax-maas/plugins/ironic_api_local_check.py | 1 | #!/usr/bin/env python
# Copyright 2017, Rackspace US, 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 applicabl... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/lovelace/test_dashboard.py | 8 | """Test the Lovelace initialization."""
from unittest.mock import patch
import pytest
from homeassistant.components import frontend
from homeassistant.components.lovelace import const, dashboard
from homeassistant.setup import async_setup_component
from tests.common import assert_setup_component, async_capture_event... |
jianjian0dandan/Zhihu_Spider | refs/heads/master | zhihu/build_users.py | 4 | from zhihu_config import *
q = json.loads(open(ZHIHU_Q_PATH, 'r').read())
q_content_adj = {}
for question in q:
q_content_adj[question['id']] = ''.join([
question['title'],
question['content']
])
qid = {}
qid_file = open(ZHIHU_ITEM_ID, 'r')
for line in qid_file.readlines():
raw_data... |
jakobzhao/wbcrawler3 | refs/heads/wendy | seg_training_2.py | 1 | # !/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on Oct 16, 2015
# @author: Bo Zhao
# @email: bo_zhao@hks.harvard.edu
# @website: http://yenching.org
# @organization: Harvard Kennedy School
import sys
# gensim modules
from gensim.models import Doc2Vec
from wbcrawler.log import *
import numpy
fro... |
sfriesel/suds | refs/heads/master | suds/umx/encoded.py | 3 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 is distributed in the hope that it will b... |
Flygohr/simple-php-bootstrap-cms | refs/heads/master | test-infra/s3_cache.py | 2166 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... |
jostep/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/metrics_test.py | 28 | # 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... |
artdent/jgments | refs/heads/master | lib/pygments-1.2.2-patched/pygments/styles/perldoc.py | 75 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... |
kordano/samba-ldb-mdb | refs/heads/master | lib/testtools/testtools/tests/matchers/test_dict.py | 12 | from testtools import TestCase
from testtools.matchers import (
Equals,
NotEquals,
Not,
)
from testtools.matchers._dict import (
ContainedByDict,
ContainsDict,
KeysEqual,
MatchesAllDict,
MatchesDict,
_SubDictOf,
)
from testtools.tests.matchers.helpers import TestMatchersInter... |
dhood/launch | refs/heads/master | launch/launch/launcher.py | 1 | # Copyright 2015 Open Source Robotics Foundation, 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... |
dwaynebailey/pootle | refs/heads/master | tests/pootle_log/log.py | 5 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from datetime import timedelt... |
ttesileanu/twostagelearning | refs/heads/master | tests.py | 1 | #! /usr/bin/env python
import simulation
import unittest
import numpy as np
import copy
from basic_defs import *
def int_r(f):
""" Convert to nearest integer. """
return int(np.round(f))
# a simple mock source layer
class SimpleNeurons(object):
def __init__(self, N, out_step=1, out_fct=None):
self.N = N
... |
kmaglione/amo-validator | refs/heads/master | tests/test_libraryblacklist.py | 6 | from nose.tools import eq_
import validator.testcases.content as test_content
from validator.constants import FIREFOX_GUID
from validator.decorator import version_range
from validator.errorbundler import ErrorBundle
from validator.xpi import XPIManager
def test_blacklisted_files():
"""
Tests the validator's ... |
diagramsoftware/odoo | refs/heads/8.0 | addons/board/controllers.py | 348 | # -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, menu_id, act... |
tensorflow/tensorflow | refs/heads/master | tensorflow/python/ops/ragged/ragged_string_ops.py | 8 | # 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... |
anthill-platform/anthill-social | refs/heads/0.1.dev0 | anthill/social/options.py | 1 |
from anthill.common.options import define
# Main
define("host",
default="http://localhost:9514",
help="Public hostname of this service",
type=str)
define("listen",
default="port:9514",
help="Socket to listen. Could be a port number (port:N), or a unix domain socket (unix:PATH)",
... |
soumyanishan/azure-linux-extensions | refs/heads/master | AzureEnhancedMonitor/ext/test/test_aem.py | 8 | #!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft 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
#
#... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/resolve/DocStringInvalid.py | 83 | class Foo:
"This is not " + "a doc string"
pass
Foo._<ref>_.doc__
|
ahvigil/pandr | refs/heads/master | pandr/constants/rinternals.py | 1 | # Expression constants from Rinternals.h
NILSXP = 0 # nil = NULL
SYMSXP = 1 # symbols
LISTSXP = 2 # lists of dotted pairs
CLOSXP = 3 # closures
ENVSXP = 4 # environments
PROMSXP = 5 # promises: [un]evaluated closure arguments
LANGSXP = 6 # language constructs (special li... |
SnowBeaver/Vision | refs/heads/master | migrations/versions/2129fab41318_.py | 2 | """empty message
Revision ID: 2129fab41318
Revises: 3ca82e77999c
Create Date: 2016-10-11 17:05:10.133197
"""
# revision identifiers, used by Alembic.
revision = '2129fab41318'
down_revision = '31572aec4659'
from alembic import op
import sqlalchemy as sa
def upgrade():
sql = """
SELECT setval('equipmen... |
a-doumoulakis/tensorflow | refs/heads/master | tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column.py | 119 | # 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... |
nilsgrabbert/spark | refs/heads/master | examples/src/main/python/mllib/gradient_boosting_classification_example.py | 106 | #
# 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... |
dcos/dcos-launch | refs/heads/master | dcos_launch/config.py | 1 | """ Module for defining and validating user-provided configuration
"""
import logging
import os
import sys
import uuid
import requests
import cerberus
import yaml
from dcos_launch import util
from dcos_launch.platforms import aws, gcp
log = logging.getLogger(__name__)
def expand_path(path: str, relative_dir: str) ... |
MLWave/kepler-mapper | refs/heads/master | docs/generated/gallery/plot_cat.py | 2 | """
3D Cat Data
============
This example generates a Mapper built from a point-cloud sampled from a 3D model of a cat.
`Visualization of the cat mapper <../../_static/cat.html>`_
"""
import numpy as np
import sklearn
import kmapper as km
data = np.genfromtxt('data/cat-reference.csv', delimiter=',')
mapper =... |
grengojbo/satchmo | refs/heads/master | satchmo/apps/satchmo_ext/recentlist/templatetags/satchmo_recentlist.py | 12 | from django.template import Node, NodeList
from django.template import TemplateSyntaxError
from django.template import Library
from product.models import Product
from livesettings import config_value
register = Library()
def recentlyviewed(recent, slug=""):
"""Build a list of recent products, skipping the current... |
paperdavid/vita | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 240 | # 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... |
sigmavirus24/twine | refs/heads/master | twine/commands/register.py | 1 | # Copyright 2015 Ian Cordasco
#
# 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, sof... |
yakky/django | refs/heads/master | tests/proxy_model_inheritance/tests.py | 89 | from __future__ import absolute_import, unicode_literals
import os
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
from .models import (
ConcreteModel, ConcreteModelSubclass, Con... |
synw/django-allons | refs/heads/master | djangomogo/install/append_to_apps.py | 2 | # -*- coding: utf-8 -*-
import sys
import os
project_name = sys.argv[1:][0]
base_dir = sys.argv[1:][1]
extralines_str = sys.argv[1:][2]
project_dir = base_dir+'/'+project_name
xlines = extralines_str.split(',')
def lines_generator(f, extralines):
for line in f.readlines():
yield line
if "# !extr... |
Psykar/ckanext-ands | refs/heads/master | ckanext/ands/auth.py | 1 | import ckan.plugins.toolkit as toolkit
from ckan.logic.auth.delete import package_delete as default_package_delete
def package_delete(context, data_dict=None):
if not context['auth_user_obj'].sysadmin:
package = toolkit.get_action('package_show')(None, data_dict)
if package.get('doi_id'):
... |
isb-cgc/ISB-CGC-Webapp | refs/heads/master | manage_unit_test.py | 1 | #!/usr/bin/env python
###
# Copyright 2015-2019, Institute for Systems Biology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
lirui-intel/Impala | refs/heads/cdh5-trunk | tests/hs2/hs2_test_suite.py | 16 | # Copyright (c) 2012 Cloudera, 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 o... |
satishgoda/bokeh | refs/heads/master | examples/plotting/server/correlation.py | 45 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import time
from numpy import cumprod, linspace, random
from bokeh.plotting import figure, show, output_server, vplot
num_points = 300
now = time.time()
dt = 24*3600 # days in seconds
dates = linspace(now, now + num_points*dt, ... |
alimanfoo/petl | refs/heads/master | examples/util/vis.py | 4 | from __future__ import division, print_function, absolute_import
# look()
########
import petl as etl
table1 = [['foo', 'bar'],
['a', 1],
['b', 2]]
etl.look(table1)
# alternative formatting styles
etl.look(table1, style='simple')
etl.look(table1, style='minimal')
# any irregularities in the lengt... |
varunnaganathan/django | refs/heads/master | tests/app_loading/tests.py | 54 | from __future__ import unicode_literals
import os
from django.apps import apps
from django.test import SimpleTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
class EggLoadingTest(SimpleTestCase):
def setUp(self):
self.egg_dir = '%s/eggs' % os.path.dirname(upath(... |
navotsil/Open-Knesset | refs/heads/master | video/management/commands/sub_commands/tests/UploadCommitteesVideos.py | 14 | #encoding: utf-8
from django.test import TestCase
from video.management.commands.sub_commands.UploadCommitteesVideos import UploadCommitteesVideos
class UploadCommitteesVideo_test(UploadCommitteesVideos):
def __init__(self,
testCase,allMmsVideos,isVideoAlreadyUploadedReturn,isAlreadyDownloadedReturn,
... |
t1m0thy/django-extensions | refs/heads/master | django_extensions/management/commands/unreferenced_files.py | 26 | import os
from collections import defaultdict
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.db import models
from django.db.models.loading import cache
from django_extensions.management.utils import signalcommand
class Command(NoArgsCommand):
help = "Prints a... |
jianghuaw/nova | refs/heads/master | nova/tests/functional/api_sample_tests/test_floating_ips_bulk.py | 9 | # Copyright 2014 IBM Corp.
#
#
# 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... |
onitake/ansible | refs/heads/devel | lib/ansible/modules/network/protocol/net_lldp.py | 104 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... |
Lochlan/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/rules/gyptest-default.py | 137 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions... |
Belxjander/Kirito | refs/heads/master | Python-3.5.0-main/Lib/multiprocessing/sharedctypes.py | 12 | #
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import ctypes
import weakref
from . import heap
from . import get_context
from .context import assert_spawning
from .... |
asm-products/movie-database-service | refs/heads/master | ani/lib/python2.7/site-packages/markdown/preprocessors.py | 6 | """
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import util
from . import odict
import re
def b... |
drjeep/django | refs/heads/master | tests/utils_tests/test_tree.py | 429 | import copy
import unittest
from django.utils.tree import Node
class NodeTests(unittest.TestCase):
def setUp(self):
self.node1_children = [('a', 1), ('b', 2)]
self.node1 = Node(self.node1_children)
self.node2 = Node()
def test_str(self):
self.assertEqual(str(self.node1), "(DE... |
afloren/nipype | refs/heads/master | nipype/interfaces/fsl/tests/test_epi.py | 14 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from tempfile import mkdtemp
from shutil import rmtree
import numpy as np
import nibabel as nb
from nipype.testing import ( assert_equal, assert_not_equal,
assert_... |
woshilapin/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/compiler-override/my_nm.py | 203 | #!/usr/bin/env python
# Copyright (c) 2014 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 sys
print sys.argv
with open('RAN_MY_NM', 'w') as f:
f.write('RAN_MY_NM')
|
manipopopo/tensorflow | refs/heads/master | tensorflow/python/keras/metrics_test.py | 2 | # 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... |
rwth-ti/gr-ofdm | refs/heads/master | python/ofdm/qa_ls_estimator_straight_slope.py | 1 | #!/usr/bin/env python
#
# Copyright 2014 Institute for Theoretical Information Technology,
# RWTH Aachen University
# www.ti.rwth-aachen.de
#
# This 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 S... |
FRC-Team-3140/north-american-happiness | refs/heads/master | lib/python2.7/site-packages/sqlalchemy/dialects/mssql/information_schema.py | 79 | # mssql/information_schema.py
# Copyright (C) 2005-2014 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
# TODO: should be using the sys. catalog with SQL Server, not information ... |
M4rtinK/anaconda | refs/heads/master | pyanaconda/modules/storage/bootloader/utils.py | 2 | #
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be ... |
kisom/pypcapfile | refs/heads/master | setup.py | 2 | #!/usr/bin/env python
import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='pypcapfile',
version='0.12.1',
description='Pure Python package for reading and parsing libpcap savefiles',
long_description=read('RE... |
vipulroxx/sympy | refs/heads/master | sympy/physics/quantum/tests/test_qasm.py | 121 | from sympy.physics.quantum.qasm import Qasm, prod, flip_index, trim,\
get_index, nonblank, fullsplit, fixcommand, stripquotes, read_qasm
from sympy.physics.quantum.gate import X, Z, H, S, T
from sympy.physics.quantum.gate import CNOT, SWAP, CPHASE, CGate, CGateS
from sympy.physics.quantum.circuitplot import Mz, Cr... |
jmickela/stalkexchange | refs/heads/master | wishlist/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('produce', '0002_gardenitem_owner'),
]... |
nocotan/otus | refs/heads/master | tests/test.py | 1 | # -*- coding: utf-8 -*-
import os
import subprocess
def compile_test(filename):
cmd = "/usr/bin/g++ -std=c++11 {}".format(filename)
if (os.system(cmd) != 0):
print("Compile Error")
result = subprocess.call(cmd.strip().split(" "))
return result
if __name__ == '__main__':
print(compile_... |
Juliusz/ntlmaps | refs/heads/master | ntlmaps/des.py | 11 | # This file is part of 'NTLM Authorization Proxy Server'
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# NTLM APS 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 Licens... |
andydandy74/ClockworkForDynamo | refs/heads/master | nodes/2.x/python/FamilyInstance.ByPointInView.py | 6 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from Revi... |
lm-tools/situational | refs/heads/master | situational/apps/job_discovery/apps.py | 1 | from django.apps import AppConfig
class JobDiscoveryConfig(AppConfig):
name = 'job_discovery'
verbose_name = "Discover jobs"
icon_url = 'images/icons/app-icon-turquoise.png'
start_url_name = "start"
manifest = True
|
ryannathans/micropython | refs/heads/master | tests/basics/builtin_abs_intbig.py | 23 | # test builtin abs
# bignum
print(abs(123456789012345678901234567890))
print(abs(-123456789012345678901234567890))
# edge cases for 32 and 64 bit archs (small int overflow when negating)
print(abs(-0x3fffffff - 1))
print(abs(-0x3fffffffffffffff - 1))
# edge case for nan-boxing with 47-bit small int
i = -0x3fffffffff... |
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.3/django/contrib/localflavor/id/forms.py | 311 | """
ID-specific Form helpers
"""
import re
import time
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
postcode_re = re.compil... |
ToonTownInfiniteRepo/ToontownInfinite | refs/heads/master | otp/friends/FriendSecret.py | 1 | from pandac.PandaModules import *
from direct.gui.DirectGui import *
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import StateData
import string
from otp.otpbase import OTPLocalizer
from otp.otpbase import OTPGlobals
from otp.uberdog import RejectCode
from otp.nametag import NametagGlobals
globalF... |
alephu5/Soundbyte | refs/heads/master | environment/lib/python3.3/site-packages/sympy/matrices/expressions/tests/test_transpose.py | 8 | from sympy.functions import adjoint, conjugate, transpose
from sympy.matrices.expressions import MatrixSymbol, Adjoint, trace, Transpose
from sympy.matrices import eye, Matrix
from sympy import symbols, S, assuming, Q
n, m, l, k, p = symbols('n m l k p', integer=True)
A = MatrixSymbol('A', n, m)
B = MatrixSymbol('B', ... |
srimai/odoo | refs/heads/8.0 | addons/purchase_analytic_plans/__openerp__.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
aer0s/encode-od | refs/heads/master | local/lib/python/yaml/constructor.py | 392 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... |
boostbob/zerorpc-python | refs/heads/master | zerorpc/channel.py | 22 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... |
wcyz666/pep8 | refs/heads/master | testsuite/support.py | 38 | # -*- coding: utf-8 -*-
import os.path
import re
import sys
from pep8 import Checker, BaseReport, StandardReport, readlines
SELFTEST_REGEX = re.compile(r'\b(Okay|[EW]\d{3}):\s(.*)')
ROOT_DIR = os.path.dirname(os.path.dirname(__file__))
class PseudoFile(list):
"""Simplified file interface."""
write = list.ap... |
Milad-Rakhsha/chrono | refs/heads/develop | src/demos/sensor/demo_SEN_HMMWV.py | 4 | # =============================================================================
# PROJECT CHRONO - http://projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distr... |
aifil/odoo | refs/heads/8.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... |
Joergen/olympia | refs/heads/master | apps/search/tests/test_views.py | 13 | # -*- coding: utf-8 -*-
import json
import urlparse
from django.http import QueryDict
from django.test.client import RequestFactory
import mock
import pytest
from jingo.helpers import datetime as datetime_filter
from nose.tools import eq_
from pyquery import PyQuery as pq
from tower import strip_whitespace
import am... |
beni55/glue | refs/heads/master | glue/__init__.py | 6 | __version__ = '0.10.0'
|
grlee77/nipype | refs/heads/master | nipype/interfaces/ants/legacy.py | 9 | ## NOTE: This implementation has been superceeded buy the antsApplyTransform
## implmeentation that more closely follows the strucutre and capabilities
## of the antsApplyTransform program. This implementation is here
## for backwards compatibility.
"""ANTS Apply Transforms interface
Change d... |
certik/dftatom | refs/heads/master | dftatom/tests/test_dftatom.py | 1 | # These tests test the Python interface (that all the types work as expected).
# The accuracy and correctness of the actual solver is tested in the Fortran
# tests.
#
# Another purpose of these tests is to show how to use the Python API.
from dftatom import (mesh_exp, mesh_exp_deriv, solve_radial_eigenproblem,
... |
da1z/intellij-community | refs/heads/master | python/testData/optimizeImports/simple.py | 89 | import sys |
hackebrot/pytest | refs/heads/master | src/_pytest/outcomes.py | 1 | """
exception classes and constants handling test outcomes
as well as functions creating them
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
class OutcomeException(BaseException):
""" OutcomeException and its subclass instances indicate... |
mccorkle/seds-utils | refs/heads/master | Grids.py | 1 | class Grids:
"""All Grid logic, including static (station), ship, and single block."""
def __init__(self, sbc_world_filename):
# grids are in sbs
# import Sbc
# self.sbc = Sbc.Sbc(sbc_world_filename)
pass
def get(self):
print('STUB')
return False
|
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_info.py | 21 | #!/usr/bin/python
# (c) 2018 Piotr Olczak <piotr.olczak@redhat.com>
# (c) 2018-2019, NetApp, 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': '... |
mkolar/pyblish-ftrack | refs/heads/master | setup.py | 2 | """This setup script packages pyblish_ftrack"""
import os
import imp
from setuptools import setup, find_packages
version_file = os.path.abspath("pyblish_ftrack/version.py")
version_mod = imp.load_source("version", version_file)
version = version_mod.version
classifiers = [
"Development Status :: 5 - Productio... |
mstriemer/zamboni | refs/heads/master | mkt/developers/tests/test_forms_payments.py | 14 | from django.test.client import RequestFactory
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import mkt
import mkt.site.tests
from mkt.constants.payments import (PAYMENT_METHOD_ALL, PAYMENT_METHOD_CARD,
PAYMENT_METHOD_OPERATOR)
from mkt.developers imp... |
DARKPOP/external_chromium_org | refs/heads/dark-5.1 | tools/telemetry/telemetry/util/path.py | 45 | # 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.
import os
from telemetry.core import util
# TODO(dtu): Move these functions from core.util to here.
GetBaseDir = util.GetBaseDir
GetTelemetryDir = util.Ge... |
codeforsanjose/trash-pickup-portal | refs/heads/master | data/env/lib/python2.7/site-packages/wheel/test/test_keys.py | 565 | import tempfile
import os.path
import unittest
import json
from wheel.signatures import keys
wheel_json = """
{
"verifiers": [
{
"scope": "+",
"vk": "bp-bjK2fFgtA-8DhKKAAPm9-eAZcX_u03oBv2RlKOBc"
},
{
"scope": "+",
"vk": "KAHZBfyqFW3OcFDbLSG4nPCjXxUPy72phP9I4Rn9MAo"
},
... |
uberamd/NGECore2 | refs/heads/master | scripts/object/static/structure/naboo/nboo_imprv_spill_gate_cap_s01.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/collection/rare_pistol_liquidsilver_l7.py | 85615 | import sys
def setup(core, object):
return |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.