repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
DavidDobr/hacker_rank
refs/heads/master
python_domain/fibonacci.py
1
# [0, 1, 1, 2, 3, 5, 8] def fibonacci(n): final = [0] old = 0 new = 1 if n >= 2: final.append(1) for i in range(n-2): current = old + new final.append(current) old, new = new, current return final n = 15 if __name__ == '__main__': print(fibo...
jimi-c/ansible
refs/heads/devel
test/sanity/code-smell/no-dict-iterkeys.py
82
#!/usr/bin/env python import os import re import sys def main(): skip = set([ 'test/sanity/code-smell/%s' % os.path.basename(__file__), 'lib/ansible/module_utils/six/__init__.py', ]) for path in sys.argv[1:] or sys.stdin.read().splitlines(): if path in skip: continue ...
googleapis/oauth2client
refs/heads/master
tests/test__helpers.py
21
# Copyright 2015 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 ...
h4ck3rm1k3/pacman
refs/heads/master
test/pacman/tests/sync043.py
28
self.description = "Install a sync package conflicting with two local ones" sp = pmpkg("pkg1") sp.conflicts = ["pkg2", "pkg3"] self.addpkg2db("sync", sp); lp1 = pmpkg("pkg2") self.addpkg2db("local", lp1); lp2 = pmpkg("pkg3") self.addpkg2db("local", lp2); self.args = "-S %s --ask=4" % sp.name self.addrule("PACMAN_R...
narusemotoki/memsource-wrap
refs/heads/master
memsource/constants.py
1
import enum class Base(enum.Enum): url = 'https://cloud1.memsource.com/web/api' timeout = 5 class ApiVersion(enum.Enum): v2 = 'v2' v3 = 'v3'
tungvx/deploy
refs/heads/master
.google_appengine/lib/django_1_2/tests/regressiontests/middleware/extra_urls.py
103
from django.conf.urls.defaults import patterns urlpatterns = patterns('', (r'^middleware/customurlconf/noslash$', 'view'), (r'^middleware/customurlconf/slash/$', 'view'), (r'^middleware/customurlconf/needsquoting#/$', 'view'), )
be-cloud-be/horizon-addons
refs/heads/9.0
partner-contact/partner_external_map/__openerp__.py
1
# -*- coding: utf-8 -*- # © 2015 Alexis de Lattre <alexis.delattre@akretion.com> # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Partner External Maps', 'version': '9.0.1.0.0', 'category': 'Extra Tools', 'license': 'AGPL-3',...
vadimtk/chrome4sdp
refs/heads/master
tools/telemetry/third_party/gsutilz/third_party/pyasn1/test/type/__init__.py
3653
# This file is necessary to make this directory a package.
gylian/headphones
refs/heads/master
lib/mako/parsetree.py
15
# mako/parsetree.py # Copyright (C) 2006-2013 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """defines the parse tree components for Mako templates.""" from mako import exceptions, ast, u...
steveb/heat
refs/heads/master
heat/objects/stack.py
2
# Copyright 2014 Intel 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 to in writing, soft...
andreshp/Algorithms
refs/heads/master
Problems/Hackerrank/IndeedPrime/6_knn.py
1
#!/usr/bin/python ####################################################################### # Author: Andrés Herrera Poyatos # Universidad de Granada, June, 2015 # Indeed Prime Challengue # Problem 6 ######################################################################## import numpy import math from sklearn import ne...
wofanli/trex-core
refs/heads/master
scripts/external_libs/zmq/green/eventloop/zmqstream.py
50
from zmq.eventloop.zmqstream import * from zmq.green.eventloop.ioloop import IOLoop RealZMQStream = ZMQStream class ZMQStream(RealZMQStream): def __init__(self, socket, io_loop=None): io_loop = io_loop or IOLoop.instance() super(ZMQStream, self).__init__(socket, io_loop=io_loop)
theo-l/django
refs/heads/master
django/db/models/fields/__init__.py
4
import collections.abc import copy import datetime import decimal import operator import uuid import warnings from base64 import b64decode, b64encode from functools import partialmethod, total_ordering from django import forms from django.apps import apps from django.conf import settings from django.core import checks...
drwyrm/Flexget
refs/heads/develop
flexget/plugins/parsers/parser_guessit.py
1
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import native import datetime import logging import re import time from guessit.rules import rebulk_builder from guessit.api import GuessItApi, GuessitEx...
FlorianLudwig/odoo
refs/heads/8.0
addons/account/report/account_partner_ledger.py
236
# -*- 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...
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/components/input_select/__init__.py
3
"""Support to select an option from a list.""" from __future__ import annotations import logging import voluptuous as vol from homeassistant.const import ( ATTR_EDITABLE, ATTR_OPTION, CONF_ICON, CONF_ID, CONF_NAME, SERVICE_RELOAD, ) from homeassistant.core import HomeAssistant, callback from ...
jorjun/django-mailchimp
refs/heads/master
mailchimp/management/commands/mcdequeue.py
20
from django.core.management import BaseCommand from mailchimp.utils import dequeue from optparse import make_option class Command(BaseCommand): def handle(self, *args, **options): if len(args) and args[0].isdigit(): limit = int(args[0]) else: limit = None print...
dlazz/ansible
refs/heads/devel
test/units/module_utils/test_text.py
111
# -*- coding: utf-8 -*- # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type import ite...
skg-net/ansible
refs/heads/devel
test/units/modules/network/radware/test_vdirect_file.py
32
# -*- coding: utf-8 -*- # # Copyright 2017 Radware LTD. # # 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 l...
jschueller/numpy
refs/heads/master
numpy/doc/glossary.py
70
""" ======== Glossary ======== .. glossary:: along an axis Axes are defined for arrays with more than one dimension. A 2-dimensional array has two corresponding axes: the first running vertically downwards across rows (axis 0), and the second running horizontally across columns (axis 1...
avneesh91/django
refs/heads/master
tests/test_discovery_sample/doctests.py
471
""" Doctest example from the official Python documentation. https://docs.python.org/3/library/doctest.html """ def factorial(n): """Return the factorial of n, an exact integer >= 0. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) # doctest: +ELLIPSIS 2652528598121910...
lafayette/JBTT
refs/heads/master
framework/python/Lib/site-packages/pyreadline/keysyms/__init__.py
10
import sys success=False in_ironpython="IronPython" in sys.version if in_ironpython: try: from ironpython_keysyms import * success=True except ImportError,x: raise else: try: from keysyms import * success=True except ImportError,x: pass if not succe...
srcLurker/home-assistant
refs/heads/dev
homeassistant/components/switch/flux.py
2
""" Flux for Home-Assistant. The idea was taken from https://github.com/KpaBap/hue-flux/ For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch.flux/ """ from datetime import time import logging import voluptuous as vol from homeassistant.components.li...
youdonghai/intellij-community
refs/heads/master
python/testData/refactoring/inlinelocal/operatorPrecedence/matrixMultiplication.after.py
79
(y @ z)[::-5] (y @ z)[5] (y @ z)(5) (y @ z).foo -(y @ z) +(y @ z) ~(y @ z) 5 ** (y @ z) (y @ z) ** 5 5 * y @ z y @ z * 5 5 / (y @ z) y @ z / 5 5 // (y @ z) y @ z // 5 5 + y @ z y @ z + 5 y @ z - 5 5 - y @ z 5 >> y @ z y @ z << 5 5 & y @ z y @ z & 5 5 ^ y @ z y @ z ^ 5 5 | y @ z y @ z | 5 () in y @ z y @ z i...
google-research/google-research
refs/heads/master
learn_to_infer/plotting.py
1
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
ENCODE-DCC/dna-me-pipeline
refs/heads/master
dnanexus/older/extract/resources/usr/bin/cxrepo-bed.py
5
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 Junko Tsuji # This script generates bed files as final outputs of # DNA methylation pipeline by taking a CX_report file # generated from bismark_methylation_extractor. from optparse import OptionParser import sys, os.path, string # RGB strings and inte...
rinodung/ufw-uncomplicated-firewall
refs/heads/master
tests/unit/test_skeleton.py
1
# # Copyright 2012 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; wit...
vmindru/ansible
refs/heads/devel
lib/ansible/modules/storage/purestorage/purefb_ds.py
6
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
deadscivey/mockthink
refs/heads/master
mockthink/test/functional/test_indexes.py
2
import rethinkdb as r from mockthink.test.common import as_db_and_table, assertEqUnordered, assertEqual from mockthink.test.functional.common import MockTest from pprint import pprint class TestIndexes(MockTest): @staticmethod def get_data(): data = [ {'id': 'bob', 'first_name': 'Bob', 'las...
python-control/python-control
refs/heads/master
control/nichols.py
2
"""nichols.py Functions for plotting Black-Nichols charts. Routines in this module: nichols.nichols_plot aliased as nichols.nichols nichols.nichols_grid """ # nichols.py - Nichols plot # # Contributed by Allan McInnes <Allan.McInnes@canterbury.ac.nz> # # This file contains some standard control system plots: Bode p...
kflavin/cobbler
refs/heads/master
cobbler/cobblerd.py
15
""" cobbler daemon for logging remote syslog traffic during automatic installation Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 So...
Team-Huawei/android_kernel_huawei_msm8909
refs/heads/cm-14.1
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...
numba/numba
refs/heads/master
numba/tests/test_copy_propagate.py
4
# # Copyright (c) 2017 Intel Corporation # SPDX-License-Identifier: BSD-2-Clause # from numba import jit, njit from numba.core import types, typing, ir, config, compiler, cpu from numba.core.registry import cpu_target from numba.core.annotations import type_annotations from numba.core.ir_utils import (copy_propagate, ...
google/makani
refs/heads/master
avionics/firmware/monitors/generate_ltc2309_monitor.py
1
# Copyright 2020 Makani Technologies 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...
ronaldahmed/labor-market-demand-analysis
refs/heads/master
rule based major_extractor/nlp scripts/tuple2json.py
2
''' Created on Apr 21, 2014 @author: ronald ''' import math from counter import * LOG = 'logaritmic' SQRT = 'sqrt' TRUNC = 'truncation' def makeJSON(NG): """ input: (str) formato: lista de {name:ngram,size:score} output: string en formato json descrip: construye dict tipo json """ json...
felliott/waterbutler
refs/heads/develop
tasks.py
2
import os import sys from invoke import task WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE') @task def wheelhouse(ctx, develop=False, pty=True): req_file = 'dev-requirements.txt' if develop else 'requirements.txt' cmd = 'pip wheel --find-links={} -r {} --wheel-dir={}'.format(WHEELHOUSE_PATH, req_file, ...
techdragon/django
refs/heads/master
django/forms/forms.py
36
""" Form classes """ from __future__ import unicode_literals import copy from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError # BoundField is imported for backwards compatibility in Django 1.9 from django.forms.boundfield import BoundField # NOQA from django.forms...
eric-dowty/JavaScript-2048
refs/heads/master
node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/flock_tool.py
604
#!/usr/bin/env python # Copyright (c) 2011 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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mikebenfield/scipy
refs/heads/master
scipy/linalg/tests/test_procrustes.py
111
from itertools import product, permutations import numpy as np from numpy.testing import assert_array_less, assert_allclose, assert_raises from scipy.linalg import inv, eigh, norm from scipy.linalg import orthogonal_procrustes def test_orthogonal_procrustes_ndim_too_large(): np.random.seed(1234) A = np.rand...
Pike/elmo
refs/heads/master
apps/elmo_commons/tests/test_bleach.py
2
# 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/. """tests for bleach filter""" from __future__ import absolute_import from __future__ import unicode_literals from djang...
jaruba/chromium.src
refs/heads/nw12
tools/perf/page_sets/page_cycler/dom.py
20
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class DomPage(page_module.Page): def __init__(self,...
dpac-vlsi/SynchroTrace
refs/heads/master
src/arch/x86/isa/insts/simd128/integer/data_transfer/move_non_temporal.py
88
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
seanli9jan/tensorflow
refs/heads/master
tensorflow/python/saved_model/builder_impl.py
3
# 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...
kmonsoor/python-for-android
refs/heads/master
python-modules/twisted/twisted/words/service.py
53
# -*- test-case-name: twisted.words.test.test_service -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ A module that needs a better name. Implements new cred things for words. How does this thing work? - Network connection on some port expecting to speak some protocol -...
tomannerino/PyHangman
refs/heads/develop
venv/lib/python2.7/site-packages/pip/_vendor/progress/bar.py
404
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
mdhaber/scipy
refs/heads/master
scipy/io/mmio.py
8
""" Matrix Market I/O in Python. See http://math.nist.gov/MatrixMarket/formats.html for information about the Matrix Market format. """ # # Author: Pearu Peterson <pearu@cens.ioc.ee> # Created: October, 2004 # # References: # http://math.nist.gov/MatrixMarket/ # import os import sys from numpy import (asarray, ...
scdls/Arduino
refs/heads/scdls-ano
arduino-core/src/processing/app/i18n/python/requests/packages/charade/codingstatemachine.py
2930
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
tigerbunny/bitmessage
refs/heads/json_tab
src/shared.py
1
softwareVersion = '0.4.1' verbose = 1 maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 # Equals two days and 12 hours. lengthOfTimeToLeaveObjectsInInventory = 237600 # Equals two days and 18 hours. This should be longer than maximumAgeOfAnObjectThatIAmWillingToAccept so that we don't process messages twice. lengthO...
thaJeztah/compose
refs/heads/master
tests/__init__.py
3
import unittest # NOQA from unittest import mock # NOQA
atuljain/odoo
refs/heads/master
addons/mrp_repair/__openerp__.py
65
# -*- 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...
FluxIX/pyShellScript
refs/heads/master
src/pyshell/internal_command.py
1
from .command import Command class InternalCommand( Command ): def __init__( self, moniker, parameters = None, *options, **kwargs ): Command.__init__( self, moniker, parameters, *options, **kwargs )
karlgluck/heroes-of-the-storm-replay-parser
refs/heads/master
s2protocol/protocol28667.py
21
# Copyright (c) 2013 Blizzard Entertainment # # 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...
vipmike007/virt-test
refs/heads/master
samples/service.py
15
""" Simple service handling test Please put the configuration file service.cfg into $tests/cfg/ directory. :difficulty: advanced :copyright: 2014 Red Hat Inc. """ import logging import time from autotest.client import utils from autotest.client.shared import error from autotest.client.shared.service import SpecificS...
grogg/v10_kernel_mm
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
dakrauth/django-swingtime
refs/heads/master
swingtime/views.py
1
import calendar import itertools import logging from datetime import datetime, timedelta, time from dateutil import parser from django import http from django.db import models from django.template.context import RequestContext from django.shortcuts import get_object_or_404, render from .models import Event, Occurrence...
FireballDWF/cloud-custodian
refs/heads/master
tools/c7n_sentry/c7n_sentry/c7nsentry.py
5
# Copyright 2016-2017 Capital One Services, 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 ...
dstaple/z3test
refs/heads/master
old-regressions/python/bug5.py
3
# Copyright (c) 2015 Microsoft Corporation from z3 import * x, y, z = Reals('x y z') print x*y - y**2 + z**2 print x*y + y**2 - z**2 print (x + y)*z set_html_mode() print x*y - y**2 + z print x*y + y**2 - z**2
trunca/enigma2
refs/heads/6.5
lib/python/Components/opkg.py
20
import os from boxbranding import getImageVersion def enumFeeds(): for fn in os.listdir('/etc/opkg'): if fn.endswith('-feed.conf'): file = open(os.path.join('/etc/opkg', fn)) feedfile = file.readlines() file.close() try: for feed in feedfile: yield feed.split()[1] except IndexError: pass...
kaixinjxq/web-testing-service
refs/heads/master
wts/tests/csp/csp_default-src_self_object_blocked-manual.py
30
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) response.headers.set("Content-Security-Policy", "default-src 'self'") response.headers.set("X...
jtpereyda/PyCRC
refs/heads/master
PyCRC/CRC32.py
1
# -*- coding: utf8 -*- # # CRC32 MODULE # from ctypes import c_ulong class CRC32(object): crc32_tab = [] # The CRC's are computed using polynomials. Here is the most used # coefficient for CRC32 crc32_constant = 0xEDB88320 def __init__(self): # initialize the precalculated tables ...
ecohealthalliance/EpiTator
refs/heads/master
epitator/metaspan.py
1
from .annospan import AnnoSpan, SpanGroup from .utils import flatten, merge_dicts class MetaSpan(AnnoSpan): def __init__(self, span=None, start=None, end=None, doc=None, metadata={}): if span is None: self.start = start self.end = end self.doc = doc elif isinsta...
2ndy/RaspIM
refs/heads/master
usr/lib/python2.6/encodings/euc_jp.py
816
# # euc_jp.py: Python Unicode Codec for EUC_JP # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jp') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
srluge/SickRage
refs/heads/master
lib/github/GitTreeElement.py
74
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
citrix-openstack-build/python-neutronclient
refs/heads/master
neutronclient/neutron/v2_0/fw/__init__.py
23
# Copyright 2013 OpenStack LLC. # 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...
ljishen/kividry
refs/heads/master
experiments/benchmarking/stress-ng/third/check_duplicate.py
1
#!/usr/bin/env python # This script is used to check if the json results produced by stress-ng has duplicated stress tests. import sys import pandas as pd if len(sys.argv) != 2: print("Usage: ./check_duplicate.py <json file>") sys.exit() df = pd.read_json(sys.argv[1]) stress_names = [] s = df['name'].str.r...
0jpq0/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/__init__.py
1849
from __future__ import absolute_import from . import urllib3
TheCodeInside/NumberMunchersXO
refs/heads/master
Source/game.py
1
import pygame, sys from fraction import * from gamestatemanager import * from input import xo_input from pygame.locals import * from exit import exit_game import os from Gamestates.mainscreen import MainScreen from Gamestates.gamescreen import GameScreen from Gamestates.instructionsscreen import InstructionsScreen fro...
eerwitt/tensorflow
refs/heads/master
tensorflow/contrib/quantization/python/nn_ops.py
179
# 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...
difcareer/Krakatau
refs/heads/master
Krakatau/java/javamethod.py
2
import collections import operator from functools import partial from ..ssa import objtypes from .. import graph_util from ..namegen import NameGen from ..verifier.descriptors import parseMethodDescriptor from . import ast, ast2, boolize from . import graphproxy, structuring, astgen, mergevariables class DeclInfo(ob...
franciscodominguezmateos/DeepLearningNanoDegree
refs/heads/master
language-translation/helper.py
17
import os import pickle import copy import numpy as np CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 } def load_data(path): """ Load Dataset from File """ input_file = os.path.join(path) with open(input_file, 'r', encoding='utf-8') as f: data = f.read() return data def pr...
ntuecon/server
refs/heads/master
pyenv/Lib/site-packages/twisted/conch/openssh_compat/factory.py
15
# -*- test-case-name: twisted.conch.test.test_openssh_compat -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Factory for reading openssh configuration files: public keys, private keys, and moduli file. """ import os, errno from twisted.python import log from twisted.python.util import...
baffolobill/django-lfs
refs/heads/master
lfs/core/settings.py
6
# coding: utf-8 from django.utils.translation import gettext_lazy as _ from django.conf import settings ACTION_PLACE_TABS = 1 ACTION_PLACE_FOOTER = 2 ACTION_PLACE_CHOICES = [ (ACTION_PLACE_TABS, _(u"Tabs")), (ACTION_PLACE_FOOTER, _(u"Footer")), ] POSTAL_ADDRESS_L10N = getattr(settings, 'POSTAL_ADDRESS_L10N',...
hirofumi0810/tensorflow_end2end_speech_recognition
refs/heads/master
models/recurrent/tests/test_tf_qrnn_work.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import time import functools import numpy as np from sklearn.datasets import load_digits from sklearn.metrics import accuracy_score import tensorflow as tf from tensorflow.python.ops import rnn, rnn_cell import unittest sys.path.append(os.pardir) fro...
djw8605/condor
refs/heads/add-force
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/Languages/cs.py
10
apiAttachAvailable = u'API je k dispozici' apiAttachNotAvailable = u'Nedostupn\xfd' apiAttachPendingAuthorization = u'Nevyr\xedzen\xe1 autorizace' apiAttachRefused = u'Odm\xedtnuto' apiAttachSuccess = u'\xdaspech' apiAttachUnknown = u'Nezn\xe1m\xfd' budDeletedFriend = u'Odstranen ze seznamu pr\xe1tel' budFriend ...
javachengwc/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/tablespaces/tests.py
119
from __future__ import absolute_import import copy from django.conf import settings from django.db import connection from django.db import models from django.db.models.loading import cache from django.core.management.color import no_style from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from ....
ka7eh/django-oscar
refs/heads/master
src/oscar/apps/checkout/calculators.py
60
from oscar.core import prices class OrderTotalCalculator(object): """ Calculator class for calculating the order total. """ def __init__(self, request=None): # We store a reference to the request as the total may # depend on the user or the other checkout data in the session. ...
chdecultot/erpnext
refs/heads/develop
erpnext/patches/v8_5/remove_quotations_route_in_sidebar.py
34
# Copyright (c) 2017, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doctype("Portal Settings") frappe.db.sql(""" delete from `tabPortal Menu Item` where (route = '/quotations' and title ...
globocom/database-as-a-service
refs/heads/master
dbaas/account/migrations/0005_split_name.py
1
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Team.email' db.alter_column(u'account_team', 'email', self.gf( 'django.db.mod...
hacklabr/timtec
refs/heads/paralapraca
ifs/migrations/0001_initial.py
4
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import core.utils import re import django.contrib.auth.models import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require...
ofanoyi/scrapy
refs/heads/master
scrapy/tests/test_downloader_handlers.py
7
import os import twisted from twisted.trial import unittest from twisted.protocols.policies import WrappingFactory from twisted.python.filepath import FilePath from twisted.internet import reactor, defer, error from twisted.web import server, static, util, resource from twisted.web.test.test_webclient import ForeverTa...
jeanlinux/calibre
refs/heads/master
src/calibre/gui2/store/stores/amazon_uk_plugin.py
6
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) store_version = 8 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import re from contextlib import ...
BassantMorsi/finderApp
refs/heads/master
lib/python2.7/site-packages/django/contrib/messages/__init__.py
741
from django.contrib.messages.api import * # NOQA from django.contrib.messages.constants import * # NOQA default_app_config = 'django.contrib.messages.apps.MessagesConfig'
hellfish2/treeio
refs/heads/master
documents/files.py
6
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Custom storage for Documents to allow dynamic MEDIA_ROOT paths """ from django.core.files.storage import FileSystemStorage from django.core.exceptions import SuspiciousOperation from django.utils._os imp...
ckirby/django
refs/heads/master
tests/apps/default_config_app/__init__.py
553
default_app_config = 'apps.default_config_app.apps.CustomConfig'
aerickson/python-rtmbot
refs/heads/master
rtmbot/__init__.py
6
from .core import * # noqa: F403, F401
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/curses/wrapper.py
204
"""curses.wrapper Contains one function, wrapper(), which runs another function which should be the rest of your curses-based application. If the application raises an exception, wrapper() will restore the terminal to a sane state so you can read the resulting traceback. """ import curses def wrapper(func, *args, ...
gsmartway/odoo
refs/heads/8.0
addons/hr_attendance/report/attendance_errors.py
377
# -*- 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...
hynnet/openwrt-mt7620
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/encodings/cp949.py
816
# # cp949.py: Python Unicode Codec for CP949 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('cp949') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrement...
taotie12010/bigfour
refs/heads/master
cms/djangoapps/contentstore/views/certificates.py
17
""" Certificates Data Model: course.certificates: { 'certificates': [ { 'version': 1, // data contract version 'id': 12345, // autogenerated identifier 'name': 'Certificate 1', 'description': 'Certificate 1 Description', 'course_title': 'course ti...
gspeedtech/Audacity-2
refs/heads/master
lib-src/lv2/lv2/plugins/eg-metro.lv2/waflib/extras/__init__.py
1037
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
frank10704/DF_GCS_W
refs/heads/master
MissionPlanner-master/packages/IronPython.StdLib.2.7.5-beta1/content/Lib/string.py
55
"""A collection of string operations (most are no longer used). Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop...
yufengg/tensorflow
refs/heads/master
tensorflow/contrib/linalg/python/kernel_tests/linear_operator_full_matrix_test.py
41
# 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...
joariasl/odoo
refs/heads/8.0
addons/web_tests/__init__.py
385
# -*- coding: utf-8 -*- import tests
ocampocj/cloud-custodian
refs/heads/master
c7n/resources/gamelift.py
5
# Copyright 2016-2017 Capital One Services, 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 ...
penhoi/linux-3.13.11
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
Zhongqilong/mykbengineer
refs/heads/master
kbe/src/lib/python/Lib/encodings/iso8859_16.py
272
""" Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
maciek263/django2
refs/heads/master
myvenv/Lib/site-packages/django/contrib/gis/db/backends/oracle/features.py
212
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures from django.db.backends.oracle.features import \ DatabaseFeatures as OracleDatabaseFeatures class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures): supports_add_srs_entry = False supports_geometry_field_introspection...
crakensio/django_training
refs/heads/master
lib/python2.7/site-packages/pygments/styles/native.py
364
# -*- coding: utf-8 -*- """ pygments.styles.native ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "native" vim theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
andbet050197/IS773UTP
refs/heads/master
modulo5/SW.py
1
import serial import numpy as np import stl, math from stl import mesh import matplotlib.pyplot as plt from scipy.spatial import ConvexHull obj = mesh.Mesh.from_file('star.stl') points = set() for p in obj.points: if (p[2] and p[5] and p[8]) <= 0: points.add((p[0],p[1])) points.add((p[3],p[4])) ...
caoning1985/blackpearl
refs/heads/master
src/strategy_py/google/protobuf/internal/descriptor_pool_test1_pb2.py
43
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/descriptor_pool_test1.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goog...