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
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the file system implementation using pyfsapfs.""" import unittest from dfvfs.lib import definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import context from dfvfs.vfs import apfs_file_system from tests import test_lib as sh...
joachimmetz/dfvfs
tests/vfs/apfs_file_system.py
Python
apache-2.0
4,316
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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...
linostar/timeline-clone
test/autopilot/autopilotlib/wrappers/aboutbox.py
Python
gpl-3.0
1,440
from .. import Availability, Class, Constant, Define, Method, Parameter, Type gx_class = Class('DSEL', doc="The :class:`DSEL` object is used to select subsets of data from the DATA object") gx_defines = [ Define('DSEL_PICTURE_QUALITY', doc="Line Label Formats", constants=[ ...
GeosoftInc/gxapi
spec/core/DSEL.py
Python
bsd-2-clause
10,171
# Copyright 2019 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...
ppwwyyxx/tensorflow
tensorflow/lite/testing/op_tests/space_to_depth.py
Python
apache-2.0
2,210
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2015 damian <damian@damian-desktop> # # Distributed under terms of the MIT license. """ Code of echo server made as Twisted application """ from twisted.internet import protocol, reactor class Echo(protocol.Protocol): def dataReceive...
xmementoit/practiseSamples
python/pythonTwistedTestApps/basicApps/echoServerApp/echoServer.py
Python
apache-2.0
468
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: metrics.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _refle...
praveev/druid
examples/quickstart/protobuf/metrics_pb2.py
Python
apache-2.0
4,405
#* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgpl-2.1.html import os, ...
harterj/moose
python/TestHarness/XMLDiffer.py
Python
lgpl-2.1
12,194
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-yadt', url='https://chris-lamb.co.uk/projects/django-yadt', version='2.2.4', description="Yet Another Django Thumbnailer", author="Chris Lamb", author_email='chris@chris-lamb.co.uk', license='BSD', ...
lamby/django-yadt
setup.py
Python
bsd-3-clause
421
""" hashdd_uuid.py @brad_anton License: Copyright 2015 hashdd.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
hashdd/pyhashdd
hashdd/features/hashdd_uuid.py
Python
apache-2.0
955
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="scattergl.marker.colorbar", **kwargs ): super(ThicknessmodeValidator, self).__init__( ...
plotly/plotly.py
packages/python/plotly/plotly/validators/scattergl/marker/colorbar/_thicknessmode.py
Python
mit
539
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import pandas.util.testing as tm import pytest from pandas import Int64Index, MultiIndex, PeriodIndex, UInt64Index, isna from pandas._libs.tslib import iNaT from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin def test_fillna(idx): # GH...
kdebrab/pandas
pandas/tests/indexes/multi/test_missing.py
Python
bsd-3-clause
4,898
import os import unittest from vsg.rules import package from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_012_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDir, ...
jeremiah-c-leary/vhdl-style-guide
vsg/tests/package/test_rule_012.py
Python
gpl-3.0
1,145
import re import urlparse import urllib class LanguageStripper(object): def __init__(self, languages=None): self.code_to_language = {} for code in ["arabic", "ara", "ar"]: self.code_to_language[code] = "ar" for code in ["bulgarian", "bul", "bg"]: self.code_to_langu...
christianbuck/pdf2bitext
languagestripper.py
Python
lgpl-3.0
3,668
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2019 Rapptz 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 u...
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/discord/enums.py
Python
mit
9,698
from django.contrib import admin from .models import Thana admin.site.register(Thana) # Register your models here.
shudwi/CrimeMap
Thana/admin.py
Python
gpl-3.0
116
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
citrix-openstack-build/ironic
ironic/tests/objects/test_chassis.py
Python
apache-2.0
3,465
from ._testutil import GibsonTest, run_until_complete from aiogibson import errors class CommandsTest(GibsonTest): """Gibson high level commands. :see: http://gibson-db.in/commands/ """ @run_until_complete def test_set(self): key, value = b'test:set', b'bar' response = yield from...
jettify/aiogibson
tests/test_commands.py
Python
mit
10,025
"""Multidict implementation. HTTP Headers and URL query string require specific data structure: multidict. It behaves mostly like a dict but it can have several values for the same key. """ from ._compat import USE_CYTHON_EXTENSIONS __all__ = ('MultiMapping', 'MutableMultiMapping', 'MultiDictProxy', 'CIM...
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/multidict/__init__.py
Python
mit
1,022
# -*- coding: utf-8 -*- """ Folium ------- Make beautiful, interactive maps with Python and Leaflet.js """ from __future__ import absolute_import from branca.colormap import StepColormap from branca.utilities import color_brewer from .map import LegacyMap, FitBounds from .features import GeoJson, TopoJson class ...
shankari/folium
folium/folium.py
Python
mit
14,914
from direct.directnotify import DirectNotifyGlobal from direct.showbase.PythonUtil import invertDictLossless from toontown.coghq import CountryClubRoomSpecs from toontown.toonbase import ToontownGlobals from direct.showbase.PythonUtil import normalDistrib, lerp import random def printAllBossbotInfo(): print 'roomI...
ksmit799/Toontown-Source
toontown/coghq/CountryClubLayout.py
Python
mit
8,370
# 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 may ...
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_operations.py
Python
mit
4,684
import unittest from nose.tools import * # PEP8 asserts import mock import labtronyx from labtronyx.bases import ResourceBase, DriverBase, InterfaceBase def test_drivers(): manager = labtronyx.InstrumentManager() for driver_uuid, driverCls in manager.plugin_manager.getPluginsByBaseClass(DriverBase).items()...
protonyx/labtronyx
tests/test_drivers.py
Python
mit
1,922
#!/usr/bin/python3 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is d...
jonathon-love/snapcraft
snapcraft/_schema.py
Python
gpl-3.0
2,896
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.dispatch import Signal #signal sent after some publishing post_publish = Signal(providing_args=['username', 'host'])
directeur/socnode
blog/signals.py
Python
mit
178
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test all test systems on different platforms to ensure differences in potenti...
choderalab/openmmtools
openmmtools/scripts/test_openmm_platforms.py
Python
mit
23,506
import warnings from allauth.account.forms import _base_signup_form_class from django import forms from allauth.account import app_settings from moe_auth.auth.utils import setup_user_email from allauth.utils import ( set_form_field_order ) from allauth.account.adapter import g...
bung87/django-moe-auth
moe_auth/auth/forms.py
Python
mit
5,193
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by René Meusel This file is part of the CernVM File System auxiliary tools. """ import abc import os import tempfile import requests import collections from datetime import datetime import dateutil.parser from dateutil.tz import tzutc import shutil import zlib ...
reneme/python-cvmfsutils
cvmfs/repository.py
Python
bsd-3-clause
19,355
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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...
pferreir/indico-backup
indico/MaKaC/webinterface/rh/paperReviewingDisplay.py
Python
gpl-3.0
2,130
from ._impl import odeint from ._impl import odeint_adjoint from ._impl import odeint_event __version__ = "0.2.2"
rtqichen/torchdiffeq
torchdiffeq/__init__.py
Python
mit
114
from engine.api import API from engine.utils.printing_utils import progressBar from setup.utils.datastore_utils import repair_corrupt_reference, link_references_to_paper def remove_duplicates_from_cited_by(): print("\nRemove Duplicates") api = API() papers = api.get_all_paper() for i, paper in enumer...
thomasmauerhofer/search-engine
src/setup/check_for_currupt_references.py
Python
mit
2,124
#! /usr/bin/python # -*- coding: utf-8 -*- # Nacteni knihoven import os.path import sys import SAKoTools SAKoTools.getPathToSubmitedData("./") r = SAKoTools.result('./') r.addText("TEST 1") r.addText("TEST 2") r.addText("TEST 3") r.addText("TEST 4") r.addText("TEST 5") r.addImg("neduchal/test/", "aaa.jpg") r.saveAn...
neduchal/SAKoTools
server/test.py
Python
gpl-2.0
329
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mithrilda/mithril
contrib/spendfrom/spendfrom.py
Python
mit
10,054
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2017 DataONE # # Licensed under the Apache License, Version 2.0 (t...
DataONEorg/d1_python
utilities/src/d1_util/cert_create_ca.py
Python
apache-2.0
2,790
import abc import json import flask class ApiBase(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def add_feature(self, feature_name, distribution, **kwargs): return @abc.abstractmethod def remove_feature(self, feature_name, **kwargs): return @abc.abstractmethod ...
diogo149/simbo
simbo/base/api.py
Python
mit
1,542
#!/usr/bin/env python3 import logging import json import asyncio from threading import Thread from uuid import uuid4 from http import HTTPStatus import websockets from homecon.core.plugins.plugin import BasePlugin class Logger(logging.Logger): """ Custom logger which blanks out passwords and tokens. ""...
BrechtBa/homecon
backend/src/homecon/plugins/websocket/websocket.py
Python
gpl-3.0
8,514
#! python3 import os, sys, subprocess, shutil # Full url of site is http://asofttech.github.io/Appst.Gentoo.Rpi/ # MkDocs Build Script class MkDocsBuild(object): # Class Init def __init__(self): self.SRCDIR = "Docs" self.BUILDDIR = "site" self.MKDOCSDIR = "./" # Run...
ASoftTech/CAD.General.Circuit
Docs/MkDocs/build.py
Python
mit
2,778
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Adam Miller (maxamillion@fedoraproject.org) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version':...
tsdmgz/ansible
lib/ansible/modules/system/firewalld.py
Python
gpl-3.0
31,991
#/usr/env/bin python import argparse import json import os import sys import numpy as np import requests from argparse import ArgumentTypeError from collections import defaultdict from itertools import izip_longest from pydub import AudioSegment from ResoundApp.scipy.io import wavfile from ResoundApp import resoun...
cgearhart/Resound-App
teach.py
Python
cc0-1.0
4,566
from numpy.random import RandomState from src import tensorflow as tf batch_size = 8 w1 = tf.Variable(tf.random_normal([2,3],stddev=1,seed=1)) w2 = tf.Variable(tf.random_normal([3,1],stddev=1,seed=1)) x = tf.placeholder(tf.float32,shape=(None,2),name='x-input') y_ = tf.placeholder(tf.float32,shape=(None,1),name='y-...
xinghalo/DMInAction
src/tensorflow/tfaction/NeuralMain.py
Python
apache-2.0
1,291
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Python interface to the Chandra Data Archive (CDA) web services and an interface to a local disk copy of the Observation Catalog (Ocat). """ from pathlib import Path import re import warnings import time import requests import numpy as np import tables...
sot/mica
mica/archive/cda/services.py
Python
bsd-3-clause
23,345
from __future__ import print_function import os import sys import re import shutil import stat import argparse import distutils.dir_util import tempfile from calc_input_checksum import calc_checksum my_path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(my_path, '../', 'test')) from exp_t...
CWSL/access-om
tools/release.py
Python
apache-2.0
5,005
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import logging import os import re import shlex import sqlite3 import sys import tempfile import time import urllib2 from lib.core.common import dataT...
krintoxi/NoobSec-Toolkit
NoobSecToolkit /tools/inject/lib/utils/api.py
Python
gpl-2.0
26,576
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial excercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` sectio...
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/exercises/plot_cv_digits.py
Python
bsd-3-clause
1,207
def is_palindrome(word): """ Check if a given string is a palindrome """ if word[::1] == word[::-1]: print 'The string', word, 'is a palindrome' else: print 'The string', word, 'is not a palindrome' is_palindrome('noon') is_palindrome('redivider') is_palindrome('redimer')
kamiljsokolowski/Tutorials
ThinkPython/chap8/ex10.py
Python
mit
311
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # core.py - basic audio class # ----------------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------------- # kaa-Metada...
jtackaberry/stagehand
external/metadata/audio/core.py
Python
mit
2,365
#!/usr/bin/env python from __future__ import absolute_import from __future__ import unicode_literals import sys import django from django.conf import settings settings_dict = dict( DEBUG=True, AUTH_USER_MODEL='testdata.CustomUser', WIKI_GROUP_MODEL='testdata.CustomGroup', DATABASES={ 'default'...
SoftwareExperiment4/SungkyunWiki
runtests.py
Python
gpl-3.0
3,337
API_ERROR_CODE__UNKNOWN = 500 API_ERROR_CODE__MISS_CONFIG = 501 def failed(message, **kwargs): ret = { 'ok': False, 'message': message } ret.update(kwargs) return ret class APIError(Exception): code = API_ERROR_CODE__UNKNOWN def __init__(self, message, *args, **kwargs): ...
thongdong7/subfind
subfind_web/exception/api.py
Python
mit
831
"""Conferences API Tests for Version 1.0. This is a testing template for the generated ConferencesAPI Class. """ import unittest import requests import secrets from py3canvas.apis.conferences import ConferencesAPI from py3canvas.apis.conferences import Conferencerecording from py3canvas.apis.conferences import Confere...
tylerclair/py3canvas
py3canvas/tests/conferences.py
Python
mit
1,203
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os, os.path import json import shutil import urllib2 import argparse import cgi from PIL import Image PRIVACY_URL = "http://senspark.com/privacy-policy" MARKETING_URL = "http://senspark.com" SUPPORT_URL = "http://fb.com/teamsenspark" IOS_LANGUAGES_CODES ...
Senspark/app-stores-toolkit
populate-v2.py
Python
gpl-3.0
17,986
# -*- coding: utf-8 -*- from __future__ import with_statement from setuptools import setup def get_version(fname='flint/__init__.py'): with open(fname) as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) def get_long_description(): des...
flintwork/flint
setup.py
Python
mit
1,678
# -*- 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 or...
googleapis/python-pubsublite
samples/generated_samples/pubsublite_generated_pubsublite_v1_cursor_service_streaming_commit_cursor_sync.py
Python
apache-2.0
1,871
from PyQt4 import QtGui, QtCore from PyQt4.QtGui import QApplication, QCursor from PyQt4.QtCore import Qt import pywt import numpy as np from scipy.io import wavfile wavelet_coefficients = None class PaintWidget(QtGui.QWidget): def __init__(self, boxborder=True, bordersize=0, xsize=300, ysize=300, coeff_range=[...
fzalkow/waveletGui
waveletGui.py
Python
mit
11,247
#!/usr/bin/env python import sys import copy import rospy,sys import moveit_commander import actionlib import roslib; roslib.load_manifest('ur_modern_driver') import tf from control_msgs.msg import * from trajectory_msgs.msg import * from sensor_msgs.msg import JointState from geometry_msgs.msg import PoseStamped,Pos...
robotic-ultrasound-image-system/ur5
src/ur5-master/universal_robot-kinetic-devel/ur_modern_driver-master/testviso.py
Python
apache-2.0
4,152
""" This script generates an html table of contributors, with names and avatars. The list is generated from scikit-learn's teams on GitHub, plus a small number of hard-coded contributors. The table should be updated for each new inclusion in the teams. Generating the table requires admin rights. """ import sys import ...
shyamalschandra/scikit-learn
build_tools/generate_authors_table.py
Python
bsd-3-clause
4,989
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from app.openapi_server.models.base_model_ import Model from openapi_server import util class User(Model): """NOTE: This class is auto generated by the swagger co...
cliffano/swaggy-jenkins
clients/python-blueplanet/generated/app/openapi_server/models/user.py
Python
mit
3,755
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, merge, publ...
sidzan/netforce
netforce_stock/netforce_stock/__init__.py
Python
mit
1,151
#!/usr/bin/env python # -*- coding: utf-8 -*- """ requests_cache.backends.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Contains BaseCache class which can be used as in-memory cache backend or extended to support persistence. """ from datetime import datetime import hashlib from copy import copy from io import Byt...
YetAnotherNerd/requests-cache
requests_cache/backends/base.py
Python
bsd-2-clause
8,344
#!/bin/env python import numpy as np import read_line def welspecs(inje_pos, file): file.write("\nwelspecs".upper()+"\n") inje = "'I' 'G' "+str(inje_pos) + " 1* 'WAT' 0.0 'STD' 'SHUT' 'NO' /" prod = "'P' 'G' 1 1 1* 'OIL' 0.0 'STD' 'SHUT' 'NO' /" file.write(inje) file.write("\n") ...
qilicun/python
python3/scripts/schedule.py
Python
gpl-3.0
2,054
from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.providers.nzb.base import NZBProvider from couchpotato.env...
jayme-github/CouchPotatoServer
couchpotato/core/providers/nzb/nzbindex/main.py
Python
gpl-3.0
2,824
# Copyright 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
HybridF5/jacket
jacket/storage/compute/__init__.py
Python
apache-2.0
1,090
""" ~ Attribute Transfer Tool ~ Christopher M. Miller ~ 2016/07/19 An interface for transferring attributes. Originally written to supplement functionality from the defunct AttributeManager script, this tool allows the user to manipulate attributes on objects. Written and maintained by Christopher M. Miller ...
CzarOfTheUniverse/MayaPythonTools
CMiller_AttrTransfer/CMiller_AttrTransfer.py
Python
mit
12,087
# Python script that generates the documentation for script functions. # This parses the codeblocks for to find all the source files, then parses all the source files for script macros. # Finally it outputs all the documentation to stdout so it can be stored on disk. # This script should run in both python2 and python3...
tdelc/EmptyEpsilon
compile_script_docs.py
Python
gpl-2.0
11,783
# -*- encoding: utf-8 -*- import models
ClearCorp/account-financial-tools
account_balance_constraint/__init__.py
Python
agpl-3.0
40
""" This module provides more sophisticated flow tracking and provides filtering and interception facilities. """ from __future__ import absolute_import from abc import abstractmethod, ABCMeta import hashlib import Cookie import cookielib import os import re from netlib import odict, wsgi, tcp import netlib.http fr...
bltb/mitmproxy
libmproxy/flow.py
Python
mit
30,125
import logging from django_db_sanitizer.exceptions import UpdaterException from django_db_sanitizer.updaters.base import BaseUpdater logger = logging.getLogger(__name__) class SingleValuePerFieldUpdater(BaseUpdater): """Use this updater to set the same value to all rows of a given field. Each field may rec...
resulto-admin/django-db-sanitizer
django_db_sanitizer/updaters/simple.py
Python
bsd-3-clause
2,389
class Base(object): def __init__(self, *args, **kwargs): pass def dispose(self, *args, **kwargs): pass def prepare(self, *args, **kwargs): pass def prepare_page(self, *args, **kwargs): pass def cleanup(self, *args, **kwargs): pass
ckcollab/polished
polished/backends/mixins/base.py
Python
mit
295
"""Distance computation.""" import numpy as np def euclidean(a, b): """Compute a Euclidean distance value.""" return np.sqrt(np.sum((a-b)**2)) def early_abandoned_euclidean(a, b, upper_limit): """Compute a Euclidean distance value in early abandoning fashion.""" lim = upper_limit * upper_limit r...
seninp/saxpy
saxpy/distance.py
Python
gpl-2.0
479
#!/usr/bin/env python # for python 2.7 import sys from sample import func1, func2, func3 """ 'python main.py -p' runs the PARALLEL code. 'python main.py -l' runs the NON parallel code. """ if __name__ == '__main__': func1() print func2() print func3()
mikec964/chelmbigstock
experiment/ifdef/main.py
Python
gpl-3.0
274
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : IOST_WMain_I2C.py # Date : Oct 20, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # Copyright : 2016 # ...
HPPTECH/hpp_IOSTressTest
Refer/IOST_OLD_SRC/IOST_0.17/Libs/IOST_WMain_I2C.py
Python
mit
10,398
import random # Regex function def to_regex (words, beg='', end=''): regex = ''.join(['^(', beg, ')(']) for word in words: regex += '(' letters = list(word) for letter in letters: regex = ''.join([regex, '(', letter.upper(), '|', letter.lower(), ')']) regex += ')|' regex = reg...
rekyuu/telegram-kuma
src/helpers/helpers.py
Python
mit
541
from django.core.management.base import BaseCommand from ... import exporters from ... import models class Command(BaseCommand): help = """Exports proposals with their scores""" def handle(self, *args, **kwargs): print exporters.SimpleSessionExporter(models.Session.objects.all())().csv
EuroPython/djep
pyconde/schedule/management/commands/simple_sessions_export.py
Python
bsd-3-clause
307
# channels.py -- OpenChange RPC-over-HTTP implementation # # Copyright (C) 2012 Julien Kerihuel <j.kerihuel@openchange.org> # Wolfgang Sourdeau <wsourdeau@inverse.ca> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
inverse-inc/openchange
mapiproxy/services/web/rpcproxy/rpcproxy/channels.py
Python
gpl-3.0
20,264
# Search for lines that start with From and have an at sign import re hand = open('mbox-short.txt') for line in hand: line = line.rstrip() if re.search('From:', line) : print line
johanfrisk/Python_at_web
notebooks/code/re01.py
Python
mit
198
from rest_framework import permissions class AdminWritePermission(permissions.BasePermission): def has_permission(self, request, view): if view.action in ['list', 'retrieve']: return request.user.is_authenticated() elif view.action in ['create', 'update', 'partial_update', 'destroy']: ...
LuckyMagpie/ITSubscriber
itsubscriber/subscriber/permissions.py
Python
apache-2.0
2,467
#!/usr/bin/env python # -*- coding, utf-8 -*- # FIDATA. Open-source system for analysis of financial and economic data # Copyright © 2013 Basil Peace # This file is part of FIDATA. # # FIDATA is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
FIDATA/database-draft
predefined-data/import.py
Python
gpl-3.0
4,368
# -*- coding: utf-8 -*- # # ODA documentation build configuration file, created by # sphinx-quickstart on Thu Mar 31 13:14:41 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
grupoanfi/orderbook-data-analysis
docs/source/conf.py
Python
gpl-3.0
11,575
source = '''# line 1 'A module docstring.' import sys, inspect # line 5 # line 7 def spam(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h): eggs(b + d, c + f) # line 11 def eggs(x, y): "A docstring." global fr, st fr = inspect.currentframe() st = inspect.stack() p = x q = y / 0 # line 20 clas...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.2/Lib/test/test_inspect.py
Python
mit
11,193
"""The tests for the Recorder component.""" import unittest from datetime import datetime from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker import homeassistant.core as ha from homeassistant.const import EVENT_STATE_CHANGED from homeassistant.util import dt from homeassistan...
tinloaf/home-assistant
tests/components/recorder/test_models.py
Python
apache-2.0
4,445
import glob import numpy as np from scipy.interpolate import interp2d import astropy.units as au import astropy.time as at import astropy.coordinates as ac import h5py import os import pylab as plt from time import gmtime, strftime from ionotomo.astro.radio_array import * from ionotomo.astro.frames.uvw_frame...
Joshuaalbert/IonoTomo
src/ionotomo/astro/real_data_.py
Python
apache-2.0
16,317
import unittest from test import support import binascii import random import sys from test.support import bigmemtest, _1G, _4G zlib = support.import_module('zlib') try: import mmap except ImportError: mmap = None class ChecksumTestCase(unittest.TestCase): # checksum test cases def test_crc32start(s...
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/test/test_zlib.py
Python
lgpl-3.0
24,349
""" Author: PH01L Email: phoil@osrsbox.com Website: https://www.osrsbox.com Copyright (c) 2019, PH01L ############################################################################### This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
osrsbox/osrsbox-db
osrsbox/items_api/item_weapon.py
Python
gpl-3.0
1,574
''' Atlas ===== .. versionadded:: 1.1.0 Atlas manages texture atlases: packing multiple textures into one. With it, you reduce the number of images loaded and speedup the application loading. This module contains both the Atlas class and command line processing for creating an atlas from a set of individual PNG files...
viralpandey/kivy
kivy/atlas.py
Python
mit
15,625
import os from contextlib import contextmanager from nbx.tools import assert_items_equal from ..bundlenbmanager import BundleNotebookManager from .common import fake_file_system @contextmanager def fake_manager(): with fake_file_system() as td: manager = BundleNotebookManager() manager.root_dir ...
dalejung/nbx
nbx/nbmanager/bundle/tests/test_bundlenbmanager.py
Python
mit
4,540
DEBUG = True ROOT_URLCONF = 'couves.urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # Or path to database file if using sqlite3. 'USER': '', ...
yangming85/lettuce
tests/integration/django/couves/settings.py
Python
gpl-3.0
702
import base64 import gevent import gevent.pywsgi import random import unittest from copy import copy from io import BytesIO import sys import six from locust import events from locust.stats import global_stats from flask import Flask, request, redirect, make_response, send_file, Response, stream_with_context def saf...
pmdarrow/locust
locust/test/testcases.py
Python
mit
5,974
# -*- coding: utf-8 -*- # Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a delegate for the special list widget for GreaseMonkey scripts. """ from __future__ import unicode_literals from PyQt5.QtCore import Qt, QSize, QRect, qVersion from PyQt5.QtGui import QFontMetr...
testmana2/test
Helpviewer/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationListDelegate.py
Python
gpl-3.0
7,381
"""Helper methods for working with containers in config.""" import yaml def GenerateManifest(context): """Generates a Container Manifest given a Template context. Args: context: Template context, which must contain dockerImage and port properties, and an optional dockerEnv property. Returns: ...
aljim/deploymentmanager-samples
examples/v2/ha-service/container_helper.py
Python
apache-2.0
1,216
""" 1 11 21 1211 111221 312211 13112221 """ def ant(num): store = [] cnt = 0 before_element = -1 for i in num: if before_element == -1: before_element = i cnt += 1 elif before_element != i: store.append(cnt) store.append(before_element) ...
JaeGyu/PythonEx_1
antEx2.py
Python
mit
606
#!/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...
teeple/pns_server
work/install/node-v0.10.25/deps/v8/tools/run-tests.py
Python
gpl-2.0
13,499
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'BIOMD0000000162.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/BIOMD0000000162
BIOMD0000000162/model.py
Python
cc0-1.0
427
""" Various kinds of input widgets and form controls. """ from __future__ import absolute_import import six from ...properties import Bool, Int, Float, String, Date, RelativeDelta, Enum, List, Dict, Tuple, Either from ..widget import Widget class InputWidget(Widget): """ Abstract base class for input widgets. `...
almarklein/bokeh
bokeh/models/widgets/inputs.py
Python
bsd-3-clause
4,499
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2015 gimoh # # This file is part of devops-utils. # # devops-utils 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, o...
gimoh/devops-utils
devops_utils/test/conftest.py
Python
gpl-3.0
1,501
# -*- coding: utf-8 -*- # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. """ This module parses and validates arguments for command-line interfaces. It uses argparse module to create the command line...
montimaj/ShaktiT_LLVM
llvm/tools/clang/tools/scan-build-py/libscanbuild/arguments.py
Python
gpl-3.0
15,613
#!/usr/bin/python import sys import string from random import randint def usage(): print ''' Generate a string of N*20 characters where each character is either W or S for Weak and Strong. The string is done is batches of 20, 10 M and 10P to gurantee fairness Usage: sequenceGenerator N where N is a nu...
secondfoundation/Second-Foundation-Src
src/turk/src/interface/acpc_2010_server/GlassFrog/tools/sequenceGenerator.py
Python
lgpl-2.1
996
from django.contrib.sitemaps import Sitemap from ostinato.pages.models import Page class PageSitemap(Sitemap): changefreq = 'never' priority = 0.5 def items(self): return Page.objects.published().filter(show_in_sitemap=True) def lastmod(self, obj): return obj.modified_date
andrewebdev/django-ostinato
ostinato/pages/sitemaps.py
Python
mit
311
# -*- coding: utf-8 -*- ''' This module provide helper views for javascript. ''' from __future__ import unicode_literals import json import logging import re from django.http import HttpResponse from django.utils.cache import patch_vary_headers from django.views.decorators.cache import cache_page from django.views.ge...
Lightmatter/django.js
djangojs/views.py
Python
lgpl-3.0
4,693
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from . import Computer class DomainMessageManager(models.Manager): def scope(self, user): qs = super(DomainMessageManager, self).get_queryset() if not user.is_view_all(): qs =...
migasfree/migasfree
migasfree/server/models/message.py
Python
gpl-3.0
1,348
""" Preview Browser Widget. """ from xml.sax.saxutils import escape from PyQt4.QtGui import ( QWidget, QLabel, QListView, QAction, QVBoxLayout, QHBoxLayout, QSizePolicy, QStyleOption, QStylePainter ) from PyQt4.QtSvg import QSvgWidget from PyQt4.QtCore import ( Qt, QSize, QByteArray, QModelIndex, QEven...
marinkaz/orange3
Orange/canvas/preview/previewbrowser.py
Python
bsd-2-clause
10,352
#!/usr/bin/env python """Launch script. manage.py used to start the application. """ import os import unittest import coverage from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand from api.models import User, BucketList, BucketItem from api import create_app, db app = create_ap...
Mbarak-Mbigo/cp2_bucketlist
manage.py
Python
mit
1,714
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_rich_string10.py
Python
bsd-2-clause
1,236