code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
platformio/platformio-core
platformio/debug/config/renode.py
Python
apache-2.0
1,290
import numpy as np from datetime import datetime import pytz from zipline.algorithm import TradingAlgorithm #from zipline.utils.factory import load_from_yahoo from pulley.zp.data.loader import load_bars_from_yahoo from zipline.finance import commission #STOCKS = ['AMD', 'CERN', 'COST', 'DELL', 'GPS', 'INTC', 'MMM'] S...
jimgoo/zipline-fork
zipline/examples/olmar.py
Python
apache-2.0
5,460
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from backend import Backend
genova/rapidsms-senegal
lib/rapidsms/backends/__init__.py
Python
bsd-3-clause
80
from keras.layers.core import Dropout, Flatten from keras.layers.convolutional import MaxPooling2D, Conv2D from keras.models import Model from keras.layers import Input, Dense FRAME_H = 70 FRAME_W = 180 def build_model(): inp = Input(shape=(FRAME_H, FRAME_W, 3)) x = Conv2D(filters=8, kernel_size=(5, 5), acti...
raghakot/keras-vis
applications/self_driving/model.py
Python
mit
845
import threading import pexpect class Connection: def __init__(self, intro, conn, numb): self.open = False self.type = intro self.connection = conn self.listening = 1 self.number = int(numb) + 1 self.thread = threading.Thread(target=self.wait) self.thread.start() def __str__(self): string = "" if(s...
Kkevsterrr/backdoorme
backdoors/connection.py
Python
mit
1,101
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-HTMLtoPDF', version='0.1', packages=['django_htmlT...
Daiech/django-HTMLtoPDF
setup.py
Python
bsd-3-clause
1,128
#!/usr/bin/python # [The "BSD licence"] # Copyright (c) 2008-2009 Dmitri Kornev # 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 copyri...
aevitas/pyREtic
Decompilers/unpyc/structure.py
Python
gpl-3.0
39,451
from tkinter import * class GUI: rows = 8 columns = 8 color1 = '#DDB88C' color2 = '#A66D4F' dim_square = 64 def __init__(self, parent): self.parent = parent canvas_width = self.columns * self.dim_square canvas_height = self.rows * self.dim_square self.canvas = ...
crazcalm/Py3.4_exploration
Tk_practice/Chess_example.py/gui.py
Python
mit
1,252
# python # This file is generated by a program (mib2py). import CISCO_PAGP_MIB OIDMAP = { '1.3.6.1.4.1.9.9.98': CISCO_PAGP_MIB.ciscoPagpMIB, '1.3.6.1.4.1.9.9.98.1': CISCO_PAGP_MIB.ciscoPagpMIBObjects, '1.3.6.1.4.1.9.9.98.1.1': CISCO_PAGP_MIB.pagpGroupCapabilityConfiguration, '1.3.6.1.4.1.9.9.98.1.2': CISCO_PAGP_MIB....
xiangke/pycopia
mibs/pycopia/mibs/CISCO_PAGP_MIB_OID.py
Python
lgpl-2.1
2,629
from __future__ import print_function import os # Tell gevent not to patch os.waitpid() since it is susceptible to race # conditions. See: # http://www.gevent.org/gevent.monkey.html#gevent.monkey.patch_os os.environ['GEVENT_NOWAITPID'] = 'true' # Use manhole to give us a way to debug hung processes # https://pypi.pyt...
dmick/teuthology
teuthology/__init__.py
Python
mit
3,990
import numpy as np def get_kernel_size(factor): """ Find the kernel size given the desired factor of upsampling. """ return 2 * factor - factor % 2 def upsample_filt(size): """ Make a 2D bilinear kernel suitable for upsampling of the given (h, w) size. """ factor = (size + 1) // 2 ...
aakashsinha19/Aspectus
Image Segmentation/tf-image-segmentation/tf_image_segmentation/utils/upsampling.py
Python
apache-2.0
1,113
# PyCloudKit. Created on 09.02.2016 # Copyright (c) 2015 Andreas Schulz # # The MIT License (MIT) # # 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 limi...
Longhanks/PyCloudKit
pycloudkit.py
Python
mit
7,431
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 l...
mo-g/iris
lib/iris/tests/unit/plot/test_contour.py
Python
gpl-3.0
1,536
from enoslib.objects import Host from enoslib.service.emul.htb import HTBConstraint, HTBSource from enoslib.tests.unit import EnosTest class TestAddConstraint(EnosTest): def test_different_target_are_added(self): nc1 = HTBConstraint("eth0", "10ms", "1.1.1.2") nc2 = HTBConstraint("eth0", "10ms", "1...
BeyondTheClouds/enoslib
enoslib/tests/unit/service/emul/test_htb.py
Python
gpl-3.0
3,542
from collections import OrderedDict import os from os.path import abspath, dirname from django.core.exceptions import ImproperlyConfigured ENV_VARIABLE_PREFIX = 'LL' def get_env_variable(var_name): """Get the environment variable or return exception""" if not ENV_VARIABLE_PREFIX: raise ImproperlyCon...
596acres/django-livinglots-template
project_name/project_name/settings/base.py
Python
gpl-3.0
8,268
# 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 ...
SUSE/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/compute/v2017_03_30/models/virtual_machine_scale_set_sku.py
Python
mit
1,622
from modules import user
tao12345666333/Talk-Is-Cheap
python/hayate/store/__init__.py
Python
mit
25
# 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 # d...
rahulunair/nova
nova/tests/unit/scheduler/filters/test_image_props_filters.py
Python
apache-2.0
12,729
# -*- 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): # Changing field 'Document.doc_id' db.alter_column(u'main_document', 'doc_id', self.gf('django.db.models.fi...
ansmirnov/losk
losk/main/migrations/0012_auto__chg_field_document_doc_id.py
Python
gpl-2.0
10,016
#!/usr/bin/python # version 4 # april 2012 # # this was written by saikia81 and is distributed under the GNU general public license 3 # it was written in notepad++, a program I recommend! # whitespace ftw! # # python V2.7.2 x32 # pygame V1.9.2pre #import random, system and operating system possibilities. import os, s...
saikia81/the-number-game
4.1/number_game.py
Python
gpl-3.0
12,567
"""~google <search term> will return three results from the google search for <search term>""" import re import requests from random import shuffle from googleapiclient.discovery import build import logging from secret_example import GOOGLE_CUSTOM_SEARCH_ENGINE, GOOGLE_SEARCH_API """fuction to fetch data from Googl...
Eulercoder/fabulous
fabulous/services/google.py
Python
gpl-3.0
1,253
import _plotly_utils.basevalidators class TickangleValidator(_plotly_utils.basevalidators.AngleValidator): def __init__( self, plotly_name="tickangle", parent_name="mesh3d.colorbar", **kwargs ): super(TickangleValidator, self).__init__( plotly_name=plotly_name, parent_n...
plotly/python-api
packages/python/plotly/plotly/validators/mesh3d/colorbar/_tickangle.py
Python
mit
474
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
ewiseblatt/spinnaker
testing/citest/tests/bake_and_deploy_test.py
Python
apache-2.0
30,181
# -*- 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): # Changing field 'Response.ts' db.alter_column(u'survey_response', 'ts', self.gf('django.db.models.fields.D...
point97/hapifis
server/apps/survey/migrations/0077_auto__chg_field_response_ts__chg_field_respondant_review_status__chg_f.py
Python
gpl-3.0
17,288
#!/usr/bin/python """Test to verify presentation of selectable list items.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(PauseAction(3000)) sequence.append(KeyComboAction("<Control><Shift>n")) sequence.append(PauseAction(3000)) sequence.append(KeyComboAction("Tab")) sequ...
GNOME/orca
test/keystrokes/oowriter/ui_role_list_item.py
Python
lgpl-2.1
2,207
#!/usr/bin/env python2 ############################################################################### # # The test framework for executing the test plan to test the various # implementations of matrix operations. # # Copyright (C) 2015, Jonathan Gillett # All rights reserved. # # # This program is free software: you c...
gnu-user/mcsc-6030-project
codes/test_framework.py
Python
gpl-3.0
10,656
#-*- coding: utf-8 -*- import re try: from PIL import Image from PIL import ImageDraw except ImportError: try: import Image import ImageDraw except ImportError: raise ImportError("The Python Imaging Library was not found.") from django.utils import six from easy_thumbnails import...
lory87/django-filer
filer/thumbnail_processors.py
Python
bsd-3-clause
5,654
""" Book: Building RESTful Python Web Services Chapter 10: Working with asynchronous code, testing and deploying an API with Tornado Author: Gaston C. Hillar - Twitter.com/gastonhillar Publisher: Packt Publishing Ltd. - http://www.packtpub.com """ from random import randint from time import sleep class HexacopterStat...
xianjunzhengbackup/code
http/REST/Building-RESTful-Python-Web-Services-master/Chapter 10/restful_python_chapter_10_04/drone.py
Python
mit
2,714
# flake8: noqa from .version import __version__ default_app_config = 'restraint.apps.RestraintConfig'
ambitioninc/django-restraint
restraint/__init__.py
Python
mit
104
# 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...
GabrielBrascher/cloudstack
systemvm/debian/opt/cloud/bin/cs/__init__.py
Python
apache-2.0
1,000
import io import os import unittest from stango import Stango from stango.files import Files from . import StangoTestCase, make_suite, view_value, view_template dummy_view = view_value('') class GenerateTestCase(StangoTestCase): def setup(self): self.tmp = self.tempdir() self.manager = Stango() ...
akheron/stango
tests/test_generate.py
Python
mit
6,958
#!/usr/bin/env python # http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ # http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/ # http://code.djangoproject.com/svn/django/trunk/tests/runtests.py # https://github.com/tomchristie/django-rest-framework/blob/master/rest...
justquick/django-sitemap-extras
sitemapext/runtests/runtests.py
Python
bsd-3-clause
869
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
ncos/lisa
src/lisa_drive/scripts/venv/lib/python3.5/site-packages/pip-10.0.1-py3.5.egg/pip/_vendor/chardet/utf8prober.py
Python
mit
2,848
""" algorithms tests thomas moll 2015 """ import unittest import algorithms class TestAlgorithms(unittest.TestCase): def setUp(self): self.list_a = [12,43,60,32,10] self.list_b = [43,60,32,10,12] self.list_c = [10,12,9,7,40,6] self.big_sorted = list(xrange(1000)...
erhuabushuo/Data-Structure-Zoo
1-Algorithm Analysis/test.py
Python
mit
1,254
# -*- coding: utf-8 -*- import markdown import argparse import time import os from toc import TocExtension from markdown_include.include import MarkdownInclude from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler INPUT = "main.md" OUTPUT = "output.html" class GenerateBook(FileS...
diegolis/ideasmanager
books/generate_book.py
Python
gpl-3.0
1,675
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import json import frappe from frappe.model.document import Document from frappe.utils import getdate class EmployeeAttendanceTool(Document): pass @frappe.whitelist() def get_employees(date, de...
mhbu50/erpnext
erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
Python
gpl-3.0
1,925
# -*- coding: utf-8 -*- from __future__ import division from relativity import constants import math class LorentzFactor(object): @staticmethod def get_beta(velocity, is_percent): if is_percent: return velocity return velocity / constants.SPEED_OF_LIGHT @staticm...
tdsymonds/relativity
relativity/special/special_relativity.py
Python
mit
1,128
""" [04/22/13] REMINDER: Week-Long Challenge #1 due today! https://www.reddit.com/r/dailyprogrammer/comments/1cv8oo/042213_reminder_weeklong_challenge_1_due_today/ Hey r/DailyProgrammers, As a friendly reminder, our first week-long challenge (making a (tiny) video game) concludes today, at midnight, here in the Ameri...
DayGitH/Python-Challenges
DailyProgrammer/DP20130422.py
Python
mit
818
from util.runescape_util import get_users_stats, get_level_at_exp from util.ascii_table import Table, Column from util.image_util import text_to_image from discord.ext import commands from util.arguments import Arguments from shlex import split class Stats: def __init__(self, bot): self.bot = bot @c...
duke605/RunePy
commands/stats.py
Python
mit
3,080
from kid_readout.analysis.timeseries import fftfilt, decimating_fir import numpy as np def test_decimating_fir(): np.random.seed(123) x = np.random.randn(2**16) + 1j*np.random.randn(2**16) dfir = decimating_fir.DecimatingFIR(downsample_factor=16,num_taps=1024) gold = fftfilt.fftfilt(dfir.coefficients.r...
ColumbiaCMB/kid_readout
kid_readout/analysis/timeseries/tests/test_decimating_fir.py
Python
bsd-2-clause
1,340
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import signal class JobTimeoutException(Exception): """Raised when a job takes longer to complete than the allowed maximum timeout value. """ pass class BaseDeathPena...
eternalthinker/flask-server-rq-example
venv/lib/python2.7/site-packages/rq/timeouts.py
Python
apache-2.0
2,099
#!/usr/bin/env python # Copyright 2019 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...
FeliciaLim/oss-fuzz
infra/ci/build.py
Python
apache-2.0
5,213
from pycoinnet.util.TwoLevelDict import TwoLevelDict def test_simple(): d = TwoLevelDict() d["foo"] = "bar" for i in range(100): d[i] = i * i for i in range(100): assert d[i] == i * i d.rotate() for i in range(100): d[-i] = i * i d.rotate() for i in range(100...
richardkiss/pycoinnet
tests/util/test_TwoLevelDict.py
Python
mit
636
# # 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 # ...
dims/cinder
cinder/tests/unit/api/contrib/test_volume_type_access.py
Python
apache-2.0
13,838
import json import logging import unittest import urllib import requests from oauthlib import oauth1 from mock import Mock from marketplace.connection import Connection log = logging.getLogger('test.%s' % __name__) # Preparing to mock the requests OLD_POST = requests.post OLD_PUT = requests.put OLD_GET = requests....
mozilla/Marketplace.Python
marketplace/tests/test_connection.py
Python
mpl-2.0
3,510
""" WSGI config for src project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_...
mezklador/drf1
src/wsgi.py
Python
cc0-1.0
383
"""1846. Maximum Element After Decreasing and Rearranging https://leetcode.com/problems/maximum-element-after-decreasing-and-rearranging/ """ from typing import List class Solution: def maximumElementAfterDecrementingAndRearranging(self, arr: List[int]) -> int: arr.sort() arr[0] = 1 for i ...
isudox/leetcode-solution
python-algorithm/leetcode/problem_1846.py
Python
mit
898
import os, pkgutil, sys, glob def _get_module_directory(namespace): return os.path.dirname(namespace['__file__']) def _get_module_name(namespace): return namespace['__name__'] #return os.path.basename(_get_module_directory(namespace)) def _get_submodules(namespace): return list(pkgutil.iter...
OpenGov/allset
allset/_allset.py
Python
bsd-3-clause
1,236
# -*- coding: utf-8 -*- from copy import copy import pytest from cfme import test_requirements from cfme.configure.settings import visual from cfme.intelligence.reports.reports import CannedSavedReport from cfme.web_ui import toolbar as tb from cfme.infrastructure import virtual_machines as vms # NOQA from cfme.infr...
dajohnso/cfme_tests
cfme/tests/configure/test_visual_infra.py
Python
gpl-2.0
6,954
from PyQt5 import QtWidgets as QW from PyQt5 import QtCore as QC class CopyTableView(QW.QTableView): """QTableView that allows to copy data. Copied data in clipboard will be separated by newlines and commas""" items_selected = QC.pyqtSignal(bool) def copy(self): selected = self.selectedIndex...
ardoi/datajuicer
lsjuicer/ui/views/dataviews.py
Python
gpl-3.0
2,048
#! /usr/bin/env python # Copyright (C) 2014-2015 The BET Development Team """ This example takes uniformly distributed samples of parameters and output data from a simple groundwater contaminant transport model, and calculates solutions to the stochastic inverse problem. The parameter domain is 5D, where the uncertai...
scottw13/BET-1
examples/contaminantTransport/contaminant.py
Python
gpl-3.0
5,784
#!/usr/bin/env python ############################################################################### # $Id: tolatlong.py 28450 2015-02-11 13:09:05Z rouault $ # # Project: GDAL Python samples # Purpose: Script to read coordinate system and geotransformation matrix # from input file and report latitude/longitude c...
kctan0805/vdpm
share/gdal/gdal-2.0.0/swig/python/samples/tolatlong.py
Python
lgpl-2.1
3,925
# coding: utf-8 # # Copyright 2015 Palantir Technologies, 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 applic...
palantir/typedjsonrpc
typedjsonrpc/registry.py
Python
apache-2.0
14,126
from django.template.loader import get_template from . import BaseNotification class EmailNotification(BaseNotification): def get_message(self): template = get_template('user_profile/notification/email/issue.txt') return template.render({ 'issue': self.issue, 'notification...
mcallistersean/b2-issue-tracker
toucan/user_profile/notifications/email.py
Python
mit
561
""" Copyright 2018 Oliver Smith This file is part of pmbootstrap. pmbootstrap 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. pmbootstrap ...
postmarketOS/pmbootstrap
pmb/parse/version.py
Python
gpl-3.0
8,621
"""Tests for `ook.decorators.patch`.""" try: reload except NameError: from imp import reload # pylint: disable=redefined-builtin from itertools import chain, combinations, product from ook import patch from ook.decorators import PY_VERSION from ook.util import Version import tests.examples from tests impo...
schesis/ook
tests/test_decorators_patch.py
Python
gpl-3.0
2,013
import sys import glob import numpy try: from setuptools import setup from setuptools import Extension except ImportError: from distutils.core import setup from distutils.extension import Extension # # Force `setup_requires` stuff like Cython to be installed before proceeding # from setuptools.dist imp...
petebachant/openpiv-python
setup.py
Python
gpl-3.0
3,204
# Copyright Microsoft 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 agreed to in writ...
hglkrijger/WALinuxAgent
tests/utils/test_process_util.py
Python
apache-2.0
10,213
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import warnings from abc import ABCMeta, abstractmethod from ..external...
zorroblue/scikit-learn
sklearn/linear_model/stochastic_gradient.py
Python
bsd-3-clause
55,771
from datetime import datetime from sqlalchemy import ( Column, ForeignKey, Integer, Text, Unicode, ) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( scoped_session, sessionmaker, relationship ) from zope.sqlalchemy import ZopeTransactionExtension DBSession = scoped_ses...
DataMonster/Python
web/MyShop/myshop/models.py
Python
unlicense
2,927
# Copyright (c) 2014 Adi Roiban. # See LICENSE for details. """ Public exceptions raised by this package. """ class KeyCertException(Exception): """ Generic exception raised by the package. Code calling the public API should handle only this exception. The other exceptions are just for fine tunning. ...
chevah/chevah-keycert
chevah/keycert/exceptions.py
Python
mit
765
# Copyright 2017 University of Rome La Sapienza and Battelle Energy Alliance, 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 req...
idaholab/raven
framework/CodeInterfaces/MELCOR/melgenInterface.py
Python
apache-2.0
3,278
from __future__ import division, absolute_import, print_function import copy import pickle import sys import platform import gc import copy import warnings import tempfile from os import path from io import BytesIO import numpy as np from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equa...
immerrr/numpy
numpy/core/tests/test_regression.py
Python
bsd-3-clause
70,985
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Manipulation de fichiers """ import sys import os def getPath(path): '''Retourne le chemin absolu vers un fichier passé en argument ''' return "%s%s" % (os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))), path) def loadJson(path): '''Retour...
idealtitude/apg
pglib/fileshandle.py
Python
gpl-3.0
506
# https://oj.leetcode.com/problems/4sum/ # Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. # # Note: # Elements in a quadruplet (a,b,c,d) must be in non-descending order. (ie, a <= b <= ...
lijunxyz/leetcode_practice
4_sum_medium/Solution2.py
Python
mit
2,496
import re from whoosh.support.pyparsing import alphanums, printables, \ CharsNotIn, Literal, Group, Combine, Suppress, Regex, OneOrMore, Forward, Word, Keyword, \ Empty, StringEnd, ParserElement from whoosh import analysis, query """ This module contains the default search query parser. This uses the excel...
ryszard/whoosh
src/whoosh/qparser.py
Python
apache-2.0
20,319
# 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 applicab...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/compression/entropy_coder/core/config_helper.py
Python
bsd-2-clause
1,611
import importlib import sys def get_cls_by_name(name, aliases={}, imp=None, package=None, sep='.', **kwargs): if not imp: imp = importlib.import_module if not isinstance(name, basestring): return name name = aliases.get(name) or name sep = ':' if ':' in name else sep module_name...
bennylope/django-firstclass
firstclass/utils.py
Python
mit
778
# # 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 # ...
NeCTAR-RC/heat
heat/common/crypt.py
Python
apache-2.0
2,223
# -*- coding: utf-8 -*- """ *************************************************************************** laspublish.py --------------------- Date : May 2016 Copyright : (C) 2016 by Martin Isenburg Email : martin near rapidlasso point com ********************...
alexbruy/QGIS
python/plugins/processing/algs/lidar/lastools/laspublish.py
Python
gpl-2.0
6,087
from debug_toolbar.panels import Panel from debug_toolbar_sqlalchemy.operation_tracker import OperationTracker from django.utils.translation import ugettext as _ from django.template.loader import render_to_string class SqlAlchemyDebugPanel(Panel): """ Panel that shows information about SQLAlchemy operations. ""...
kevinoconnor7/django-debug-toolbar-sqlalchemy
debug_toolbar_sqlalchemy/panel.py
Python
gpl-3.0
1,242
from db import Client StatisticError = IOError client = None def init(**kwargs): global client client = Client(**kwargs) __all__ = ['init', 'client', 'StatisticError']
neuront/redis-ctl
stats/__init__.py
Python
mit
181
from .prox_fn import ProxFn import numpy as np from proximal.utils.utils import Impl from proximal.halide.halide import Halide class norm1(ProxFn): """The function ||x||_1. """ def init_tmps(self): """Initialize temporary variables for _prox method. """ self.v_sign = np.zeros(self...
timmeinhardt/ProxImaL
proximal/prox_fns/norm1.py
Python
mit
2,119
import six import pytest import numpy as np from mock import patch, MagicMock from eight_mile.optz import ( create_lr_scheduler, CosineDecayScheduler, CyclicLRScheduler, ExponentialDecayScheduler, WarmupLinearScheduler, ConstantScheduler, PiecewiseDecayScheduler, ZarembaDecayScheduler, ...
dpressel/baseline
tests/test_decay.py
Python
apache-2.0
5,397
import fnmatch from importlib import import_module from inspect import ismethod, isclass, ismodule, currentframe __all__ = ['get_module', 'get_classes', 'get_properties', 'get_methods'] def get_module(module_name): """Imports and returns a module.""" if not module_name: return None return import_...
LuizArmesto/easyaspect
src/easyaspect/utils.py
Python
mit
3,551
# Rename this file to settings.py from settings import * PATTERN_GROUP = PATTERN_GROUP + ( r'^::cinemate', r'^::comment', r'^::export', r'^::feed', r'^::forum', r'^::gs', r'^::pc-', r'^::pcid', r'^::profile', r'^::render_to_cache', r'^::template', r'^::user', r'^::vi...
Romamo/memcached-analyse
settings-sample.py
Python
gpl-2.0
433
"""A PolyData file reader object. """ # Author: R.Sreekanth <sreekanth [at] aero.iitb.ac.in> # Suyog Dutt Jain <suyog.jain [at] aero.iitb.ac.in> # Copyright (c) 2009-2015, Enthought, Inc. # License: BSD Style. # Standard library imports. from os.path import basename # Enthought imports. from traits.ap...
dmsurti/mayavi
mayavi/sources/poly_data_reader.py
Python
bsd-3-clause
5,872
import os from flowdas import meta def test_version(): VERSION = os.path.join(os.path.dirname(__file__), '../VERSION') assert meta.__version__ == open(VERSION).read().strip()
flowdas/meta
tests/test_setup.py
Python
mpl-2.0
185
# Copyright 2008 Dan Smith <dsmith@danplanet.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
mach327/chirp_fork
chirp/drivers/generic_csv.py
Python
gpl-3.0
15,039
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2020 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. from flask import request from ..db import RadioStation from . import get_entity, api_routing from .exceptions import ...
spl0k/supysonic
supysonic/api/radio.py
Python
agpl-3.0
1,836
import re import random import pytest from utils import testgen from utils.appliance.implementations.ui import navigate_to from utils.blockers import BZ from utils.version import current_version from cfme.web_ui import toolbar, AngularSelect, form_buttons from cfme.configure.configuration import Tag from cfme.container...
dajohnso/cfme_tests
cfme/tests/containers/test_smart_management.py
Python
gpl-2.0
4,381
#-*- coding:utf-8 -*- import struct from config import BYTE_ORDER from cmds import * def crc_1byte(data): crc_1byte = 0 for i in range(0, 8): if ((crc_1byte ^ data) & 0x01): crc_1byte ^= 0x18 crc_1byte >>= 1 crc_1byte |= 0x80 else: crc_1byte >>= 1...
hookehu/utility
sock/protocol_jt/protocol.py
Python
gpl-2.0
2,929
# -*- 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...
xaviercobain88/framework-python
openerp/addons/mrp/mrp.py
Python
agpl-3.0
56,286
# # Part of p5: A Python package based on Processing # Copyright (C) 2017-2019 Abhik Pal # # 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 option) ...
p5py/p5
p5/core/primitives3d.py
Python
gpl-3.0
12,736
def bisearch(ucs, tbl, max): min = 0 if ucs < tbl[0][0] or ucs > tbl[max][1]: return 0 while (max >= min): mid = int((min + max) / 2) if ucs > tbl[mid][1]: min = mid + 1 elif ucs < tbl[mid][0]: max = mid -1 else: return 1 re...
stonewell/wxglterm
pysrc/libs/term/term_char_width.py
Python
mit
4,383
# Copyright (c) 2010-2013, 2016 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the fun...
SanchayanMaity/gem5
configs/example/fs.py
Python
bsd-3-clause
15,347
#!/usr/bin/env python # -*- coding: utf-8 -*- from nipype.testing import (assert_equal, example_data) from nipype.algorithms.metrics import ErrorMap import nibabel as nib import numpy as np from tempfile import mkdtemp import os def test_errormap(): tempdir = mkdtemp() # Single-Spectual # Make two fake 2*2*2 voxe...
grlee77/nipype
nipype/algorithms/tests/test_errormap.py
Python
bsd-3-clause
2,505
# Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong # # This file is part of WESTPA. # # WESTPA 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...
nrego/westpa
src/oldtools/aframe/iter_range.py
Python
gpl-3.0
9,411
import sys import textwrap import pip.download from pip.basecommand import Command, SUCCESS from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from pip.exceptions import CommandError from pip.status_codes import NO_MATCHES_FOUND from pip....
Orav/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/commands/search.py
Python
lgpl-3.0
4,868
""" This module contains classes for both RSS and Atom feeds. To use these, you'll need to set up a couple of URL patterns; e.g. from blargg.feeds import RSSEntriesFeed, AtomEntriesFeed urlpatterns = patterns('', (r'^feed/rss/$', RSSEntriesFeed()), (r'^feed/atom/$', AtomEntriesFeed()), ) ...
bradmontgomery/django-blargg
blargg/feeds.py
Python
mit
1,141
from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.forms.widgets import ClearableFileInput, CheckboxInput from easy_thumbnails.files import get_thumbnailer from django.templatetags.static import static from django.utils.encoding import force_text class ImagePrevi...
adfinis-sygroup/freedomvote
app/core/widgets.py
Python
gpl-3.0
1,773
import bpy from ... base_types.node import AnimationNode class SequenceInfoNode(bpy.types.Node, AnimationNode): bl_idname = "an_SequenceInfoNode" bl_label = "Sequence Info" def create(self): self.newInput("Sequence", "Sequence", "sequence", defaultDrawType = "PROPERTY_ONLY") self.newOutpu...
Thortoise/Super-Snake
Blender/animation_nodes-master/nodes/sequences/sequence_info.py
Python
gpl-3.0
4,238
#!/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...
roadmapper/ansible
lib/ansible/modules/network/nxos/nxos_bgp.py
Python
gpl-3.0
25,655
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/models/email_notification_py3.py
Python
mit
1,896
import datetime from google.appengine.ext import db class AuthToken(db.Model): """Representation of a stored authid""" user_id = db.StringProperty(required=True) blob = db.TextProperty(required=True) expires = db.DateTimeProperty(required=True) service = db.StringProperty(required=True) class F...
duplicati/oauth-handler
dbmodel.py
Python
lgpl-3.0
2,546
# Configuration file for ipython-qtconsole. c = get_config() #------------------------------------------------------------------------------ # IPythonQtConsoleApp configuration #------------------------------------------------------------------------------ # IPythonQtConsoleApp will inherit config from: BaseIPythonA...
dwwkelly/configs
srv/salt/laptop/config/ipython/profile_default/ipython_qtconsole_config.py
Python
gpl-2.0
23,719
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
Khilo84/PyQt4
examples/itemviews/puzzle/puzzle.py
Python
gpl-2.0
14,246
#!/usr/bin/python from __future__ import division # We need the following two lines in order for matplotlib to work # without access to an X server. import matplotlib #matplotlib.use('Agg') import pylab, numpy, sys if len(sys.argv) != 2: print(("Usage: " + sys.argv[0] + " out-filename.pdf")) exit(1) pdffil...
droundy/deft
papers/contact/figs/plot-ghs.py
Python
gpl-2.0
6,742
from bs4 import BeautifulSoup from helptux.modules.error import RequiredAttributeMissing, DatabaseItemDoesNotExist class GenericApi: def clean_input_data(self, input_data, possible_params, required_params, complex_params): """ Clean the input data dict: remove all non-supported attributes and che...
pieterdp/helptux
helptux/modules/api/generic.py
Python
gpl-2.0
2,992
def init_prms(m, b, L, k, beta, S0, dt, g, w_formula, N): import argparse parser = argparse.ArgumentParser() parser.add_argument('--m', '--mass', type=float, default=m) parser.add_argument('--b', '--boxheight', type=float, default=b) parser.add_argumen...
qilicun/python
python3/src/box_spring/box_spring.py
Python
gpl-3.0
2,535