repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
aaronorosen/horizon-congress | refs/heads/master | openstack_dashboard/dashboards/project/access_and_security/keypairs/urls.py | 5 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
klingebj/regreg | refs/heads/master | code/regreg/atoms/block_norms.py | 1 | """
This module contains the implementation of block norms, i.e.
l1/l*, linf/l* norms. These are used in multiresponse LASSOs.
"""
import warnings
import numpy as np
import seminorms
from ..identity_quadratic import identity_quadratic
from ..problems.composite import smooth_conjugate
from ..objdoctemplates import ob... |
xuxiao/zulip | refs/heads/master | zerver/lib/socket.py | 121 | from __future__ import absolute_import
from django.conf import settings
from django.utils.importlib import import_module
from django.utils import timezone
from django.contrib.sessions.models import Session as djSession
import sockjs.tornado
import tornado.ioloop
import ujson
import logging
import time
from zerver.mo... |
xchenum/quantum | refs/heads/master | quantum/tests/unit/extensions/v2attributes.py | 2 | # Copyright (c) 2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
MIPS/external-chromium_org-tools-gyp | refs/heads/dev-mips-jb-kitkat | test/intermediate_dir/gyptest-intermediate-dir.py | 243 | #!/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.
"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... |
ruo91/letsencrypt | refs/heads/master | letsencrypt/proof_of_possession.py | 14 | """Proof of Possession Identifier Validation Challenge."""
import logging
import os
from cryptography import x509
from cryptography.hazmat.backends import default_backend
import zope.component
from acme import challenges
from acme import jose
from acme import other
from letsencrypt import interfaces
from letsencrypt... |
parker-mar/BB10-WebWorks-Community-Samples | refs/heads/master | Ant-Cordova-Build-Script/tools/apache-ant-1.8.2/bin/runant.py | 124 | #!/usr/bin/python
# 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 "Licen... |
diorcety/translate | refs/heads/master | translate/filters/decorators.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright 2012 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 y... |
dim0/ansible-commander | refs/heads/master | lib/main/migrations/0006_changes.py | 3 | # -*- 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 field 'Team.organization'
db.add_column(u'main_team', 'organization',
self.gf... |
oleiade/Elevator | refs/heads/master | elevator/utils/patterns.py | 2 | from collections import Sequence
# Enums beautiful python implementation
# Used like this :
# Numbers = enum('ZERO', 'ONE', 'TWO')
# >>> Numbers.ZERO
# 0
# >>> Numbers.ONE
# 1
# Found here: http://stackoverflow.com/questions/36932/whats-the-best-way-to-implement-an-enum-in-python
def enum(*sequential, **named):
en... |
yekeqiang/mypython | refs/heads/master | socketserver.py | 1 | #!/usr/bin/env python
# Basic SocketServer Example
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
import time
class TimeRequestHandler(StreamRequestHandler):
def handle(self):
req = self.rfile.readline().strip()
if req == "asctime":
result = time.asctime()
... |
Geode/geonode | refs/heads/master | geonode/geoserver/tests.py | 12 | # -*- 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 ... |
ahMarrone/solar_radiation_model | refs/heads/master | models/stats.py | 4 | # This file contains a fraction of the scipy library to simplify a complex
# instrallation process inside the Makefile. The entire source code of this
# file can be downloaded from the next URL:
# https://github.com/scipy/scipy/blob/v0.13.0/scipy/stats/stats.py
import numpy as np
from numpy import array
def scoreatpe... |
marhar/cx_OracleTools | refs/heads/master | cx_PyGenLib/cx_Utils.py | 1 | """Defines a number of utility functions."""
import cx_Exceptions
import cx_Logging
import glob
import os
import sys
if sys.platform == "win32":
import _winreg
class CommandExecutionFailed(cx_Exceptions.BaseException):
message = "Execution of command %(command)s failed with exit code " \
"%(exi... |
fran-penedo/dreal | refs/heads/master | tools/proofcheck/split.py | 16 | #!/usr/bin/python
import sys
import os
import shutil
trace_name = sys.argv[1]
base_name, ext = os.path.splitext(trace_name)
input = open(trace_name)
counter = 0
def touch(fname, times=None):
with file(fname, 'a'):
os.utime(fname, times)
def get_newname():
global counter
counter = counter + 1
... |
KousikaGanesh/purchaseandInventory | refs/heads/master | openerp/addons/web_linkedin/web_linkedin.py | 25 | # -*- 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... |
microsoft/LightGBM | refs/heads/master | examples/python-guide/sklearn_example.py | 1 | # coding: utf-8
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import GridSearchCV
import lightgbm as lgb
print('Loading data...')
# load or create your dataset
df_train = pd.read_csv('../regression/regression.train', header=None, sep='\t')
df_test =... |
ChameleonCloud/horizon | refs/heads/chameleoncloud/train | openstack_dashboard/dashboards/admin/flavors/panel.py | 7 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
indictranstech/erpnext | refs/heads/develop | erpnext/hr/doctype/training_result/test_training_result.py | 51 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Training Result')
class TestTrainingResult(unittest.TestCase):
pass
|
pombredanne/pulp | refs/heads/master | nodes/child/pulp_node/__init__.py | 56 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
olemis/zebra | refs/heads/master | tests/io/jsonrpclib/config.py | 188 | import sys
class LocalClasses(dict):
def add(self, cls):
self[cls.__name__] = cls
class Config(object):
"""
This is pretty much used exclusively for the 'jsonclass'
functionality... set use_jsonclass to False to turn it off.
You can change serialize_method and ignore_attribute, or use
... |
levibostian/myBlanky | refs/heads/master | googleAppEngine/google/appengine/api/yaml_object.py | 13 | #!/usr/bin/env python
#
# Copyright 2007 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... |
Madril/env | refs/heads/master | emacs.d/pycomplete.py | 5 |
"""
Python dot expression completion using Pymacs.
This almost certainly needs work, but if you add
(require 'pycomplete)
to your .xemacs/init.el file (untried w/ GNU Emacs so far) and have Pymacs
installed, when you hit M-TAB it will try to complete the dot expression
before point. For example, given this imp... |
Belgabor/django | refs/heads/master | django/contrib/auth/management/__init__.py | 96 | """
Creates permissions for all installed apps that need permissions.
"""
from django.db.models import get_models, signals
from django.contrib.auth import models as auth_app
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retur... |
dmsul/econtools | refs/heads/master | econtools/util/gentools.py | 1 | from typing import Union, Generator, Optional, Any, Iterable
import string
import pandas as pd
def force_df(s: Union[pd.DataFrame, pd.Series],
name: Optional[str]=None) -> pd.DataFrame:
"""
Forces a Series to a DataFrame. DataFrames are returned unaffected. Other
objects raise `ValueError`.... |
Phil-LiDAR2-Geonode/pl2-geonode | refs/heads/master | geonode/base/forms.py | 11 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... |
cysuncn/python | refs/heads/master | spark/crm/PROC_A_SUBJECT_D004031.py | 1 | #coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_SUBJECT_D004031').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.... |
rockyzhengwu/mlscratch | refs/heads/master | mxent/maxent.py | 1 | #!/usr/bin/env python
# encoding: utf-8
import sys;
import math;
from collections import defaultdict
class MaxEnt:
def __init__(self):
self._samples = []; #样本集, 元素是[y,x1,x2,...,xn]的元组
self._Y = set([]); #标签集合,相当于去重之后的y
self._numXY = defaultdict(int); #Key是(xi,yi)对,Value是count(xi,yi)
... |
Samsung/skia | refs/heads/dev/m36_1985 | third_party/externals/gyp/test/win/gyptest-link-embed-manifest.py | 244 | #!/usr/bin/env python
# Copyright (c) 2013 Yandex LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure manifests are embedded in binaries properly. Handling of
AdditionalManifestFiles is tested too.
"""
import TestGyp
import sy... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/DunderAll/m1.py | 24 | __all__ = ["m1m1"]
__all__ += ["m1m2"]
def m1m1():
pass
def m1m2():
pass
def m1m3():
pass |
jianlirong/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/pexpect-4.2/pexpect/pty_spawn.py | 16 | import os
import sys
import time
import pty
import tty
import errno
import signal
from contextlib import contextmanager
import ptyprocess
from ptyprocess.ptyprocess import use_native_pty_fork
from .exceptions import ExceptionPexpect, EOF, TIMEOUT
from .spawnbase import SpawnBase
from .utils import which, split_comman... |
abingham/ycmd | refs/heads/master | ycmd/tests/bindings/cpp_bindings_general_test.py | 1 | # Copyright (C) 2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... |
jcftang/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <[email protected]>
#
# 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 Lice... |
littlstar/chromium.src | refs/heads/nw | tools/telemetry/telemetry/web_perf/metrics/rendering_stats.py | 4 | # 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 logging
from operator import attrgetter
from telemetry.page import page_test
from telemetry.web_perf.metrics import rendering_frame
# These are Laten... |
demon-ru/iml-crm | refs/heads/master | addons/purchase_requisition/__openerp__.py | 61 | ##############################################################################
#
# 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 Affero General Public L... |
partofthething/home-assistant | refs/heads/dev | homeassistant/components/smarthab/config_flow.py | 9 | """SmartHab configuration flow."""
import logging
import pysmarthab
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
# pylint: disable=unused-import
from . import DOMAIN
_LOGGER = logging.getLogger(__name__)
class SmartHabConfigFlow(config... |
robertkowalski/node-gyp | refs/heads/master | gyp/setup.py | 2462 | #!/usr/bin/env python
# Copyright (c) 2009 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.
from setuptools import setup
setup(
name='gyp',
version='0.1',
description='Generate Your Projects',
author='Chromium Authors',
a... |
morian/blacknet | refs/heads/master | blacknet/updater.py | 1 | import codecs
import csv
import os
import shutil
import sys
import tempfile
import zipfile
from .config import BlacknetConfig, BlacknetConfigurationInterface
from .database import BlacknetDatabase
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
GEOLITE_CSV_URL="https:... |
matbu/ansible-modules-extras | refs/heads/devel | packaging/os/pkgng.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, bleader
# Written by bleader <[email protected]>
# Based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew W... |
AI-Innovation/cs231n_ass1 | refs/heads/master | cs231n/vis_utils.py | 65 | from math import sqrt, ceil
import numpy as np
def visualize_grid(Xs, ubound=255.0, padding=1):
"""
Reshape a 4D tensor of image data to a grid for easy visualization.
Inputs:
- Xs: Data of shape (N, H, W, C)
- ubound: Output grid will have values scaled to the range [0, ubound]
- padding: The number of b... |
imanolarrieta/RL | refs/heads/master | examples/gridworld/ucrl.py | 1 |
"""
Agent Tutorial for RLPy
=================================
Assumes you have created the SARSA0.py agent according to the tutorial and
placed it in the current working directory.
Tests the agent on the GridWorld domain.
"""
__author__ = "Robert H. Klein"
from rlpy.Domains import GridWorld
from rlpy.Agents import UC... |
daishi4u/J7_Afterburner | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
MartyMacGyver/DirTreeDigest | refs/heads/master | python3/dirtreedigest/comparator.py | 1 | """
Copyright (c) 2017-2021 Martin F. Falatic
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 ... |
Snazz2001/BDA_py_demos | refs/heads/master | demos_ch11/demo11_1.py | 19 | """Bayesian data analysis
Chapter 11, demo 1
Gibbs sampling demonstration
"""
from __future__ import division
import threading
import numpy as np
import scipy.io # For importing a matlab file
from scipy import linalg, stats
import matplotlib as mpl
import matplotlib.pyplot as plt
# edit default plot settings (colou... |
hgl888/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/internal/backends/chrome_inspector/websocket.py | 25 | # Copyright 2013 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 __future__ import absolute_import
import socket
from telemetry.core import util
util.AddDirToPythonPath(
util.GetTelemetryDir(), 'third_party', 'w... |
zzcclp/spark | refs/heads/master | sql/hive/src/test/resources/data/scripts/doubleescapedtab.py | 131 | #
# 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... |
drodri/common | refs/heads/develop | settings/cppsettings.py | 5 | from biicode.common.settings.smart_serial import smart_serialize, smart_deserialize
from biicode.common.exception import ConfigurationFileError
import os
from biicode.common.settings.loader import yaml_dumps
class CPPSettings(object):
""" Store specific C++ settings
"""
def __init__(self):
self.ge... |
leonardowolf/bookfree | refs/heads/master | flask/lib/python2.7/ntpath.py | 4 | /usr/lib/python2.7/ntpath.py |
bcornwellmott/frappe | refs/heads/develop | frappe/custom/doctype/customize_form/customize_form.py | 5 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Customize Form is a Single DocType used to mask the Property Setter
Thus providing a better UI from user perspective
"""
import frappe
import frappe.translate
from frappe im... |
SimtterCom/gyp | refs/heads/master | test/relative/gyptest-default.py | 336 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simplest-possible build of a "Hello, world!" program
using the default build target.
"""
import TestGyp
test = TestGyp.TestGy... |
Ju2ender/CSharp-Exercise | refs/heads/master | shadowsocks/shadowsocks/daemon.py | 386 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-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 requi... |
ck1125/sikuli | refs/heads/master | sikuli-ide/resources/scripts/clean-dot-sikuli.py | 3 | import os
import re
import glob
import sys
def grep(string,list):
expr = re.compile(string)
return filter(expr.search,list)
if locals().has_key('bundle_path'):
path = bundle_path
#path = sys.argv[1]
f_py = glob.glob(path + "/*.py")
pngFilter = re.compile("\"([^\"]+\.png)\"", re.I)
goodFiles = []
for py in ... |
bobobox/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/apt_key.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <[email protected]>
# (c) 2012, Jayson Vantuyl <[email protected]>
#
# 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
#... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-1.4/django/conf/locale/es/formats.py | 100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \d\e F \d\e... |
opepin/container-transform | refs/heads/develop | container_transform/client.py | 5 | import click
from .converter import Converter
from .schema import InputTransformationTypes, OutputTransformationTypes
from .version import __version__
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.command(context_settings=CONTEXT_SETTINGS)
@click.argument(
'input_file',
default='/dev/s... |
JohnDenker/brython | refs/heads/master | www/src/Lib/test/test_tempfile.py | 23 | # tempfile.py unit tests.
import tempfile
import errno
import io
import os
import signal
import sys
import re
import warnings
import contextlib
import unittest
from test import support
if hasattr(os, 'stat'):
import stat
has_stat = 1
else:
has_stat = 0
has_textmode = (tempfile._text_openflags != tempfil... |
Alwnikrotikz/cortex-vfx | refs/heads/master | test/IECore/BoolVectorData.py | 12 | ##########################################################################
#
# Copyright (c) 2007-2012, Image Engine Design 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:
#
# * Redis... |
CERT-BDF/Cortex-Analyzers | refs/heads/master | analyzers/URLhaus/URLhaus_analyzer.py | 1 | #!/usr/bin/env python3
from cortexutils.analyzer import Analyzer
from URLhaus_client import URLhausClient
class URLhausAnalyzer(Analyzer):
def __init__(self):
Analyzer.__init__(self)
def run(self):
data = self.get_data()
if not data:
self.error('No observable or file given... |
kikusu/chainer | refs/heads/master | chainer/dataset/dataset_mixin.py | 1 | class DatasetMixin(object):
"""Default implementation of dataset indexing.
DatasetMixin provides the :meth:`__getitem__` operator. The default
implementation uses :meth:`get_exmample` to extract each example, and
combines the results into a list. This mixin makes it easy to implement a
new dataset... |
oneconvergence/group-based-policy | refs/heads/oneconvergence_service_node_driver | gbpservice/neutron/db/migration/alembic_migrations/versions/3791adbf0045_sc_shared_attribute.py | 4 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
MrNuggles/HeyBoet-Telegram-Bot | refs/heads/master | temboo/Library/Foursquare/Users/UpdatePhoto.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# UpdatePhoto
# Updates the user's profile photo.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... |
magic0704/neutron | refs/heads/master | neutron/tests/unit/agent/linux/test_bridge_lib.py | 17 | # Copyright 2015 Intel Corporation.
# Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licen... |
ProfMobius/ThinLauncher | refs/heads/master | surfaces/StatusBar.py | 1 | import pygame
from Constants import *
class StatusBar(pygame.Surface):
def __init__(self, w, h):
super(StatusBar, self).__init__((w, h), pygame.SRCALPHA)
def redraw(self, screen, x, y):
self.fill((150, 150, 150, 150))
screen.blit(self, self.get_rect(x=x, y=y))
|
jorge2703/scikit-learn | refs/heads/master | sklearn/preprocessing/imputation.py | 208 | # Authors: Nicolas Tresegnie <[email protected]>
# License: BSD 3 clause
import warnings
import numpy as np
import numpy.ma as ma
from scipy import sparse
from scipy import stats
from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array
from ..utils import as_float_array
from ..uti... |
bittner/django-allauth | refs/heads/master | allauth/socialaccount/providers/robinhood/urls.py | 12 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import RobinhoodProvider
urlpatterns = default_urlpatterns(RobinhoodProvider)
|
hengyicai/OnlineAggregationUCAS | refs/heads/master | dev/audit-release/audit_release.py | 8 | #!/usr/bin/python
#
# 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 "Licens... |
alexlo03/ansible | refs/heads/devel | lib/ansible/modules/network/netvisor/pn_trunk.py | 32 | #!/usr/bin/python
""" PN CLI trunk-create/trunk-delete/trunk-modify """
#
# 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 y... |
heimdalerp/heimdalerp | refs/heads/master | common/validators.py | 2 | import datetime
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
def date_is_future(value):
if isinstance(value, datetime.date):
if value <= datetime.date.today():
raise ValidationError(
_("The date entered must be grea... |
nanolearningllc/edx-platform-cypress | refs/heads/master | openedx/core/djangoapps/util/testing.py | 107 | """ Mixins for setting up particular course structures (such as split tests or cohorted content) """
from datetime import datetime
from pytz import UTC
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
f... |
scorpionis/docklet | refs/heads/master | client/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 713 | from __future__ import absolute_import
import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_b... |
j-mracek/dnf | refs/heads/master | tests/test_base.py | 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed ... |
daviwesley/OWASP-ZSC | refs/heads/master | lib/generator/windows_x64/exc.py | 20 | #!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
def run(filename):
return 'N'
|
acsproj/acscore | refs/heads/master | test/file_length_test.py | 1 | import unittest
from unittest.mock import patch
from unittest.mock import mock_open
from acscore import metrics
class FileLengthTest(unittest.TestCase):
def setUp(self):
self.file_length = metrics.FileLength()
self.data = {'5': 10, '35': 5, '100': 4, '105': 6}
def test_count(self):
... |
passiweinberger/passiweinberger.github.io | refs/heads/master | _site/presentations/IBM_Lab_Lecture/node_modules/utf8/tests/generate-test-data.py | 1788 | #!/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:
... |
JohannesFeldmann/pism | refs/heads/pik | examples/searise-greenland/future_forcing/average.py | 5 | #!/usr/bin/env python
from numpy import arange, squeeze, zeros, shape
from sys import exit
try:
from netCDF4 import Dataset as NC
except:
from netCDF3 import Dataset as NC
## prepare the output file:
def prepare_file(fname, x, y):
print " preparing file '%s'..." % fname
nc = NC(fname, "w",format="NE... |
hanvo/MusicCloud | refs/heads/master | Crawler/Install Files/pygame/build/lib.linux-x86_64-2.7/pygame/tests/run_tests__tests/everything/magic_tag_test.py | 36 | __tags__ = ['magic']
if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg... |
k3nnyfr/s2a_fr-nsis | refs/heads/master | s2a/Python/Lib/bdb.py | 144 | """Debugger basics"""
import fnmatch
import sys
import os
import types
__all__ = ["BdbQuit","Bdb","Breakpoint"]
class BdbQuit(Exception):
"""Exception to give up completely"""
class Bdb:
"""Generic Python debugger base class.
This class takes care of details of the trace facility;
a derived class... |
qtproject/pyside-pyside | refs/heads/dev | tests/QtQml/bug_557.py | 1 | #############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commercial ... |
aquarimeter/aquarimeter | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 714 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... |
scigghia/account-invoicing | refs/heads/8.0 | account_invoice_supplierinfo_update_discount/__openerp__.py | 6 | # -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Invoice - Discount Supplier Info Update',
'summary': 'In the supplier invoice, aut... |
nacc/autotest | refs/heads/master | client/tests/kvm/tests/pci_hotplug.py | 1 | import re
from autotest.client.shared import error
from autotest.client.virt import virt_utils, virt_vm, aexpect
def run_pci_hotplug(test, params, env):
"""
Test hotplug of PCI devices.
(Elements between [] are configurable test parameters)
1) PCI add a deivce (NIC / block)
2) Compare output of m... |
orlandi/connectomicsPerspectivesPaper | refs/heads/master | participants_codes/lukasz8000/DEMO/layers.py | 2 | import numpy as np
import cPickle
import gzip
import os
import sys
import time
import theano
import theano.tensor as T
from theano.ifelse import ifelse
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv
import theano.printing
import theano.tensor.shared_randomstreams
from... |
da-mkay/subsynco | refs/heads/master | src/subsynco/utils/textfile.py | 1 | #!/usr/bin/env python
'''
SubSynco - a tool for synchronizing subtitle files
Copyright (C) 2015 da-mkay
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 your o... |
anisyonk/pilot | refs/heads/master | saga/utils/pty_shell.py | 4 |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
import re
import os
import sys
import errno
import saga.utils.misc as sumisc
import radical.utils.logger as rul
import saga.utils.pty_shell_factory as supsf
import saga.uti... |
bbc/kamaelia | refs/heads/master | Code/Python/Kamaelia/Kamaelia/Apps/SA/Chassis.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... |
nhmc/xastropy | refs/heads/master | xastropy/igm/abs_sys/abs_survey.py | 2 | """
#;+
#; NAME:
#; abssys_utils
#; Version 1.0
#;
#; PURPOSE:
#; Module for Absorption Systems
#; 23-Oct-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
... |
jaruba/chromium.src | refs/heads/nw12 | tools/perf/metrics/speedindex.py | 9 | # Copyright 2013 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 collections
from metrics import Metric
from telemetry.image_processing import image_util
from telemetry.image_processing import rgba_color
from telem... |
ActionLuzifer/python-oauth2 | refs/heads/master | setup.py | 7 | #!/usr/bin/env python
from setuptools import setup, find_packages
import os, re
PKG='oauth2'
VERSIONFILE = os.path.join('oauth2', '_version.py')
verstr = "unknown"
try:
verstrline = open(VERSIONFILE, "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
MVSRE = r"^manual_verstr... |
ZTH1970/alcide | refs/heads/wip-Django1.7 | alcide/models.py | 1 | # -*- coding: utf-8 -*-
from django.db import models
from django.db.models import fields
from django import forms
from localflavor.fr.forms import FRPhoneNumberField, FRZipCodeField
from django.utils.text import capfirst
class BaseModelMixin(object):
def __repr__(self):
return '<%s %s %r>' % (self.__clas... |
jean/sentry | refs/heads/master | src/sentry/south_migrations/0047_migrate_project_slugs.py | 5 | # encoding: utf-8
import datetime
import six
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from django.template.defaultfilters import slugify
from sentry.db.models import update
for project... |
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/docutils/test/DocutilsTestSupport.py | 18 | # $Id: DocutilsTestSupport.py 7539 2012-11-26 13:50:06Z milde $
# Authors: David Goodger <[email protected]>;
# Garth Kidd <[email protected]>
# Copyright: This module has been placed in the public domain.
"""
Exports the following:
:Modules:
- `statemachine` is 'docutils.statemachine'
-... |
Thor77/youtube-dl | refs/heads/master | youtube_dl/extractor/dctp.py | 17 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class DctpTvIE(InfoExtractor):
_VALID_URL = r'https?://www.dctp.tv/(#/)?filme/(?P<id>.+?)/$'
_TEST = {
'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassa... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/gsuiteaddons/v1/google-cloud-workspace-add-ons-v1-py/tests/unit/gapic/__init__.py | 951 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/reader.py | 272 | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... |
beacloudgenius/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/draft_and_published.py | 116 | """
This module provides an abstraction for Module Stores that support Draft and Published branches.
"""
import threading
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from . import ModuleStoreEnum
# Things w/ these categories should never be marked as version=DRAFT
DIRECT_ONLY_CATEGOR... |
uchida/selenium | refs/heads/master | py/selenium/webdriver/remote/errorhandler.py | 5 | # 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... |
inspyration/django-gluon | refs/heads/master | gluon/saas/apps.py | 1 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class SaasConfig(AppConfig):
name = "saas"
verbose_name = _("Gluon - 02 - SAAS management")
|
arbrandes/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/xml_importer.py | 3 | """
Each store has slightly different semantics wrt draft v published. XML doesn't officially recognize draft
but does hold it in a subdir. Old mongo has a virtual but not physical draft for every unit in published state.
Split mongo has a physical for every unit in every state.
Given that, here's a table of semantics... |
yassersouri/pykov | refs/heads/master | pykov/learning.py | 1 | import numpy
from utils import add_logs, forward_path, backward_path, params_to_vector
import markov, evaluation
def baum_welch(observations, N, M, max_iters=1000, conv_crit=0.00001, INITIALIZATION_MODE="random"):
"""
N is the number of hidden states, M is the number of different possible observations
"""
... |
gdelpierre/ansible-modules-core | refs/heads/devel | network/cumulus/cl_bridge.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <[email protected]>
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.