text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# 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 requ... | jeffrey4l/nova | nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping.py | Python | apache-2.0 | 13,826 | 0.000072 |
# Copyright 2016 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import contextlib
from gi.reposito... | ptitjes/quodlibet | quodlibet/ext/events/seekbar.py | Python | gpl-2.0 | 4,402 | 0 |
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
#
# This library is free software; you ca... | nrgaway/qubes-core-admin | qubes/vm/templatevm.py | Python | gpl-2.0 | 4,118 | 0.001457 |
from __future__ import print_function
from __future__ import division
from django.core.management.base import BaseCommand
from query.models import Video, Face, LabelSet, Frame
from scannerpy import ProtobufGenerator, Config
import os
import cv2
import math
import numpy as np
import tensorflow as tf
import align.detect_... | MattPerron/esper | esper/query/management/commands/score.py | Python | apache-2.0 | 14,310 | 0.004892 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py's Event Model (encapsulates wx.Event)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart"
__license__ = "LGPL 3.0"
# Initial implementation was inspired on PythonCard's event module, altought
# it was... | reingart/gui2py | gui/event.py | Python | lgpl-3.0 | 6,795 | 0.003974 |
import warnings
import numpy as np
from pandas import compat
from pandas._libs import reduction
from pandas.core.dtypes.generic import ABCSeries
from pandas.core.dtypes.common import (
is_extension_type,
is_dict_like,
is_list_like,
is_sequence)
from pandas.util._decorators import cache_readonly
from pa... | harisbal/pandas | pandas/core/apply.py | Python | bsd-3-clause | 12,744 | 0 |
# Copyright 2018, OpenCensus 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 w... | census-instrumentation/opencensus-python | tests/unit/stats/test_measure_to_view_map.py | Python | apache-2.0 | 16,207 | 0 |
# -*- coding: utf-8 -*-
from collections import defaultdict
import mock
from searx.engines import btdigg
from searx.testing import SearxTestCase
class TestBtdiggEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 0
params... | misnyo/searx | tests/unit/engines/test_btdigg.py | Python | agpl-3.0 | 19,083 | 0.002626 |
from django.contrib import admin
from django.contrib.auth import get_user_model
class SignUpAdmin(admin.ModelAdmin):
class Meta:
model = get_user_model()
admin.site.register(get_user_model(), SignUpAdmin) | acenario/Payable | Payable/PayableCore/admin.py | Python | mit | 217 | 0.013825 |
"""Copyright 2012 TechInvestLab.ru dot15926@gmail.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following di... | TechInvestLab/dot15926 | editor_qt/extensions/__init__.py | Python | lgpl-3.0 | 1,249 | 0.001601 |
from behave import then, when
from bs4 import BeautifulSoup
from bs4.element import Tag
from pageobjects.pages import About, Welcome
@when(u'I instantiate the Welcome page object')
def new_pageobject(context):
context.page = Welcome(context)
@then(u'it provides a valid Beautiful Soup document')
def pageobject_w... | behave/behave-django | tests/acceptance/steps/using_pageobjects.py | Python | mit | 1,207 | 0 |
#!/usr/bin/env python
"""
@package ion.agents.platform.util.node_configuration
@file ion/agents/platform/util/node_configuration.py
@author Mike Harrington
@brief read node configuration files
"""
__author__ = 'Mike Harrington'
__license__ = 'Apache 2.0'
from ooi.logging import log
from mi.platform.exceptions ... | mikeh77/mi-instrument | mi/platform/util/node_configuration.py | Python | bsd-2-clause | 2,911 | 0.012367 |
from webplot import p
p.use_doc('webplot example')
import numpy as np
import datetime
import time
x = np.arange(100) / 6.0
y = np.sin(x)
z = np.cos(x)
data_source = p.make_source(idx=range(100), x=x, y=y, z=z)
p.plot(x, y, 'orange')
p.figure()
p.plot('x', 'y', color='blue', data_source=data_source, title='sincos')
p.pl... | zrhans/python | exemplos/wakari/scripts-examples-webplot_example.py | Python | gpl-2.0 | 885 | 0.00339 |
# -*- coding: utf-8 -*-
"""
pygments.lexers._openedge_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = (
'ABSOLUTE',
'ABS',
... | GarySparrow/mFlaskWeb | venv/Lib/site-packages/pygments/lexers/_openedge_builtins.py | Python | mit | 48,362 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
import zipfile
import config
import store
import common
from db import db_session, Source
import crypto_util
# Set environment variable so config.py uses a test environment
os.environ['SECUREDROP_ENV'] = 'test'
class TestStore(unittest.TestCase)... | mark-in/securedrop-app-code | tests/test_unit_store.py | Python | agpl-3.0 | 1,563 | 0.00064 |
# http://lodev.org/cgtutor/filtering.html
import cv2
import numpy as np
#img = cv2.imread('../images/input_sharp_edges.jpg', cv2.IMREAD_GRAYSCALE)
img = cv2.imread('../images/input_tree.jpg')
rows, cols = img.shape[:2]
#cv2.imshow('Original', img)
###################
# Motion Blur
size = 15
kernel_motion_blur = np.z... | PacktPublishing/OpenCV-Computer-Vision-Projects-with-Python | Module 2/1/image_filters.py | Python | mit | 2,407 | 0.02742 |
# -*- encoding: utf-8 -*-
from openerp.osv import osv, fields
from idvalidator import is_ncf
from openerp.osv.osv import except_osv
from openerp import netsvc
from datetime import datetime
from openerp.tools.translate import _
import time
class account_invoice(osv.Model):
_inherit = "account.invoice"
_name =... | eneldoserrata/marcos_openerp | marcos_addons/marcos_ncf/account_invoice.py | Python | agpl-3.0 | 10,032 | 0.004288 |
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Tong-Chen/genomics-tools | mapreduce-python/mapreduce/model.py | Python | apache-2.0 | 39,526 | 0.006274 |
"""
This little helper takes Lebedev point and weight data from [1] and produces JSON files.
[1]
https://people.sc.fsu.edu/~jburkardt/datasets/sphere_lebedev_rule/sphere_lebedev_rule.html
"""
import os
import re
import numpy as np
def read(filename):
data = np.loadtxt(filename)
azimuthal_polar = data[:, :2]... | nschloe/quadpy | tools/lebedev/import_lebedev.py | Python | mit | 4,694 | 0.000639 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('applications', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='question',
name=... | patjouk/djangogirls | applications/migrations/0002_auto_20150308_2229.py | Python | bsd-3-clause | 1,002 | 0.002994 |
#!/usr/bin/env python
# encoding: utf-8
"""
generate_keys.py
Generate CSRF and Session keys, output to secret_keys.py file
Usage:
generate_keys.py [-f]
Outputs secret_keys.py file in current folder
By default, an existing secret_keys file will not be replaced.
Use the '-f' flag to force the new keys to be writt... | rhololkeolke/apo-website | src/application/generate_keys.py | Python | bsd-3-clause | 2,126 | 0.003293 |
'''
Definitions of the configuration for correctness testing.
'''
import brian2
import os
import shutil
import sys
import brian2genn
from brian2.tests.features import (Configuration, DefaultConfiguration,
run_feature_tests, run_single_feature_test)
__all__ = ['GeNNConfiguration',
... | brian-team/brian2genn | brian2genn/correctness_testing.py | Python | gpl-2.0 | 1,039 | 0.005775 |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Björn Larsson
#
# 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 r... | fuzzycode/RoboPi | main.py | Python | mit | 2,261 | 0.002655 |
# -*- coding:UTF-8 -*-
#用于产生吞吐量、可用带宽、抖动、丢包率
import csv
f = open('iperf_13.csv')
c = f.readlines()
csvfile1 = open('iperf_133.csv', 'ab')
writer1 = csv.writer(csvfile1)
for i in c:
# try:
t = i.split()
# print t
# print len(t)
ll = []
if len(t)==14:
a= t[5]
# ... | lefteye/superroutingchioce | create_loss_width_thoughtout.py | Python | gpl-2.0 | 1,854 | 0.006608 |
# $Id$
#
# Copyright (C) 2003-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code ... | bp-kelley/rdkit | rdkit/ML/UnitTestBuildComposite.py | Python | bsd-3-clause | 7,293 | 0.000137 |
'''
Created on 13 Jul 2017
@author: T
https://www.youtube.com/watch?v=6isuF_bBiXs
Tkinter:
+ standard lib
+ lightweight
+ good enough
- limited widgets
- strange import
- ugly
Python 3x
- ttk module (theme for better)
* run in transparent loop
* widgets are with parents
Geometry:
: absolute (avoid this)... | kirkwor/py | buildingGui_2.py | Python | mit | 1,732 | 0.008083 |
"Interactions with the Juju environment"
# Copyright 2013 Canonical Ltd.
#
# Authors:
# Charm Helpers Developers <juju@lists.ubuntu.com>
import os
import json
import yaml
import subprocess
import sys
import UserDict
from subprocess import CalledProcessError
CRITICAL = "CRITICAL"
ERROR = "ERROR"
WARNING = "WARNING"
I... | chuckbutler/shoutcast-charm | lib/charmhelpers/core/hookenv.py | Python | mit | 14,883 | 0 |
"""
To start UNO for both Calc and Writer:
(Note that if you use the current_document command, it will open the Calc's current document since it's the first switch passed)
libreoffice "--accept=socket,host=localhost,port=18100;urp;StarOffice.ServiceManager" --norestore --nofirststartwizard --nologo --calc --writer
To ... | Risto-Stevcev/iac-protocol | iac/app/libreoffice/calc.py | Python | bsd-3-clause | 3,484 | 0.003731 |
"""
Records for SMART Reference EMR
Ben Adida & Josh Mandel
"""
from base import *
from django.utils import simplejson
from django.conf import settings
from smart.common.rdf_tools.rdf_ontology import ontology
from smart.common.rdf_tools.util import rdf, foaf, vcard, sp, serialize_rdf, parse_rdf, bound_graph, URIRef, ... | smart-classic/smart_server | smart/models/records.py | Python | apache-2.0 | 5,560 | 0.001079 |
#
# Copyright (c) 2013 Markus Eliasson, http://www.quarterapp.com/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version... | ricjon/quarterapp | quarterapp/settings.py | Python | gpl-3.0 | 3,199 | 0.004689 |
from __future__ import print_function
import sys
def main():
for line in sys.stdin:
line = line.strip()
if not line.startswith("#STRUCT_SIZER"):
continue
line = line[14:]
line = line.replace("#", "")
print(line)
if __name__ == "__main__":
main()
| JLLeitschuh/allwpilib | wpilibj/src/athena/cpp/nivision/get_struct_size.py | Python | bsd-3-clause | 308 | 0.006494 |
# Copyright 2018 DeepMind Technologies Limited. 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 ... | deepmind/acme | acme/tf/networks/distributions_test.py | Python | apache-2.0 | 2,618 | 0.00382 |
# Copyright (c) 2015 Dell 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 a... | Akrog/cinder | cinder/tests/test_dellscapi.py | Python | apache-2.0 | 155,946 | 0 |
# -*- coding: utf-8 -*-
# python std lib
import asyncio
import os
import sys
import json
# rediscluster imports
from aredis import StrictRedisCluster, StrictRedis
# 3rd party imports
import pytest
from distutils.version import StrictVersion
# put our path in front so we can be sure we are testing locally not agains... | NoneGG/aredis | tests/cluster/conftest.py | Python | mit | 3,388 | 0.000885 |
'''
Written by Dmitry Chirikov <dmitry@chirikov.ru>
This file is part of Luna, cluster provisioning tool
https://github.com/dchirikov/luna
This file is part of Luna.
Luna 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 Foun... | dchirikov/luna | luna/utils/ip.py | Python | gpl-3.0 | 5,972 | 0.002009 |
# -*- coding: utf-8 -*-
# Copyright 2017, 2021 ProjectQ-Framework (www.projectq.ch)
#
# 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.... | ProjectQ-Framework/ProjectQ | projectq/ops/_command_test.py | Python | apache-2.0 | 12,405 | 0.000564 |
import numpy
import bob.bio.spear
# The authors of CQCC features recommend to use only first 20 features, plus deltas and delta-deltas
# feature vector is 60 in this case
cqcc20 = bob.bio.spear.extractor.CQCCFeatures(
features_mask=numpy.r_[
numpy.arange(0, 20), numpy.arange(30, 50), numpy.arange(60, 80)
... | bioidiap/bob.bio.spear | bob/bio/spear/config/extractor/cqcc20.py | Python | gpl-3.0 | 328 | 0.003049 |
from SimpleCV import Camera, Image, Color, TemporalColorTracker, ROI, Display
import matplotlib.pyplot as plt
cam = Camera(1)
tct = TemporalColorTracker()
img = cam.getImage()
roi = ROI(img.width*0.45,img.height*0.45,img.width*0.1,img.height*0.1,img)
tct.train(cam,roi=roi,maxFrames=250,pkWndw=20)
# Matplot Lib exampl... | beni55/SimpleCV | SimpleCV/MachineLearning/TestTemporalColorTracker.py | Python | bsd-3-clause | 1,136 | 0.033451 |
#! /usr/bin/env python
import argparse
import sys
from yamltempl import yamlutils, vtl
def main():
parser = argparse.ArgumentParser(
description="Merge yaml data into a Velocity Template Language template")
parser.add_argument('yamlfile',
metavar='filename.yaml',
... | butwhywhy/yamltempl | yamltempl/yaml_templates_command.py | Python | mit | 1,406 | 0.000711 |
import random
import time
from flask import (
request,
session,
flash,
redirect,
url_for,
Response,
render_template,
)
from NossiPack.Cards import Cards
from NossiPack.User import Userlist
from NossiPack.VampireCharacter import VampireCharacter
from NossiPack.krypta import DescriptiveError... | x4dr/NossiNet | NossiSite/extra.py | Python | gpl-2.0 | 9,041 | 0.001106 |
# Copyright (c) 2015, National Documentation Centre (EKT, www.ekt.gr)
# 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
# n... | EKT/pyrundeck | tests/unit_tests/test_native_conversion.py | Python | bsd-3-clause | 34,251 | 0 |
import unittest
from django.utils import inspect
class Person:
def no_arguments(self):
return None
def one_argument(self, something):
return something
def just_args(self, *args):
return args
def all_kinds(self, name, address='home', age=25, *args, **kwargs):
return ... | georgemarshall/django | tests/utils_tests/test_inspect.py | Python | bsd-3-clause | 1,501 | 0.002665 |
from __future__ import (absolute_import, print_function, division)
class NotImplementedException(Exception):
pass
| zbuc/imaghost | ghost_exceptions/__init__.py | Python | bsd-2-clause | 120 | 0 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | owlabs/incubator-airflow | tests/test_utils/db.py | Python | apache-2.0 | 2,430 | 0.000823 |
import threading
# lock for each project or domain
# treat it as a singleton
# all file operation should be in lock region
class Locker(object):
_lock = {}
def acquire(self, name):
# create lock if it is not there
if name not in self._lock:
self._lock[name] = threading.Lock()
... | svebk/DeepSentiBank_memex | cu_image_search/www/manager/locker.py | Python | bsd-2-clause | 868 | 0.004608 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | tiborsimko/invenio-ext | invenio_ext/fixtures/registry.py | Python | gpl-2.0 | 1,417 | 0.000706 |
###
# Copyright (c) 2008, James McCoy
# 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 conditions, ... | Ban3/Limnoria | src/utils/crypt.py | Python | bsd-3-clause | 1,697 | 0 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2015 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... | eayunstack/fuel-ostf | fuel_health/tests/smoke/test_vcenter.py | Python | apache-2.0 | 20,161 | 0.000198 |
"""
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | vortex-ape/scikit-learn | sklearn/preprocessing/__init__.py | Python | bsd-3-clause | 1,775 | 0 |
from abc import ABCMeta, abstractmethod, abstractproperty
from contextlib import contextmanager
from functools import wraps
import gzip
from inspect import getargspec
from itertools import (
combinations,
count,
product,
)
import operator
import os
from os.path import abspath, dirname, join, realpath
import... | enigmampc/catalyst | catalyst/testing/core.py | Python | apache-2.0 | 47,204 | 0.000021 |
"""
Python wrapper for functionality exposed in the TemcaGraph dll.
@author: jayb
"""
from ctypes import *
import logging
import threading
import time
import os
import sys
import numpy as np
from pytemca.image.imageproc import fit_sin
from numpy.ctypeslib import ndpointer
if sys.flags.debug:
rel = "../x64/Debug... | jaybo/OpenCVGraph | TemcaGraphPy/temca_graph.py | Python | apache-2.0 | 21,780 | 0.007714 |
#!/usr/bin/env python
import paramiko
from datetime import datetime
#hostname='192.168.0.102'
hostname='172.28.102.250'
username='root'
password='abc'
#port=22
if __name__=='__main__':
paramiko.util.log_to_file('paramiko.log')
s=paramiko.SSHClient()
#s.load_system_host_keys()
... | kinddevil/aatest | python/mik.py | Python | mit | 831 | 0.049338 |
# Find Objects Partially Inside Region of Interest or Cut Objects to Region of Interest
import cv2
import numpy as np
from . import print_image
from . import plot_image
from . import fatal_error
def roi_objects(img, roi_type, roi_contour, roi_hierarchy, object_contour, obj_hierarchy, device, debug=None):
"""Find... | AntonSax/plantcv | plantcv/roi_objects.py | Python | mit | 4,848 | 0.004332 |
"""Provides compatibility with first-generation host delegation options in ansible-test."""
from __future__ import annotations
import argparse
import dataclasses
import enum
import os
import types
import typing as t
from ..constants import (
CONTROLLER_PYTHON_VERSIONS,
SUPPORTED_PYTHON_VERSIONS,
)
from ..uti... | abadger/ansible | test/lib/ansible_test/_internal/cli/compat.py | Python | gpl-3.0 | 22,147 | 0.004425 |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from .build_response import BuildResponse # noqa
from .pod_response import PodResponse # noqa
| bfontecc007/osbs-client | osbs/build/__init__.py | Python | bsd-3-clause | 314 | 0 |
#!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The SpeedCoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
im... | SureshMatsui/SpeedCoin | contrib/linearize/linearize.py | Python | mit | 3,357 | 0.034257 |
# this program requires the 32 bit version of Python!!
import os
import glob
import math
import subprocess
import re
import sys
import string
from decimal import Decimal
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
from scipy.ndimage i... | mcnowinski/various-and-sundry | lightcurve/windows/firstlook.py | Python | mit | 10,661 | 0.001782 |
from worldengine.simulations.basic import find_threshold_f
import numpy
class HumiditySimulation(object):
@staticmethod
def is_applicable(world):
return world.has_precipitations() and world.has_irrigation() and (
not world.has_humidity())
def execute(self, world, seed):
assert... | MM1nd/worldengine | worldengine/simulations/humidity.py | Python | mit | 1,502 | 0.000666 |
from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
from Components.Button import Button
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.FileList import FileList
from Components.Task import Task, Job, job_manager, ... | vitmod/dvbapp | lib/python/Plugins/SystemPlugins/SoftwareManager/Flash_online.py | Python | gpl-2.0 | 18,755 | 0.028686 |
#!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software... | privateip/ansible-modules-core | database/mysql/mysql_user.py | Python | gpl-3.0 | 22,945 | 0.005709 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | XueqingLin/tensorflow | tensorflow/python/training/sync_replicas_optimizer.py | Python | apache-2.0 | 40,433 | 0.003067 |
#!/usr/bin/env python
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
###############################... | arrayfire/arrayfire-python | setup.py | Python | bsd-3-clause | 4,514 | 0.005981 |
"""
A *lock* defines access to a particular subsystem or property of
Evennia. For example, the "owner" property can be impmemented as a
lock. Or the disability to lift an object or to ban users.
A lock consists of three parts:
- access_type - this defines what kind of access this lock regulates. This
just a stri... | MarsZone/DreamLand | evennia/evennia/locks/lockhandler.py | Python | bsd-3-clause | 20,024 | 0.002497 |
#
# 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... | NoyaInRain/tornado | tornado/web.py | Python | apache-2.0 | 138,158 | 0.000637 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | adviti/melange | thirdparty/google_appengine/google/appengine/api/prospective_search/prospective_search_pb.py | Python | apache-2.0 | 60,260 | 0.020179 |
"""
GraphLab Create offers several data structures for data analysis.
Concise descriptions of the data structures and their methods are contained in
the API documentation, along with a small number of simple examples. For more
detailed descriptions and examples, please see the `User Guide
<https://dato.com/learn/userg... | haijieg/SFrame | oss_src/unity/python/sframe/data_structures/__init__.py | Python | bsd-3-clause | 841 | 0.005945 |
from ctypes import Structure, POINTER, c_void_p, cast, create_string_buffer, \
c_char_p, byref, memmove
from ctypes import windll, WinDLL, WINFUNCTYPE
try:
from ctypes import wintypes
except ValueError:
# see http://bugs.python.org/issue16396
raise ImportError("wintypes")
from keyring.util.escape impo... | b-jesch/service.fritzbox.callmonitor | resources/lib/PhoneBooks/pyicloud/vendorlibs/keyrings/alt/_win_crypto.py | Python | gpl-2.0 | 3,477 | 0.000575 |
#!/usr/bin/env python
''' W celu poprawniego dzialania ponizszego skryptu, trzeba skonigurowac
logowanie RSA / DSA na maszynie na ktora, bedziemy przenosic nasza kopie zapasowa. Sposob konfiguracji mozna znalezc tutaj
http://www.nerdokracja.pl/linux-logowanie-ssh-klucze-rsa/
'''
import os
import os.path
print ('Tw... | laszewsm/backuper | backup.py | Python | gpl-2.0 | 1,456 | 0.013049 |
"""
Django settings for sw_tts project.
Generated by 'django-admin startproject' using Django 1.9.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# ... | g10k/sw_tts | sw_tts/settings.py | Python | mit | 5,058 | 0.000989 |
__all__ = ['persistence', 'baltimorejsondecoder', 'baltimorejsonencoder']
| mfrey/baltimore | persistence/__init__.py | Python | gpl-3.0 | 74 | 0 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **Template Composition Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... | cchristelis/inasafe | safe/report/test/test_template_composition.py | Python | gpl-3.0 | 4,573 | 0.000219 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import re
import xmlrpc.client
from flexget import plugin
from flexget.event import event
from flexget.utils.template import RenderError
from flexget.plugin impo... | qvazzler/Flexget | flexget/plugins/plugin_aria2.py | Python | mit | 22,207 | 0.003017 |
import gel.gelcd
import gel.gelfista
import gel.gelpaths
import gel.ridgepaths
__version__ = "2.0.0"
__all__ = ["gelcd", "gelfista", "gelpaths", "ridgepaths"]
| jayanthkoushik/torch-gel | gel/__init__.py | Python | mit | 160 | 0 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# blog.py - maps requests to methods and handles them accordingly.
# Copyright (C) 2017 Jose Ricardo Ziviani
#
# 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 Softwa... | jrziviani/ziviani.net | build.py | Python | gpl-3.0 | 1,772 | 0.004515 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='StaticPage',
fields=[
('id', models.AutoField(s... | null-none/OpenGain | default_set/staticpages/migrations/0001_initial.py | Python | gpl-2.0 | 1,523 | 0.005909 |
from django.core.serializers.json import Serializer
from ..builtins import StringIO
class CustomizableLocalFieldsSerializer(Serializer):
"""
This is a not so elegant copy/paste from django.core.serializer.base.Serializer serialize method.
We wanted to add parent fields of current serialized object becaus... | iwoca/django-deep-collector | deep_collector/compat/serializers/django_1_9.py | Python | bsd-3-clause | 2,672 | 0.004117 |
# Copyright 2015 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... | hfp/tensorflow-xsmm | tensorflow/python/keras/backend.py | Python | apache-2.0 | 160,654 | 0.006648 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Li... | DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/ir_nec/lists.py | Python | gpl-3.0 | 1,471 | 0.008158 |
class Capture(object):
"""
Generic Capture entity. Base class
that both Screenshot and Pdiff can inherit from.
"""
def __init__(self, img_path):
if img_path is not None:
try:
self.path = img_path
self.hashvalue = self._set_hash()
except... | nicovillanueva/obsidian-core | src/screenshots/Capture.py | Python | gpl-2.0 | 836 | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | mrkm4ntr/incubator-airflow | tests/dags/test_on_kill.py | Python | apache-2.0 | 1,647 | 0 |
# -*- coding: utf-8 -*-
import sys
import os
from datetime import date
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.... | california-civic-data-coalition/django-calaccess-processed-data | docs/conf.py | Python | mit | 8,077 | 0.007305 |
"""
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
OpenCV Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) a... | atzengin/OCC | occ/gui/Block.py | Python | gpl-3.0 | 8,149 | 0.006381 |
import logging
import pathlib
import pytest
from datetime import date, time
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from chronophore.models import Base, Entry, User
logging.disable(logging.CRITICAL)
@pytest.fixture()
def nonexistent_file(tmpdir, request):
"""Return a path t... | mesbahamin/chronophore | tests/conftest.py | Python | mit | 4,885 | 0 |
from __future__ import division
from math import *
import numpy as np
import scipy
import matplotlib
# USER INPUT
def UserValues(VariablesToModify):
# Blade Geometry Definition
_DefinedValues_dict = dict()
_DefinedValues_dict["Blade_gamma"]=45 # Blade stagger angle
_DefinedValues_dict["Blade_B1"]=15 # angle of at... | bbiped-platform/BBIPED | src/BBIPED-GUI/src/Automatization/templates/BackwardBlade3D_template/BackwardBlade3D_template_Calculations.py | Python | lgpl-3.0 | 12,276 | 0.039915 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.extensions import PageExtensionAdmin, TitleExtensionAdmin
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .forms import TitleMetaAdmi... | Formlabs/djangocms-page-meta | djangocms_page_meta/admin.py | Python | bsd-3-clause | 1,842 | 0.001086 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
"""Make osversion.osmajor_id non-NULLable
Revision ID: 5ab66e956c6b
Re... | beaker-project/beaker | Server/bkr/server/alembic/versions/5ab66e956c6b_osversion_osmajor_id_non_nullable.py | Python | gpl-2.0 | 743 | 0.008075 |
import logging
from django.db import connection
from django.contrib.auth.models import User
from tenant_schemas.utils import get_tenant_model
from tenant_schemas.test.cases import TenantTestCase
import pytest
logger = logging.getLogger('tests.util')
def make_tenant(schema='test', domain='tenant.test.com', userna... | Applied-GeoSolutions/geokit | geokit/tests/util.py | Python | gpl-2.0 | 1,699 | 0.000589 |
#!/usr/bin/python
import urllib, urllib2, json, sys
import splunk.entity as entity
# access the credentials in /servicesNS/nobody/app_name/admin/passwords
def getCredentials(sessionKey):
myapp = 'tado'
try:
# list all credentials
entities = entity.getEntities(['admin', 'passwords'], namespace=myapp... | nickhills81/tado_heating_for_splunk | bin/zone0.py | Python | mit | 2,916 | 0.03155 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
from curl2share.config import log_file, log_level
loglevel = {'CRITICAL': logging.CRITICAL,
'ERROR': logging.ERROR,
'WARNING': logging.WARN,
'INFO': logging.INFO,
'DEBUG... | cuongnv23/curl2share | curl2share/__init__.py | Python | mit | 691 | 0 |
####
#### Setup gross testing environment.
####
#import time
from behave_core.environment import start_browser, define_target, quit_browser
from behave import *
## Run this before anything else.
def before_all(context):
#pass
start_browser(context)
define_target(context)
#time.sleep(10)
## Do thi... | berkeleybop/behave_core | tests/environment.py | Python | bsd-3-clause | 411 | 0.024331 |
# 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/.
from __future__ import unicode_literals
from datetime import datetime
import urllib
import jingo
from lib.l10n_utils.do... | ckprice/bedrock | bedrock/mozorg/helpers/social_widgets.py | Python | mpl-2.0 | 3,148 | 0.001271 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... | TheProjecter/kassie | src/bases/importeur.py | Python | bsd-3-clause | 10,203 | 0.00337 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
def sig... | bwasti/caffe2 | caffe2/python/operator_test/cross_entropy_ops_test.py | Python | apache-2.0 | 3,643 | 0.000274 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import re
from rest_framework.serializers import ValidationError
def name(value):
'''Matches names of people, countries and and other thing... | jmosky12/huxley | huxley/api/validators.py | Python | bsd-3-clause | 1,610 | 0.001882 |
#!/usr/bin/env python
#
# 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 a... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tornado/escape.py | Python | bsd-2-clause | 14,393 | 0.000208 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Unit tests for comprehend_demo_resources.py
"""
from io import BytesIO
import json
import tarfile
import time
from unittest.mock import MagicMock
import uuid
import boto3
from botocore.exceptions import Clie... | awsdocs/aws-doc-sdk-examples | python/example_code/comprehend/test/test_comprehend_demo_resources.py | Python | apache-2.0 | 4,823 | 0.000622 |
#!/usr/bin/python
y = '''75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
53 71 44 65 25 43 91 52 97 51 14
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 67 ... | generica/euler | 18.py | Python | gpl-2.0 | 782 | 0.001279 |
# Copyright 2019, Google LLC 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... | tseaver/google-cloud-python | pubsub/google/cloud/pubsub_v1/_gapic.py | Python | apache-2.0 | 2,637 | 0.000758 |
# -*- coding: utf-8 -*-
import os
import sys
from django.contrib.auth.decorators import login_required
from django import get_version as get_django_version
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.conf import settings
from django_info import __version__
de... | marcelor/django_info | django_info/views.py | Python | mit | 1,879 | 0.001064 |
# encoding=utf8
import utils
import pickle
import zipfile
import os
from tqdm import tqdm
from pprint import pprint
# Globals
#[Special, Heavy, Primary]
bucketHashes = [2465295065,953998645,1498876634]
# Load in Manifest
print 'Loading Manifest...'
with open('manifest.pickle','rb') as f:
data = pickle.loads(f.rea... | linkian209/Destiny_RNN | create.py | Python | mit | 3,091 | 0.019088 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.