repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
pax2you4now/wesnoth | scons/python_devel.py | 49 | 1381 | # vi: syntax=python:et:ts=4
import sys, os
from config_check_utils import backup_env, restore_env
import distutils.sysconfig
def exists():
return True
def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), ... | gpl-2.0 |
Tocknicsu/nctuoj | backend/web/user.py | 1 | 2943 | from req import WebRequestHandler
from req import Service
import tornado
import math
class WebUsersHandler(WebRequestHandler):
@tornado.gen.coroutine
def get(self):
if self.map_power['user_manage'] not in self.account['power']:
self.write_error(403)
return
args = ["page... | mit |
DarkRebel/myrobotlab | src/resource/Python/examples/AdafruitMotoShield.Stepper.py | 5 | 1115 |
// create a 200 step stepper on adafruitsheild port 1
Stepper stepper1 = fruity.createStepper(200, 1);
// step 100 in one direction
stepper1.step(100);
// step 100 in the other
stepper1.step(-100);
// FIXME - needs to be cleaned up - tear down
fruity.releaseStepper(stepper1.getName());
# Arduino and motor details... | apache-2.0 |
Dark-Hacker/horizon | openstack_dashboard/dashboards/admin/volumes/volumes/views.py | 13 | 6688 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
eric-stanley/selenium | py/selenium/webdriver/common/keys.py | 71 | 2748 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
lthurlow/Network-Grapher | proj/external/numpy-1.7.0/build/lib.linux-i686-2.7/numpy/distutils/exec_command.py | 2 | 18578 | #!/usr/bin/env python
"""
exec_command
Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments fo... | mit |
andersinno/django-analog | analog/define.py | 1 | 2981 | from django.db import models
from .models import BaseLogEntry
all_known_log_models = {}
def define_log_model(
model_class,
base_class=BaseLogEntry,
on_delete=models.CASCADE,
allow_null_target=False,
):
"""
Define a log model for a given Django model class ("parent model").
The log entry... | mit |
mlperf/training_results_v0.6 | Google/benchmarks/mask/implementations/tpu-v3-256-mask/mask_rcnn/object_detection/shape_utils.py | 22 | 2359 | # Copyright 2017 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 |
HyperionROM/android_external_chromium | net/tools/testserver/backoff_server.py | 64 | 1382 | #!/usr/bin/python2.4
# Copyright (c) 2011 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.
"""This is a simple HTTP server for manually testing exponential
back-off functionality in Chrome.
"""
import BaseHTTPServer
impor... | bsd-3-clause |
RedRightHand/llvm-analyses | cse231-proj1/llvm/src/utils/lint/cpp_lint.py | 147 | 3031 | #!/usr/bin/python
#
# Checks C++ files to make sure they conform to LLVM standards, as specified in
# http://llvm.org/docs/CodingStandards.html .
#
# TODO: add unittests for the verifier functions:
# http://docs.python.org/library/unittest.html .
import common_lint
import re
import sys
def VerifyIncludes(filename, li... | gpl-2.0 |
gaoxiaofeng/troubleShooting | src/troubleshooting/framework/template/Keyword.py | 1 | 1763 | from troubleshooting.framework.modules.configuration import ConfigManagerInstance
from troubleshooting.framework.remote.client import client
from troubleshooting.framework.libraries.bash import ExecuteCommond
try:
#import project config.variable
from config.variable import *
except:
print "WARN: failed to i... | apache-2.0 |
palaniyappanBala/thug | src/Analysis/peepdf/jsbeautifier/unpackers/myobfuscate.py | 175 | 2832 | #
# deobfuscator for scripts messed up with myobfuscate.com
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
# CAVEAT by Einar Lielmanis
#
# You really don't want to obfuscate yo... | gpl-2.0 |
Hastwell/baconbot | nbt/chunk.py | 6 | 7930 | """
Handles a single chunk of data (16x16x128 blocks) from a Minecraft save.
Chunk is currently McRegion only.
"""
from io import BytesIO
from struct import pack, unpack
import array, math
class Chunk(object):
"""Class for representing a single chunk."""
def __init__(self, nbt):
chunk_data = nbt['Level... | gpl-2.0 |
scionoftech/PushyNotification | pushy_server/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
marratj/ansible | lib/ansible/modules/network/nxos/nxos_portchannel.py | 10 | 15668 | #!/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 |
georgemarshall/django | django/db/backends/sqlite3/operations.py | 5 | 14006 | import datetime
import decimal
import uuid
from functools import lru_cache
from itertools import chain
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import utils
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.models import aggregates... | bsd-3-clause |
hendradarwin/VTK | Utilities/Maintenance/VisualizeModuleDependencies.py | 12 | 11003 | #!/usr/bin/env python
'''
This program takes a list of module files and creates a (possibly disjoint)
directed graph of the modules and their dependencies. Arrows on the
directed graph point to the dependent module.
Typical usage would be as follows:
VisualizeModuleDependencies.py VTKSourceDir vtkFiltersSources,vtkI... | bsd-3-clause |
adityacs/ansible | lib/ansible/modules/network/junos/junos_package.py | 50 | 5163 | #!/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 |
Maistho/CouchPotatoServer | libs/requests/packages/urllib3/_collections.py | 484 | 10454 | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from ... | gpl-3.0 |
pombredanne/django-linkcheck | linkcheck/tests/__init__.py | 4 | 6017 | import urllib2
import socket
import re
import os
#MOCK addinfurl
class addinfoUrl():
"""class to add info() and getUrl(url=) methods to an open file."""
def __init__(self, url, code, msg):
self.headers = None
self.url = url
self.code = code
self.msg = msg
def info(self):
... | bsd-3-clause |
wscullin/spack | var/spack/repos/builtin/packages/r-permute/package.py | 3 | 1978 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
tqchen/tvm | tests/python/unittest/test_runtime_heterogeneous.py | 2 | 15150 | # 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... | apache-2.0 |
stephenlienharrell/roster-dns-management | test/dnslshost_test.py | 1 | 21050 | #!/usr/bin/python
# Copyright (c) 2009, Purdue University
# 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 ... | bsd-3-clause |
kawasaki2013/getting-started-python | optional-container-engine/tests/test_crud.py | 17 | 3024 | # Copyright 2015 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 or agreed to in writing, ... | apache-2.0 |
gigglesninja/senior-design | MissionPlanner/Lib/lib2to3/pgen2/conv.py | 325 | 9627 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Convert graminit.[ch] spit out by pgen to Python code.
Pgen is the Python parser generator. It is useful to quickly create a
parser from a grammar file in Python's grammar notation. But I don't
wa... | gpl-2.0 |
julienvey/solum | solum/tests/api/v1/test_plan.py | 1 | 6136 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | apache-2.0 |
gmimano/commcaretest | corehq/apps/domain/utils.py | 1 | 1991 | import json
import re
from couchdbkit import ResourceNotFound
from django.conf import settings
from dimagi.utils.couch.cache import cache_core
from corehq.apps.domain.models import Domain
from dimagi.utils.couch.database import get_db
from django.core.cache import cache
DOMAIN_MODULE_KEY = 'DOMAIN_MODULE_CONFIG'
ADM_D... | bsd-3-clause |
janusnic/youtube-dl-GUI | youtube_dl/extractor/daum.py | 118 | 2755 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class DaumIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)'
IE_NAME = 'daum.net'
_TESTS = [{
... | mit |
bigfatpaulyj/py-airfoil | scons-local-2.2.0/SCons/Variables/EnumVariable.py | 14 | 3872 | """engine.SCons.Variables.EnumVariable
This file defines the option type for SCons allowing only specified
input-values.
Usage example:
opts = Variables()
opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
allowed_values=('yes', 'no', 'full'),
map={}, ign... | gpl-3.0 |
bwasti/caffe2 | caffe2/python/layers/layers.py | 1 | 10652 | ## @package layers
# Module caffe2.python.layers.layers
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, schema, scope
from caffe2.python.layers.tags import TagContext
from collections i... | apache-2.0 |
ciaa/linux | tools/perf/python/twatch.py | 1565 | 1316 | #! /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 |
pyjs/pyjs | examples/asteroids/Space.py | 6 | 4946 | # Copyright 2009 Joe Rumsey (joe@rumsey.org)
# Copyright 2012 Charles Law (charles.law@gmail.com)
#
# 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/licen... | apache-2.0 |
RydrDojo/Ridr_app | pylotVenv/lib/python2.7/site-packages/pip/_vendor/html5lib/tokenizer.py | 1710 | 76929 | from __future__ import absolute_import, division, unicode_literals
try:
chr = unichr # flake8: noqa
except NameError:
pass
from collections import deque
from .constants import spaceCharacters
from .constants import entities
from .constants import asciiLetters, asciiUpper2Lower
from .constants import digits, ... | mit |
hiuwo/acq4 | acq4/analysis/tools/Fitting.py | 1 | 36006 | #!/usr/bin/env python
"""
Python class wrapper for data fitting.
Includes the following external methods:
getFunctions returns the list of function names (dictionary keys)
FitRegion performs the fitting
Note that FitRegion will plot on top of the current data using MPlots routines
if the current curve and the current ... | mit |
wangxin39/xstat | ManageSystem/WebContent/fckeditor/editor/filemanager/connectors/py/connector.py | 55 | 4026 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gn... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/repoze.who-2.3/docs/examples/standalone_login_no_who.py | 2 | 3146 | # Standalone login application for demo SSO:
# N.B.: this version does *not* use repoze.who at all, but should produce
# a cookie which repoze.who.plugin.authtkt can use.
import datetime
from paste.auth import auth_tkt
from webob import Request
LOGIN_FORM_TEMPLATE = """\
<html>
<head>
<title> Demo SSO Login </t... | apache-2.0 |
abought/osf.io | scripts/migrate_unregistered.py | 61 | 4757 | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""Migrates old-style unregistered users (dictionaries in Node#contributor_list)
to actual User records.
"""
import logging
from modularodm.exceptions import ValidationValueError
from website import app, models
from framework import auth
from framework.auth import Auth
from tests... | apache-2.0 |
rkmaddox/expyfun | expyfun/io/tests/test_wav.py | 3 | 2485 | # -*- coding: utf-8 -*-
import numpy as np
from nose.tools import assert_equal, assert_raises
from numpy.testing import assert_array_almost_equal, assert_array_equal
from os import path as op
import warnings
from expyfun._utils import _TempDir, _has_scipy_version
from expyfun.io import read_wav, write_wav
warnings.si... | bsd-3-clause |
JoelEager/pyTanks.Player | clientLogic/clock.py | 1 | 5148 | """
The asyncio code that maintains a consistent frame rate and runs the on-frame logic
"""
import math
import json
from datetime import datetime
import asyncio
import config
from aiLogic import tankAI
from . import clientData
from .logging import logPrint
running = True # The asyncio event loop will end wh... | mit |
codevlabs/ZeroNet | plugins/Trayicon/TrayiconPlugin.py | 10 | 4312 | import time
import os
import sys
import atexit
from Plugin import PluginManager
from Config import config
allow_reload = False # No source reload supported in this plugin
@PluginManager.registerTo("Actions")
class ActionsPlugin(object):
def main(self):
global notificationicon, winfolders
from ... | gpl-2.0 |
stevenbrichards/boto | boto/ec2/ec2object.py | 150 | 5554 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus 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
# w... | mit |
alxgu/ansible | lib/ansible/plugins/doc_fragments/default_callback.py | 45 | 2283 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
display_skipped_hosts:
name: Show skipped hosts
description: "Toggl... | gpl-3.0 |
sahiljain/catapult | telemetry/telemetry/timeline/trace_data.py | 6 | 11161 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import json
import logging
import os
import shutil
import subprocess
import tempfile
from telemetry.core import util
_TRACE2HTML_PATH = os.pat... | bsd-3-clause |
rchicoli/samba | selftest/selftest.py | 4 | 16699 | #!/usr/bin/python -u
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2012 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2007-2009 Stefan Metzmacher <metze@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 |
bacontext/mopidy | tests/test_httpclient.py | 13 | 1421 | from __future__ import unicode_literals
import re
import pytest
from mopidy import httpclient
@pytest.mark.parametrize("config,expected", [
({}, None),
({'hostname': 'proxy.lan'}, 'http://proxy.lan:80'),
({'scheme': None, 'hostname': 'proxy.lan'}, 'http://proxy.lan:80'),
({'scheme': 'https', 'hostn... | apache-2.0 |
maciekcc/tensorflow | tensorflow/python/debug/cli/curses_ui_test.py | 57 | 59063 | # 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 |
TreesLab/NCLscan | bin/create_reference.py | 1 | 3080 | #! /usr/bin/env python2
import argparse
import re
import os
import sys
from collections import OrderedDict
def create_reference_and_index(config):
'''
Create the reference and index for NCLscan.
1. Repeat_ChrM
2. AllRef.fa
3. Bwa index
4. Novoalign index
'''
config... | mit |
nilearn/nilearn_sandbox | examples/rpbi/plot_localizer_rpbi.py | 1 | 4435 | """
Massively univariate analysis of a computation task from the Localizer dataset
==============================================================================
A permuted Ordinary Least Squares algorithm is run at each voxel in
order to determine which voxels are specifically active when a healthy subject
performs a... | bsd-3-clause |
hyundukkim/WATT | tools/WebIDLBinder/third_party/ply/test/lex_optimize3.py | 164 | 1062 | # -----------------------------------------------------------------------------
# lex_optimize3.py
#
# Writes table in a subdirectory structure.
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = (
... | apache-2.0 |
luca76/QGIS | python/ext-libs/jinja2/bccache.py | 116 | 11902 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... | gpl-2.0 |
shakamunyi/tensorflow | tensorflow/contrib/image/__init__.py | 19 | 2181 | # 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 |
mantidproject/mantid | scripts/Diffraction/isis_powder/routines/yaml_sanity.py | 3 | 2383 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
de... | gpl-3.0 |
edxnercel/edx-platform | lms/djangoapps/verify_student/migrations/0001_initial.py | 114 | 7568 | # -*- 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 'SoftwareSecurePhotoVerification'
db.create_table('verify_student_softwaresecurephotoverifica... | agpl-3.0 |
ShinySide/HispAsian_Kernel_NH7 | build-all.py | 75 | 10510 | #! /usr/bin/env python
# Copyright (c) 2009-2011, 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 the above copyright
# ... | gpl-2.0 |
yasoob/PythonRSSReader | venv/lib/python2.7/site-packages/pip/index.py | 237 | 47847 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mit |
badock/nova | nova/api/openstack/compute/contrib/quota_classes.py | 13 | 4976 | # Copyright 2012 OpenStack Foundation
# 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... | apache-2.0 |
meyburgh/googletest | scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
ldhwin/pywinauto | pywinauto/__init__.py | 14 | 1225 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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 Foundation; either version 2.1
# of the License, or (at you... | lgpl-2.1 |
ujjvala-addsol/addsol_hr | openerp/addons/stock_landed_costs/stock_landed_costs.py | 56 | 18361 | # -*- 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 |
jaredmichaelsmith/grove | api/resources/UserResource.py | 1 | 1057 | # -*- coding: utf-8 -*-
"""HTTP resources for the comment entities."""
# Third-Party modules
from flask_restful import Resource
from flask_restful import fields
from flask_restful import marshal_with
from flask_restful import current_app
# Project specific modules
from api.models import User
from api.utils import ... | mit |
av8ramit/tensorflow | tensorflow/contrib/eager/python/examples/mnist/mnist.py | 2 | 9148 | # Copyright 2017 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 |
m-movahhedinia/Strigil | v_0.0.1.py | 1 | 5683 | from urllib import request
from bs4 import BeautifulSoup
import re
from builtins import print
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
"""
The source for the very first version of the web scrapper app.
No classes or functions. Just codes.
"""
# Open the fil... | agpl-3.0 |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pycoin/services/blockchain_info.py | 1 | 2303 | import io
import json
import warnings
from .agent import request, urlencode, urlopen
from pycoin.serialize import b2h, h2b
from pycoin.tx import Spendable
class BlockchainInfoProvider(object):
def __init__(self, netcode):
if netcode != 'BTC':
raise ValueError("BlockchainInfo only supports ma... | gpl-3.0 |
alangwansui/mtl_ordercenter | openerp/addons/purchase/report/__init__.py | 68 | 1108 | # -*- 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 |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/wheel/signatures/ed25519py.py | 565 | 1695 | # -*- coding: utf-8 -*-
import warnings
import os
from collections import namedtuple
from . import djbec
__all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair',
'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES']
PUBLICKEYBYTES=32
SECRETKEYBYTES=64
SIGNATUREBYTES=64
Keypair = n... | mit |
mjcollin/2016spr | notebook/lib/pos_tags.py | 1 | 1029 | import nltk
class PosTags:
def tag(self, t, as_dicts=True):
'''
With a list of tokens, mark their part of speech and return
a list dicts (no native tuple type in dataframes it seems).
'''
pos = nltk.pos_tag(t)
if as_dicts:
return self.to_dicts(pos)
... | mit |
rohe/pysaml2-3 | tests/test_05_md.py | 1 | 52530 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Umeå University.
#
# 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
#
# U... | bsd-2-clause |
mrkm4ntr/incubator-airflow | tests/executors/test_debug_executor.py | 11 | 3877 | # 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... | apache-2.0 |
yongshengwang/hue | desktop/core/ext-py/kazoo-2.0/kazoo/recipe/party.py | 54 | 3886 | """Party
:Maintainer: Ben Bangert <ben@groovie.org>
:Status: Production
A Zookeeper pool of party members. The :class:`Party` object can be
used for determining members of a party.
"""
import uuid
from kazoo.exceptions import NodeExistsError, NoNodeError
class BaseParty(object):
"""Base implementation of a pa... | apache-2.0 |
lhilt/scipy | scipy/sparse/linalg/tests/test_onenormest.py | 27 | 9311 | """Test functions for the sparse.linalg._onenormest module
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_
import pytest
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse.linalg._onenormest import _... | bsd-3-clause |
GFI-Informatique/georchestra | mapfishapp/test_windmill/util/gen-go-windmill.py | 7 | 1443 | #!/usr/bin/env python
"""Generate go-jstools.py"""
import sys
import textwrap
import virtualenv
filename = 'go-windmill.py'
after_install = """\
import os, subprocess
def after_install(options, home_dir):
etc = join(home_dir, 'etc')
## TODO: this should all come from distutils
## like distutils.sysconfig.... | gpl-3.0 |
behzadnouri/numpy | numpy/polynomial/legendre.py | 5 | 57194 | """
Legendre Series (:mod: `numpy.polynomial.legendre`)
===================================================
.. currentmodule:: numpy.polynomial.polynomial
This module provides a number of objects (mostly functions) useful for
dealing with Legendre series, including a `Legendre` class that
encapsulates the usual arith... | bsd-3-clause |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/core/serializers/pyyaml.py | 115 | 2635 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import decimal
import yaml
import sys
from io import StringIO
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSe... | gpl-2.0 |
mrquim/mrquimrepo | plugin.video.castaway/resources/lib/sources/on_demand_sport/Other/rutube_nhlnba.py | 4 | 1244 | from __future__ import unicode_literals
from resources.lib.modules import client,webutils,convert
import re,urlparse,json
from resources.lib.modules.log_utils import log
class info():
def __init__(self):
self.mode = 'rutube_nhlnba'
self.name = 'Rutube NHL/NBA 2015./16.'
self.icon = 'rutube.p... | gpl-2.0 |
serl/hls-bba-testbed | pylibs/parallelize.py | 1 | 2494 | from multiprocessing import Process, Pipe
import sys, time
class AsyncFunction(object):
def __init__(self, fn, args=(), kwargs={}, return_obj=None, return_attr=None):
self.fn = fn
self.args = args
self.kwargs = kwargs
self.result = None
self.return_obj = return_obj
self.return_attr = return_attr
self._c... | mit |
manuelep/pydal | pydal/contrib/reserved_sql_keywords.py | 29 | 26960 | # encoding utf-8
__author__ = "Thadeus Burgess <thadeusb@thadeusb.com>"
# we classify as "non-reserved" those key words that are explicitly known
# to the parser but are allowed as column or table names. Some key words
# that are otherwise non-reserved cannot be used as function or data type n
# ames and ... | bsd-3-clause |
DiamondLightSource/auto_tomo_calibration-experimental | old_code_scripts/measure_resolution/lmfit-py/examples/example_covar.py | 4 | 2319 | import sys
from numpy import linspace, zeros, sin, exp, random, sqrt, pi, sign
from scipy.optimize import leastsq
from lmfit import Parameters, Minimizer, report_fit
from lmfit.lineshapes import gaussian
try:
import pylab
HASPYLAB = True
except ImportError:
HASPYLAB = False
HASPYLAB = False
def residual... | apache-2.0 |
HiroIshikawa/21playground | payblog/blog/lib/python3.5/site-packages/pygments/lexers/igor.py | 72 | 16870 | # -*- coding: utf-8 -*-
"""
pygments.lexers.igor
~~~~~~~~~~~~~~~~~~~~
Lexers for Igor Pro.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, words
from pygments.token import Text, Commen... | mit |
zuotingbing/spark | python/pyspark/rddsampler.py | 157 | 4250 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/limelight.py | 18 | 15181 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
smuggle_url,
unsmuggle_url,
ExtractorError,
)
class LimelightBaseIE(InfoExtractor):
_... | gpl-3.0 |
kbrebanov/ansible-modules-extras | database/vertica/vertica_facts.py | 15 | 9256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
S0lll0s/powerline | powerline/lib/overrides.py | 33 | 1815 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import json
from powerline.lib.dict import REMOVE_THIS_KEY
def parse_value(s):
'''Convert string to Python object
Rules:
* Empty string means that corresponding key should be removed from the
... | mit |
lokeshjindal15/gem5_transform | src/mem/slicc/ast/DeclListAST.py | 65 | 2271 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
synth3tk/the-blue-alliance | tests/test_notification_base.py | 7 | 1200 | import unittest2
import json
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.client_type import ClientType
from consts.notification_type import NotificationType
from notifications.ping import PingNotification
class TestBaseNotification(unittest2.TestCase):
def setUp(sel... | mit |
rsalmaso/scripts | scripts/cdblank.py | 1 | 5608 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 1999-2015, Raffaele Salmaso <raffaele@salmaso.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, includ... | mit |
SUNET/eduid-common | src/eduid_common/api/request.py | 1 | 9772 | #
# Copyright (c) 2018 NORDUnet A/S
# 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
# notice, this list of ... | bsd-3-clause |
pymedusa/Medusa | medusa/providers/generic_provider.py | 1 | 42303 | # coding=utf-8
"""Provider code for Generic Provider."""
from __future__ import unicode_literals
import logging
import operator
import re
from builtins import map
from builtins import object
from builtins import str
from datetime import datetime, timedelta
from os.path import join
from dateutil import parser, tz
f... | gpl-3.0 |
zkraime/osf.io | framework/transactions/handlers.py | 34 | 2780 | # -*- coding: utf-8 -*-
import httplib
import logging
from flask import request, current_app
from pymongo.errors import OperationFailure
from framework.transactions import utils, commands, messages
from website import settings
LOCK_ERROR_CODE = httplib.BAD_REQUEST
NO_AUTO_TRANSACTION_ATTR = '_no_auto_transaction'... | apache-2.0 |
tkarna/cofs | test/tracerEq/test_consistency_2d.py | 1 | 5860 | """
Tracer box in 2D
================
Solves a standing wave in a rectangular basin using wave equation.
This version uses a constant tracer to check local/global conservation of tracers.
Initial condition for elevation corresponds to a standing wave.
Time step and export interval are chosen based on theoretical
osc... | mit |
martin-neuhaeusser/benchexec | benchexec/oomhandler.py | 2 | 6248 | # BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... | apache-2.0 |
aLaix2/O-Nes-Sama | DebuggerClient/PPUDebugger.py | 1 | 8074 | import wx
import Breakpoint
import Debugger
import DialogAddBreakpoint
import GUI
class PPUDebuggerFrame(GUI.MainFrame, Debugger.Debugger):
#constructor
def __init__(self, parent):
GUI.MainFrame.__init__(self, parent)
Debugger.Debugger.__init__(self)
self.addBreakpointFra... | gpl-3.0 |
cjdelisle/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/common_test.py | 13 | 2021 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | gpl-3.0 |
steventimberman/masterDebater | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 514 | 4531 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from nt... | mit |
realsagi/python_koans | python2/koans/about_lists.py | 54 | 2995 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutArrays in the Ruby Koans
#
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(__, len(empty_list))
def test_lis... | mit |
fuzeman/trakt.py | tests/oauth/test_oauth.py | 1 | 5552 | from __future__ import absolute_import, division, print_function
from tests.core import mock
from tests.core.helpers import assert_url
from trakt import Trakt, TraktClient
from httmock import HTTMock
from threading import Event
import calendar
import datetime
import pytest
def test_authorize_url():
Trakt.site_u... | mit |
gojira/tensorflow | tensorflow/contrib/cluster_resolver/python/training/cluster_resolver_test.py | 23 | 8811 | # Copyright 2017 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 applicable ... | apache-2.0 |
bokeh/bokeh | bokeh/client/session.py | 1 | 21780 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
nmrao/robotframework | src/robot/model/totalstatistics.py | 27 | 2283 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
zutshi/S3CAMR | examples/spi/spi_plant.py | 1 | 2022 |
# Must satisfy the signature
# [t,X,D,P] = sim_function(T,X0,D0,P0,I0);
import numpy as np
from scipy.integrate import ode
import matplotlib.pyplot as PLT
PLOT = True
class SIM(object):
def __init__(self, plt, pvt_init_data):
#print I
# atol = 1e-10
rtol = 1e-5
# tt,YY,dummy_D,... | bsd-2-clause |
irwinlove/django | django/middleware/cache.py | 372 | 7303 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.