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 |
|---|---|---|---|---|---|
KFire-Android/kernel_omap_otter-common | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
robwarm/gpaw-symm | gpaw/hooks.py | 1 | 1120 | import os
import random
class NotConverged:
def __init__(self, dir='.'):
self.dir = dir
def __call__(self, calc):
if calc.wfs.world.rank > 0:
return
from ase.io import write
name = os.path.join(self.dir, ''.join(random.sample('gpaw' * 3, 12)))
write(name ... | gpl-3.0 |
mmazanec22/too-windy | env/lib/python3.5/site-packages/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## 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 |
Erotemic/guitool | guitool_ibeis/api_table_view.py | 1 | 6221 | from __future__ import absolute_import, division, print_function
from guitool_ibeis.__PYQT__ import QtCore, QtGui
from guitool_ibeis.__PYQT__ import QtWidgets
from guitool_ibeis import api_item_view
from guitool_ibeis.guitool_decorators import signal_, slot_
import utool
(print, rrr, profile) = utool.inject2(__name__,... | apache-2.0 |
mvidalgarcia/indico | indico/modules/events/abstracts/notifications.py | 2 | 6735 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import itertools
from collections import OrderedDict
from flask ... | mit |
jkliff/project_walker | walker.py | 1 | 4914 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os.path
import sys
import ProjectWalker
import Checkers
from yaml import load
from string import ljust, rjust
CHECKER_STATUS_PADDING = 40
COUNTS_PADDING = 8
DEFAULT_CONFIG_NAME = 'walker.conf'
IS_TERMINAL = sys.stdout.isatty()
def red(string):
i... | bsd-3-clause |
shubhamdhama/zulip | zerver/tests/test_unread.py | 1 | 22793 | from typing import Any, List, Mapping
from unittest import mock
import ujson
from django.db import connection
from zerver.lib.fix_unreads import fix, fix_pre_pointer, fix_unsubscribed
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import get_subscription, tornado_redirected_to_list
fro... | apache-2.0 |
dentaku65/pelisalacarta | python/main-classic/servers/nosvideo.py | 9 | 4368 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para nosvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... | gpl-3.0 |
jmztaylor/android_kernel_htc_zara | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
ric2b/Vivaldi-browser | chromium/third_party/blink/tools/blinkpy/third_party/wpt/wpt/tools/third_party/h2/h2/frame_buffer.py | 46 | 6771 | # -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.exceptions import InvalidFrameError
from hyperframe.frame import (
Frame, HeadersFrame, ContinuationFrame, PushPromiseFrame
)
from .exceptions impo... | bsd-3-clause |
ApuliaSoftware/l10n-italy | __unported__/l10n_it_corrispettivi/installer.py | 12 | 2596 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | agpl-3.0 |
pahans/nototools | nototools/fix_khmer_and_lao_coverage.py | 6 | 2903 | #!/usr/bin/python
#
# Copyright 2014 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... | apache-2.0 |
RecursiveForest/whipper | whipper/test/test_common_renamer.py | 3 | 4950 | # -*- Mode: Python; test-case-name: whipper.test.test_image_cue -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
import tempfile
import unittest
from whipper.common import renamer
class RenameInFileTestcase(unittest.TestCase):
def setUp(self):
(fd, self._path) = tempfile.mkstemp(suffix='.whipper.renamer.infil... | gpl-3.0 |
davidwtbuxton/pycodebase | src/codebase/client.py | 1 | 24245 | import ConfigParser
import logging
import os
import notrequests
from . import utils
CODEBASE_API_URL = 'https://api3.codebasehq.com'
logger = logging.getLogger(__file__)
class BaseClient(object):
"""Codebase API client class."""
def __init__(self, (username, key)):
self.auth = (username, key)
... | mit |
pgmillon/ansible | lib/ansible/modules/net_tools/nios/nios_naptr_record.py | 68 | 5884 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
an7oine/WinVHS | Cygwin/lib/python2.7/encodings/mac_arabic.py | 593 | 36723 | """ Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.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_map)
def decode(self,input,errors='strict'):
... | gpl-3.0 |
indevgr/django | tests/template_tests/filter_tests/test_striptags.py | 197 | 1632 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
... | bsd-3-clause |
MeigaraJuma/XQS-Website-Angular | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/usr/bin/env python
# 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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
zengluyang/ns3-d2d | examples/wireless/wifi-ap.py | 108 | 5883 | # -*- Mode: Python; -*-
# /*
# * Copyright (c) 2005,2006,2007 INRIA
# * Copyright (c) 2009 INESC Porto
# *
# * 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 p... | gpl-2.0 |
btabibian/scikit-learn | sklearn/calibration.py | 37 | 20332 | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
from __future__ impo... | bsd-3-clause |
slightstone/SickRage | tests/issue_submitter_tests.py | 5 | 1664 | # coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 vers... | gpl-3.0 |
leoliujie/odoo | addons/hr/res_config.py | 377 | 3452 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
ruiting/opencog | opencog/python/pln_old/examples/attentionallocation/socrates_attention_agent.py | 5 | 2253 | __author__ = 'sebastian'
from opencog.cogserver import MindAgent
from opencog.atomspace import types
from pln.chainers import Chainer
from pln.rules import *
class SocratesAgent(MindAgent):
def __init__(self):
self.chainer = None
def create_chainer(self, atomspace):
self.chainer = Chainer(at... | agpl-3.0 |
rmboggs/django | tests/auth_tests/test_validators.py | 49 | 7726 | from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_val... | bsd-3-clause |
cxxgtxy/tensorflow | tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py | 132 | 22955 | # 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 |
albertomurillo/ansible | test/units/modules/network/netvisor/test_pn_vrouter_pim_config.py | 15 | 2490 | # Copyright: (c) 2018, Pluribus Networks
# 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
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | gpl-3.0 |
SaschaMester/delicium | tools/perf/page_sets/tough_texture_upload_cases.py | 1 | 1659 | # 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 import story
class ToughTextureUploadCasesPage(page_module.Page):
def __init__(self, url, p... | bsd-3-clause |
kirca/odoo | addons/mail/ir_attachment.py | 378 | 5643 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-TODAY OpenERP SA (http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
aajanki/youtube-dl | youtube_dl/extractor/myspass.py | 40 | 2670 | from __future__ import unicode_literals
import os.path
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
)
class MySpassIE(InfoExtractor):
_VALID_URL = r'http://www\.myspass\.de/.*'
_TEST = {
'url': 'http://www.myspa... | unlicense |
RPGOne/scikit-learn | sklearn/ensemble/__init__.py | 153 | 1382 | """
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification, regression and anomaly detection.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesCla... | bsd-3-clause |
zainabg/NOX | src/nox/lib/graph_topology.py | 11 | 4483 | import pydot
import time
import re
import os.path
from pyapps import locator
from pyapps import discovery
from vigil.packet import *
def dot_output(graph, name):
sfx = name.split('.')[len(name.split('.')) -1]
base = os.path.basename(name)
if sfx == "svg":
svg = graph.create_svg(prog='dot')... | gpl-3.0 |
stratosphereips/Manati | manati/api_manager/common/abstracts.py | 1 | 1595 | #
# Copyright (c) 2017 Stratosphere Laboratory.
#
# This file is part of ManaTI Project
# (see <https://stratosphereips.org>). It was created by 'Raul B. Netto <raulbeni@gmail.com>'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License ... | agpl-3.0 |
trendelkampschroer/PyEMMA | pyemma/util/tests/__init__.py | 3 | 1434 |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# 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... | bsd-2-clause |
SummerLW/Perf-Insight-Report | telemetry/telemetry/internal/util/global_hooks.py | 18 | 1350 | # 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.
"""Hooks that apply globally to all scripts that import or use Telemetry."""
import signal
import sys
from telemetry.internal.util import exception_formatte... | bsd-3-clause |
teemulehtinen/a-plus | selenium_test/test/my_ajax_exercise_grader_test.py | 3 | 1797 | import unittest
from page_objects import LoginPage, MyAjaxExerciseGrader
from test_initializer import TestInitializer
class MyAjaxExerciseGraderTest(unittest.TestCase):
def setUp(self):
testInitializer = TestInitializer()
self.driver = testInitializer.getDefaultDriver()
testInitializer.re... | gpl-3.0 |
instantinfrastructure/linux-yocto-3.10 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
kostyll/micropython | tests/run-tests-exp.py | 43 | 2697 | #
# This is minimal MicroPython variant of run-tests script, which uses
# .exp files as generated by run-tests --write-exp. It is useful to run
# testsuite on systems which have neither CPython3 nor unix shell.
# This script is intended to be run by the same interpreter executable
# which is to be tested, so should use... | mit |
HuaweiSwitch/ansible | lib/ansible/modules/commands/shell.py | 17 | 5631 | # There is actually no actual shell module source, when you use 'shell' in ansible,
# it runs the 'command' module with special arguments and it behaves differently.
# See the command source and the comment "#USE_SHELL".
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify... | gpl-3.0 |
ThomasGsp/eyeprox | script/eyeprox_mongodb.py | 1 | 6777 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Author: Tlams
Langage: Python
Minimum version require: 3.4
Version software: 2
Function: Generate a central database informations for multiples clusters proxmox.
"""
# Imports
import threading
import time
import web
import configparser
from pathlib import Path... | gpl-3.0 |
liberorbis/libernext | env/lib/python2.7/site-packages/pip/download.py | 61 | 30557 | from __future__ import absolute_import
import cgi
import email.utils
import hashlib
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib i... | gpl-2.0 |
ShwoognationHQ/bitcoin | qa/rpc-tests/test_framework/blockstore.py | 98 | 4096 | # BlockStore: a helper class that keeps a map of blocks and implements
# helper functions for responding to getheaders and getdata,
# and for constructing a getheaders message
#
from mininode import *
import dbm
class BlockStore(object):
def __init__(self, datadir):
self.blockDB = ... | mit |
amishb/youtube-dl | youtube_dl/extractor/telemb.py | 177 | 2964 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import remove_start
class TeleMBIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html'
_TESTS = [
{
'url': 'http://www.telemb... | unlicense |
OBA-code/tgstation | tools/HitboxExpander/hitbox_expander.py | 206 | 2697 | import os
import sys
import inspect
import shutil
def AddToPath(path):
if path not in sys.path:
sys.path.insert(0, path)
delimeter = ':' if os.name == "posix" else ";"
os.environ['PATH'] = path + delimeter + os.environ['PATH']
current_dir = os.path.split(inspect.getfile(inspect.currentframe()... | agpl-3.0 |
SANBI-SA/tools-iuc | data_managers/data_manager_fetch_ncbi_taxonomy/data_manager/data_manager.py | 8 | 2307 | import argparse
import datetime
import json
import os
import shutil
import tarfile
import zipfile
try:
# For Python 3.0 and later
from urllib.request import Request, urlopen
except ImportError:
# Fall back to Python 2 imports
from urllib2 import Request, urlopen
def url_download(url, workdir):
fil... | mit |
johnwlockwood/appengine-mapreduce | python/test/mapreduce/operation/db_test.py | 4 | 1781 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
shuggiefisher/potato | django/contrib/formtools/preview.py | 229 | 6829 | """
Formtools Preview application.
"""
import cPickle as pickle
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.hashcompat import md5_constructor
from django.utils.crypto import consta... | bsd-3-clause |
bartoldeman/easybuild-framework | test/framework/modulestool.py | 1 | 9067 | # #
# Copyright 2014-2018 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | gpl-2.0 |
JeyZeta/Dangerous | Dangerous/sqlmap/thirdparty/colorama/winterm.py | 18 | 4133 |
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL = 0x00 # dim text, dim background
BRIGHT = 0x08 # bright text, dim backgr... | mit |
wrouesnel/ansible | test/units/modules/network/vyos/test_vyos_command.py | 43 | 4225 | # (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 dis... | gpl-3.0 |
yuzhangcmu/Python-Study | Leetcode/Sort_Colors.py | 2 | 1167 | """
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
Note:
You are not suppose to use the library's ... | mit |
TimBizeps/BachelorAP | FP 2018/V51 Operationsverstärker/auswertung/auswertung5.py | 1 | 1788 | import matplotlib as mpl
mpl.use('pgf')
import numpy as np
import scipy.constants as const
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from uncertainties import ufloat
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
mpl.rcParams.upd... | gpl-3.0 |
deltreey/ansible | lib/ansible/parsing/__init__.py | 22 | 8948 | # (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... | gpl-3.0 |
t3wz/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/service_reflection_test.py | 560 | 5127 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | gpl-3.0 |
naparuba/opsbro | data/global-configuration/packs/system/collectors/collector_interfaces.py | 2 | 1852 | import os
import re
from opsbro.collector import Collector
def extract(input):
mo = re.search(r'^(?P<interface>eth\d+|eth\d+:\d+)\s+' +
r'Link encap:(?P<link_encap>\S+)\s+' +
r'(HWaddr\s+(?P<hardware_address>\S+))?' +
r'(\s+inet addr:(?P<ip_address>\S+))?'... | mit |
kch8qx/osf.io | framework/celery_tasks/utils.py | 54 | 1936 | from __future__ import unicode_literals
import logging
import inspect
from functools import wraps
from raven import Client
from website import settings
logger = logging.getLogger(__name__)
sentry = Client(dsn=settings.SENTRY_DSN, release=settings.VERSION, tags={'App': 'celery'})
# statuses
FAILED = 'failed'
CREATE... | apache-2.0 |
kingvuplus/New | lib/python/Components/HdmiCec.py | 3 | 7495 | import struct
from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText
from enigma import eHdmiCEC, eTimer
from Screens.Standby import inStandby
import Screens.Standby
from Tools import Notifications
import time
from os import system
from Tools.Directories import fileExists
class HdmiCec:... | gpl-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/mpmath/functions/elliptic.py | 2 | 38824 | r"""
Elliptic functions historically comprise the elliptic integrals
and their inverses, and originate from the problem of computing the
arc length of an ellipse. From a more modern point of view,
an elliptic function is defined as a doubly periodic function, i.e.
a function which satisfies
.. math ::
f(z + 2 \om... | mit |
VitalPet/odoo | addons/l10n_fr/report/compute_resultant_report.py | 50 | 1763 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
abhisg/scikit-learn | sklearn/manifold/mds.py | 257 | 15138 | """
Multi-dimensional Scaling (MDS)
"""
# author: Nelle Varoquaux <nelle.varoquaux@gmail.com>
# Licence: BSD
import numpy as np
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_array, check_symmetric
from ..externals.joblib impo... | bsd-3-clause |
jdahlin/pygobject | gi/overrides/Pango.py | 5 | 1970 | # -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2010 Paolo Borelli <pborelli@gnome.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundat... | lgpl-2.1 |
romulocollopy/rows | tests/tests_plugin_xlsx.py | 1 | 4320 | # coding: utf-8
# Copyright 2014-2015 Álvaro Justen <https://github.com/turicas/rows/>
#
# 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 of the License, or
# (at yo... | gpl-3.0 |
HybridF5/tempest_debug | tempest/cmd/cleanup_service.py | 2 | 31506 | #!/usr/bin/env python
# Copyright 2015 Dell 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 appl... | apache-2.0 |
frvcoin/frvcoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
crcresearch/osf.io | reviews/workflow.py | 1 | 2410 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from enum import Enum
from enum import unique
class ChoiceEnum(Enum):
@classmethod
def choices(cls):
return tuple((v, unicode(v).title()) for v in cls.values())
@classmethod
def values(cls):
return tuple(c.value for c in... | apache-2.0 |
breuderink/golem | golem/helpers.py | 1 | 1501 | import csv, itertools
import numpy as np
def to_one_of_n(labels, class_rows=None):
'''
Convert a list with integers to one-of-N coding for to use in a DataSet.
Note that the rows correspond to the classes in *sorted* order.
>>> to_one_of_n([0, 0, 0, 2, 0, 1])
array([[ 1., 1., 1., 0., 1., 0.],
... | bsd-3-clause |
styskin/pybrain | pybrain/rl/environments/renderer.py | 31 | 1454 | # obsolete - should be deleted if there are no objections.
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.utilities import abstractMethod
import threading
class Renderer(threading.Thread):
""" The general interface for a class displays what is happening in an environment.
The renderer... | bsd-3-clause |
timofeymukha/eddylicious | eddylicious/generators/lund_rescaling.py | 1 | 15250 | # This file is part of eddylicious
# (c) Timofey Mukha
# The code is released under the GNU GPL Version 3 licence.
# See LICENCE.txt and the Legal section in the User Guide for more information
"""Functions for generating inflow velocity fields using
Lund et al's rescaling, see
Lund T.S., Wu X., Squires K.D. ... | gpl-3.0 |
fzheng/codejam | lib/python2.7/site-packages/setuptools/command/install_lib.py | 104 | 3839 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... | mit |
tchellomello/home-assistant | homeassistant/components/knx/schema.py | 1 | 14928 | """Voluptuous schemas for the KNX integration."""
import voluptuous as vol
from xknx.devices.climate import SetpointShiftMode
from homeassistant.const import (
CONF_ADDRESS,
CONF_DEVICE_CLASS,
CONF_ENTITY_ID,
CONF_HOST,
CONF_NAME,
CONF_PORT,
CONF_TYPE,
)
import homeassistant.helpers.config_... | apache-2.0 |
olymk2/maidstone-hackspace | website/data/sql/donate.py | 4 | 1034 | import os
from scaffold.core.data.select import select_data
from scaffold.core.data.insert import insert_data
#~ from scaffold.core.data.update import update_data
#~ from scaffold.core.data.delete import delete_data
from scaffold.core.data.sql import query_builder
query_builder.query_path = os.path.abspath('./data/sq... | gpl-3.0 |
GitHublong/hue | desktop/core/ext-py/requests-2.6.0/requests/auth.py | 197 | 6710 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... | apache-2.0 |
SP7-Ritmare/starterkit | geosk/mdtools/views.py | 1 | 5159 | import os
import sys
import json
import logging
import pycsw
import subprocess
import re
from urlparse import urlparse
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.forms import model_to_dict
from django.core.serializers.json import DjangoJSONEncoder
from django.forms.... | gpl-3.0 |
cmacmackin/isoft | plotting/eos.py | 1 | 1429 | #
# entrainment.py
# This file is part of ISOFT.
#
# Copyright 2017 Chris MacMackin <cmacmackin@gmail.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 3 of the Lic... | gpl-3.0 |
priyam0074/musicApp | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
alonsebastian/SocialID | personal_page/views.py | 1 | 5302 | from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from personal_page.models import PersonalPage
from personal_page.forms import PersonalPageForm
from accounts.models import UserProfile
def p... | gpl-2.0 |
halberom/ansible-modules-core | cloud/google/gce_lb.py | 7 | 12559 | #!/usr/bin/python
# Copyright 2013 Google 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 vers... | gpl-3.0 |
taknira/certificate-transparency | python/ct/client/log_client_test.py | 26 | 18164 | #!/usr/bin/env python
import unittest
import base64
import json
import mock
import requests
import sys
from ct.client import log_client
from ct.client import log_client_test_util as test_util
from ct.crypto import merkle
from ct.proto import client_pb2
import gflags
FLAGS = gflags.FLAGS
class LogClientTest(unitte... | apache-2.0 |
rouault/Quantum-GIS | python/plugins/processing/tools/raster.py | 20 | 2896 | # -*- coding: utf-8 -*-
"""
***************************************************************************
raster.py
---------------------
Date : February 2013
Copyright : (C) 2013 by Victor Olaya and Alexander Bruy
Email : volayaf at gmail dot com
**********... | gpl-2.0 |
lneisenman/meanet | meanet/graph_theory.py | 1 | 4877 | # -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import,
unicode_literals)
import networkx as nx
import numpy as np
from .meanet import corr_matrix_to_graph
def analyse_data(data, threshold=0.66):
""" perform graph theory analysis on data
Parameter... | bsd-3-clause |
40423219/2017springcd_hw | blog/theme/glow/primitive.py | 161 | 4838 | from javascript import JSConstructor, JSObject
from .vector import vec
class primitive:
def __init__(self, prim, **kwargs):
for _key in kwargs.keys():
if isinstance(kwargs[_key], vec):
kwargs[_key]=kwargs[_key]._vec
self._prim=prim(kwargs)
def rotate(self, **kwargs):
if '... | agpl-3.0 |
mushtaqak/edx-platform | common/lib/xmodule/xmodule/tests/test_html_module.py | 58 | 4458 | import unittest
from mock import Mock
from xblock.field_data import DictFieldData
from xmodule.html_module import HtmlModule, HtmlDescriptor
from . import get_test_system, get_test_descriptor_system
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xblock.fields import ScopeIds
def instantiate_des... | agpl-3.0 |
BYK/fb2goog | gdata/finance/service.py | 261 | 8974 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... | mpl-2.0 |
40223226/2015cdbg80420 | static/Brython3.1.1-20150328-091302/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
Greennut/ostproject | django/contrib/sites/models.py | 387 | 2867 | from django.db import models
from django.utils.translation import ugettext_lazy as _
SITE_CACHE = {}
class SiteManager(models.Manager):
def get_current(self):
"""
Returns the current ``Site`` based on the SITE_ID in the
project's settings. The ``Site`` object is cached the first
... | bsd-3-clause |
aburleigh94/LehighPV | doc/ext/pvsample.py | 6 | 2202 | """
Adds the pv-sample directive that allows to show code for an
example which is at the same time executed life on the web-page.
"""
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.util.compat import make_admonition
from sphinx.util.nodes import set_source_info
from sphinx.locale imp... | mit |
yasoob/youtube-dl-GUI | youtube_dl/extractor/discoveryvr.py | 59 | 2129 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import parse_duration
class DiscoveryVRIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?discoveryvr\.com/watch/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.discoveryvr.com/watch/discovery-vr-an... | mit |
wujuguang/sentry | src/sentry/interfaces/base.py | 13 | 3049 | from __future__ import absolute_import
from django.conf import settings
from django.utils.html import escape
from django.utils.translation import ugettext as _
from sentry.utils.imports import import_string
def get_interface(name):
try:
import_path = settings.SENTRY_INTERFACES[name]
except KeyError:... | bsd-3-clause |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/django/contrib/sitemaps/tests/urls.py | 233 | 1275 | from datetime import datetime
from django.conf.urls.defaults import *
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap
from django.contrib.auth.models import User
class SimpleSitemap(Sitemap):
changefreq = "never"
priority = 0.5
location = '/location/'
lastmod = datetime.now... | gpl-3.0 |
msiedlarek/qtwebkit | Tools/Scripts/webkitpy/test/runner.py | 130 | 3330 | # Copyright (C) 2012 Google, Inc.
#
# 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
# notice, this list of conditions and the following disclaimer... | lgpl-3.0 |
Oteng/youtube-dl | youtube_dl/extractor/c56.py | 162 | 1365 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class C56IE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|player)\.)?56\.com/(?:.+?/)?(?:v_|(?:play_album.+-))(?P<textid>.+?)\.(?:html|swf)'
IE_NAME = '56.com'
_TEST = {
'url': 'http://www.56.... | unlicense |
manaris/jythonMusic | library/jython2.5.3/Lib/test/test_generators.py | 9 | 50380 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback (most recent call la... | gpl-3.0 |
dnerdy/namesync | namesync/packages/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | mit |
stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/modules/ini_manage.py | 2 | 11110 | # -*- coding: utf-8 -*-
'''
Edit ini files
:maintainer: <akilesh1597@gmail.com>
:maturity: new
:depends: re
:platform: all
(for example /etc/sysctl.conf)
'''
# Import Python libs
from __future__ import print_function
from __future__ import absolute_import
import re
import json
from salt.utils.odict import OrderedDic... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/nltk/tag/api.py | 17 | 3616 | # Natural Language Toolkit: Tagger Interface
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Interface for tagging each token in... | agpl-3.0 |
GunoH/intellij-community | python/helpers/coveragepy/coverage/parser.py | 39 | 39537 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code parsing for coverage.py."""
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward... | apache-2.0 |
robblack007/clase-dinamica-robot | Practicas/practica2/robots/graficacion.py | 4 | 3522 | def rotacion_geom_3d(pathpatch, rotacion):
'''
Esta función toma un objeto asociado a una gráfica de matplotlib y aplica una matriz
de rotación al objeto (convirtiendolo a tres dimensiones).
>>> from robots.utilidades import DH
>>> from robots.graficacion import rotacion_geom_3d
>>> from ma... | mit |
huobaowangxi/scikit-learn | examples/text/hashing_vs_dict_vectorizer.py | 284 | 3265 | """
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | bsd-3-clause |
mikedanese/contrib | diurnal/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/lines.py | 2 | 50873 | """
This module contains all the 2D line class which can draw with a
variety of line styles, markers and colors.
"""
# TODO: expose cap and join style attrs
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import numpy as np
fro... | mit |
tsw-apropos/mapbiographer | mapBiographer/ui_mapbio_manager.py | 1 | 98907 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_mapbio_manager.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _from... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.