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
import numpy as np from scipy.stats import mode class SimpleMMMRegressor(object): def __init__(self, rtype='mean'): self.rtype = rtype self.mean = None self.median = None self.mode = None def fit(self, X, y): self.mean = np.mean(y) self.median = np...
zakkum42/Bosch
src/include/SimpleMMMRegressor.py
Python
apache-2.0
1,037
#!/usr/bin/env python # Copyright 2014 Cloudera 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 ag...
brightchen/Impala
shell/impala_shell_config_defaults.py
Python
apache-2.0
1,541
""" views.admin is a basic home page for your admin area """ from mocha import (Mocha, utils, render, decorators as deco, ) import mocha.contrib __options__ = utils.dict_dot({}) @mocha.contrib.admin class Admin(Mocha): @classmethod ...
mardix/Mocha
mocha/contrib/views/admin.py
Python
mit
697
""" @name to_and_from_panda_DataFrame.py @file to_and_from_panda_DataFrame.py @author Ernest Yeung @email ernestyalumni@gmail.com @brief Using Pandas (Panda dataframe) for NIST Physical Constants, i.e. NIST National Institute of Standards and Technology @ref @details @copyright If you find this code useful, feel free ...
ernestyalumni/Propulsion
Physique/Source/to_panda_DataFrame.py
Python
gpl-2.0
5,251
# see LICENSE SEVENBIT_SIZE = 160 EIGHTBIT_SIZE = 140 UCS2_SIZE = 70 SEVENBIT_MP_SIZE = SEVENBIT_SIZE - 7 EIGHTBIT_MP_SIZE = EIGHTBIT_SIZE - 6 UCS2_MP_SIZE = UCS2_SIZE - 3 # address type UNKNOWN = 0 INTERNATIONAL = 1 NATIONAL = 2 NETWORK_SPECIFIC = 3 SUBSCRIBER = 4 ALPHANUMERIC = 5 ABBREVIATED = 6 RESERVED = 7
awangga/smsweb
messaging/sms/consts.py
Python
agpl-3.0
313
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
maoy/zknova
nova/tests/test_test.py
Python
apache-2.0
1,740
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib import Utils,Options,Errors,Logs from waflib.TaskGen import extension,before_method,after_method,feature from waflib.Configure import conf FRAG=''' #...
automatthias/aubio
waflib/Tools/python.py
Python
gpl-3.0
13,263
# Copyright 2018 Onestein # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import io import base64 import json from odoo import http from odoo.http import request from PIL import Image class MainController(http.Controller): @http.route('/website_adv_image_optimization/attachment/optimize', ...
Vauxoo/website
website_adv_image_optimization/controllers/main.py
Python
agpl-3.0
1,876
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class YelpspiderPipeline(object): def process_item(self, item, spider): return item
Billibilli/yelp-scraper
yelpspider/pipelines.py
Python
mit
264
#!/usr/bin/python # -*- coding: utf8 -*- from gwcconfig.support import xml_property, url, write_string, string_list, write_string_list, write_numeric, write_int_list, int_list, write_bool, build_gridSubsets, write_gridSubsets, write_parameterFilters, build_parameterFilters from gwcconfig.ResourceInfo import Resource...
ndufrane/gwcconfig
src/gwcconfig/GeoServerLayer.py
Python
mit
2,105
# -*- coding: utf-8 -*- from openerp import models, fields, api class sale_quotation(models.Model): _name = 'sale.quotation' inc_imagen = fields.Boolean(string="Incluir imagen", default=False) pers_contacto = fields.Char(string="Persona de contacto") tipo_madera = fields.Selection([ ('pino', ...
sandrafig/addons
sale_quotation/models/sale_order.py
Python
agpl-3.0
4,566
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Romeo Theriault <romeot () hawaii.edu> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
az7arul/ansible-modules-core
network/basics/uri.py
Python
gpl-3.0
19,177
from twisted.application.service import ServiceMaker urenderer = ServiceMaker( "UpnpRenderer", "pyrenderer.tap", "An Upnp renderer", "UpnpRenderer")
bverdu/onDemand
twisted/plugins/upnp_renderer.py
Python
agpl-3.0
166
#!/usr/bin/env python # Copyright (c) 2015 IBM. 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 b...
cloudant/python-cloudant
tests/__init__.py
Python
apache-2.0
1,113
# Copyright 2018 Espressif Systems (Shanghai) PTE 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 ...
armada-ai/esp-idf
tools/esp_prov/security/__init__.py
Python
apache-2.0
653
import os from unittest import SkipTest import param import holoviews from pyviz_comms import nb_mime_js from IPython import version_info from param import ipython as param_ext from IPython.display import HTML, publish_display_data from ..core.dimension import LabelledData from ..core.tree import AttrTree from ..core...
basnijholt/holoviews
holoviews/ipython/__init__.py
Python
bsd-3-clause
11,221
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2018-12-27 08:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('invoices', '0019_auto_20181227_0846'), ] operations = [ migrations.AddField(...
samupl/simpleERP
apps/invoices/migrations/0020_auto_20181227_0847.py
Python
mit
1,016
"""The tests for the mqtt climate component.""" import copy import json from unittest.mock import call, patch import pytest import voluptuous as vol from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP from homeassistant.components.climate.const import ( DOMAIN as CLIMATE_DOMAIN, HV...
lukas-hetzenecker/home-assistant
tests/components/mqtt/test_climate.py
Python
apache-2.0
43,626
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {...
albertomurillo/ansible
lib/ansible/modules/database/postgresql/postgresql_ping.py
Python
gpl-3.0
4,598
#!/usr/bin/env python # -*- coding: utf8 -*- import sys, os, random, time, math import pygame from pygame.locals import * import py2048_VG as VG pygame.init() class threat(pygame.sprite.Sprite): def __init__(self, image=0, x=0, y=0, score=0): pygame.sprite.Sprite.__init__(self) self.x = x ...
Prannoy-Noel/2048_simulation
py2048_threat.py
Python
gpl-3.0
2,880
from utils.edit_configs import get_json class Logger: config = get_json('server_configs') log_config = {} _instances = {} @staticmethod def get_singleton(client): if client.shard_id not in Logger._instances: Logger._instances[client.shard_id] = Logger() return Logger....
initzx/aobot
utils/logger.py
Python
gpl-3.0
3,201
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Src: https://gym.openai.com/docs/#environments import gym env = gym.make('CartPole-v0') for i_episode in range(3): observation = env.reset() for t in range(100): env.render() print(observation) action = env.action_space.sample() ...
jeremiedecock/snippets
python/gym/random-actions_cartpole-v0.py
Python
mit
520
""" # nfl/gf.py # interactive search of player_game_finder """ from cmd import Cmd import logging from pathlib import Path from pprint import pprint try: import readline except ImportError: readline = None from fcache.cache import FileCache import pandas as pd from .pfr import Scraper, Parser from .seaso...
sansbacon/nfl
nfl/gf.py
Python
mit
11,339
#!/usr/bin/env python """ EucFACE CO2 simulations Spin-up assuming forest params, to check matches with EucFACE data. -> Spinup with forest params, fixed NDEP, fixed CO2 """ import os import shutil import sys import subprocess USER = os.getlogin() sys.path.append('/Users/%s/Documents/Research/Projects/eucface/Git/...
mingkaijiang/eucface_cnp
simulations/old/eucface_spinup_to_equilibrium_ellsworth_N.py
Python
gpl-3.0
17,526
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ import datetime import decimal import os import platform from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends.base.base import BaseD...
alimony/django
django/db/backends/oracle/base.py
Python
bsd-3-clause
23,451
# 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 __...
mozilla/ChangeDetector
pyLibrary/queries/es14/util.py
Python
mpl-2.0
2,190
mealCost = float(input()) tipPercent = int(input()) taxPercent = int(input()) totalMealCost = mealCost + (tipPercent+taxPercent )/100*mealCost #print("The total meal cost is %f" % totalMealCost) print("The total meal cost is %d dollars." % round(totalMealCost))
vasadhananjay/HackerRank_30-Day-of-Code
Day2.py
Python
mit
263
import math from nltk import probability def bag_of_words(words): return dict([(word, True) for word in words]) def bag_of_words_in_set(words, wordset): return bag_of_words(set(words) & wordset) def word_counts(words): return dict(probability.FreqDist((w for w in words))) def word_counts_in_set(words, wordset): ...
gicsi/aap
src/machine_learning/nltk-trainer-master/nltk_trainer/classification/featx.py
Python
gpl-3.0
712
class DeadlockInGenerationError(Exception): pass class NotPossibleToGenerateSosError(Exception): pass class TooManyMembersOnDayError(Exception): pass class BadDistributionBetweenDepartmentsError(Exception): pass class DepartmentNotAvailableError(Exception): pass
cederstrom/natet-sos-generator
generator/exceptions.py
Python
mit
291
## # Copyright 2012-2014 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
geimer/easybuild-framework
test/framework/modules.py
Python
gpl-2.0
12,759
from OpenGL.raw.WGL.VERSION.WGL_1_0 import * wglUseFontBitmaps = wglUseFontBitmapsW
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/WGL/__init__.py
Python
lgpl-3.0
85
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mosaic', '0004_auto_20150502_1351'), ] operations = [ migrations.RemoveField( model_name='normalizedsourceimage'...
pipermerriam/mozy
mozy/apps/mosaic/migrations/0005_auto_20150502_1437.py
Python
mit
633
"""Hello message tests.""" from pyof.v0x01.symmetric.hello import Hello from tests.unit.test_struct import TestStruct class TestHello(TestStruct): """Hello message tests (also those in :class:`.TestDump`).""" @classmethod def setUpClass(cls): """Configure raw file and its object in parent class (...
kytos/python-openflow
tests/unit/v0x01/test_symmetric/test_hello.py
Python
mit
506
from easy_print import * from working_init import * def main(): """ Working With Threats """ # optionally set max results tc.set_max_results("500") """ Get Threat by ID Method: get_threat_by_id(id) id -> threat id # Use this method to return a single threat result by...
andybarilla/TCPy_V2
working_with_threats.py
Python
apache-2.0
10,904
import os import shutil from xml.etree import ElementTree from twisted.internet import defer from zope.interface import alsoProvides import opennode.knot.tests from opennode.knot.backend.operation import IGetComputeInfo, IStartVM, IShutdownVM, IListVMS, IUpdateVM from opennode.oms.model.form import RawDataApplier fr...
opennode/opennode-knot
opennode/knot/tests/test_salt.py
Python
gpl-3.0
2,974
# This is a simplified version of the PyQuante1 and pyquante2 dft loops to work out # the bugs when implementing pyquante2. import numpy as np def pyq1_rohf(atomtuples=[(2,(0,0,0))],basis = '6-31G**',maxit=10,mult=3): from PyQuante import Ints,settings,Molecule from PyQuante.hartree_fock import get_energy ...
berquist/pyquante2
tests/pyq1_comparison.py
Python
bsd-3-clause
8,542
#!/usr/bin/env python from greenspace.command import process process()
Klaudial/packaginghomework
greenspace/greenspaceentry.py
Python
gpl-3.0
70
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
aimas/TuniErp-8.0
addons/mail/mail_followers.py
Python
agpl-3.0
12,494
# 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 ...
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_settings_operations.py
Python
mit
6,443
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ImportProxy' db.create_table('importer_importproxy', ( ...
zniper/automag
magazine/apps/importer/migrations/0001_initial.py
Python
mit
10,009
# Copyright (c) 2014 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 writing, ...
Mirantis/pumphouse
tests/unit/tasks/test_server.py
Python
apache-2.0
10,639
from __future__ import division, print_function from abc import ABCMeta, abstractmethod import matplotlib as mpl mpl.use('TkAgg') from matplotlib.ticker import MaxNLocator, Formatter, Locator from matplotlib.widgets import Slider, Button import matplotlib.patches as patches import matplotlib.pyplot as plt from matplotl...
vaquerizaslab/tadtool
tadtool/plot.py
Python
mit
28,848
''' Created on Nov 1, 2014 @author: chris ''' from Tkinter import * def printHello(thisWidget): print "Hello" #create the Window root = Tk() #modify root Window root.title("Simple GUI") root.geometry("200x250") app = Frame(root) app.grid() label = Label(app, text = "This is a label!") label.bind('<Button-...
sql-sith/cdc2015
simple_gui.py
Python
gpl-3.0
599
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Spectrum Analyzer # Author: Astro # Description: UHD FFT Waveform Plotter # Generated: Thu Jun 22 21:19:02 2017 ################################################## from PyQt4 import Qt from PyQt4.QtCore import...
astro7x/Cognitive-Radio-Network
spectrum_analyzer.py
Python
gpl-3.0
23,752
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/ai_1_1/LocationsType.py
Python
gpl-3.0
1,280
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division from math import log, exp def getz(r, nr): z = [2*nr[0]/r[1]] for i in xrange(len(nr)-2): z.append(2*nr[i+1]/(r[i+2]-r[i])) z.append(nr[-1]/(r[-1]-r[-2])) return z def least_square(x, y): # y=a+bx ...
ycchuang/snownlp
snownlp/utils/good_turing.py
Python
mit
1,804
from datetime import timedelta, datetime from pyramid.view import view_config from pyramid_spine.utils import utcnow from almanac.models import Event def begin_day(dt): return datetime(dt.year, dt.month, dt.day, 0) @view_config(route_name='home', renderer='index.html') def index(request): today = begin_day(ut...
binarydud/almanac
almanac/views.py
Python
bsd-3-clause
1,315
#!/usr/bin/env python __author__ = "Timothy McFadden" __date__ = "06/03/2015" __copyright__ = "Timothy McFadden, 2015" __license__ = "MIT" """ This is a unit test for storcli-check.py """ import os import sys import logging import unittest THIS_DIR = os.path.abspath(os.path.dirname(__file__)) DATA_DIR = os.path.join(T...
mtik00/storcli-check
tests/test_controller.py
Python
mit
5,536
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np; np.random.seed(0) Z = np.random.poisson(lam=6, size=(64,64)) x = np.mean(Z, axis=0) y = np.mean(Z, axis=1) fig, ax = plt.subplots() ax.imshow(Z) # create new axes on the right and on the top of the current axe...
jdurbin/sandbox
python/plotting/matrix_with_track.py
Python
mit
742
macimport os import subprocess name = "gobuildmaster" current_hash = "" for line in os.popen("md5sum " + name).readlines(): current_hash = line.split(' ')[0] # Move the old version over for line in os.popen('cp ' + name + ' old' + name).readlines(): print line.strip() # Rebuild for line in os.popen('go ...
brotherlogic/gobuildmaster
BuildAndRun.py
Python
apache-2.0
1,102
# -*- coding: utf-8 -*- """ Display Yahoo! Weather forecast. See http://developer.yahoo.com/weather for more information. Visit http://woeid.rosselliot.co.nz for WOEID, Where On Earth IDentifier. Configuration parameters: cache_timeout: refresh interval for this module (default 7200) forecast_days: specifiy n...
vvoland/py3status
py3status/modules/weather_yahoo.py
Python
bsd-3-clause
12,117
'''listctrlparse''' import os def hdrdata(parentitem, selitem, header_data): retlist = [('acq_mode', header_data.acq_mode[0]),\ ('acq_mode', header_data.acq_mode[0]),\ ('checksum', header_data.checksum[0]),\ ('data_format', header_data.data_format[0]),\ ('file_type', header_data.file_type[0]),\ ...
badbytes/pymeg
gui/wx/listparse.py
Python
gpl-3.0
1,121
""" Maximum likelihood covariance estimator. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD Style. # avoid division truncation from __future__ import division import numpy as...
ominux/scikit-learn
sklearn/covariance/empirical_covariance_.py
Python
bsd-3-clause
6,823
#! /usr/bin/env python from __future__ import print_function from openturns import * TESTPREAMBLE() try: matrix1 = CorrelationMatrix(2) matrix1.setName("matrix1") print("matrix1 = ", repr(matrix1)) p = NumericalPoint((1., 3.)) print("matrix1*", p, "=", matrix1 * p) s = 3. print("matrix1...
aurelieladier/openturns
python/test/t_CorrelationMatrix_std.py
Python
lgpl-3.0
704
# -*- coding: utf-8 -*- """Dump username, per-student anonymous id, and per-course anonymous id triples as CSV. Give instructors easy access to the mapping from anonymized IDs to user IDs with a simple Django management command to generate a CSV mapping. To run, use the following: ./manage.py lms anonymized_id_mappin...
nanolearning/edx-platform
common/djangoapps/student/management/commands/anonymized_id_mapping.py
Python
agpl-3.0
2,648
""" find_sources.py Find sources in GALFACTS transient search 03 June 2014 - Trey Wenger - creation 12 June 2014 - Trey Wenger - fixed smoothing convolution normalization bug in beam.py """ vers = "v1.0.1" import sys import os import argparse import numpy as np import beam def main(**opti...
tvwenger/galfacts
find_sources.py
Python
mit
6,373
# Copyright (c) 2014 Hitachi Data Systems, 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 # # U...
rakeshmi/cinder
cinder/tests/unit/test_hds_iscsi.py
Python
apache-2.0
16,454
"""App name""" from django.apps import AppConfig class CertificateEngineConfig(AppConfig): name = "certificate_engine"
repleo/bounca
certificate_engine/apps.py
Python
apache-2.0
126
from __future__ import absolute_import, division, print_function import os import json from glue.external.six.moves import configparser from glue.logger import logger def save_settings(): from glue.config import settings, CFG_DIR settings_cfg = os.path.join(CFG_DIR, 'settings.cfg') config = configpars...
saimn/glue
glue/_settings_helpers.py
Python
bsd-3-clause
1,583
# # This file is a command-module for Dragonfly. # (c) Copyright 2008 by Christo Butcher # Licensed under the LGPL, see <http://www.gnu.org/licenses/> # """ Command-module for direct opening of **user-defined targets** ============================================================================ This module offers ver...
Erotemic/local
depricated/speech/Examples/_bringme.py
Python
gpl-3.0
6,043
"""Test for User Group related Upgrade Scenario's :Requirement: UpgradedSatellite :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: UsersRoles :Assignee: sganar :TestType: Functional :CaseImportance: High :Upstream: No """ import pytest from nailgun import entities from nailgun.config import Ser...
SatelliteQE/robottelo
tests/upgrades/test_usergroup.py
Python
gpl-3.0
3,681
# # 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...
wooga/airflow
airflow/providers/google/marketing_platform/operators/analytics.py
Python
apache-2.0
16,192
import _plotly_utils.basevalidators class XanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="xanchor", parent_name="splom.marker.colorbar", **kwargs ): super(XanchorValidator, self).__init__( plotly_name=plotly_name, par...
plotly/python-api
packages/python/plotly/plotly/validators/splom/marker/colorbar/_xanchor.py
Python
mit
549
# 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 agreed to in writing, software #...
gluke77/rally
tests/unit/plugins/openstack/context/sahara/test_sahara_image.py
Python
apache-2.0
6,485
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, 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 requir...
scalingdata/Impala
tests/data_errors/test_data_errors.py
Python
apache-2.0
3,632
#!/usr/bin/env python3 # -*- 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 Licen...
dmlc/tvm
tests/scripts/ci.py
Python
apache-2.0
10,909
from pycp2k.inputsection import InputSection class _ri_laplace4(InputSection): def __init__(self): InputSection.__init__(self) self.Quadrature_points = None self.Size_integ_group = None self._name = "RI_LAPLACE" self._keywords = {'Size_integ_group': 'SIZE_INTEG_GROUP', 'Qua...
SINGROUP/pycp2k
pycp2k/classes/_ri_laplace4.py
Python
lgpl-3.0
1,028
""" Copyright 2016-2020 Peter Urda 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, softwar...
urda/django-letsencrypt
letsencrypt/models.py
Python
apache-2.0
1,568
""" Copyright 2017 Troy Hirni This file is part of the pyrox project, distributed under the terms of the GNU Affero General Public License. FILE OPENER I'm not sure this will ever be used, but there's no harm in placing it here just in case. Only when running the earliest versions of python would this be necessary. ...
troyhirni/pyro
fs/opener/_file.py
Python
agpl-3.0
534
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the CLI argument helper interface.""" import locale import sys import unittest from plaso.lib import errors from tests.cli import test_lib as cli_test_lib from tests.cli.helpers import test_lib class HelperManagerTest(unittest.TestCase): """Tests the parsers...
dc3-plaso/plaso
tests/cli/helpers/interface.py
Python
apache-2.0
2,527
import unittest from test import test_support import io import os import uuid def importable(name): try: __import__(name) return True except: return False class TestUUID(unittest.TestCase): def test_UUID(self): equal = self.assertEqual ascending = []...
Jeff-Tian/mybnb
Python27/Lib/test/test_uuid.py
Python
apache-2.0
22,660
"""Support for MySensors sensors.""" from homeassistant.components import mysensors from homeassistant.components.sensor import DOMAIN from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT SENSORS = { 'V_TEMP': [None, 'mdi:thermometer'], 'V_HUM': ['%', 'mdi:water-percent'], 'V_DIMMER': ['%', 'mdi:p...
HydrelioxGitHub/home-assistant
homeassistant/components/mysensors/sensor.py
Python
apache-2.0
2,939
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
CLVsol/odoo_addons_l10n_br
l10n_br_clv_insured/__init__.py
Python
agpl-3.0
1,423
""" The open source data science cloud-native super service suricate. """ __author__ = 'tmetsch'
tmetsch/suricate
suricate/__init__.py
Python
mit
98
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013-2014 Camptocamp SA # # This program 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 Softw...
Eficent/purchase-workflow
purchase_rfq_bid_workflow/model/purchase_order.py
Python
agpl-3.0
11,709
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-02 18:32 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('backend', '0005_auto_20170529_1947'), ] operations = [...
PrivacyScore/PrivacyScore
privacyscore/backend/migrations/0006_auto_20170602_1832.py
Python
gpl-3.0
679
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
UManPychron/pychron
pychron/processing/analyses/analysis_group.py
Python
apache-2.0
33,548
# -*- coding: utf-8 -*- """ Gentoo packages =============== This module provides tools for managing Gentoo packages and repositories using the Portage_ package manager. .. _Portage: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 """ import re from fabric.api import hide, run, settings from f...
bitmonk/fabtools
fabtools/portage.py
Python
bsd-2-clause
2,791
import logging from typing import Any, List, Tuple, Optional, Dict from collections import defaultdict from unittest import TestCase from lib.localObjects import SensorAlert, Option, Profile, SensorDataInt from lib.internalSensors import ProfileChangeSensor from lib.globalData import GlobalData # noinspection PyProtect...
sqall01/alertR
server/tests/internalSensors/test_profileChange.py
Python
agpl-3.0
7,192
""" Definition of urls for DiabloDjango. """ #from datetime import datetime #from django.conf.urls import patterns from django.conf.urls import url #import DiabloDjango.AppCode.views import DiabloDjango.AppCode.Views.View_Career import DiabloDjango.AppCode.Views.View_Home import DiabloDjango.AppCode.Views.View_Hero im...
Vegan6/DiabloDjango
DiabloDjango/DiabloDjango/AppCode/urls.py
Python
gpl-2.0
1,907
from flask import Flask, g from flask_login import LoginManager from flask_babel import Babel from flask_sqlalchemy import SQLAlchemy from flask.json import JSONEncoder from flask_mail import Mail app = Flask(__name__) app.config.from_object('config') app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.db = SQLAl...
jerome76/web-prototype
flask_shop/__init__.py
Python
gpl-3.0
1,344
from twilio.twiml.voice_response import Dial, Number, VoiceResponse response = VoiceResponse() dial = Dial() dial.number( '+12349013030', status_callback_event='initiated ringing answered completed', status_callback='https://myapp.com/calls/events', status_callback_method='POST' ) response.append(dial)...
TwilioDevEd/api-snippets
twiml/voice/number/number-3/number-3.6.x.py
Python
mit
338
from chaostoolkit.cli import cli if __name__ == "__main__": cli()
chaostoolkit/chaostoolkit
chaostoolkit/__main__.py
Python
apache-2.0
71
from __future__ import absolute_import import sys from concurrent.futures import ThreadPoolExecutor from tornado.gen import convert_yielded from apscheduler.executors.base import BaseExecutor, run_job try: from inspect import iscoroutinefunction from apscheduler.executors.base_py3 import run_coroutine_job e...
srault95/apscheduler
apscheduler/executors/tornado.py
Python
mit
1,712
import re from etl.EtlProcessor import EtlProcessor, EtlProcessorDataPort class FieldFindReplace(EtlProcessor): '''Find and replace values in one or more fields This processor performs a simple text search and replace on the input records fields. Call replace() ro regexp_replace() on process...
nshearer/etl
src/etl/common_processors/FieldFindReplace.py
Python
gpl-2.0
2,008
import pickle from revscoring.datasources import revision_oriented from revscoring.dependencies import solve from revscoring.languages import greek from .util import compare_extraction BAD = [ "αδερφάρα", "αδελφάρα", "αλήτης", "αλητήριος", "αλητήρια", "αλητήριο", "αλητάμπουρας", "άχρηστος", "άχρη...
wiki-ai/revscoring
tests/languages/test_greek.py
Python
mit
5,978
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import io import os import importlib.util import sys import time import stat import shutil import struct import binascii import threading try: import zlib # We may need its compression method crc32 = zlib.crc32 except Import...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/zipfile.py
Python
gpl-2.0
80,379
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostDiskMappingOption(vim, *args, **kwargs): '''The HostDiskMappingOption data object...
xuru/pyvisdk
pyvisdk/do/host_disk_mapping_option.py
Python
mit
1,083
from collections import OrderedDict from PyQt4 import QtGui from PyQt4.QtCore import Qt from Orange.data import Table from Orange.classification.svm import SVMLearner, NuSVMLearner from Orange.widgets import settings, gui from Orange.widgets.utils.owlearnerwidget import OWBaseLearner class OWBaseSVM(OWBaseLearner):...
qPCR4vir/orange3
Orange/widgets/classify/owsvmclassification.py
Python
bsd-2-clause
7,592
from base import * DIR = "QA262" CONF = """ vserver!1!rule!2620!match = directory vserver!1!rule!2620!match!directory = /%(DIR)s vserver!1!rule!2620!handler = redir vserver!1!rule!2620!handler!rewrite!1!show = 1 vserver!1!rule!2620!handler!rewrite!1!regex = ^/(.*)$ vserver!1!rule!2620!handler!rewrite!1!substring = /F...
lmcro/webserver
qa/262-Redir-order-1.py
Python
gpl-2.0
1,110
"""Support for LED numbers.""" from __future__ import annotations from typing import cast from homeassistant import config_entries from homeassistant.components.number import NumberEntity, NumberMode from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant from homeassistant.exceptions i...
mezz64/home-assistant
homeassistant/components/flux_led/number.py
Python
apache-2.0
2,621
"""Utilities for the neural network modules """ # Author: Issam H. Laradji <issam.laradji@gmail.com> # License: BSD 3 clause import numpy as np from ..utils.fixes import expit as logistic_sigmoid def identity(X): """Simply return the input array. Parameters ---------- X : {array-like, sparse matri...
imaculate/scikit-learn
sklearn/neural_network/_base.py
Python
bsd-3-clause
6,157
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
mrunge/openstack_horizon
openstack_horizon/test/settings.py
Python
apache-2.0
5,889
""" WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py schemamigration courseware --auto description_of_your_change 3. Add the migration file created...
caesar2164/edx-platform
lms/djangoapps/courseware/models.py
Python
agpl-3.0
14,249
# Copyright 2015 Michael Frank <msfrank@syntaxjockey.com> # # This file is part of cifparser. cifparser is BSD-licensed software; # for copyright information see the LICENSE file. from cifparser.path import Path, make_path, ROOT_PATH class ValueTree(object): """ """ def __init__(self): self._valu...
msfrank/cifparser
cifparser/valuetree.py
Python
bsd-2-clause
11,719
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cbh_chembl_model_extension', '0031_auto_20151203_0856'), ] operations = [ migrations.RemoveField( model_name='cb...
thesgc/chembiohub_ws
cbh_chembl_model_extension/migrations/0032_auto_20160302_1120.py
Python
gpl-3.0
499
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
quinox/weblate
weblate/billing/admin.py
Python
gpl-3.0
1,712
""" ``nanshe`` package, an image processing toolkit. =============================================================================== Overview =============================================================================== The ``nanshe`` package is an image processing package that contains a variety of different techn...
DudLab/nanshe
nanshe/__init__.py
Python
bsd-3-clause
9,198
from numpy import * from matplotlib.pyplot import * import scipy.constants as sc import copy import scipy.integrate as integ # test sun/earth with hw5(1.989e30,5.972e24,149.6e6,0.0167,1000) def hw5(m1, m2, a, e, tmax, tstep=0.001, tplot=0.025, method='leapfrog'): if method != 'leapfrog' and method != 'odeint': ...
smorad/ast119
hw5.py
Python
gpl-2.0
2,857
"""Sphinx OE Theme package.""" import os from setuptools import setup, find_packages from sphinx_oe_theme import __version__ ############################################################################### # Environment and Packages. ############################################################################### # Don...
OnroerendErfgoed/sphinx-oe-theme
setup.py
Python
mit
2,069