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 |
|---|---|---|---|---|---|
caoning1985/sqt | src/strategy_py/google/protobuf/proto_builder.py | 168 | 5202 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | apache-2.0 |
Celedhrim/persomov | libs/rtorrent/__init__.py | 64 | 24837 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
daenamkim/ansible | lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py | 32 | 7935 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
sander76/home-assistant | tests/components/bond/test_entity.py | 3 | 5636 | """Tests for the Bond entities."""
import asyncio
from datetime import timedelta
from unittest.mock import patch
from bond_api import BPUPSubscriptions, DeviceType
from homeassistant import core
from homeassistant.components import fan
from homeassistant.components.fan import DOMAIN as FAN_DOMAIN
from homeassistant.c... | apache-2.0 |
daichi-yoshikawa/dnn | examples/mnist/nn_mnist.py | 1 | 3211 | # Authors: Daichi Yoshikawa <daichi.yoshikawa@gmail.com>
# License: BSD 3 clause
import sys
sys.path.append('../..')
import json
import numpy as np
"""Configure logger before importing dnnet."""
import logging.config
with open('../common/logging.json') as f:
data = json.load(f)
logging.config.dictConfig(data... | bsd-3-clause |
yingcuhk/LeetCode | Algorithms/#321 Create Maximum Number/PythonCode.py | 1 | 4004 |
"""
Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from the same array must be preserved. Return an array of the k digits. You should try to optimize your time and space complexity.
Ex... | mit |
lycantropos/VKScheduler | vk_scheduler/app.py | 1 | 10827 | import logging
import math
import os
import time
from typing import List
import requests
import vk.exceptions
from vk_app import App
from vk_app.app import captchured
from vk_app.models import VKPhoto, VKPhotoAlbum, VKVideo, VKPost
from vk_app.utils import make_delayed
from vk_scheduler.settings import (CONFIGURATION... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/it/wmz.py | 1 | 4252 | import requests,re,time,xbmcaddon
import resolveurl as urlresolver
from ..common import clean_title, clean_search,send_log,error_log
from ..scraper import Scraper
dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log")
User_Agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTM... | gpl-2.0 |
Dhivyap/ansible | lib/ansible/modules/network/fortios/fortios_ips_decoder.py | 13 | 10630 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/idlexlib/extensions/CythonScript.py | 7 | 13080 | # IDLEX EXTENSION
from __future__ import print_function
## """
## Copyright(C) 2011 The Board of Trustees of the University of Illinois.
## All rights reserved.
##
## Developed by: Roger D. Serwy
## University of Illinois
##
## Permission is hereby granted, free of charge, to any per... | gpl-3.0 |
cldershem/osf.io | website/profile/views.py | 5 | 22259 | # -*- coding: utf-8 -*-
import logging
import httplib
import httplib as http
from dateutil.parser import parse as parse_date
from flask import request
from modularodm.exceptions import ValidationError, NoResultsFound, MultipleResultsFound
from modularodm import Q
from framework import sentry
from framework.auth imp... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/network/lenovo/cnos_bgp.py | 59 | 19250 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... | gpl-3.0 |
dfunckt/django | tests/template_tests/filter_tests/test_escapejs.py | 64 | 2489 | from __future__ import unicode_literals
from django.template.defaultfilters import escapejs_filter
from django.test import SimpleTestCase
from django.utils import six
from django.utils.functional import lazy
from ..utils import setup
class EscapejsTests(SimpleTestCase):
@setup({'escapejs01': '{{ a|escapejs }}'... | bsd-3-clause |
optimumtact/CloudBot | cloudbot/util/test/test_colors.py | 38 | 1996 | import pytest
from cloudbot.util.colors import parse, strip, get_available_colours, get_available_formats, get_color, get_format, \
_convert, strip_irc, strip_all, IRC_COLOUR_DICT
test_input = "The quick $(brown, red)brown$(clear) fox$(fake) jumps over the $(bold)lazy dog$(clear)."
test_parse_output = "The quick... | gpl-3.0 |
horance-liu/tensorflow | tensorflow/python/kernel_tests/check_ops_test.py | 2 | 45181 | # 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 |
jokuf/hack-blog | users/migrations/0002_auto_20170322_2028.py | 1 | 2798 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-22 20:28
from __future__ import unicode_literals
from django.db import migrations, models
import users.managers
class Migration(migrations.Migration):
dependencies = [
('auth', '0008_alter_user_username_max_length'),
('users', '0001... | mit |
asteca/ASteCA | packages/best_fit/DEPRECATED/abcpmc_algor_DEPRECATED.py | 1 | 9822 |
import numpy as np
from scipy.optimize import differential_evolution as DE
import time as t
from .abcpmc import sampler, threshold
from ..synth_clust import synth_cluster
from . import likelihood
from .emcee_algor import varPars, closeSol, discreteParams, convergenceVals
def main(
lkl_method, e_max, err_lst, com... | gpl-3.0 |
salamer/django | tests/ordering/models.py | 261 | 1379 | """
Specifying ordering
Specify default ordering for a model using the ``ordering`` attribute, which
should be a list or tuple of field names. This tells Django how to order
``QuerySet`` results.
If a field name in ``ordering`` starts with a hyphen, that field will be
ordered in descending order. Otherwise, it'll be ... | bsd-3-clause |
FreeAgent/djangoappengine-starter | django/contrib/admin/sites.py | 80 | 17398 | import re
from django import http, template
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.contenttypes import views as contenttype_views
from django.views.decorators.csrf import ... | bsd-3-clause |
wyom/sympy | sympy/integrals/manualintegrate.py | 51 | 41607 | """Integration method that emulates by-hand techniques.
This module also provides functionality to get the steps used to evaluate a
particular integral, in the ``integral_steps`` function. This will return
nested namedtuples representing the integration rules used. The
``manualintegrate`` function computes the integra... | bsd-3-clause |
mwmuni/LIGGGHTS_GUI | OpenGL/raw/GL/AMD/gpu_shader_int64.py | 9 | 6133 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
konker/switchd | util/pidfile.py | 1 | 1188 | import fcntl
import os
# FROM: http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/
class PidFile(object):
"""Context manager that locks a pid file. Implemented as class
not generator because daemon.py is calling .__exit__() with no parameters
instead of the None, None, None s... | mit |
ppmt/Crust | flask/lib/python2.7/site-packages/migrate/tests/fixture/pathed.py | 79 | 2146 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import tempfile
from migrate.tests.fixture import base
class Pathed(base.Base):
# Temporary files
_tmpdir = tempfile.mkdtemp()
def setUp(self):
super(Pathed, self).setUp()
self.temp_usable_dir = tempfile.m... | gpl-2.0 |
BK-TN/Islander | systems.py | 1 | 4654 | import components, actions
import pygame
import math
from collections import defaultdict
from point import Point
class DrawingSystem:
def __init__(self, screen, camera_target):
self.screen = screen
self.camera_pos = Point(0,0,0)
self.camera_target = camera_target
self.tileset = pyga... | mit |
sadimanna/computer_vision | clustering/kmeansppclustering_with_gap_statistic.py | 1 | 2599 | #K-Means++ Clustering with Gap Statistic to determine the optimal number of clusters
import sys
import numpy as np
import scipy.io as sio
#import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.svm import SVC
filename = sys.argv[1]
datafile = sio.loadmat(filename)
data = datafile['bow']
sizeda... | gpl-3.0 |
Jeff-Tian/mybnb | Python27/Lib/csv.py | 7 | 17164 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from functools import reduce
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL,... | apache-2.0 |
JarbasAI/jarbas-core | mycroft/jarbas-skills/skill_apod/__init__.py | 1 | 4205 | from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill
from mycroft.util.log import getLogger
from mycroft.messagebus.message import Message
try:
# try to load display service
import sys
from os.path import dirname
sys.path.append(dirname(dirname(__file__)))
from serv... | gpl-3.0 |
vrieni/orange | source/pyxtract/makedep.py | 6 | 5006 | #! /usr/bin/env python
import os, re, sys
filenamedef=re.compile(r".*\..pp$")
includedef=re.compile(r'\s*#include\s*"(?P<filename>.*(([chpij]pp)|(px)))"')
filestemdef=re.compile(r'(?P<filestem>.*)\.(?P<fileextension>[^.]*)$')
def findfiles():
files = {}
for dir in dirs:
for filename in os.listdir(dir):
... | gpl-3.0 |
isvaldo/Ola_Bemobenses | tests/Selenium/environment/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py | 442 | 5732 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
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 ... | cc0-1.0 |
windedge/odoo | openerp/addons/test_impex/models.py | 392 | 5891 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
def selection_fn(obj, cr, uid, context=None):
return list(enumerate(["Corge", "Grault", "Wheee", "Moog"]))
def function_fn(model, cr, uid, ids, field_name, arg, context):
return dict((id, 3) for id in ids)
def function_fn_write(model, cr, uid, id, f... | agpl-3.0 |
michhar/flask-webapp-aml | env1/Lib/site-packages/pip/_vendor/html5lib/treewalkers/_base.py | 436 | 7014 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE... | mit |
AOKP/external_chromium_org | tools/PRESUBMIT.py | 35 | 1506 | # Copyright (c) 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.
"""Top-level presubmit script for bisect trybot.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmi... | bsd-3-clause |
dannykopping/mysql-utilities | mysql/utilities/common/tools.py | 1 | 12360 | #
# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in th... | gpl-2.0 |
nju520/youtube-dl | youtube_dl/extractor/jove.py | 177 | 3068 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate
)
class JoveIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)'
_CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide... | unlicense |
karna41317/personal_blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/util.py | 95 | 8306 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... | mit |
moylop260/odoo-dev | addons/product/report/product_pricelist.py | 341 | 5151 | # -*- 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 |
pearu/sympycore | sympycore/heads/base_exp_dict.py | 1 | 11228 |
__all__ = ['BASE_EXP_DICT']
from .base import heads, heads_precedence, ArithmeticHead
from ..core import init_module, Expr
init_module.import_heads()
init_module.import_numbers()
init_module.import_lowlevel_operations()
class BaseExpDictHead(ArithmeticHead):
""" BASE_EXP_DICT expression data is a dictionary of ... | bsd-3-clause |
fernandezcuesta/ansible | test/units/module_utils/basic/test_exit_json.py | 45 | 7162 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
openstack/python-tackerclient | tackerclient/osc/utils.py | 2 | 7872 | # Copyright 2016 NEC Corporation
#
# 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 ag... | apache-2.0 |
toobaz/pandas | pandas/tests/indexes/datetimes/test_timezones.py | 2 | 47130 | """
Tests for DatetimeIndex timezone-related methods
"""
from datetime import date, datetime, time, timedelta, tzinfo
import dateutil
from dateutil.tz import gettz, tzlocal
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import conversion, timezones
import pandas.util._test_decorators as td
imp... | bsd-3-clause |
thawatchai/mrkimontour | appengine-django/lib/django/contrib/admin/actions.py | 395 | 3316 | """
Built-in, globally-available admin actions.
"""
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import get_deleted_objects, model_ngettext
from django.core.exceptions import PermissionDenied
from django.db import router
from django.template.response impo... | gpl-2.0 |
gcarq/freqtrade | freqtrade/configuration/check_exchange.py | 1 | 3242 | import logging
from typing import Any, Dict
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import (available_exchanges, get_exchange_bad_reason, is_exchange_bad,
is_exchange_known_ccxt, is_exchange_officially_supported)
from freqtrade.state import RunMode
... | gpl-3.0 |
hver/ansible-modules-core | packaging/os/rpm_key.py | 60 | 7339 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# (c) 2013, Héctor Acosta <hector.acosta@gazzang.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 ... | gpl-3.0 |
thurt/arangodb | 3rdParty/V8-4.3.61/tools/run-deopt-fuzzer.py | 18 | 17279 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# noti... | apache-2.0 |
aungzanbaw/gjstest | third_party/gmock/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | apache-2.0 |
chen0031/nupic | nupic/data/record_stream.py | 39 | 15221 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
hugovk/terroroftinytown | terroroftinytown/tracker/base.py | 1 | 1068 | # encoding=utf-8
import tornado.web
from terroroftinytown.tracker.model import User
ACCOUNT_COOKIE_NAME = 'tottu'
ACCOUNT_TOKEN_COOKIE_NAME = 'tottt'
class BaseHandler(tornado.web.RequestHandler):
def get_current_user(self):
username_raw = self.get_secure_cookie(ACCOUNT_COOKIE_NAME)
token = sel... | mit |
pivonroll/Qt_Creator | tests/system/suite_tools/tst_designer_goto_slot/test.py | 3 | 3073 | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | gpl-3.0 |
yuwen41200/biodiversity-analysis | src/controller/main_action.py | 1 | 10383 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from dateutil.parser import parse
from pprint import pformat
from traceback import format_exc
from model.dataset import Dataset
from model.species import Species
from model.leaflet_map import LeafletMap
from model.scatter_plot import ScatterPlot
from view.spatial_analysi... | gpl-3.0 |
tdeboissiere/DeepLearningImplementations | WassersteinGAN/src/utils/general_utils.py | 7 | 1073 | import os
def remove_files(files):
"""
Remove files from disk
args: files (str or list) remove all files in 'files'
"""
if isinstance(files, (list, tuple)):
for f in files:
if os.path.isfile(os.path.expanduser(f)):
os.remove(f)
elif isinstance(files, str):... | mit |
brain-research/mirage-rl-bpttv | baselines/acktr/run_atari.py | 1 | 1510 | #!/usr/bin/env python
import os, logging, gym
from baselines import logger
from baselines.common import set_global_seeds
from baselines import bench
from baselines.acktr.acktr_disc import learn
from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv
from baselines.common.atari_wrappers import make_atari, wra... | mit |
thedep2/CouchPotatoServer | libs/pyutil/increasing_timer.py | 106 | 6607 | # Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
This module was invented when it was discovered that time.time() can return
decreasing answers, which was causing scheduled tasks to get executed out ... | gpl-3.0 |
jaysonsantos/servo | tests/wpt/css-tests/tools/html5lib/html5lib/ihatexml.py | 1727 | 16581 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... | mpl-2.0 |
takaakiaoki/PyFoam | PyFoam/ThirdParty/Gnuplot/test.py | 3 | 13092 | #! /usr/bin/env python
# $Id: test.py 302 2008-01-14 22:15:19Z bmcage $
# Copyright (C) 1999-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL). See LICENSE.txt for details.
"""test.py -- Exercise the Gnuplot.py module.
This module is not mea... | gpl-2.0 |
elkingtonmcb/h2o-2 | py/testdir_multi_jvm/test_GLM2grid_hastie.py | 9 | 2649 | import unittest, time, sys, copy
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_util, h2o_import as h2i
## Dataset created from this:
#
# from sklearn.datasets import make_hastie_10_2
# import numpy as np
# i = 1000000
# f = 10
# (X,y) = make_hastie_10_2(n_samples=i,random_state=None)
# y.sh... | apache-2.0 |
joemphilips/cloudbiolinux | cloudbio/deploy/main.py | 9 | 3796 | from argparse import ArgumentParser
import yaml
from cloudbio.deploy import deploy
DESC = "Creates an on-demand cloud instance, sets up applications, and transfer files to it."
## Properties that may be specified as args or in settings file,
## argument takes precedence.
ARG_PROPERTIES = [
# VM launcher options
... | mit |
v-iam/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/compute/v2015_06_15/operations/virtual_machine_scale_sets_operations.py | 2 | 55706 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
nhippenmeyer/django | django/template/defaultfilters.py | 224 | 28536 | """Default variable filters."""
from __future__ import unicode_literals
import random as random_module
import re
import warnings
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from pprint import pformat
from django.conf import settings
from django.utils import format... | bsd-3-clause |
netmanchris/PYHPEIMC | build/lib/pyhpeimc/plat/termaccess.py | 3 | 23499 | #!/usr/bin/env python3
# author: @netmanchris
# This section imports required libraries
import json
import requests
import ipaddress
HEADERS = {'Accept': 'application/json', 'Content-Type':
'application/json', 'Accept-encoding': 'application/json'}
def get_real_time_locate(ipAddress, auth, url):
"""
... | apache-2.0 |
dwavesystems/dimod | dimod/core/sampler.py | 1 | 9510 | # Copyright 2018 D-Wave Systems 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... | apache-2.0 |
dontnod/weblate | weblate/trans/tests/test_edit.py | 1 | 24404 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | gpl-3.0 |
xionzz/earthquake | venv/lib/python2.7/site-packages/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## 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... | mit |
dakcarto/QGIS | python/ext-libs/jinja2/__init__.py | 130 | 2270 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | gpl-2.0 |
jfpla/odoo | addons/project/report/__init__.py | 444 | 1069 | # -*- 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 |
jasonseminara/OpenSourceFinal | myvenv/lib/python3.5/site-packages/django/conf/locale/fr/formats.py | 504 | 1454 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... | mit |
bsmitty83/SpecialKang | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
daanwierstra/pybrain | pybrain/rl/tasks/pomdp/pomdp.py | 1 | 1502 | __author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import ndarray
from pybrain.rl.tasks import EpisodicTask
from pybrain.utilities import Named, drawIndex
class POMDPTask(EpisodicTask, Named):
""" Partially observable episodic MDP (with discrete actions)
Has actions that can be performed, and observations i... | bsd-3-clause |
eeshangarg/oh-mainline | vendor/packages/Django/django/contrib/localflavor/us/us_states.py | 355 | 7655 | """
A mapping of state misspellings/abbreviations to normalized
abbreviations, and alphabetical lists of US states, territories,
military mail regions and non-US states to which the US provides
postal service.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
# The... | agpl-3.0 |
timothyclarke/ansible-modules-extras | cloud/lxd/lxd_profile.py | 8 | 12120 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@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... | gpl-3.0 |
40223112/w16test | static/Brython3.1.3-20150514-095342/Lib/_threading_local.py | 923 | 7410 | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... | agpl-3.0 |
beni55/viewfinder | backend/db/asset_id.py | 13 | 8323 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder asset id prefixes and helpers.
"""
__author__ = 'andy@emailscrubbed.com (Andy Kimball)'
import struct
from collections import namedtuple
from tornado import gen
from viewfinder.backend.base import base64hex, util
from viewfinder.backend.base.except... | apache-2.0 |
olivierdalang/QGIS | python/plugins/processing/algs/qgis/TilesXYZ.py | 26 | 25996 | # -*- coding: utf-8 -*-
"""
***************************************************************************
TilesXYZ.py
---------------------
Date : April 2019
Copyright : (C) 2019 by Lutra Consulting Limited
Email : marcel.dancak@lutraconsulting.co.uk
********... | gpl-2.0 |
ericholscher/django-browserid | django_browserid/tests/test_helpers.py | 11 | 5716 | from django.contrib.auth import authenticate
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils.functional import lazy
from mock import patch
from pyquery import PyQuery as pq
from django_browserid.helpers import ... | mpl-2.0 |
starcroce/PyAlgoDataStructure | linked_list/linked_list_to_queue.py | 1 | 1314 | import MyDoubleLinkedList
class DoubleLinkedListStack:
def __init__(self):
self.front = None
self.rear = None
self.content = None
def push(self, val):
# push to empty queue
if self.content is None:
self.content = MyDoubleLinkedList.LinkedList(val)
... | gpl-2.0 |
aditigupta96/DealBazaar | welcome.py | 1 | 26070 | import os
import couchdb
import uuid
import requests
from datetime import datetime
from flask import Flask, jsonify, session, render_template, request, redirect, g, url_for, flash
# from .models import User
from datetime import datetime
from couchdb.mapping import Document, TextField, DateTimeField, ListField, FloatF... | apache-2.0 |
kayhayen/Nuitka | nuitka/build/inline_copy/lib/scons-3.1.2/SCons/Platform/cygwin.py | 2 | 2227 | """SCons.Platform.cygwin
Platform-specific initialization for Cygwin systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is here... | apache-2.0 |
jvanz/core | sw/qa/python/var_fields.py | 6 | 4415 | import unittest
import os
from org.libreoffice.unotest import UnoInProcess
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
class TestVarFields(unittest.TestCase):
_uno = None
_xDoc = None
@classmethod
def setUpClass(cls):
cls._uno = UnoInProcess()
cls._uno.setUp()
... | gpl-3.0 |
eusoubrasileiro/fatiando | fatiando/vis/mpl.py | 2 | 35331 | """
Wrappers for :mod:`matplotlib` functions to facilitate plotting grids,
2D objects, etc.
This module loads all functions from :mod:`matplotlib.pyplot`, adds new
functions and overwrites some others (like :func:`~fatiando.vis.mpl.contour`,
:func:`~fatiando.vis.mpl.pcolor`, etc).
**Grids**
* :func:`~fatiando.vis.mp... | bsd-3-clause |
jucimarjr/IPC_2017-1 | lista1.5/lista1.5_questao15.py | 1 | 1739 | # ----------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
#
# Carlos Eduardo Tapudima de Oliveira 1715310030
# Frederico Victor Alfaia Rodrigues 1515200030
# Joelson Pereira Lima ... | apache-2.0 |
linjoahow/2015cdaa-w11 | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | gpl-3.0 |
jroltgen/aqua-gesture-framework | samples/SampleEvent/scons-local-1.3.0/SCons/Tool/hplink.py | 5 | 2387 | """SCons.Tool.hplink
Tool-specific initialization for the HP linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foun... | gpl-3.0 |
chdecultot/frappe | frappe/integrations/doctype/gcalendar_settings/gcalendar_settings.py | 9 | 4711 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, DOKOS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import get_request_site_address
import requests
import time
from... | mit |
sbalde/edxplatform | lms/envs/test.py | 3 | 18356 | # -*- coding: utf-8 -*-
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We ... | agpl-3.0 |
carsongee/edx-platform | common/djangoapps/third_party_auth/tests/test_settings.py | 32 | 3841 | """Unit tests for settings.py."""
from third_party_auth import provider, settings
from third_party_auth.tests import testutil
_ORIGINAL_AUTHENTICATION_BACKENDS = ('first_authentication_backend',)
_ORIGINAL_INSTALLED_APPS = ('first_installed_app',)
_ORIGINAL_MIDDLEWARE_CLASSES = ('first_middleware_class',)
_ORIGINAL_... | agpl-3.0 |
wangyum/tensorflow | tensorflow/python/kernel_tests/reduce_join_op_test.py | 116 | 14445 | # 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 |
jtpereyda/boofuzz | boofuzz/pgraph/graph.py | 1 | 18926 | #
# pGRAPH
# Copyright (C) 2006 Pedram Amini <pedram.amini@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 2 of the License, or (at your option) any later
# version.
#
... | gpl-2.0 |
open-falcon/portal | frame/store.py | 7 | 2834 | # -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
import logging
import MySQLdb
from frame import config
def connect_db(cfg):
try:
conn = MySQLdb.connect(
host=cfg.DB_HOST,
port=cfg.DB_PORT,
user=cfg.DB_USER,
passwd=cfg.DB_PASS,
db=cfg.DB_NAME,
... | apache-2.0 |
factorlibre/account-financial-tools | account_balance_line/__openerp__.py | 19 | 1742 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Vincent Renaville (Camptocamp)
# Copyright 2010-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public... | agpl-3.0 |
jeckersb/Proton | examples/python/reactor/echo.py | 4 | 2079 | #!/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
# "Lice... | apache-2.0 |
pcon/mpd-rest | cherrypy/test/test_misc_tools.py | 36 | 7586 | import os
localDir = os.path.dirname(__file__)
logfile = os.path.join(localDir, "test_misc_tools.log")
import cherrypy
from cherrypy import tools
def setup_server():
class Root:
def index(self):
yield "Hello, world"
index.exposed = True
h = [("Content-Language", "en-GB"), ('Co... | gpl-2.0 |
TangXT/edx-platform | common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py | 69 | 14684 | # -*- 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 'CourseEnrollmentAllowed.auto_enroll'
db.add_column('student_courseenrollmentallowed', 'auto_... | agpl-3.0 |
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/Basics/DataStructures.py | 1 | 16332 | """Data structures in Foam-Files that can't be directly represented by Python-Structures"""
from __future__ import division
from copy import deepcopy
from collections import OrderedDict
import math
import re
# import FoamFileGenerator in the end to avoid circular dependencies
from PyFoam.ThirdParty.six import integ... | gpl-2.0 |
rabipanda/tensorflow | tensorflow/python/keras/_impl/keras/utils/layer_utils.py | 4 | 8849 | # Copyright 2018 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 |
jtraver/dev | python3/selenium/apihelper.py | 1 | 1826 | #!/usr/bin/env python3
#!/usr/bin/python
"""Cheap and simple API helper
This program is part of "Dive Into Python", a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
"""
__author__ = "Mark Pilgrim (mark@diveintopython.org)"
__version__ = "$Revision: 1.3 $"
__da... | mit |
nikpap/inspire-next | inspirehep/modules/search/parser.py | 3 | 7116 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio-Query-Parser.
# Copyright (C) 2014, 2015, 2016 CERN.
#
# Invenio-Query-Parser 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
# ... | gpl-2.0 |
40223225/cdb-test2 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_setups.py | 791 | 16440 | import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases... | gpl-3.0 |
pombredanne/semanticizer | semanticizer/util/timer.py | 3 | 1223 | # Copyright 2012-2013, University of Amsterdam. This program 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 3 of the License, or (at your option) any later version.
#
# This program... | gpl-3.0 |
dgarros/ansible | lib/ansible/modules/clustering/consul_acl.py | 66 | 11534 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@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... | gpl-3.0 |
turbokongen/home-assistant | tests/components/motion_blinds/test_config_flow.py | 8 | 7452 | """Test the Motion Blinds config flow."""
import socket
from unittest.mock import Mock, patch
import pytest
from homeassistant import config_entries
from homeassistant.components.motion_blinds.config_flow import DEFAULT_GATEWAY_NAME
from homeassistant.components.motion_blinds.const import DOMAIN
from homeassistant.co... | apache-2.0 |
codenote/chromium-test | build/android/pylib/utils/emulator.py | 3 | 12430 | #!/usr/bin/env python
#
# Copyright (c) 2012 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.
"""Provides an interface to start and stop Android emulator.
Assumes system environment ANDROID_NDK_ROOT has been set.
Emulat... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.