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
# Support Python 2 and 3 from __future__ import unicode_literals from __future__ import absolute_import from __future__ import print_function import sys, os from collections import OrderedDict if sys.version_info < (3,): import odpslides.ElementTree_27OD as ET else: import odpslides.ElementTree_34OD as ET fro...
sonofeft/ODPSlides
odpslides/code_gen/make_page_layouts.py
Python
lgpl-3.0
6,050
#!/usr/bin/env python import os,sys,re from collections import defaultdict from gzip import GzipFile import numpy as np from numpy import chararray as carray from numpy import fromstring,byte import mmap import logging import pysam import optparse import traceback __version__ = "1.99" __author__ = "Marvin Jens" __cred...
rajewsky-lab/find_circ2
find_circ.py
Python
gpl-3.0
60,667
# # Copyright 2009 Facebook # # 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, s...
bdarnell/tornado
tornado/iostream.py
Python
apache-2.0
65,697
# -*- coding: utf-8 -*- """ Show a tray icon to indicate the status of Github service. Could serve as notification for pull requests, etc, in the future. Author: Gabriel Patiño <gepatino@gmail.com> License: Do whatever you want """ import appindicator import dateutil.parser import gtk import os import pynotify import...
gepatino/github-indicator
ghindicator/gui.py
Python
gpl-3.0
6,462
# -*- coding: utf-8 -*- # 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 distributed in the hope that...
msabramo/kallithea
kallithea/lib/auth_modules/auth_ldap.py
Python
gpl-3.0
14,266
"""Module for representation of wing section's structure This module defines classes which allow definition of a wing section as chain of multiple structure elements. Definition of a structure starts with SectionBase, which stores airfoil coordinates. Beginning with this exterior geometry structure elements can be add...
helo9/wingstructure
wingstructure/structure/section.py
Python
mit
11,241
# Copyright (c) 2014-2016, Clemson University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditio...
ClemsonSoCUnix/django-sshkey
django_sshkey/models.py
Python
bsd-3-clause
5,547
import sys sys.path.insert(1, "../../../") import h2o def offset_gamma(ip,port): # Connect to a pre-existing cluster h2o.init(ip,port) insurance = h2o.import_frame(h2o.locate("smalldata/glm_test/insurance.csv")) insurance["offset"] = insurance["Holders"].log() gbm = h2o.gbm(x=insurance[0:3], y=i...
ChristosChristofidis/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_offset_gammaGBM.py
Python
apache-2.0
1,603
from eve import Eve from eve.auth import TokenAuth import jwt import os from flask import Flask, request, redirect, url_for from werkzeug.utils import secure_filename from cross import crossdomain import uuid app = Eve() ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']) UPLOAD_FOLDER = 'C:/Bitnami...
jemiaymen/pm
restful/run.py
Python
mit
2,598
## The brain of WhiteDragon # chenmz 2017.9.1 from modules import stateMachine as sm from modules import ioControl as io import math import json import time # Import the configure infomation conf = json.load(open('conf.json')) # Move forward for 0.01 meter # state: (position_x(unit: m), position_y(unit: m), angle_t...
treegod13/whiteDragon
whiteBrain.py
Python
gpl-3.0
2,884
import re import urllib.parse as urlparse from django.conf import settings REPLACE_STR = '$encrypted$' class UriCleaner(object): REPLACE_STR = REPLACE_STR SENSITIVE_URI_PATTERN = re.compile(r'(\w{1,20}:(\/?\/?)[^\s]+)', re.MULTILINE) # NOQA @staticmethod def remove_sensitive(cleartext): # ...
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awx/main/redact.py
Python
apache-2.0
3,346
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017 AVSystem <avsystem@avsystem.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/LICEN...
dextero/Anjay
test/integration/runtest.py
Python
apache-2.0
7,173
def str_length(line): return len(line) if __name__ == '__main__': # These "asserts" using only for self-checking and not necessary for auto-testing assert str_length("") == 0, "1st example"; assert str_length("mo") == 2, "2st example"; assert str_length("length") == 6, "3st example"; print("Co...
edwardzhu/checkio-solution
EmpireOfCode/common/Adamantite Mines/strlen.py
Python
mit
391
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap from schools.sitemaps import school_sitemaps from places.models import Province, County, District, Division, Location, SubLocation from places.models import Constituency, SchoolZone province_dict = { 'queryset': Province.objects.all(), 'date...
moshthepitt/shulezote
core/sitemaps.py
Python
mit
1,839
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns #from django.contrib import admin #admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'base.views.index', name='index'), url(r'^event/$', 'base.views.event'), url(r'^event/(?P<e...
gmjosack/auditor
auditor/urls.py
Python
mit
597
import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import pandas as pd import io u = u"""latitude,longitude 42.357778,-71.059444 39.952222,-75.163889 25.787778,-80.224167 30.267222, -97.763889""" # read in data to use for plotted points # buildingdf = pd.read_csv(io.StringIO(u), delimiter=",") b...
rbdedu/runway
examples/basemap4.py
Python
mit
1,490
""" Things commonly needed in Enterprise tests. """ from django.conf import settings FEATURES_WITH_ENTERPRISE_ENABLED = settings.FEATURES.copy() FEATURES_WITH_ENTERPRISE_ENABLED['ENABLE_ENTERPRISE_INTEGRATION'] = True FAKE_ENTERPRISE_CUSTOMER = { 'active': True, 'branding_configuration': None, 'catalog':...
ahmedaljazzar/edx-platform
openedx/features/enterprise_support/tests/__init__.py
Python
agpl-3.0
728
#!/usr/bin/python import sys import os VERSION = "0.1" def run(): sys.argv.insert(1, "serve") if len(sys.argv) <= 2: # set default file config_file_path = os.path.join(os.getcwd(), "config.py") sys.argv.append(config_file_path) from pecan.commands import CommandRunner CommandR...
jlpk/joulupukki-dispatcher
joulupukki/dispatcher/__init__.py
Python
agpl-3.0
348
#!/usr/bin/python # -*- coding: utf-8 -*- from qframer.qt import QtGui from qframer.qt import QtCore from logindialog import login from exitdialog import exit from msgdialog import MessageDialog from msgdialog import msg from ipaddressdialog import ipaddressinput from urlinputdialog import urlinput from numinputdialog ...
dragondjf/QMarkdowner
utildialog/__init__.py
Python
mit
666
#!/usr/bin/env python # # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2011-2013 Marcus Popp marcus@popp.mx ######################################################################### #...
mptei/smarthome
lib/orb.py
Python
gpl-3.0
3,811
# Copyright (c) 2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
ruijie/quantum
quantum/plugins/openvswitch/common/constants.py
Python
apache-2.0
1,066
#!/usr/bin/env python """ Convert GFF2 file format to BED Careful: GFF2 files have 1-based coordinates and BED files have 0-based coordinates This is called "off-by-one coordinate" """ #################### ## Import librairies #################### # import librairies import argparse import os #################### ##...
BleekerLab/Solanum_sRNAs
scripts/gff2tobed.py
Python
mit
1,180
"""Handles DigitalOcean Domain Record CRD."""
Jitsusama/lets-do-dns
lets_do_dns/do_domain/__init__.py
Python
apache-2.0
46
import _objc __all__ = ['protocolNamed', 'ProtocolError'] class ProtocolError(_objc.error): __module__ = 'objc' PROTOCOL_CACHE = {} def protocolNamed(name): """ Returns a Protocol object for the named protocol. This is the equivalent of @protocol(name) in Objective-C. Raises objc.ProtocolError wh...
rays/ipodderx-core
objc/_protocols.py
Python
mit
912
from rllab.spaces.base import Space import tensorflow as tf import numpy as np class Product(Space): def __init__(self, *components): if isinstance(components[0], (list, tuple)): assert len(components) == 1 components = components[0] self._components = tuple(components) ...
brain-research/mirage-rl-qprop
sandbox/rocky/tf/spaces/product.py
Python
mit
2,360
#!/usr/bin/python """ This example shows subfigure functionality. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ # begin-doc-include from pylatex import Document, Section, Figure, SubFigure, NoEscape import os if __name__ == '__main__': doc = Document(default_file...
JelteF/PyLaTeX
examples/subfigure.py
Python
mit
1,279
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db import IntegrityError from django.core.exceptions import ObjectDoe...
sshkm/django-sshkm
sshkm/views/group.py
Python
gpl-3.0
4,174
# Copyright (C) 2016, Hitachi, Ltd. # # 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...
ge0rgi/cinder
cinder/volume/drivers/hitachi/vsp_horcm.py
Python
apache-2.0
56,982
#!/usr/bin/env python # # waCaptcha # Copyright (C) 2012 Larroque Stephen # # This program is free software; you can redistribute it and/or modify # it under the terms of the Affero GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any late...
lrq3000/waCaptcha
auxlib.py
Python
agpl-3.0
4,579
# Copyright 2015 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
hayderimran7/ec2-api
ec2api/tests/functional/botocoreclient.py
Python
apache-2.0
1,492
"""OpenBMP File Consumer Copyright (c) 2013-2016 Cisco Systems, Inc. and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10....
OpenBMP/openbmp-file-consumer
src/site-packages/openbmp/file/RawTimedRotatingFileHandler.py
Python
epl-1.0
5,283
#!/usr/bin/env python import sys import xbmc #enable localization getLS = sys.modules[ "__main__" ].__language__ class logging: @staticmethod def dbg( msg ): xbmc.output( "LibraryManager: "+msg.encode('utf-8'), xbmc.LOGDEBUG ) @staticmethod def err( msg ): xbmc.output( "LibraryMan...
albertfc/XBMC-Library-Manager
resources/lib/logging.py
Python
gpl-3.0
367
# Calc command. from distutils.version import LooseVersion import logging import click import snuggs from cligj import files_inout_arg from .helpers import resolve_inout from . import options import rasterio from rasterio.fill import fillnodata from rasterio.features import sieve def get_bands(inputs, d, i=None): ...
kapadia/rasterio
rasterio/rio/calc.py
Python
bsd-3-clause
5,282
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
codilime/cloudify-dsl-parser
dsl_parser/elements/blueprint.py
Python
apache-2.0
4,108
# -*- coding: utf-8 -*- """ Created on Wed Dec 02 17:43:52 2015 @author: okada $Id: qc.py 205 2017-08-08 06:25:59Z aokada $ """ ########### js template js_header = """(function() { qc_data = {}; """ js_footer = """ })(); Object.freeze(qc_data); """ js_dataset = """ qc_data.Ids = [{IDs}]; qc_data.plots = [{plots}]; ...
Genomon-Project/paplot
scripts/paplot/qc.py
Python
mit
6,736
# Copyright (c) 2009-2010 Arista Networks, Inc. - James Lingard # Copyright (c) 2004-2010 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # 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 ...
dbbhattacharya/kitsune
vendor/packages/pylint/checkers/string_format.py
Python
bsd-3-clause
11,146
""" ========================================================= Hashing feature transformation using Totally Random Trees ========================================================= RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representation, which might be beneficial for classificati...
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/examples/ensemble/plot_random_forest_embedding.py
Python
mit
3,528
"""Support for Dark Sky weather service.""" import logging from datetime import timedelta import voluptuous as vol from requests.exceptions import ( ConnectionError as ConnectError, HTTPError, Timeout) import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA...
jabesq/home-assistant
homeassistant/components/darksky/sensor.py
Python
apache-2.0
21,674
#! -*- coding:utf-8 -*- import os import time import signal import traceback from pyflumes.channels.base import ChannelBase class FileChannel(ChannelBase): def __init__(self, config, section): super(FileChannel, self).__init__(config, section) self.store_dir = os.path.join(config.get('GLOBAL', '...
jrc-github/pyflume
pyflumes/channels/file_channel.py
Python
gpl-3.0
2,715
from __future__ import absolute_import from .runtime import scheduler from .exceptions import AlreadyScheduled registered_jobs = {} def register_interval_job(name, title, func, weeks=0, days=0, hours=0, minutes=0, seconds=0, start_date=None, args=None, kwargs=None, ...
appsembler/mayan_appsembler
apps/scheduler/api.py
Python
gpl-3.0
888
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.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 # # ...
dreamhost/ceilometer
tests/api/v2/test_compute_duration_by_resource.py
Python
apache-2.0
7,710
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
slashdd/sos
sos/report/plugins/rpm.py
Python
gpl-2.0
2,346
import json import numpy as np from skimage.measure import regionprops from skimage.morphology import convex_hull_image from skimage.segmentation import find_boundaries class STObject(object): """ The STObject stores data and location information for objects extracted from the ensemble grids. Attributes...
djgagne/hagelslag
hagelslag/processing/STObject.py
Python
mit
23,608
#! /usr/bin/env python # Calculate the n^th Fibonacci number. def fib(n): if (n < 2): return n else: return fib(n - 1) + fib(n - 2) res = fib(20) print(res)
emerging-technologies/fib-languages
fib.py
Python
mit
171
# # Copyright 2016 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
magne-max/zipline-ja
tests/risk/test_risk_period.py
Python
apache-2.0
23,082
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2007-2009 Stephane Charette # Copyright (C) 2009 Gary Burton # Contribution 2009 by Bob Ham <rah@bash.sh> # Copyright (C) 2010 Jakim Friant # Copyright (C) 2012-2013 Paul Franklin # # This ...
beernarrd/gramps
gramps/gui/plug/report/_graphvizreportdialog.py
Python
gpl-2.0
10,695
import os import re import string from itertools import chain from .detector_morse import Detector from .detector_morse import slurp # from .penn_treebank_tokenizer import word_tokenize import nlup from pug.nlp.constant import DATA_PATH from pug.nlp.util import generate_files # regex namespace only conflicts with reg...
hobson/pug-nlp
pug/nlp/segmentation.py
Python
mit
13,806
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import os # This must be run before importi...
ta2-1/pootle
pootle/apps/pootle_app/management/commands/retry_failed_jobs.py
Python
gpl-3.0
727
""" Helpers to allow vncdotool to be intergrated into other applications. This feature is under developemental, you're help testing and debugging is appreciated. """ import threading try: import queue except ImportError: import Queue as queue import logging from twisted.internet import reactor from twisted.i...
jamtwister/vncdotool
vncdotool/api.py
Python
mit
3,674
from lxml import html from .Form import build from artemis.handlers.HandlerRules import getHandler from artemis.Task import buildFromURI, Task, AuthNature import formasaurus class FormHandler : def __init__(self): pass def extract(self, url, nature ): task = TaskFactory.buildFromURI( url, Task(auth=AuthNature...
athena-project/Artemis
src/accreditation/FormHandler.py
Python
gpl-2.0
1,176
# -*- coding: utf-8 -*- from __future__ import unicode_literals from importlib import import_module from django import VERSION as DJANGO_VERSION from django.conf import settings # Do we support set_required and set_disabled? # See GitHub issues 337 and 345 # TODO: Get rid of this after support for Django 1.8 LTS end...
thodoris/djangoPharma
djangoPharma/env/Lib/site-packages/bootstrap3/bootstrap.py
Python
apache-2.0
3,125
#! /usr/bin/python __author__="Ashish Hunnargikar" __date__ ="$Jun 13, 2014 12:33:33 PM$" import time import random import subprocess import os import uuid import datetime from elasticsearch.transport import Transport from elasticsearch import (Elasticsearch, RoundRobinSelector, ImproperlyConfigured, ElasticsearchExc...
misho-kr/elasticsearchindex
loadtest/dockerpush.py
Python
apache-2.0
18,039
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" client = Client(account_sid, auth_token) # A list of record objects ...
teoreteetik/api-snippets
rest/usage-records/list-get-example-3/list-get-example-3.6.x.py
Python
mit
472
# Copyright (c) 2010 OpenStack, LLC. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wit...
bswartz/manila
manila/scheduler/manager.py
Python
apache-2.0
12,711
#!/usr/bin/env python # -*- test-case-name: calendarserver.tools.test.test_calverify -*- ## # Copyright (c) 2011-2014 Apple 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 Lice...
trevor/calendarserver
calendarserver/tools/dbinspect.py
Python
apache-2.0
29,245
__author__ = 'mramire8' import nltk from scipy.sparse import diags from numpy.random import RandomState from randomsampling import * import random class AALStructuredFixk(AnytimeLearner): def __init__(self, model=None, accuracy_model=None, budget=None, seed=None, vcn=None, subpool=None, cost_mod...
mramire8/active
strategy/structured.py
Python
apache-2.0
47,843
import networkx as nx import numpy as np def bipartite_region_tracking(partition, optical_flow, reliability, matching_th=0.1, reliability_th=0.2): """ Parameters ---------- partition: numpy array A 3D label array where each label represents a region optical_flow: numpy arra...
guillempalou/scikit-cv
skcv/video/segmentation/region_tracking.py
Python
bsd-3-clause
3,595
from typing import Tuple from hwt.doc_markers import internal from hwt.hdl.transPart import TransPart from hwt.hdl.transTmpl import OneOfTransaction @internal def iterSort(iterators, cmpFn): """ Sort items from iterators(generators) by alwas selecting item with lowest value (min first) :return: gene...
Nic30/HWToolkit
hwt/hdl/frameTmplUtils.py
Python
mit
8,128
"""Offer time listening automation rules.""" import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import CONF_AT, CONF_PLATFORM from homeassistant.helpers import config_validation as cv from homeassistant.helpers.event import async_track_time_change # mypy: allow-...
joopert/home-assistant
homeassistant/components/automation/time.py
Python
apache-2.0
1,060
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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 progra...
ywcui1990/nupic
examples/opf/experiments/multistep/simple_0/description.py
Python
agpl-3.0
1,588
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Joji Doi import argparse import os import json import shutil """ /usr/local/bin/file_lister.py script to list all media files in the given --media-root dir """ """ MEDIA_TYPES -- key is supported folder name, value is a tuple of supported file ex...
do-i/bansible
roles/webapp/files/file_lister.py
Python
mit
4,213
#!/usr/bin/python3 -tt from .config_agent import ConfigAgent __all__ = ['ConfigAgent']
techlib/adminator
adminator/config_agent/__init__.py
Python
mit
89
#!/usr/bin/env python """Parsers for handling rekall output.""" import json import ntpath from grr.lib import artifact_utils from grr.lib import parsers from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues import paths as rdf_paths class RekallPsListParser(parsers.RekallPluginParser): """Pars...
darrenbilby/grr
parsers/rekall_artifact_parser.py
Python
apache-2.0
1,907
from website.files.models.base import File, Folder, FileNode __all__ = ('S3File', 'S3Folder', 'S3FileNode') class S3FileNode(FileNode): provider = 's3' class S3Folder(S3FileNode, Folder): pass class S3File(S3FileNode, File): version_identifier = 'version'
ticklemepierce/osf.io
website/files/models/s3.py
Python
apache-2.0
275
# BEGIN_COPYRIGHT # # Copyright (C) 2009-2013 CRS4. # # This file is part of biodoop-core. # # biodoop-core 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 optio...
crs4/biodoop-core
bl/core/messages/details/__init__.py
Python
gpl-3.0
1,154
#!/usr/bin/env python #-------------------------------------------------------------------------- # Python to manage garage alarms and door bell # sends notification out to Instapush # logs CLIMATE to RRD # Open/Close may be reversed is code started WITH THE DOOR OPEN/CLOSED # KFREEGARD/NORTHWARKS 2016 # Version 1.0 2...
northwarks/AlarmPi
alarmpi.py
Python
gpl-3.0
9,787
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
pabelanger/stackalytics
dashboard/web.py
Python
apache-2.0
13,882
import logging import os import requests import json from .twxthing import TWX_Thing, TWX_Property,TWX_Template from .twxexcelparser import parseSimulatorConfig from .helper import setup_log,parse_commandline from .thingworx import ThingworxServer def get_server(args): configurationpath = args.config_path co...
arproio/kpitest
kpitest/restsimulator.py
Python
mit
2,804
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> import numbers import warnings import numpy as np from scipy impo...
soulmachine/scikit-learn
sklearn/linear_model/logistic.py
Python
bsd-3-clause
38,054
#!/usr/bin/env python import os import pywns.TableParser class ProbeTypeError(Exception): """ Raised if not a probe of desired type """ pass class Probe(object): """ Base class to read probes from files """ valueNames = ["minimum", "maximum", "trials", "mean", "variance", "relativeV...
openwns/pywns
pywns/Probe.py
Python
gpl-2.0
25,493
# -*- coding:utf-8 -*- #!/usr/bin/env python # Import all the things! import sys import os try: import argparse except: print '[!] argparse is not installed. Try "pip install argparse"' sys.exit(0) try: from urllib import urlopen from urllib import urlretrieve from urllib import urlencode except: print '...
hxer/Scripts
GitHarvester/githarvester.py
Python
gpl-2.0
8,757
# -*- coding: utf-8 -*- # Copyright 2022 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-dialogflow-cx
samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_async.py
Python
apache-2.0
1,525
""" jobber.conf ~~~~~~~~~~~ Exposes a `_Settings_` instance with applied overrides from local.py. """ from jobber.conf import default as default_settings try: from jobber.conf import local as local_settings except ImportError: local_settings = None def _make_dict(module): """Transforms a module into a ...
hackcyprus/jobber
jobber/conf/__init__.py
Python
mit
980
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import hashlib import json from dataclasses import dataclass from enum import Enum from typing import Any, Callable, Iterable, Set, TypeVar from pkg_re...
patricklaw/pants
src/python/pants/backend/python/util_rules/lockfile_metadata.py
Python
apache-2.0
14,210
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import vtk import vtk.test.Testing import math class TestLinePlotColors(vtk.test.Testing.vtkTest): def testLinePlot(self): "Test if colored line plots can be built with python" # Set up a 2D scene, add an XY chart to it view = vtk.vt...
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Charts/Core/Testing/Python/TestLinePlotColors.py
Python
gpl-3.0
3,397
# Copyright 2014, Brian Coca <bcoca@ansible.com> # Copyright 2017, Ken Celenza <ken@networktocode.com> # Copyright 2017, Jason Edelman <jason@networktocode.com> # Copyright 2017, Ansible Project # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of ...
tchernomax/ansible
lib/ansible/plugins/filter/mathstuff.py
Python
gpl-3.0
8,117
import warnings as custom_warnings # Monkeypatch the print of warning so we can customize them def my_format_warning(message, category, *args): """ Override the default showwarning to customize the appearance of warnings :return: """ return "\nWARNING %s: %s\n\n" % (category.__name__, message) ...
sybenzvi/3ML
threeML/exceptions/custom_exceptions.py
Python
bsd-3-clause
633
# Copyright 2016 VMware, 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...
ashahi1/docker-volume-vsphere
esx_service/vmodl/VsphereContainerService__ext_init__.py
Python
apache-2.0
828
""" Created by Max 12/10/2017 """ from ValueIteration import ValueIteration from Game import Game x = {(0, 32, -5, -5): None, (0, 32, -5, -4): None, (0, 32, -5, -3): None, (0, 32, -5, -2): None, (0, 32, -5, -1): None, (0, 32, -5, 0): None, (0, 32, -5, 1): None, (0, 32, -5, 2): None, (0, 32, -5, 3): None, (0,...
MaxRobinson/CS449
project7/extra.py
Python
apache-2.0
494,316
from abc import ABC, abstractmethod import logging from humanfriendly.prompts import prepare_friendly_prompts from adles.__about__ import __url__, __email__ class Script(ABC): """Base class for all CLI scripts.""" __version__ = '0.1.0' name = '' def __init__(self): prepare_friendly_prompts(...
GhostofGoes/ADLES
adles/scripts/script_base.py
Python
apache-2.0
1,402
from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base engine = create_engine('sqlite:///backend.db', convert_unicode=True) db_session = scoped_session(sessionmaker(autocommit=False, a...
SecurityCompass/LabServer
database.py
Python
bsd-3-clause
730
from __future__ import print_function import unittest import numpy as np import pydrake import os.path class TestRBTCoM(unittest.TestCase): def testCoM0(self): r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))...
billhoffman/drake
drake/bindings/python/pydrake/test/testRBTCoM.py
Python
bsd-3-clause
1,228
# -*- coding: utf-8 -*- from .baseaction import BaseAction class PolyAction (BaseAction): """ Класс для полиморфного действия, поведение которого можно менять во время работы """ def __init__(self, application, strid, title, des...
unreal666/outwiker
src/outwiker/gui/polyaction.py
Python
gpl-3.0
1,052
data = ( 'Zhi ', # 0x00 'Liu ', # 0x01 'Mei ', # 0x02 'Hoy ', # 0x03 'Rong ', # 0x04 'Zha ', # 0x05 '[?] ', # 0x06 'Biao ', # 0x07 'Zhan ', # 0x08 'Jie ', # 0x09 'Long ', # 0x0a 'Dong ', # 0x0b 'Lu ', # 0x0c 'Sayng ', # 0x0d 'Li ', # 0x0e 'Lan ', # 0x0f 'Yong ', # 0x10...
samuelmaudo/yepes
yepes/utils/unidecode/x068.py
Python
bsd-3-clause
4,674
#!/usr/bin/env python3 # Copyright (c) 2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test logic for setting nMinimumChainWork on command line. Nodes don't consider themselves out of "initia...
doriancoins/doriancoin
test/functional/feature_minchainwork.py
Python
mit
3,955
# # Kivy - Crossplatform NUI toolkit # http://kivy.org/ # import sys from copy import deepcopy import os from os.path import join, dirname, sep, exists, basename from os import walk, environ from distutils.core import setup from distutils.extension import Extension from collections import OrderedDict if sys.version ...
JulienMcJay/eclock
windows/kivy/setup.py
Python
gpl-2.0
24,726
import yaml import os.path import os import jinja2 import sys sys.path = [os.path.join(os.path.dirname(__file__), '..')] + sys.path import bindings.get_info from bindings.maybe_write import maybe_write import re if len(sys.argv) != 2: print("Invalid usage: do not have destination") sys.exit(1) print("Generati...
zaolij/libaudioverse
metadata/metadata.py
Python
gpl-3.0
7,800
""" modified from the original idea on inventingwithpython.com added parsing of a web-page for a list of animals, as a proof of concept built in stages with prompting by Y10 pupils """ from html.parser import HTMLParser import urllib.request import random HANGMANPICS = [""" +---+ | | | | ...
MrHarcombe/GCSEPythonExamples
Python/hangman.py
Python
mit
3,900
""" @author: Fabio Erculiani <lxnay@sabayon.org> @contact: lxnay@sabayon.org @copyright: Fabio Erculiani @license: GPL-2 B{Entropy Updates Notification Applet (Magneto) UI components module} """ # System imports import os # Qt imports from PyQt5.QtCore import QStringListModel from PyQt5.QtWidge...
Sabayon/entropy
magneto/src/magneto/qt5/components.py
Python
gpl-2.0
2,329
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
klahnakoski/esReplicate
pyLibrary/queries/expression_compiler.py
Python
mpl-2.0
1,182
""" feather-format compat """ from distutils.version import LooseVersion from pandas import DataFrame, RangeIndex, Int64Index from pandas.compat import range def _try_import(): # since pandas is a dependency of feather # we need to import on first use try: import feather except ImportError: ...
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/pandas/io/feather_format.py
Python
mit
2,938
import os import json from Tkinter import * from ttk import * from subprocess import Popen, PIPE VERSION = "0.1" # default config CONFIG = dict( settings=dict( terminal="Terminal", sshbin="/usr/bin/ssh", window_width=400, window_height=40, item_display="%(host)s as user %(user)s" ), hosts=[...
chassing/QuickSSH
quickssh/main.py
Python
mit
6,381
"""Support for device connected via Lightwave WiFi-link hub.""" from lightwave.lightwave import LWLink import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_LIGHTS, CONF_NAME, CONF_SWITCHES import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import async_load_pl...
leppa/home-assistant
homeassistant/components/lightwave/__init__.py
Python
apache-2.0
1,567
""" Generators for geometric graphs. """ # Copyright (C) 2004-2008 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from __future__ import print_function __author__ ="""Aric Hagberg (hagberg@lanl.gov)\nPie...
rainest/dance-partner-matching
networkx/generators/geometric.py
Python
bsd-2-clause
2,543
# -*- coding: utf-8 -*- import logging import cgi import re import widgets from . import convs from ..utils import cached_property from collections import OrderedDict from .perms import FieldPerm logger = logging.getLogger(__name__) __all__ = ['BaseField', 'Field', 'FieldBlock', 'FieldSet', 'FieldList', 'FileField'...
oas89/iktomi
iktomi/forms/fields.py
Python
mit
14,070
# -*- coding: utf-8 -*- # # ncclient documentation build configuration file, created by # sphinx-quickstart on Fri Sep 18 17:32:15 2009. # # 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. # # Al...
travelping/ncclient
docs/source/conf.py
Python
apache-2.0
6,621
from django.contrib.contenttypes.models import ContentType from django.utils import simplejson as json from hyperadmin.mediatypes.json import JSON, JSONP from common import MediaTypeTestCase class JsonTestCase(MediaTypeTestCase): def get_adaptor(self): self.api_request = self.get_api_request() r...
zbyte64/django-hyperadmin
hyperadmin/tests/mediatypes/test_json.py
Python
bsd-3-clause
2,803
'''The pdp.portals.bc_prism module configures a raster portal to serve the 1971-2000 and 1981-2010 climatologies and monthly climate data for 800 meter resolution PRISM dataset for BC ''' from pdp.portals import make_raster_frontend, data_server from pdp_util.ensemble_members import EnsembleMemberLister __all__ = ['u...
pacificclimate/pdp
pdp/portals/bc_prism.py
Python
gpl-3.0
2,824
''' Copyright (c) 2012 Dustin Frisch <fooker@lab.sh>, Sven Reissmann <sven@0x80.io> This file is part of the PyTgen traffic generator. PyTgen 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, ...
reissmann/PyTgen
core/scheduler.py
Python
gpl-3.0
4,853
from api.decorators import api_view, request_data_nodc from api.permissions import IsSuperAdmin, IsSuperAdminOrReadOnly from api.dc.base.dc_view import DcView from api.dc.base.dc_settings import DcSettingsView __all__ = ('dc_list', 'dc_manage', 'dc_settings') @api_view(('GET',)) @request_data_nodc(permissions=(IsSup...
erigones/esdc-ce
api/dc/base/views.py
Python
apache-2.0
5,970