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 2013 Cloudscaling Group, 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 applicabl... | openstack/ec2-api | ec2api/db/sqlalchemy/migrate_repo/versions/001_juno.py | Python | apache-2.0 | 2,144 |
### HiForest Configuration
# Collisions: pp
# Type: MC
# Input: AOD
import FWCore.ParameterSet.Config as cms
process = cms.Process('HiForest')
process.options = cms.untracked.PSet()
#####################################################################################
# HiForest labelling info
########################... | tuos/RpPb2015Analysis | pileup/mc/pu1/v01/runForestAOD_pp_MC_75X.py | Python | mit | 9,788 |
# 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 applica... | Laucoonte/cpmx | object_detection/utils/np_box_list.py | Python | mit | 4,520 |
"""Authentication operations."""
import logging
import requests
from objectrocket import bases
from objectrocket import errors
logger = logging.getLogger(__name__)
class Auth(bases.BaseAuthLayer):
"""Authentication operations.
:param objectrocket.client.Client base_client: An objectrocket.client.Client ins... | objectrocket/python-client | objectrocket/auth.py | Python | mit | 4,660 |
#!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extract UserMetrics "actions" strings from the Chrome source.
This program generates the list of known actions we expect to s... | anirudhSK/chromium | tools/metrics/actions/extract_actions.py | Python | bsd-3-clause | 31,615 |
# -*- coding: utf-8 -*-
# Copyright 2017 Quartile Limited
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import models, fields, api, _
from odoo.exceptions import Warning
class ProjectActivityConfirm(models.TransientModel):
_name = 'project.activity.confirm'
_description = 'Project... | rfhk/tks-custom | project_activity/wizard/project_activity_confirm.py | Python | agpl-3.0 | 699 |
import collections
#from goodreads import apikey
from goodreads.client import GoodreadsClient
from goodreads.book import GoodreadsBook
from goodreads.author import GoodreadsAuthor
from goodreads.shelf import GoodreadsShelf
class TestBook():
@classmethod
def setup_class(cls):
client = GoodreadsClient(... | TEJESH/gandhi | tests/book_test.py | Python | mit | 3,364 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Alignak-monitoring-contrib/alignak-app | alignak_app/qobjects/events/item.py | Python | agpl-3.0 | 3,581 |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | joelsmith/openshift-tools | ansible/roles/lib_openshift_3.2/library/oc_pvc.py | Python | apache-2.0 | 39,870 |
"""A file interface for handling local and remote data files.
The goal of datasource is to abstract some of the file system operations
when dealing with data files so the researcher doesn't have to know all the
low-level details. Through datasource, a researcher can obtain and use a
file with one function call, regar... | tynn/numpy | numpy/lib/_datasource.py | Python | bsd-3-clause | 25,311 |
# -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy.utils.project import get_project_settings
from time import sleep
from AcgnzSpider.items import AcgnzItem
class AcgnzSpider(scrapy.Spider):
name = 'acgnz.cc'
start_urls = ['http://www.acgnz.cc/sign']
allowed_domains = ['acgnz.cc']
def... | Nymphet/acgnz-spider | AcgnzSpider/spiders/AcgnzSpider01.py | Python | mit | 3,584 |
import angr
import resource
import time
import os
b = angr.Project(os.path.join(
os.path.dirname(__file__),
"../../binaries-private/cgc_scored_event_2/cgc/0b32aa01_01"
))
start = time.time()
#s = b.factory.blank_state(add_options={"COMPOSITE_SOLVER"})
s = b.factory.blank_state(add_options={"COMPOSITE_SOLVER... | f-prettyland/angr | tests/manual_explosion.py | Python | bsd-2-clause | 601 |
# -*- coding: utf-8 -*-
# These tests don't work at the moment, due to the security_groups multi select not working
# in selenium (the group is selected then immediately reset)
import pytest
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.opens... | RedHatQE/cfme_tests | cfme/tests/cloud_infra_common/test_cloud_init_provisioning.py | Python | gpl-2.0 | 7,648 |
from modeller.util.modlist import VarList
from modeller.excluded_pair import excluded_pair
import _modeller
class ExcludedPairList(VarList):
def __init__(self, mdl):
self.__mdl = mdl
VarList.__init__(self)
def __len__(self):
return _modeller.mod_model_nexcl_get(self.__mdl.modpt)
de... | bjornwallner/proq2-server | apps/modeller9v8/modlib/modeller/excluded_pair_list.py | Python | gpl-3.0 | 903 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("credentials", "0002_signatory_organization_name_override"),
]
operations = [
migrations.AddField(
model_name="programcertificate",
name="use_org_name",
f... | edx/credentials | credentials/apps/credentials/migrations/0003_programcertificate_use_org_name.py | Python | agpl-3.0 | 597 |
#
# Copyright 2014 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 ... | DataReply/google-maps-services-python | googlemaps/client.py | Python | apache-2.0 | 11,665 |
#!/usr/bin/env python
import roslib
import rospy
import smach
import smach_ros
from geometry_msgs.msg import Point
from geometry_msgs.msg import Point32
from geometry_msgs.msg import PointStamped
from geometry_msgs.msg import Pose
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import Quate... | ReconCell/smacha | smacha_ros/test/smacha_generated_py/smacha_test_examples/rosbag_cli_recording_1_generate_output.py | Python | bsd-3-clause | 24,378 |
#!/usr/bin/env python
import rosunit
import unittest
import re
from flexbe_core.core.user_data import UserData
from .logger import Logger
from .test_interface import TestInterface
from .test_context import TestContext, LaunchContext
from .data_provider import DataProvider
class Tester(object):
def __init__(sel... | team-vigir/flexbe_behavior_engine | flexbe_testing/src/flexbe_testing/tester.py | Python | bsd-3-clause | 7,123 |
from flask import Blueprint, render_template, request, send_from_directory
from werkzeug.utils import secure_filename
from mrt_file_server import app, schematics
from mrt_file_server.utils.file_utils import get_filesize, split_file_root_and_extension, file_exists_in_dir
from mrt_file_server.utils.flash_utils import fl... | Frumple/mrt-file-server | mrt_file_server/blueprints/schematic.py | Python | mit | 5,181 |
# -*- coding: utf-8 -*-
from django.db import migrations
import os.path
def default_filename(apps, schema_editor):
PatientConsent = apps.get_model("patients", "PatientConsent")
for pc in PatientConsent.objects.all():
if not pc.filename:
pc.filename = os.path.basename(pc.form.name)
... | muccg/rdrf | rdrf/registry/patients/migrations/0017_patientconsent_filename.py | Python | agpl-3.0 | 711 |
#!/usr/bin/env python
import traceback
import json
import os
import datetime
import fitbit
import time
import sys
import pprint
hr_metrics = [] # Store (time,value) tuples parsed from json
step_data = []
# Must take at least 10 steps to count as a walk period
MIN_STEPS_MINUTE_TO_COUNT = 10
MAX_LOW_INTERVALS_TO_END_P... | scottmccool/basis_utilities | basis_steps_to_fitbit.py | Python | mit | 5,938 |
#
# As with the perceptron exercise, you will modify the
# last functions of this sigmoid unit class
#
# There are two functions for you to finish:
# First, in activate(), write the sigmoid activation function
#
# Second, in train(), write the gradient descent update rule
#
# NOTE: the following exercises c... | dmytroKarataiev/MachineLearning | learning/algorithms/perceptron/sigmoid.py | Python | mit | 2,049 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
# Copyright (c) 2009 Jendrik Seipp
#
# RedNotebook 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 vers... | jendrikseipp/rednotebook-elementary | rednotebook/gui/search.py | Python | gpl-2.0 | 4,060 |
from django import forms
from japos.goods.models import Product, Group
class ProductForm(forms.ModelForm):
sku = forms.CharField(widget = forms.TextInput(attrs={'class': 'text-input small-input'}))
barcode = forms.CharField(widget = forms.TextInput(attrs={'class': 'text-input small-input'}))
name = forms.... | jyr/japos | goods/forms.py | Python | gpl-2.0 | 1,027 |
#
# Copyright 2016 The BigDL Authors.
#
# 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 ... | intel-analytics/BigDL | python/orca/test/bigdl/orca/learn/ray/pytorch/test_ray_pytorch_estimator.py | Python | apache-2.0 | 4,024 |
import PythonQt
from PythonQt import QtCore, QtGui, QtUiTools
from director import objectmodel as om
from director import visualization as vis
from director import transformUtils
from director import vtkAll as vtk
from director import cameracontrol
from director import propertyset
from director import pointpicker
impo... | patmarion/director | src/python/director/cameracontrolpanel.py | Python | bsd-3-clause | 6,133 |
# coding=utf-8
"""
__Arthur Marble__
__init__.py is here so we can import GameManager in Main,py
"""
from .ResourceLoader import *
| bubbles231/Hangman-Clone | Engine/__init__.py | Python | mit | 131 |
# -*- coding: utf-8 -*-
"""Parse settings, set defaults."""
#: Default values for settings.
DEFAULTS = {
'diecutter.service': 'diecutter.local:LocalService',
'diecutter.engine': 'jinja2',
'diecutter.filename_engine': 'filename',
'diecutter.engine.django': 'piecutter.engines.django:DjangoEngine',
'd... | diecutter/diecutter | diecutter/settings.py | Python | bsd-3-clause | 748 |
import falcon
class Resource(object):
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/plain'
resp.body = 'Hello, world!'
app = falcon.API()
app.add_route('/text', Resource())
| MuhammadAlkarouri/hug | benchmarks/http/falcon_test.py | Python | mit | 245 |
# coding=utf-8
#
# BSD 3-Clause License
#
# Copyright (c) 2016-18, University of Liverpool
# 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 abov... | fsimkovic/conkit | conkit/core/contact.py | Python | bsd-3-clause | 15,242 |
# Copyright (C) 2015 by Per Unneberg
import pytest
from snakemakelib.sample.organization import sample_org
def test_sample_org():
print (sample_org)
| percyfal/snakemakelib-core | snakemakelib/sample/tests/test_sampleorganization.py | Python | mit | 154 |
#!/usr/bin/python
# Tool to compare MPlayer translation files against a base file. Reports
# conflicting definitions, mismatching arguments, extra definitions
# not present in the base file and (optionally) missing definitions.
# Written by Uoti Urpala
import sys
import re
def parse(filename):
r = {}
f = op... | philipl/mplayer | TOOLS/mphelp_check.py | Python | gpl-2.0 | 2,073 |
from django.db import models
from model_utils.models import TimeStampedModel
class MathEngineHistory(TimeStampedModel):
"""Math engime history model"""
ip = models.GenericIPAddressField()
values = models.CharField(max_length=255)
sum = models.IntegerField()
product = models.IntegerField()
de... | morenopc/dimagi | dimagi/math_engine/models.py | Python | mit | 490 |
# Copyright © 2012-2015 Umang Varma <umang.me@gmail.com>
#
# This file is part of indicator-stickynotes.
#
# indicator-stickynotes is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | lesion/indicator-stickynotes | stickynotes/gui.py | Python | gpl-3.0 | 22,520 |
import sys
import cPickle
from PySide import QtGui, QtCore
from PySide.QtCore import Qt
class Node(object):
def __init__(self, parent=None):
self._parent = parent
self._label = 'root'
self._type = None
self._items = []
self.setParent(parent)
d... | arubertoson/piemenu | piemenu/menusystem/refs/test2.py | Python | gpl-2.0 | 2,336 |
#!/usr/bin/python
""" Creates a widget for monitoring logger information. """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'LGPL'
... | bitesofcode/projexui | projexui/widgets/xloggerwidget/xloggerwidgethandler.py | Python | lgpl-3.0 | 3,594 |
"""State estimator."""
from __future__ import absolute_import
from __future__ import division
#from __future__ import google_type_annotations
from __future__ import print_function
import numpy as np
from typing import Any, Sequence
import collections
_DEFAULT_WINDOW_SIZE = 20
class MovingWindowFilter(object):
"... | google-research/motion_imitation | mpc_controller/com_velocity_estimator.py | Python | apache-2.0 | 4,437 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PatchADependency(Package):
"""Package that requries a patched version of a dependency."""
... | rspavel/spack | var/spack/repos/builtin.mock/packages/patch-a-dependency/package.py | Python | lgpl-2.1 | 539 |
from __future__ import print_function
from __future__ import absolute_import
from .. import log
import os
import codecs
import re
import xml.dom.minidom
from Components.config import config
from .dvbscanner import DvbScanner
import six
from six.moves.urllib.parse import quote
class Tools():
SERVICEREF_ALLOWED_TYPES... | oe-alliance/AutoBouquetsMaker | AutoBouquetsMaker/src/scanner/tools.py | Python | gpl-3.0 | 20,258 |
__version__ = "1.0.0"
| 5t111111/alt-gtags.vim | altgtags_lib/altgtags/__init__.py | Python | lgpl-2.1 | 23 |
from django.contrib import admin
from django.forms import ModelForm
from django.urls import reverse
from .models import Ballot, LoggedAction, PartySet
class LoggedActionAdminForm(ModelForm):
pass
@admin.register(LoggedAction)
class LoggedActionAdmin(admin.ModelAdmin):
form = LoggedActionAdminForm
searc... | DemocracyClub/yournextrepresentative | ynr/apps/candidates/admin.py | Python | agpl-3.0 | 1,386 |
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^... | vandorjw/django-traceability | demo/demo/urls.py | Python | bsd-3-clause | 1,137 |
#!/usr/bin/python
import sys
import argparse
import sql
import process_xls as p_xls
DEFAULT_EXPERIMENT_ID = 1
""" Change to whatever is needed. """
DEFAULT_DATE_STR = ''
DB_NAME = 'trost_prod'
TABLE_NAME = 'temps'
# column name in xls: (order, column name in sql, cast function[, lookup function])
columns_d = {
... | ingkebil/trost | scripts/update/import_climate.py | Python | gpl-2.0 | 1,110 |
# -*- coding: utf-8 -*-
#
# 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 conditions and the following disclaimer.
# * ... | progrium/WebSocket-for-Python | ws4py/__init__.py | Python | bsd-3-clause | 1,625 |
from phystricks import *
def DeuxCercles():
pspict,fig = SinglePicture("DeuxCercles")
A=Point(0,0.5)
B=Point(0.5,0)
C1=Circle(A,0.5)
C2=Circle(B,0.5)
l1=C1.parametric_curve(-pi/2,0)
l2=C2.parametric_curve(pi/2,-pi)
l1.parameters.color="red"
l2.parameters.color="red"
surf=CustomSurface(l1,l2)
surf.paramete... | Naereen/mazhe | phystricksDeuxCercles.py | Python | gpl-3.0 | 540 |
from ..broker import Broker
class NetworkBroker(Broker):
controller = "networks"
def show(self, **kwargs):
"""Shows the details for the specified network.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
... | infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_8_0/network_broker.py | Python | apache-2.0 | 23,895 |
import re
from scrubadub.detectors.base import RegexDetector
from scrubadub.filth import TaxReferenceNumberFilth
class TaxReferenceNumberDetector(RegexDetector):
"""Use regular expressions to detect the UK PAYE temporary reference number (TRN),
Simple pattern matching, no checksum solution.
"""
name... | deanmalmgren/scrubadub | scrubadub/detectors/en_GB/tax_reference_number.py | Python | mit | 1,121 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | kevin-coder/tensorflow-fork | tensorflow/python/keras/engine/training_arrays.py | Python | apache-2.0 | 21,792 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | jonparrott/google-cloud-python | error_reporting/tests/unit/gapic/v1beta1/test_error_stats_service_client_v1beta1.py | Python | apache-2.0 | 7,368 |
from __future__ import absolute_import
import sys
import pytest
import myhdl
from myhdl import *
from myhdl import ConversionError
from myhdl.conversion._misc import _error
from myhdl.conversion import analyze, verify
import myhdl
from myhdl import *
"""
This set of tests exercies a peculiar scenario where an
expa... | juhasch/myhdl | myhdl/test/conversion/general/test_interfaces4.py | Python | lgpl-2.1 | 4,065 |
import numpy as np
import sklearn.cluster as skl_cluster
from sklearn.metrics import silhouette_score
from Orange.data import Table, DiscreteVariable, Domain, Instance
from Orange.projection import SklProjector, Projection
from Orange.distance import Euclidean
__all__ = ["KMeans"]
class KMeans(SklProjector):
_... | qusp/orange3 | Orange/clustering/kmeans.py | Python | bsd-2-clause | 2,246 |
__author__ = 'allentran'
import json
import os
import re
import datetime
import unidecode
from spacy.en import English
import requests
import pandas as pd
import numpy as np
import allen_utils
logger = allen_utils.get_logger(__name__)
class Interval(object):
def __init__(self, start, end):
assert isin... | allentran/fed-rates-bot | fed_bot/model/data.py | Python | mit | 8,747 |
import json
import random
import colorbrewer
import itertools
import numpy as np
from astropy.io import fits
from collections import Counter
# Determine the number of unique morphological classes from GZ2 and the number
# of galaxies in each respective class
def collate_classes():
fitsfile = 'gz2class.fits'
... | willettk/gzviz | prep_json.py | Python | gpl-2.0 | 3,453 |
def init(id):
go = getObject(id)
if go == None:
return
vc = go.getVelocityComponent()
if vc == None:
return
vc.accelerate("")
return
def tick(id):
return
def shatter(selfID, otherID):
go = getObject(selfID)
if go == None:
return
psc = go.getPhysicalStateComponent()
if psc == None:
return
psc.app... | ClockworkOrigins/i6engine | media/scripts/python/MoveScript.py | Python | lgpl-2.1 | 574 |
# Print the version splitted in three components
import sys
verfile = sys.argv[1]
f = open(verfile)
version = f.read()
l = [a[0] for a in version.split('.') if a[0] in '0123456789']
# If no revision, '0' is added
if len(l) == 2:
l.append('0')
for i in l:
print i,
f.close()
| cpcloud/PyTables | mswindows/get_pytables_version.py | Python | bsd-3-clause | 300 |
#!/usr/bin/python
def logPassing(jobName, passing):
if passing:
print(jobName + " is passing!")
elif not passing:
print(jobName + " is failing!")
else:
print(jobName + " has no completion status.")
def logBuilding(jobName, building):
if building:
print(jobName + " has a building task!")
elif not building... | HopefulLlama/JenkinsLightPi | console_logger.py | Python | gpl-3.0 | 446 |
#!/usr/bin/python
from setuptools import setup
setup(name='pygments-github-lexers',
version='0.0.5',
description='Pygments Github custom lexers.',
keywords='pygments github lexer',
license='BSD',
author='Liluo',
author_email='i@liluo.org',
url='https://github.com/liluo/pygm... | liluo/pygments-github-lexers | setup.py | Python | bsd-2-clause | 1,241 |
#!/usr/bin/python2.7
from socket import socket
import ssl
import sys
s = socket()
c = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/tmp/lev5/cert.pem', ciphers='ALL:eNULL', ssl_version=2)
#c = ssl.wrap_socket(s, ciphers='ALL:eNULL', ssl_version=2)
# maybe this is port 2112 in the future ? see meeting !
c... | godoppl/project | otw/abraxas/level5/kill.py | Python | gpl-3.0 | 570 |
#python
import k3d
import testing
setup = testing.setup_mesh_writer_test(["PolyCube", "TriangulateFaces", "STLMeshWriter"], "STLMeshReader", "mesh.sink.STLMeshWriter.stl")
setup.modifier.mesh_selection = k3d.geometry.selection.create(1)
testing.require_valid_mesh(setup.document, setup.reader.get_property("output_mes... | barche/k3d | tests/mesh/mesh.sink.STLMeshWriter.py | Python | gpl-2.0 | 442 |
#!/usr/bin/python3
# Thanks to the GNOME theme nerds for the original source of this script
import os
import sys
import xml.sax
import subprocess
INKSCAPE = '/usr/bin/inkscape'
OPTIPNG = '/usr/bin/optipng'
SRC = os.path.join('.', 'src/gtk3')
inkscape_process = None
def optimize_png(png_file):
if os.path.exist... | bysshe/paper-gtk-theme | render-gtk3-assets.py | Python | gpl-3.0 | 5,784 |
import basic
import likelihood
import mcmc
| profxj/xastropy | xastropy/stats/__init__.py | Python | bsd-3-clause | 43 |
###########################################################
#
# Copyright (c) 2014, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | Southpaw-TACTIC/TACTIC | src/tactic/ui/widget/gallery_wdg.py | Python | epl-1.0 | 20,684 |
# coding=utf-8
"""
vckube
Kubernetes Vagrant Provisioning and management script
-
Active8 (08-03-15)
author: erik@a8.nl
license: GNU-GPL2
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_l... | erikdejonge/vckube | main.py | Python | gpl-2.0 | 426 |
import sys
import jsonpickle
import os
import datetime
import inspect
jsonpickle.set_preferred_backend('json')
if sys.version_info.major < 3:
types = (bool, str, unicode, int, long, float, datetime.datetime)
else:
types = (bool, str, int, float, datetime.datetime)
def pretty_print():
jsonpickle.set_enco... | syncloud/lib | syncloudlib/json/convertible.py | Python | gpl-3.0 | 3,287 |
"""
Shim to maintain backwards compatibility with old IPython.kernel imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
from IPython.utils.shimmodule import ShimModule, ShimWarning
warn("The `IPython.kernel` package h... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/kernel/__init__.py | Python | bsd-2-clause | 1,185 |
from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
from pony.orm.tests.testutils import *
class TestKeys(unittest.TestCase):
def test_keys1(self):
db = Database('sqlite', ':memory:')
class Entity1(db.Entity):
a = P... | compiteing/flask-ponypermission | venv/lib/python2.7/site-packages/pony/orm/tests/test_diagram_keys.py | Python | mit | 6,778 |
from GetListEmailAddresses import *
from AddEmailToList import *
from DeleteEmailFromList import *
| egetzel/wecrow | truehand2014/temboo/Library/SendGrid/NewsletterAPI/ListsEmail/__init__.py | Python | apache-2.0 | 99 |
#Contains a basic class for viewing a mesh, wrapping around glcanvas. Includes
#Basic functionality for setting up lighting/cameras and handling mouse events
#for changing viewing parameters
from OpenGL.GL import *
from OpenGL.arrays import vbo
import wx
from wx import glcanvas
from Primitives3D import *
from PolyMes... | ctralie/S3DGLPy | MeshCanvas.py | Python | apache-2.0 | 7,133 |
# -*- coding: utf-8 -*-
##===-----------------------------------------------------------------------------*- Python -*-===##
## _
## | |
## __| | __ ___ ___ ___
## / _` |/ _` \ \ /\ / / '_ |
## | (_| | ... | MeteoSwiss-APN/dawn | dawn/test/unit-test/dawn/Optimizer/samples/TemporaryTypeDontDemoteSparse.py | Python | mit | 3,918 |
from mesh import Mesh1D
from fem import DofHandler
from function import Function
from fem import QuadFE
from assembler import Kernel
from assembler import Form
from fem import Basis
from assembler import Assembler
from solver import LinearSystem
from plot import Plot
import numpy as np
import matplotlib.pyplot as plt
... | hvanwyk/quadmesh | experiments/multiscale_inverse/test02.py | Python | mit | 4,488 |
import pytest
from domainics.util import ContentTree
def test_dag():
dag = ContentTree()
a, b, c, d, e, f, g, h = (100 + i for i in range(0, 8))
A, B, C, D, E, F, G, H = 'ABCDEFGH'
"""
a(100) -> b(101) -> d(103) -> e(104)
| | + ------> h(107)
| + ------> g(106)
... | lcgong/domainics | test/pillar/test_contenttree.py | Python | apache-2.0 | 941 |
import os
import re
import sys
import zlib
import time
import socket
import httplib
import cPickle
import threading
import BaseHTTPServer
import httplib
import logging
import blocks
import pedrpc
import pgraph
import sex
import primitives
##############################################################################... | OpenRCE/sulley | sulley/sessions.py | Python | gpl-2.0 | 48,671 |
#!/usr/bin/python
# vim: et sw=4 ts=4:
# -*- coding: utf-8 -*-
#
# Piwik - free/libre analytics platform
#
# @link http://piwik.org
# @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
# @version $Id$
#
# For more info see: http://piwik.org/log-analytics/ and http://piwik.org/docs/log-analytics-tool-how-... | hannesk001/SPHERE-Framework | Library/Piwik/misc/log-analytics/import_logs.py | Python | agpl-3.0 | 92,545 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.widgets.reportview import get_match_cond
def get_filters_cond(doctype, filters, conditions):
if filters:
if isinsta... | saurabh6790/test-med-app | controllers/queries.py | Python | agpl-3.0 | 9,022 |
import subprocess
import smtplib
import socket
from email.mime.text import MIMEText
import datetime
# Change to your own account information
to = 'rk.ryan.king@gmail.com'
gmail_user = 'rk.ryan.king@gmail.com'
gmail_password = 'nzwaahcmdzjchxsz'
smtpserver = smtplib.SMTP('smtp.gmail.com', 587)
smtpserver.ehlo()
smtpserv... | rkryan/seniordesign | pi/utils/startup_ip.py | Python | gpl-2.0 | 865 |
from __future__ import annotations
import glob
import logging
import os
import shutil
import uuid
from xia2.Driver.DriverFactory import DriverFactory
from xia2.lib.bits import auto_logfiler
from xia2.Wrappers.XIA.Integrate import Integrate as XIA2Integrate
logger = logging.getLogger("xia2.Applications.xia2_helpers")... | xia2/xia2 | src/xia2/Applications/xia2_helpers.py | Python | bsd-3-clause | 4,081 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import logging
import shutil
HOME_DIR_ENV = 'AVA_HOME'
PROFILE_ENV = 'AVA_PROFILE'
HOME_DIR_NAME = u'home'
PKGS_DIR_NAME = u'pkgs'
LOGS_DIR_NAME = u'logs'
DATA_DIR_NAME = u'data'
CONF_DIR_NAME = u'co... | eavatar/ava-srv | src/eavatar.ava/ava/runtime/environ.py | Python | bsd-3-clause | 2,446 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requireme... | saksham/sample_project | setup.py | Python | bsd-3-clause | 1,503 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Python ctypes bindings for VLC
#
# Copyright (C) 2009-2012 the VideoLAN team
# $Id: $
#
# Authors: Olivier Aubert <contact at olivieraubert.net>
# Jean Brouwers <MrJean1 at gmail.com>
# Geoff Salmon <geoff.salmon at gmail.com>
#
# This library is free soft... | jcherfils/Previoo | vlc.py | Python | gpl-3.0 | 355,425 |
"""engine.SCons.Platform.hpux
Platform-specific initialization for HP-UX systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 200... | ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib64/scons-2.1.0/SCons/Platform/hpux.py | Python | gpl-2.0 | 1,777 |
# 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 unicode_literals
from __f... | mozilla/ChangeDetector | pyLibrary/env/pulse.py | Python | mpl-2.0 | 7,334 |
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Bind the socket to the address given on the command line
server_name = sys.argv[1]
server_address = (server_name, 10000)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.bind(server_addres... | janusnic/21v-python | unit_18/socket/s4.py | Python | mit | 777 |
from feature_extraction.pre_processing.filter_precedent import precendent_directory_cleaner
def run(command_list):
precendent_directory_cleaner.run(command_list)
| Cyberjusticelab/JusticeAI | src/ml_service/feature_extraction/pre_processing/pre_processing_driver.py | Python | mit | 168 |
# -*- coding: utf-8 -*-
##
## This file is part of Flask-Registry
## Copyright (C) 2013 CERN.
##
## Flask-Registry is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at y... | jirikuncar/flask-registry | flask_registry/registries/modulediscovery.py | Python | gpl-2.0 | 4,906 |
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'djangster.views.home', name='home'),
url(r'^create-site/$', 'djangster.vi... | ramseydsilva/djangster | djangster/djangster/urls.py | Python | apache-2.0 | 1,692 |
from django.conf.urls import url
from django.conf.urls import patterns
from pyday_alarms import views
app_name = 'pyday_alarms'
urlpatterns = [
url(r'^alarms/$', views.AlarmView.as_view(), name='alarms'),
]
'''urlpatterns += patterns('pyday_social_network.views',
url(r'^list/$', 'list', na... | 6desislava6/PyDay | pyday_alarms/urls.py | Python | mit | 336 |
# -*- coding: utf-8 -*-
"""In-memory representation of cluster state.
This module implements a data-structure used to keep
track of the state of a cluster of workers and the tasks
it is working on (by consuming events).
For every event consumed the state is updated,
so the state represents the state of the cluster
at... | kawamon/hue | desktop/core/ext-py/celery-4.2.1/celery/events/state.py | Python | apache-2.0 | 25,942 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
See README :)
"""
from __future__ import print_function
import argparse
import cgi
import difflib
import tempfile
import os
import re
import sys
import json
from itertools import chain
import concurrent.futures
import pip_api
from packaging.requirements import Requir... | peterbe/hashin | hashin.py | Python | mit | 27,305 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set ts=4 sw=4 et fdm=marker : */
from django.db import models
class TreePathModel(models.Model):
# ancestor = models.ForeignKey('Node', related_name='tpa')
# descendant = models.ForeignKey('Node', related_name='tpd')
path_len = models.IntegerField... | HiddenData/django-ctt | ctt/core.py | Python | mit | 1,176 |
#!/usr/bin/env python
"""file_utils.py: convenient file operations used by derpbox"""
__author__ = "Waris Boonyasiriwat"
__copyright__ = "Copyright 2017"
import os
import hashlib
def md5(filename):
hash_md5 = hashlib.md5()
with open(filename, "rb") as f:
for chunk in iter(lambda: f.read(4096), b"")... | warisb/derpbox | DerpBox/file_utils.py | Python | mit | 1,062 |
#!/usr/bin/python
# Filename: stringtools.py
import string
def split_embiggen_sort(sentence):
'''
takes a string and removes punctuation
splits it into a list of individual words,
converts them to uppercase and
sorts them in descending order
'''
all_converted = embiggen(sentence)
all... | alistairwalsh/NeuralCode_2015_05_8 | stringtools.py | Python | mit | 1,324 |
# 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/v2018_07_01/aio/operations/_connection_monitors_operations.py | Python | mit | 41,918 |
"""
Tests for xsiftx.util functions
"""
import os
import stat
import unittest
from mock import patch
from .util import mkdtemp_clean
from xsiftx.util import (
get_sifters,
get_course_list,
get_settings,
run_sifter,
XsiftxException,
SifterException
)
class TestUtils(unittest.TestCase):
""... | mitocw/xsiftx | xsiftx/tests/test_util.py | Python | gpl-3.0 | 4,654 |
# Copyright 2015 Violin Memory, 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 requi... | HybridF5/jacket | jacket/tests/storage/unit/test_v7000_common.py | Python | apache-2.0 | 30,620 |
from sfa.generic import Generic
class dummy (Generic):
# the importer class
def importer_class (self):
import sfa.importer.dummyimporter
return sfa.importer.dummyimporter.DummyImporter
# use the standard api class
def api_class (self):
import sfa.server.sfaapi
... | yippeecw/sfa | sfa/generic/dummy.py | Python | mit | 1,036 |
# -*- coding: utf-8 -*-
import pytest
import json
import os.path
import importlib
import jsonpickle
from fixture.application import Application
from fixture.db import DbFixture
from fixture.orm import ORMFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
conf... | DmitriyNeurov/python_training | conftest.py | Python | apache-2.0 | 2,844 |
import os
import sys
import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx
import maya.cmds as cmds
kPluginNodeName = "MitsubaRenderSettings"
kPluginNodeId = OpenMaya.MTypeId(0x87021)
# Command
class MitsubaRenderSetting(OpenMayaMPx.MPxNode):
# Class variables
mMitsubaPath = OpenMaya.MObject... | hpd/MitsubaForMaya | plug-ins/mitsuba/renderer/MitsubaRenderSettings.py | Python | mit | 53,926 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ... | baloo/shinken | shinken/downtime.py | Python | agpl-3.0 | 11,225 |
from __future__ import absolute_import
from __future__ import print_function
# 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/.
import warnings
warnings.simplefilter( "al... | vadzimt/python-nss | doc/examples/ssl_example.py | Python | gpl-2.0 | 16,895 |
# ~*~ coding:utf-8 ~*~
from PyQt5.Qt import QColor
import math
import numpy as np
from geometry import Geometry
class Sphere:
"""
Класс для общего описания сферы
"""
def __init__(self, render_area):
self.render_area = render_area
self.approximation_step = 0
self.radius = 0
... | katya-malyk/sphere_approximation | sphere.py | Python | apache-2.0 | 9,596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.