repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
sztena/DG08_android4.2
refs/heads/master
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (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, sys sys.path.append(os.env...
cjhak/b2share
refs/heads/master
invenio/modules/search/fixtures.py
6
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your optio...
dkellner/cerberus
refs/heads/master
cerberus/tests/test_validation.py
1
# -*- coding: utf-8 -*- import re import sys from datetime import datetime, date from random import choice from string import ascii_lowercase from pytest import mark from cerberus import errors, Validator from cerberus.tests import \ (assert_bad_type, assert_fail, assert_has_error, assert_not_has_error, ass...
yeraydiazdiaz/nonrel-blog
refs/heads/master
django/contrib/gis/geos/coordseq.py
411
""" This module houses the GEOSCoordSeq object, which is used internally by GEOSGeometry to house the actual coordinates of the Point, LineString, and LinearRing geometries. """ from ctypes import c_double, c_uint, byref from django.contrib.gis.geos.base import GEOSBase, numpy from django.contrib.gis.geos.error impo...
LLNL/spack
refs/heads/develop
var/spack/repos/builtin/packages/r-matrixstats/package.py
5
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RMatrixstats(RPackage): """High-performing functions operating on rows and columns of matr...
Suwmlee/XX-Net
refs/heads/python3
Python3/lib/_pyio.py
3
""" Python implementation of the io module. """ import os import abc import codecs import errno import array import stat import sys # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock if ...
acalzada/kosmopolis2015
refs/heads/master
applyBlacklist.py
1
""" usage: [dictOut] = applyBlacklist(dictIn,blacklist_file) This function reads the words in clacklist_file and sets the counter to 0 in the dictionary. """ def applyBlacklist(dictIn,blacklist_file): fileHandler = open(blacklist_file); for word in fileHandler: word = word.rstrip('\n'); word = word.rstrip('\r...
openthread/openthread
refs/heads/main
tests/scripts/thread-cert/common.py
7
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
suninsky/ReceiptOCR
refs/heads/master
Python/server/lib/python2.7/site-packages/pip/exceptions.py
280
"""Exceptions used throughout package""" from __future__ import absolute_import class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class ...
unifieddigitalmedia/sinopia_inn-M.E.A.N_stack
refs/heads/master
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
#!/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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
40223114/0519
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/dummy.py
1061
# Empty module for testing the loading of modules
TobbeTripitaka/src
refs/heads/master
user/ediazp/MnpyConv.py
5
#!/usr/bin/env python ''' Implements conv(a,b) along the fast axis a [file] : is taken from stdin b [file] : is taken from "flt" Requires both files to have the same sampling interval mode [string]: 'full': returns an M+N-1 array, boundary effects are visible. 'same': returns a max(M,N) array, boundary effects are...
analurandis/Tur
refs/heads/master
backend/venv/Lib/site-packages/paste/errordocument.py
14
# (c) 2005-2006 James Gardner <james@pythonweb.org> # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Middleware to display error documents for certain status codes The middleware in this module can be used to intercept res...
duskCoder/am335x-kernel
refs/heads/3-10-usb
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
adamantike/salud-api
refs/heads/master
tests/test_gender.py
3
# -*- coding: utf-8 -*- import json from nose.tools import * import unittest from app import app, db from app.mod_profiles.models import Gender class GenderModelTestCase(unittest.TestCase): # Preparación del entorno para la ejecución de los tests. def setUp(self): self.app = app ...
dsanders11/mezzanine
refs/heads/master
mezzanine/conf/models.py
56
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from mezzanine.core.models import SiteRelated @python_2_unicode_compatible class Setting(SiteRelated): """ Stores values ...
sporksmith/polygraph
refs/heads/master
polygraph/util/pysubseq.py
2
# Polygraph (release 0.1) # Signature generation algorithms for polymorphic worms # # Copyright (c) 2004-2005, Intel Corporation # All Rights Reserved # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY ...
GreenRecycleBin/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/_base.py
652
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
ioshchepkov/pygeoid
refs/heads/master
pygeoid/reduction/topography.py
1
"""Topographic reduction in gravity and geoid modelling""" import numpy as np import astropy.units as u from pygeoid.constants import _2piG @u.quantity_input def bouguer_plate(height: u.m, density: u.kg / u.m**3 = 2670 * u.kg / u.m**3) -> u.mGal: r"""Return an attraction of an infinite Bouguer...
VentureROM-L/android_kernel_moto_shamu
refs/heads/lollipop
scripts/gcc-wrapper.py
264
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
harshilasu/LinkurApp
refs/heads/master
y/google-cloud-sdk/.install/.backup/lib/yaml/cyaml.py
125
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
antoniov/tools
refs/heads/master
clodoo/docs/conf.py
4
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation on 2019-11-11 07:48:10 # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ----------------------------------------------...
VigoTech/reto
refs/heads/master
201705/peque/biggest_set.py
2
#!/usr/bin/env python3 from contextlib import contextmanager import time from main import has_subset_sum_zero class Duration: def __init__(self, elapsed=None): self.elapsed = elapsed @contextmanager def timeit(): duration = Duration() tic = time.time() yield duration elapsed = time.time...
blacktear23/django
refs/heads/master
tests/regressiontests/urlpatterns_reverse/included_urls2.py
109
""" These URL patterns are included in two different ways in the main urls.py, with an extra argument present in one case. Thus, there are two different ways for each name to resolve and Django must distinguish the possibilities based on the argument list. """ from django.conf.urls.defaults import * from views import ...
miguelfervi/SSBW-Restaurantes
refs/heads/master
restaurantes/lib/python2.7/site-packages/django/core/mail/backends/filebased.py
558
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import \ EmailBackend as ConsoleEmailBackend from django.utils import six class EmailBackend(ConsoleEmailB...
PPCDroid/external-gtest
refs/heads/master
test/gtest_env_var_test.py
27
#!/usr/bin/env python # # Copyright 2008, 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...
rhndg/openedx
refs/heads/master
common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py
114
# -*- 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): # Adding model 'UserSignupSource' db.create_table('student_usersignupsource', ( ('id', self.gf('...
tttthemanCorp/CardmeleonAppEngine
refs/heads/master
django/contrib/gis/db/models/aggregates.py
512
from django.db.models import Aggregate from django.contrib.gis.db.models.sql import GeomField class Collect(Aggregate): name = 'Collect' class Extent(Aggregate): name = 'Extent' class Extent3D(Aggregate): name = 'Extent3D' class MakeLine(Aggregate): name = 'MakeLine' class Union(Aggregate): nam...
dendisuhubdy/diffusion-mri
refs/heads/master
Python/src/utils.py
2
#!/usr/bin/env python #coding=utf-8 import math import numpy import array import scipy.special import scipy.optimize import spherical_harmonics class Error(Exception): """Base class for exceptions in this module.""" pass class InputError(Error): """Exception raised for errors in the input. Attribute...
iismd17/scikit-learn
refs/heads/master
sklearn/ensemble/gradient_boosting.py
50
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
LettError/glyphNameFormatter
refs/heads/master
Lib/glyphNameFormatter/rangeProcessors/ethiopic.py
1
def process(self): pass self.edit("ETHIOPIC") self.edit("SYLLABLE") self.edit("GLOTTAL", "glottal") self.processAs("Helper Digit Names") self.edit("NUMBER") self.edit("DIGIT") self.edit("COMBINING", "cmb") self.lower() self.compress() self.scriptPrefix() if __name__ == "__m...
dannyperry571/theapprentice
refs/heads/master
script.module.liveresolver/lib/liveresolver/resolvers/turbocast.py
12
# -*- coding: utf-8 -*- import re,urllib,urlparse,base64 from liveresolver.modules import client def resolve(url): try: try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer= url result = client.request(url, referer=...
angelman/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/model/workitems_unittest.py
125
# 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 ...
chinfeng/gumpy
refs/heads/master
huacaya/auth/exception.py
1
# -*- coding: utf-8 -*- __author__ = 'chinfeng' class RegisterError(Exception): pass class InvalidTokenError(Exception): pass class AuthorizationError(Exception): pass
slohse/ansible
refs/heads/devel
test/integration/targets/async_fail/action_plugins/normal.py
152
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
liangz0707/scikit-learn
refs/heads/master
sklearn/covariance/tests/test_robust_covariance.py
213
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_alm...
chrismeyersfsu/ansible
refs/heads/devel
test/units/playbook/test_taggable.py
293
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
sysadminmatmoz/odoo-clearcorp
refs/heads/8.0
cash_budget/wizard/cash_budget_import_catalog.py
1
# -*- coding: utf-8 -*- # © 2016 ClearCorp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import errno from openerp.osv import osv, fields from openerp.tools.translate import _ import base64 import logging class cash_budget_import_catalog(osv.osv_memory): _name = 'cash.budget.import.catalog...
Mlieou/lXXtcode
refs/heads/master
leetcode/python/ex_280.py
3
class Solution(object): def wiggleSort(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ nums.sort() for i in xrange(1, len(nums) - 1, 2): nums[i], nums[i+1] = nums[i+1], nums[i]
daicang/Leetcode-solutions
refs/heads/master
150-evaluate-reverse-polish-notation.py
1
from typing import List class Solution: def evalRPN(self, tokens: List[str]) -> int: stack = [] for token in tokens: # print(stack) if token.isnumeric() or token[1:].isnumeric(): stack.append(int(token)) else: n1 = stack.pop() ...
lowtalker/splunk-sdk-python
refs/heads/master
sitecustomize.py
2
#!/usr/bin/env python # # Copyright 2011-2014 Splunk, 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...
ryannathans/micropython
refs/heads/master
tests/basics/bytes_compare3.py
57
# Based on MicroPython config option, comparison of str and bytes # or vice versa may issue a runtime warning. On CPython, if run as # "python3 -b", only comparison of str to bytes issues a warning, # not the other way around (while exactly comparison of bytes to # str would be the most common error, as in sock.recv(3)...
SwordGO/SwordGO_app
refs/heads/master
example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py
152
from __future__ import absolute_import from contextlib import contextmanager import zlib import io from socket import timeout as SocketTimeout from socket import error as SocketError from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ...
jasonwaters/media-organizer
refs/heads/master
local_settings.template.py
1
DOWNLOAD_FOLDER = "/path/to/downloads" TV_FOLDER = "/path/to/tvshows" MOVIE_FOLDER = "/path/to/movies" TRASH_FOLDER = "/path/to/trashcan" TRANSMISSION_HOST = "localhost" TRANSMISSION_PORT = 9091 TRANSMISSION_USER = "" TRANSMISSION_PASSWORD = ""
creker/thrift
refs/heads/master
test/features/local_thrift/__init__.py
43
# # 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 u...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/recoveryservices/azure-mgmt-recoveryservices/setup.py
1
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
annatisch/autorest
refs/heads/master
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/SubscriptionIdApiVersion/microsoftazuretesturl/__init__.py
25
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
n-west/gnuradio
refs/heads/maint
gr-zeromq/python/zeromq/rpc_manager.py
25
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio. # # 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 Software Foundation; either version 3, or (at your option) # any later version. # # Thi...
yaroslavprogrammer/django
refs/heads/master
tests/indexes/tests.py
61
from django.core.management.color import no_style from django.db import connections, DEFAULT_DB_ALIAS from django.test import TestCase from django.utils.unittest import skipUnless from .models import Article class IndexesTests(TestCase): def test_index_together(self): connection = connections[DEFAULT_DB_...
fourtriple/bt-dist
refs/heads/master
Adafruit_Python_BluefruitLE/Adafruit_BluefruitLE/bluez_dbus/adapter.py
2
# Python object to represent the bluez DBus adapter object. Provides properties # and functions to easily interact with the DBus object. # Author: Tony DiCola # # Copyright (c) 2015 Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated do...
meetshah1995/pytorch-semseg
refs/heads/master
ptsemseg/models/utils.py
1
import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from torch.autograd import Variable class conv2DBatchNorm(nn.Module): def __init__( self, in_channels, n_filters, k_size, stride, padding, bias=True, dilation=1, ...
AndrewPeelMV/Blender2.78c
refs/heads/master
2.78/scripts/addons/space_view3d_pie_menus/pie_proportional_menu.py
2
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your option) any later version. # # This program is distrib...
don-systems/management-system
refs/heads/10.0
mgmtsystem_nonconformity/models/__init__.py
1
# -*- coding: utf-8 -*- # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ( mgmtsystem_nonconformity_stage, mgmtsystem_nonconformity_cause, mgmtsystem_nonconformity_origin, mgmtsystem_nonconformity...
FloatingGuy/sslyze
refs/heads/master
plugins/PluginHeartbleed.py
3
#!/usr/bin/env python #------------------------------------------------------------------------------- # Name: PluginHeartbleed.py # Purpose: Tests the target server for CVE-2014-0160. # # Author: alban # # Copyright: 2014 SSLyze developers # # SSLyze is free software: you can redistribute it an...
Seagate/swift
refs/heads/master
test/unit/proxy/test_server.py
6
# -*- coding: utf-8 -*- # Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
teoliphant/scipy
refs/heads/master
scipy/weave/bytecodecompiler.py
3
#**************************************************************************# #* FILE ************** bytecodecompiler.py ************************# #************************************************************************ **# #* Author: Patrick Miller February 9 2002 *# #* Copyrigh...
adityaduggal/erpnext
refs/heads/develop
erpnext/setup/setup_wizard/operations/default_website.py
38
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import nowdate class website_maker(object): def __init__(self, args): self.args = args self....
zapier/evernote-sdk-python-old
refs/heads/master
lib/thrift/transport/httpslib.py
2
''' Replacement of HTTPS client from standart httplib module workaround of ssl bug: https://bugs.launchpad.net/ubuntu/source/openssl/bug/965371 Copyright (C) http://docs.python.org/license.html Marat Khayrullin <xmm.dev@gmail.com> ''' import httplib import socket try: import ssl except ImportError: pass else...
SteveHNH/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_user_group.py
19
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module 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...
filipenf/ansible
refs/heads/devel
lib/ansible/errors/yaml_strings.py
264
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
TESScience/httm
refs/heads/master
httm/transformations/constants.py
1
# HTTM: A transformation library for RAW and Electron Flux TESS Images # Copyright (C) 2016, 2017 John Doty and Matthew Wampler-Doty of Noqsi Aerospace, Ltd. # # 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 Softwa...
cwisecarver/osf.io
refs/heads/develop
admin/meetings/serializers.py
16
from osf.models.conference import DEFAULT_FIELD_NAMES def serialize_meeting(meeting): is_meeting = True if hasattr(meeting, 'is_meeting') and meeting.is_meeting is not None: is_meeting = meeting.is_meeting return { 'endpoint': meeting.endpoint, 'name': meeting.name, 'info_ur...
ArcherSys/ArcherSys
refs/heads/master
Lib/site-packages/html5lib/treewalkers/etree.py
658
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from six import text_type from . im...
kubaszostak/gdal-dragndrop
refs/heads/master
osgeo/apps/Python27/Lib/uu.py
62
#! /usr/bin/env python # Copyright 1994 by Lance Ellinghouse # Cathedral City, California Republic, United States of America. # All Rights Reserved # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # ...
cc13ny/Allin
refs/heads/master
leetcode/219-Contains-Duplicate-II/ContainDupII_001.py
5
class Solution: # @param {integer[]} nums # @param {integer} k # @return {boolean} def containsNearbyDuplicate(self, nums, k): tb = {} for i in range(len(nums)): num = nums[i] if num not in tb: tb[num] = i elif i - tb[num] <= k: ...
ymero/pulsar
refs/heads/master
pulsar/apps/data/store.py
4
''' Tha main component for pulsar datastore clients is the :class:`.Store` class which encapsulates the essential API for communicating and executing asynchronous commands on remote servers. ''' from abc import ABCMeta, abstractmethod from urllib.parse import urlsplit, parse_qsl, urlunparse, urlencode from pulsar impo...
super7ramp/pulseaudio-dlna
refs/heads/master
pulseaudio_dlna/utils/encoding.py
3
#!/usr/bin/python # This file is part of pulseaudio-dlna. # pulseaudio-dlna 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. # pulsea...
Xaltotun/conan
refs/heads/develop
conans/test/integration/manifest_validation_test.py
3
import unittest from conans.test.tools import TestServer, TestClient from conans.model.ref import ConanFileReference import os from conans.util.files import save, load, md5 from conans.model.ref import PackageReference from conans.paths import CONANFILE, SimplePaths class ManifestValidationTest(unittest.TestCase): ...
phlax/translate
refs/heads/master
translate/tools/test_phppo2pypo.py
4
# -*- coding: utf-8 -*- # phppo2pypo unit tests # Author: Wil Clouser <wclouser@mozilla.com> # Date: 2009-12-03 from io import BytesIO from translate.convert import test_convert from translate.tools import phppo2pypo class TestPhpPo2PyPo: def test_single_po(self): inputfile = b""" # This user comment ...
marshallcoz/turnt-octo-happiness
refs/heads/master
LayIBEM3d/geometria3d/reimprimir/scriptJustPrint.py
1
import bpy import bmesh import sys,getopt import os from math import pi bpy.ops.object.mode_set(mode='EDIT') print("hello") bpy.context.tool_settings.mesh_select_mode = [False, True, False] scene = bpy.context.scene scene.layers = [True] * 20 # Show all layers contador = 0 maxiter = 5 G = "8.4" for obj in scene.obje...
jiangzhuo/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/decimal.py
72
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
blckshrk/Weboob
refs/heads/master
weboob/applications/boobathon/__init__.py
12
# -*- coding: utf-8 -*- # Copyright(C) 2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
mt2d2/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/abort_wsh.py
465
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
liavkoren/djangoDev
refs/heads/master
tests/proxy_model_inheritance/app1/models.py
515
# TODO: why can't I make this ..app2 from app2.models import NiceModel class ProxyModel(NiceModel): class Meta: proxy = True
andela-bojengwa/reportr
refs/heads/master
apps/home/models.py
2
from django.db import models # Create your models here. class ContactModel(models.Model): name = models.CharField(max_length=64) email = models.EmailField() phone = models.CharField(max_length=15) class Meta: verbose_name = "inquiry" verbose_name_plural = "inquiries" def __str__(...
Etxea/gestioneide
refs/heads/master
gestioneide/management/commands/__init__.py
4
__author__ = 'patataman'
yrizk/django-blog
refs/heads/master
blogvenv/lib/python3.4/site-packages/pip/req/__init__.py
806
from __future__ import absolute_import from .req_install import InstallRequirement from .req_set import RequirementSet, Requirements from .req_file import parse_requirements __all__ = [ "RequirementSet", "Requirements", "InstallRequirement", "parse_requirements", ]
rcbops/python-novaclient-buildpackage
refs/heads/master
novaclient/v1_1/volume_snapshots.py
1
# Copyright 2011 Denali Systems, 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 requ...
jsyqrt/hwr-address
refs/heads/master
test/test_recognize.py
1
# coding: utf-8 # test_recognize.py to test `../src/recognize.py` from __future__ import division import os import sys sys.path.append('../tools') import tools import time test_n = 1000 accurancy = 0 accurancy_full = 0 samples = tools.get_n_samples(tools.test_sameles_path, test_n) print len(samples.keys()) m=0 n=0 spl...
solintegra/addons
refs/heads/master
partner_risk_insurance/models/__init__.py
30
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Albert Cervera i Areny (http://www.nan-tic.com). # All Rights Reserved # Copyright (c) 2014 Factor Libre SL. All Rights Reserved # # T...
uberamd/NGECore2
refs/heads/master
scripts/object/factory/base/base_factory.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/wearables/ithorian/ith_underwear_bottom.py
85615
import sys def setup(core, object): return
magul/pywikibot-core
refs/heads/master
pywikibot/titletranslate.py
1
# -*- coding: utf-8 -*- """Title translate module.""" # # (C) Rob W.W. Hooft, 2003 # (C) Yuri Astrakhan, 2005 # (C) Pywikibot team, 2003-2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals import re import pywikibot import pywikibot.date as date from py...
phrawzty/pelican-plugins
refs/heads/master
render_math/__init__.py
371
from .math import *
chris-martin/refund-calculation
refs/heads/master
python/setup.py
1
from setuptools import setup import pkg_resources import re def read(path): with open(pkg_resources.resource_filename(__name__, path)) as f: return f.read() def long_description(): return re.split('\n\.\. pypi [^\n]*\n', read('README.rst'), 1)[1] setup( name='refund_calculation', version='...
Bathlamos/Project-Euler-Solutions
refs/heads/master
solutions/p203.py
1
# # Solution to Project Euler problem 203 # Philippe Legault # # https://github.com/Bathlamos/Project-Euler-Solutions from math import sqrt from lib import legendre, primes_up_to, ncr # The jth entry of the ith row of the Pascal triangle is # i choose j. We simply need to ensure that for all primes p # less than i...
citrix/netscaler-ansible-modules
refs/heads/master
ansible-collections/adc/plugins/modules/citrix_adc_gslb_site.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2020 Citrix Systems, Inc. # # 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 # ...
simar7/build-mozharness
refs/heads/master
configs/single_locale/ash.py
1
# This configuration uses mozilla-central binaries (en-US, localized complete # mars) and urls but it generates 'ash' artifacts. With this setup, binaries # generated on ash are NOT overwriting mozilla-central files. # Using this configuration, on a successful build, artifacts will be uploaded # here: # # * http://dev-...
meredith-digops/ansible
refs/heads/devel
test/units/template/test_template_utilities.py
66
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ...
perlygatekeeper/glowing-robot
refs/heads/master
Project_Euler/06_sum_of_squares_minus_square_of_sum/sum_of_squares_square_of_sums_difference.py
1
#!/opt/local/bin/python # Python program to find sum_of_squares - square_of_sums_difference of numbers from 1 to 100 import sys import math import timeit import time def brute_force(n=100): sum_of_squares = 0 the_sum = 0 for i in range(1,n+1): # print (" ", i, flush=True) sum_of_s...
CERNDocumentServer/invenio
refs/heads/prod
modules/bibsword/lib/bibsword_webinterface.py
1
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # Li...
seungjin/app5-seungjin-net.appspot.com
refs/heads/master
django/db/backends/oracle/client.py
645
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlplus' def runshell(self): conn_string = self.connection._connect_string() args = [self.executable_name, "-L", conn_string] if os.name == 'nt': ...
rjdp/EE-dbmigrate
refs/heads/master
ee/cli/plugins/log.py
8
"""Debug Plugin for EasyEngine""" from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.core.logging import Log from ee.cli.plugins.site_functions import logwatch from ee.core.variables import EEVariables from ee.core.fileutils import EEFileUtils from ee.core.she...
jbzdak/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/edit_info.py
201
""" Access methods to get EditInfo for xblocks """ from xblock.fields import XBlockMixin from abc import ABCMeta, abstractmethod class EditInfoMixin(XBlockMixin): """ Provides the interfaces for getting the edit info from XBlocks """ @property def edited_by(self): """ The user id o...
csrocha/OpenUpgrade
refs/heads/8.0
addons/hr_recruitment/report/__init__.py
442
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
goodguy/satchmo
refs/heads/master
docs/create-docs.py
17
""" Helper script to create the documentation for Satchmo """ import os import string os.environ["DJANGO_SETTINGS_MODULE"]="satchmo.settings" pathToModelviz = "." modelsToProcess = ["contact", "discount", "payment", "product", "shipping", "shop", "supplier", "tax"] pathToRest = "/home/chris/python-stuff/docutils/tool...
DamianPilot382/Rubiks-Cube-Solver
refs/heads/master
opencv/sources/modules/core/src/opencl/runtime/generator/parser_clamdblas.py
13
#!/bin/python # usage: # cat clAmdBlas.h | $0 import sys, re; from common import remove_comments, getTokens, getParameters, postProcessParameters try: if len(sys.argv) > 1: f = open(sys.argv[1], "r") else: f = sys.stdin except: sys.exit("ERROR. Can't open input file") fns = [] while ...
abusse/cinder
refs/heads/master
cinder/tests/test_fujitsu_compatibility.py
4
# Copyright (c) 2015 FUJITSU LIMITED # # 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...
mikkylok/mikky.lu
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/distlib/version.py
166
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-386, distribute-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
ksmaheshkumar/gitfs
refs/heads/master
tests/utils/test_commit_list.py
3
# Copyright 2014 PressLabs SRL # # 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,...