repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
USGSDenverPychron/pychron
pychron/experiment/queue/experiment_queue.py
1
15561
# =============================================================================== # Copyright 2012 Jake Ross # # 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...
apache-2.0
azatoth/scons
test/Deprecated/debug-stree.py
5
3474
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
mit
cod3monk/kerncraft
kerncraft/roofline-plot.py
2
2490
#!/usr/bin/env python3 from pprint import pprint import matplotlib.pyplot as plt from ruamel import yaml from .prefixedunit import PrefixedUnit def frange(start, stop, step=1.0): f = start while f < stop: f += step yield f # Input (usually from ECM model) result = { 'min performance': ...
agpl-3.0
M4rtinK/tsubame
core/bundle/oauthlib/oauth1/rfc5849/parameters.py
87
4949
# -*- coding: utf-8 -*- """ oauthlib.parameters ~~~~~~~~~~~~~~~~~~~ This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec. .. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5 """ from __future__ import absolute_import, unicode_literals try: from urlparse import urlparse, url...
gpl-3.0
vim-IDE/python-mode
pymode/libs3/rope/refactor/restructure.py
91
11628
import warnings from rope.base import change, taskhandle, builtins, ast, codeanalyze from rope.refactor import patchedast, similarfinder, sourceutils from rope.refactor.importutils import module_imports class Restructure(object): """A class to perform python restructurings A restructuring transforms pieces ...
lgpl-3.0
hubertokf/lupsEdgeServer
projects/lupsEdgeServer/EngineRules/setuptools-20.10.1/setuptools/__init__.py
114
5440
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools.extern.six.moves import filterfalse, ...
mit
edulramirez/nova
nova/tests/functional/api_sample_tests/test_servers_ips.py
21
1558
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
ignatenkobrain/firewalld
src/firewall/core/io/zone.py
3
30153
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2013 Red Hat, Inc. # # Authors: # Thomas Woerner <twoerner@redhat.com> # # 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 Li...
gpl-2.0
albertomurillo/ansible
test/units/modules/network/ironware/test_ironware_config.py
38
6804
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
pnavarro/neutron
neutron/tests/unit/agent/linux/test_ip_monitor.py
58
1544
# Copyright 2015 Red Hat, 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...
apache-2.0
724400475/gallery-by-react
node_modules/_node-gyp@3.6.2@node-gyp/gyp/pylib/gyp/generator/xcode.py
1363
58344
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import...
mit
iphanzeke/support-tools
googlecode-issues-exporter/github_issue_converter.py
90
4057
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
dmc2015/hall-of-justice
common/utils.py
2
1903
import csv import itertools import re from django.utils.encoding import smart_text from django.core.exceptions import FieldDoesNotExist MARKDOWN_LIST_ITEM_REG = r'^(?P<indent>\s*)[\-+*]\s(?P<item>.*)$' class Echo(object): """An object that implements just the write method of the file-like interface.""" de...
bsd-3-clause
loco-odoo/localizacion_co
openerp/addons-extra/l10n_co_nit/__init__.py
6
1471
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
briancline/softlayer-python
SoftLayer/CLI/config/setup.py
2
4222
"""Setup CLI configuration.""" # :license: MIT, see LICENSE for more details. import os.path import SoftLayer from SoftLayer import auth from SoftLayer.CLI import config from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer import utils import c...
mit
xuerenlv/jieba
jieba/posseg/viterbi.py
71
1610
import sys import operator MIN_FLOAT = -3.14e100 MIN_INF = float("-inf") if sys.version_info[0] > 2: xrange = range def get_top_states(t_state_v, K=4): return sorted(t_state_v, key=t_state_v.__getitem__, reverse=True)[:K] def viterbi(obs, states, start_p, trans_p, emit_p): V = [{}] # tabular mem_p...
mit
gnieboer/tensorflow
tensorflow/python/debug/wrappers/dumping_wrapper_test.py
16
14700
# 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...
apache-2.0
ehashman/oh-mainline
vendor/packages/docutils/docutils/languages/fr.py
148
1893
# $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Stefane Fermigier <sf@fermigier.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translat...
agpl-3.0
CentralLabFacilities/m3meka
python/scripts/tools/m3qa_preisach.py
2
7452
#! /usr/bin/python import time import m3.toolbox as m3t import Numeric as nu import math import yaml import m3.rt_proxy as m3p import m3.toolbox as m3t import m3.component_factory as mcf #Image stuff from PIL import Image from PIL import ImageDraw import sys import matplotlib.pyplot as plt import matplotlib.image as ...
mit
danielharbor/openerp
addons/l10n_be_hr_payroll_account/__init__.py
430
1046
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
emmatoday/PyClimateGraphs
SeaIce_Combined.py
1
19763
#!/usr/bin/env python3 """ Global Sea Ice Extent Graph for 1979-Current Website : https://github.com/emmatoday/PyClimateGraphs Author : Emma M - GitHub: @emmatoday Date : 15 February 2017 This code will download and render a current graph of the global sea ice extent. Beginning in 1979 until yesterday (base...
mit
zehortigoza/ardupilot
Tools/autotest/arduplane.py
105
17060
# fly ArduPlane in SIL import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavutil import random # get location of scripts testdir=os.path.dirname(os.path.realpath(__file__)) HOME_LOCATION='-35.362938,149.165085,585,354' WIND="0,180,0.2" # speed,direction,variance homeloc =...
gpl-3.0
mezz64/home-assistant
tests/components/vera/test_config_flow.py
7
5809
"""Vera tests.""" from requests.exceptions import RequestException from homeassistant import config_entries, data_entry_flow from homeassistant.components.vera import CONF_CONTROLLER, CONF_LEGACY_UNIQUE_ID, DOMAIN from homeassistant.const import CONF_EXCLUDE, CONF_LIGHTS, CONF_SOURCE from homeassistant.core import Hom...
apache-2.0
chen0031/rekall
rekall-core/rekall/plugins/renderers/data_export.py
3
6094
# Rekall Memory Forensics # Copyright (C) 2014 Michael Cohen # Copyright 2014 Google Inc. All Rights Reserved. # # 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, ...
gpl-2.0
tiexinliu/odoo_addons
smile_purchase_access_rights/__openerp__.py
5
1806
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
dennissergeev/classcode
lib/cloudsat/cloudsat_tool.py
1
14059
""" modified 2012/11/24 to add cast for LayerTop modified 2014/11/07 temporally remove "__main__" add I/O for radar file add I/O for lidar file combine readrain.py combine read_ecmwf.py modif...
cc0-1.0
DrXyzzy/smc
src/scripts/clear_forever_logs.py
3
1137
#!/usr/bin/env python ############################################################################### # # CoCalc: Collaborative Calculation in the Cloud # # Copyright (C) 2016, Sagemath Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
agpl-3.0
spallavolu/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
qsnake/gpaw
gpaw/wannier.py
1
6936
from math import pi from pickle import load, dump import numpy as np from ase.units import Bohr from _gpaw import localize from gpaw.utilities.tools import dagger, lowdin class Wannier: def __init__(self, calc=None, spin=0, nbands=None): self.spin = spin self.Z_nnc = None if calc is not ...
gpl-3.0
dwf/numpy
numpy/distutils/fcompiler/mips.py
94
1757
from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler compilers = ['MIPSFCompiler'] class MIPSFCompiler(FCompiler): compiler_type = 'mips' description = 'MIPSpro Fortran Compiler' version_pattern = r'MIPSpro Compilers: Version (?P<version>[^\s*,]*)' executables = {...
bsd-3-clause
tequa/ammisoft
ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/idlexlib/extensions/LineNumbers.py
7
11947
# IDLEX EXTENSION ## """ ## Copyright(C) 2011 The Board of Trustees of the University of Illinois. ## All rights reserved. ## ## Developed by: Roger D. Serwy ## University of Illinois ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this sof...
bsd-3-clause
mzdaniel/oh-mainline
vendor/packages/Django/django/core/mail/backends/console.py
308
1295
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', sys.stdout) self._loc...
agpl-3.0
IBYoung/oceanbase
oceanbase_0.4/tools/dump_data/merge_tmp.py
13
1648
#!/usr/bin/python import sys import os import time def gettime(): return time.strftime("%Y-%m-%d %k:%M:%S", time.localtime()) def hadoop_ls(dir): cmd = "hadoop fs -ls %s" % dir file = os.popen(cmd) line = file.readline(); reslist = [] while True: line = file.readline() if len(line) == 0: b...
gpl-2.0
cmelange/ansible
lib/ansible/modules/cloud/amazon/ec2_ami_find.py
6
14027
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
dev-harsh1998/Phantom-Jalebi
tools/perf/util/setup.py
2079
1438
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
jimengliu/cattle
tests/integration-v1/cattletest/core/test_svc_links.py
1
20854
from common_fixtures import * # NOQA from cattle import ApiError def _create_stack(client): env = client.create_environment(name=random_str()) env = client.wait_success(env) assert env.state == "active" return env def test_service_add_remove_service_link(client, context): env = _create_stack(cl...
apache-2.0
nirs/vdsm
tests/kvm2ovirt_test.py
2
4854
# Copyright 2017 Red Hat, Inc. # # 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 distributed in the ...
gpl-2.0
medspx/QGIS
python/plugins/processing/algs/grass7/ext/v_edit.py
5
2610
# -*- coding: utf-8 -*- """ *************************************************************************** v_edit.py --------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *******************************************...
gpl-2.0
Gitlab11/odoo
addons/hr_expense/__init__.py
436
1079
# -*- 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...
agpl-3.0
shyamalschandra/picochess
libs/requests/packages/chardet/eucjpprober.py
2919
3678
######################## 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...
gpl-3.0
linuxbox10/openpli-oe-core
meta-openpli/recipes-openpli/enigma2/settings-autorestore/convert-smbconf.py
3
8770
# # convert-smbconfig.py: Convert an smb.conf file into OpenPLi format # import sys import os.path import collections import ConfigParser # ini files processed by this command SMBCONF = "/etc/samba/smb.conf" SMBUSERCONF = "/etc/samba/smb-user.conf" # location of the share config SHAREPATH = '/etc/samba/shares' # # ...
gpl-2.0
wackymaster/QTClock
Libraries/numpy/distutils/line_endings.py
256
2053
""" Functions for converting from DOS to UNIX line endings """ from __future__ import division, absolute_import, print_function import sys, re, os def dos2unix(file): "Replace CRLF with LF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") ret...
mit
dmitry-sobolev/ansible
lib/ansible/modules/web_infrastructure/taiga_issue.py
28
11404
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Alejandro Guirao <lekumberri@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 ...
gpl-3.0
javachengwc/hue
desktop/core/src/desktop/lib/python_util.py
33
4303
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
wrouesnel/ansible
lib/ansible/modules/cloud/misc/virt.py
27
15003
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2007, 2012 Red Hat, Inc # Michael DeHaan <michael.dehaan@gmail.com> # Seth Vidal <skvidal@fedoraproject.org> # 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_f...
gpl-3.0
rwillmer/django
django/contrib/gis/geos/prepared.py
328
2445
from .base import GEOSBase from .error import GEOSException from .libgeos import geos_version_info from .prototypes import prepared as capi class PreparedGeometry(GEOSBase): """ A geometry that is prepared for performing certain operations. At the moment this includes the contains covers, and intersects ...
bsd-3-clause
rapilabs/django
tests/check_framework/test_model_field_deprecation.py
322
2584
from django.core import checks from django.db import models from django.test import SimpleTestCase from .tests import IsolateModelsMixin class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_deprecated_details ...
bsd-3-clause
python-hyper/hyper-h2
examples/twisted/head_request.py
13
3380
# -*- coding: utf-8 -*- """ head_request.py ~~~~~~~~~~~~~~~ A short example that demonstrates a client that makes HEAD requests to certain websites. This example is intended as a reproduction of nghttp2 issue 396, for the purposes of compatibility testing. """ from __future__ import print_function from twisted.inter...
mit
Urvik08/ns3-gpcr
src/tap-bridge/examples/tap-csma-virtual-machine.py
157
3012
# -*- Mode: Python; -*- # # Copyright 2010 University of Washington # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be usefu...
gpl-2.0
hurricup/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/relatedapp/tests.py
123
13948
from django.test import TestCase from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati...
apache-2.0
camptocamp/odoo
addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
Dandandan/wikiprogramming
jsrepl/extern/python/closured/lib/python2.7/linecache.py
299
3964
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globals=None): li...
mit
anisse/bepo-android
android.py
1
5313
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Produit une carte de touches android à partir d'un fichier xkb # # Copyright (C) 2008 Gaëtan Lehmann <gaetan.lehmann@jouy.inra.fr> # Copyright (C) 2014 Anisse Astier <anisse@astier.eu> # # Utilisable uniquement au sein du configGenerator bépo; # premier argument: le fic...
mit
chenjun0210/tensorflow
tensorflow/python/debug/lib/session_debug_testlib.py
3
62078
# 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...
apache-2.0
krisys/django
django/core/management/commands/showmigrations.py
7
4973
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the ...
bsd-3-clause
kernc/networkx
networkx/tests/benchmark.py
40
7480
from timeit import Timer # This is gratefully modeled after the benchmarks found in # the numpy svn repository. http://svn.scipy.org/svn/numpy/trunk class Benchmark(object): """ Benchmark a method or simple bit of code using different Graph classes. If the test code is the same for each graph class, then...
bsd-3-clause
OSSESAC/odoopubarquiluz
addons/l10n_lu/__openerp__.py
32
2695
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011 Thamini S.à.R.L (<http://www.thamini.com>) # Copyright (C) 2011 ADN Consultants S.à...
agpl-3.0
icoxfog417/enigma_abroad
pola/conversation.py
1
2645
from enum import Enum class Reaction(Enum): positive = 1 neutral = 0 negative = -1 class Suggestion(): def __init__(self, topic, candidate_ids, reaction): self.topic = topic self.candidate_ids = candidate_ids self.reaction = reaction def serialize(self): return ...
mit
SnipyJulmy/hesso-latextemplate-lab
getreport.py
1
4539
#!/usr/bin/python3 import os import sys import shutil import argparse # -- Configuration MODEL_DIR = 'report' MODEL_REPORT_FILE = 'report.tex' MODEL_METADATA_FILE = 'metadata.tex' REPORT_NAME = 'report' REPORT_DIR = 'report' def parse_args(): """ Parses the command line arguments. :return: metadata ...
gpl-2.0
BehavioralInsightsTeam/edx-platform
cms/djangoapps/contentstore/tests/test_orphan.py
24
10573
""" Test finding orphans via the view and django config """ import json import ddt from opaque_keys.edx.locator import BlockUsageLocator from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url from student.models import CourseEnrollment from xmodule.modulestore import Mod...
agpl-3.0
quixoten/ansible
lib/ansible/utils/module_docs_fragments/backup.py
427
1071
# Copyright (c) 2015 Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansi...
gpl-3.0
tquizzle/Sick-Beard
sickbeard/clients/requests/packages/charade/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
Red--Code/Code-Red-honami
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
luiseduardohdbackup/Data-Structure-Zoo
1-Algorithm Analysis/test.py
10
1250
""" algorithms tests thomas moll 2015 """ import unittest import algorithms class TestAlgorithms(unittest.TestCase): def setUp(self): self.list_a = [12,43,60,32,10] self.list_b = [43,60,32,10,12] self.list_c = [10,12,9,7,40,6] self.big_sorted = list(xrange(1000)) ...
mit
boudinfl/pke
pke/unsupervised/graph_based/expandrank.py
1
6147
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Florian Boudin # Date: 10-02-2018 """ExpandRank keyphrase extraction model. Graph-based ranking approach to keyphrase extraction described in: * Xiaojun Wan and Jianguo Xiao. Single Document Keyphrase Extraction Using Neighborhood Knowledge. *In proceedings...
gpl-3.0
willbarton/inflection
docs/conf.py
4
7973
# -*- coding: utf-8 -*- # # inflection documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 22:51:13 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
mit
run2/citytour
4symantec/Lib/encodings/tis_620.py
593
12556
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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='st...
mit
tunneln/CarnotKE
jyhton/lib-python/2.7/plat-irix6/SV.py
132
3331
from warnings import warnpy3k warnpy3k("the SV module has been removed in Python 3.0", stacklevel=2) del warnpy3k NTSC_XMAX = 640 NTSC_YMAX = 480 PAL_XMAX = 768 PAL_YMAX = 576 BLANKING_BUFFER_SIZE = 2 MAX_SOURCES = 2 # mode parameter for Bind calls IN_OFF = 0 # No Video IN_OVER = 1 ...
apache-2.0
Elettronik/SickRage
lib/github/Branch.py
72
2919
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
OpenSeizureDetector/OpenSeizureDetector
audio_version/audioInput.py
2
2086
#!/usr/bin/python # # Graham Jones, May 2013. import alsaaudio, audioop class audioInput: """ A simple class to grab frames of audio samples from the audio system """ def __init__(self,sampFreq,frameSize): print("auidioInput.__init__"); self.audioSampleFreq = sampFreq self.frameSize =...
gpl-3.0
matejcik/weblate
weblate/trans/checks/markup.py
2
4238
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
gpl-3.0
OCA/l10n-italy
l10n_it_ricevute_bancarie/models/riba.py
1
18317
# Copyright (C) 2012 Andrea Cometa. # Email: info@andreacometa.it # Web site: http://www.andreacometa.it # Copyright (C) 2012 Associazione OpenERP Italia # (<http://www.odoo-italia.org>). # Copyright (C) 2012-2017 Lorenzo Battistini - Agile Business Group # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). ...
agpl-3.0
yfdyh000/olympia
migrations/503-gaia-device-type.py
23
1455
#!/usr/bin/env python from celeryutils import task from django.core.exceptions import ObjectDoesNotExist from django.db.models import Count import amo from addons.models import AddonDeviceType as ADT from amo.decorators import write from amo.utils import chunked @task @write def _task(**kw): # Remove any dupes...
bsd-3-clause
brunitob/tuhotelhoy
node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
1534
3426
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
a-pertsev/flask-security
flask_security/confirmable.py
18
2456
# -*- coding: utf-8 -*- """ flask_security.confirmable ~~~~~~~~~~~~~~~~~~~~~~~~~~ Flask-Security confirmable module :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from datetime import datetime from flask import current_app as app from werkzeug.local import ...
mit
ArtsiomCh/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/conditional_bijector_impl.py
81
2294
# 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...
apache-2.0
notapresent/rbm2m
rbm2m/views/api.py
1
3418
# -*- coding: utf-8 -*- from flask import Blueprint, jsonify, current_app, request from ..webapp import db, redis, basic_auth from ..action import (stats, scanner, record_manager, genre_manager, user_settings, scan_manager, export_manager, debug) bp = Blueprint('api', __name__) @bp.before_requ...
apache-2.0
asimshankar/tensorflow
tensorflow/python/kernel_tests/slice_op_test.py
13
14833
# 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...
apache-2.0
gfyoung/pandas
pandas/tests/frame/methods/test_reindex_like.py
8
1187
import numpy as np import pytest from pandas import DataFrame import pandas._testing as tm class TestDataFrameReindexLike: def test_reindex_like(self, float_frame): other = float_frame.reindex(index=float_frame.index[:10], columns=["C", "B"]) tm.assert_frame_equal(other, float_frame.reindex_like...
bsd-3-clause
lfcnassif/MultiContentViewer
release/modules/ext/libreoffice/program/python-core-3.3.0/lib/datetime.py
4
75402
"""Concrete date/time and related types -- prototype implemented in Python. See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage See also http://dir.yahoo.com/Reference/calendars/ For a primer on DST, including many current DST rules, see http://webexhibits.org/daylightsaving/ For more about DST than you e...
lgpl-3.0
gaddman/ansible
lib/ansible/modules/web_infrastructure/gunicorn.py
27
6924
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Alejandro Gomez <alexgomez2202@gmail.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': '...
gpl-3.0
rascalmicro/openembedded-rascal
contrib/mtn2git/mtn2cache.py
45
2335
#!/usr/bin/env python import os, processing from child import Child MTN = ["mtn", "--db=~/oe/OE.mtn"] DIFF = ["diff", "-u"] def handle_parents(revision): parents = Child(*MTN+["au", "parents", revision]).stdout.strip().split('\n') if not parents: return print "revision: %s (parents: %s)" % (revis...
mit
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/encodings/iso8859_3.py
272
13089
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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='...
lgpl-3.0
SKA-ScienceDataProcessor/integration-prototype
sip/examples/flask_processing_controller/app/api/scheduling_block_list.py
1
2351
# -*- coding: utf-8 -*- """Scheduling Block Instance List API resource.""" import logging from http import HTTPStatus from random import choice from flask import Blueprint, request from .utils import add_scheduling_block, get_root_url, missing_db_response from ..db.client import ConfigDb BP = Blueprint("scheduling-...
bsd-3-clause
jhjguxin/blogserver
lib/python2.7/site-packages/django/template/context.py
57
6070
from copy import copy from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.http import HttpRequest # Cache of actual callables. _standard_context_processors = None # We need the CSRF processor no matter what the user has in their settings, # because other...
mit
mbedmicro/pyOCD
pyocd/target/builtin/target_STM32F429xx.py
1
6887
# pyOCD debugger # Copyright (c) 2018 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 # # ...
apache-2.0
staute/shinken_deb
test/test_maintenance_period.py
18
6228
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
mozilla/make.mozilla.org
vendor-local/lib/python/requests/async.py
33
2717
# -*- coding: utf-8 -*- """ requests.async ~~~~~~~~~~~~~~ This module contains an asynchronous replica of ``requests.api``, powered by gevent. All API methods return a ``Request`` instance (as opposed to ``Response``). A list of requests can be sent with ``map()``. """ try: import gevent from gevent import m...
bsd-3-clause
3oheme/dominous
intro.py
1
1950
# -*- coding: utf-8 -*- from pygame import * from gloss import * from sound import * from tools import * class Intro(): def __init__(self, mainp): self.game = mainp self.logo_fade = 0 self.logo_fade_out = 0 self.logo_fading_out = False self.fadeout_amount = 0.0 sel...
gpl-3.0
adamfisk/littleshoot-client
server/appengine/boto/services/message.py
5
2405
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
gpl-2.0
ddmax/shadowsocks
tests/test.py
1016
5029
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
apache-2.0
largelymfs/topical_word_embeddings
TWE-2/gensim/scripts/make_wiki.py
76
4327
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s WIKI_XML_DUMP OUTPUT_PREFIX [VOCABULARY_SIZE] Convert a...
mit
saneyuki/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorservodriver.py
1
10173
import json import os import socket import threading import time import traceback from .base import (Protocol, BaseProtocolPart, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from ..testrunner im...
mpl-2.0
nikitos/npui
netprofile_ipaddresses/netprofile_ipaddresses/__init__.py
2
2967
#!/usr/bin/env python # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*- # # NetProfile: IP addresses module # © Copyright 2013-2015 Alex 'Unik' Unigovsky # # This file is part of NetProfile. # NetProfile is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Publ...
agpl-3.0
fbradyirl/home-assistant
homeassistant/components/rpi_gpio/__init__.py
2
1625
"""Support for controlling GPIO pins of a Raspberry Pi.""" import logging from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP _LOGGER = logging.getLogger(__name__) DOMAIN = "rpi_gpio" def setup(hass, config): """Set up the Raspberry PI GPIO component.""" from RPi import GPIO...
apache-2.0
wdv4758h/ZipPy
edu.uci.python.benchmark/src/benchmarks/sympy/sympy/functions/elementary/trigonometric.py
3
58568
from __future__ import print_function, division from sympy.core.add import Add from sympy.core.basic import C, sympify, cacheit from sympy.core.singleton import S from sympy.core.numbers import igcdex from sympy.core.function import Function, ArgumentIndexError from sympy.functions.elementary.miscellaneous import sqrt...
bsd-3-clause
dol-sen/portage
pym/portage/tests/resolver/soname/test_reinstall.py
10
1929
# Copyright 2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, ResolverPlaygroundTestCase) class SonameReinstallTestCase(TestCase): def testSonameReinstall(self): ...
gpl-2.0
martinbuc/missionplanner
Lib/stat.py
60
1812
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8...
gpl-3.0
jahangir091/geodash26
geonode/geoserver/views.py
6
19673
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
camagenta/youtube-dl
youtube_dl/extractor/drbonanza.py
109
5082
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class DRBonanzaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dr\.dk/bonanza/(?:[^/]+/)+(?:[^/])+?(?:assetId=(?P<id>\d+))?(?:[#&]|$)' _TESTS = [{...
unlicense