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 2020 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...
tensorflow/tfx
tfx/tools/cli/testdata/test_pipeline_local_2.py
Python
apache-2.0
2,230
""" Django settings for firstdjango project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
carolinehardin/pagewise
firstdjango/firstdjango/settings.py
Python
gpl-2.0
2,728
""" ========================================== IsolationForest benchmark ========================================== A test of IsolationForest on classical anomaly detection datasets. """ print(__doc__) from time import time import matplotlib.pyplot as plt import numpy as np from sklearn.datasets import fetch_kddcup...
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/benchmarks/bench_isolation_forest.py
Python
mit
3,144
"""Tests for log_check script.""" try: from mock import patch except ImportError: from unittest.mock import patch import subprocess import log_check as lc from tests import TestCase class TestCheckFile(TestCase): regex = 'test123' file_path = '/tmp/file.log' @patch('sys.stdout') def test_c...
freyes/juju
acceptancetests/tests/test_log_check.py
Python
agpl-3.0
2,372
# 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 argparse import json import os import os.path from socorro.lib.datetimeutil import JsonDTEncoder from socorro.li...
lonnen/socorro
socorro/scripts/fetch_crash_data.py
Python
mpl-2.0
7,578
# -*- coding: utf-8 -*- # # Copyright (c) 2018, Marcelo Jorge Vieira <metal@alucinados.com> # # 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 Software Foundation, either version 3 of the License, or (at yo...
olhoneles/politicos
tests/politicos_api/handlers/test_political_parties.py
Python
agpl-3.0
1,568
# # 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...
airbnb/airflow
tests/providers/telegram/hooks/test_telegram.py
Python
apache-2.0
7,973
############################################################################### # -*- coding: utf-8 -*- # Order: A tool to characterize the local structure of liquid water # by geometric order parameters # # Authors: Pu Du # # Released under the MIT License ####################################################...
ipudu/order
tests/test_order.py
Python
mit
347
from modules.user.model.session import UserSession from google.appengine.ext import webapp from lib.registry import Registry #decorator def logged(f): def _inner(*args, **kwargs): if not UserSession().isLogged(): raise BaseException('You are not authorized') return f(*args, **kwargs) ...
retif/stealthpage
modules/core/model/app.py
Python
gpl-3.0
1,218
# coding: utf-8 # Set default logging handler to avoid "No handler found" warnings. import logging from logging import StreamHandler, Formatter logger = logging.getLogger('sol') _been_initialized = False __all__ = ['logger', 'init_logger'] def init_logger(level=logging.DEBUG): """ Default logger initializer...
progwriter/SOL
src/sol/utils/logger.py
Python
mit
784
from front import front, direct_front from xlog import getLogger xlog = getLogger("gae_proxy") def set_proxy(args): front.set_proxy(args) direct_front.set_proxy(args) def is_workable(): if front.http_dispatcher.is_idle(): return True num = len(front.connect_manager.new_conn_pool.pool) +\ ...
zlsun/XX-Net
code/default/gae_proxy/local/apis.py
Python
bsd-2-clause
657
# 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...
hguemar/cinder
cinder/tests/api/contrib/test_scheduler_hints.py
Python
apache-2.0
3,517
from flask import Flask from flask_sqlalchemy import SQLAlchemy from pynuts import Pynuts CONFIG = {'SQLALCHEMY_DATABASE_URI': 'sqlite:////tmp/test.db', 'PYNUTS_DOCUMENT_REPOSITORY': '/tmp/employees.git'} app = Flask(__name__) app.config.update(CONFIG) app.db = SQLAlchemy(app) nuts = Pynuts(app)
Kozea/Pynuts
docs/example/advanced/application.py
Python
bsd-3-clause
310
def label_amdpar_from(instruction_xml): label_parts = instruction_xml.get('label', '').split('-') # <AMDPAR><EREGS_INSTRUCTIONS><INSTRUCTION>... amdpar = instruction_xml.getparent().getparent() return label_parts, amdpar
tadhg-ohiggins/regulations-parser
regparser/notice/amendments/utils.py
Python
cc0-1.0
237
### Author: Dag Wieers <dag$wieers,com> class dstat_plugin(dstat): """ Number of operations performed on a GPFS filesystem. """ def __init__(self): self.name = 'gpfs file operations' self.nick = ('open', 'clos', 'read', 'writ', 'rdir', 'inod') self.vars = ('_oc_', '_cc_', '_rdc...
dagwieers/dstat
plugins/dstat_gpfs_ops.py
Python
gpl-2.0
1,751
import os import sys #PYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager_kvm/src/python/') PYTHON_DIR = os.path.join(os.path.dirname(__file__), "../..") # This is needed because wsgi disallows using stdout sys.stdout = sys.stderr os.environ['DJANGO_SETTINGS_MODULE'] = 'vt_manager_kvm.settings.settingsLoade...
ict-felix/stack
vt_manager_kvm/src/python/vt_manager_kvm/tests/deleteVM.py
Python
apache-2.0
550
from collections import Sequence from functools import wraps from itertools import repeat class DeltaPenality(object): """This decorator returns penalized fitness for invalid individuals and the original fitness value for valid individuals. The penalized fitness is made of a constant factor *delta* added ...
DailyActie/Surrogate-Model
01-codes/deap-master/deap/tools/constraint.py
Python
mit
7,871
# Copyright (c) 2014 - 2016 townhallpinball.org # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, p...
town-hall-pinball/project-omega
pin/lib/ui/effects/pulse.py
Python
mit
1,687
from vertebra.util import symbol from logging import info class incall(object): def setup(self,frm,request): pass def dispatch(self,request): pass class outcall(object): def setup(self,to,request): pass class invocation(object): pass class invo_local(invocation): pass class invo_net(invocati...
jvantuyl/vertebra-py
lib/vertebra/calls.py
Python
lgpl-3.0
733
""" Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
googleinterns/adversarial-0th-order-optimization
discretezoo/loss/adversarial_hinge_test.py
Python
apache-2.0
6,604
""" Copyright (c) 2011, 2012, Regents of the University of California 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...
tectronics/smap-data
python/smap/drivers/acmex2/acmex2.py
Python
bsd-2-clause
3,726
# matplotlib without any blocking GUI import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np from smst.utils import audio, peaks from smst.models import dft (fs, x) = audio.read_wav('../../../sounds/oboe-A4.wav') N = 512 * 2 M = 511 t = -60 w = np.hamming(M) start = .8 * fs hN = N...
bzamecnik/sms-tools
lectures/06-Harmonic-model/plots-code/spectral-peaks-and-f0.py
Python
agpl-3.0
953
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level from sverchok.utils.curve import SvCurveLengthSolver, SvCurve from sverch...
nortikin/sverchok
nodes/curve/length_parameter.py
Python
gpl-3.0
5,754
''' /******************************************************************************* * * Copyright (c) 2015 Fraunhofer FOKUS, All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Sof...
fraunhoferfokus/fixmycity
dummy/templatetags/value_from_settings.py
Python
lgpl-3.0
2,196
# -*- coding: utf-8 -*- # -------------------------------------------------------------------------------- # Updater (kodi) # -------------------------------------------------------------------------------- import traceback import xbmc import xbmcaddon import threading import subprocess import time from platformcode ...
alfa-jor/addon
plugin.video.alfa/platformcode/custom_code.py
Python
gpl-3.0
18,041
import copy import pickle import msgpack import numpy as np import pytest from tlz import identity from distributed import wait from distributed.protocol import ( register_serialization, serialize, deserialize, nested_deserialize, Serialize, Serialized, to_serialize, serialize_bytes, ...
blaze/distributed
distributed/protocol/tests/test_serialize.py
Python
bsd-3-clause
11,096
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Author: Gillett Hernandez # @Date: 2016-07-14 17:06:40 # @Last Modified by: Gillett Hernandez # @Last Modified time: 2016-09-03 00:19:08 def Collatz(n, seen={}): steps_list = [n] if n in seen: return seen[n] steps=1 i=n while i>1: ...
gillett-hernandez/project-euler
Python/problem_14.py
Python
mit
954
import os import re import datetime import requests.exceptions from openstates.utils import LXMLMixin from pupa.utils import convert_pdf from pupa.scrape import Scraper, VoteEvent as Vote date_re = r".*(?P<date>(MONDAY|TUESDAY|WEDNESDAY|" + \ "THURSDAY|FRIDAY|SATURDAY|SUNDAY),\s\w+\s\d{1,2},\s\d{4}).*" ...
votervoice/openstates
openstates/nd/votes.py
Python
gpl-3.0
12,605
# -*- coding: utf-8 -*- # Copyright 2015 OpenMarket 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 la...
iot-factory/synapse
synapse/rest/client/v2_alpha/account.py
Python
apache-2.0
5,356
from detonator import main import os for root, subdir, fnames in os.walk("programs"): for fname in fnames: if fname.endswith(".py") and not fname.startswith("_"): # Quick hack to import the modules and automagify things. __import__("programs.{}".format(fname[:-3])) if __name__ == "__main__": main...
shuhaowu/detonator
run.py
Python
gpl-3.0
322
#!/usr/bin/env python3 # -*- coding: utf8 -*- # # # # Copyright (C) by p.oseidon@datec.at, 1998 - 2017 # # This file is part of tau4. # # tau4 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...
p-o-seidon/tau4
src/tau4/ce/__init__.py
Python
gpl-3.0
1,941
# -*- coding: utf-8 -*- """ werkzeug.contrib.limiter ~~~~~~~~~~~~~~~~~~~~~~~~ A middleware that limits incoming data. This works around problems with Trac_ or Django_ because those directly stream into the memory. .. _Trac: http://trac.edgewall.org/ .. _Django: http://www.djangoproje...
jeremydane/Info3180-Project4
server/lib/werkzeug/contrib/limiter.py
Python
apache-2.0
1,373
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import flt, comma_or, nowdate, getdate from frappe import _ from frappe.model.document import Document from erpnext.acco...
indautgrp/erpnext
erpnext/controllers/status_updater.py
Python
gpl-3.0
13,277
# -*- coding: utf-8 -*- #!/usr/bin/env python """ Created on Sun Sep 18 20:24:29 2016 """ list1 = [3, 44, 38, 5, 47, 15, 36, 26, 27, 2, 46, 4, 19, 50, 48] list2 = [1,1,1,1,1,1,1,1] list3 = [1,2,3,4,5,6,7,8] list4 = [2,3,6,7,5,2,2,2] list5 = [8,7,6,5,4,3,2,1] #检查函数 def check(func): print sort_bubble(list1)==func(lis...
zfrxiaxia/Code-zfr
visualgo数据结构/01_sort.py
Python
gpl-3.0
1,847
# # 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...
apache/airflow
airflow/config_templates/default_celery.py
Python
apache-2.0
4,059
import numpy as np import copy import os import pickle import multiprocessing as mp import csv import xml.etree.cElementTree as ET import time as T def findMagnitude(vector): '''This function simply returns the magnitude of a given vector''' return np.sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2) def upd...
matty-jones/MorphCT
tests/assets/update_pickle/MCT1.0_pickle/code/helperFunctions.py
Python
gpl-3.0
53,553
"""Common test support for all numpy test scripts. This single module should provide all the common functionality for numpy tests in a single location, so that test scripts can just import it and work right away. """ from unittest import TestCase from ._private.utils import * from ._private.utils import (_assert_val...
simongibbons/numpy
numpy/testing/__init__.py
Python
bsd-3-clause
680
from rdkit import Chem from rdkit import rdBase from rdkit import RDConfig import os from rdkit.Chem import rdMolDescriptors as rdMD from rdkit.Chem import AllChem import time def get3D(m,is3d): if not is3d: m = Chem.AddHs(m) # define the new code from RDKit Molecule 3D ETKDG. ps = AllChe...
ptosco/rdkit
Code/GraphMol/Descriptors/test3D.py
Python
bsd-3-clause
1,389
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 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 ## ...
EUDAT-B2SHARE/invenio-old
modules/miscutil/lib/mailutils.py
Python
gpl-2.0
17,746
#!/usr/bin/env python # coding=utf-8 import tornado.web import common.result as CR class DashHandler(tornado.web.RequestHandler): def get(self): self.render("dashboard.html") def post(self): select = self.get_argument("select","") data=CR.result2json('./common/FKPIDB.txt', se...
gongshijun/ystechweb
handlers/dashboard.py
Python
gpl-3.0
374
# # 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...
Acehaidrey/incubator-airflow
airflow/example_dags/example_dag_decorator.py
Python
apache-2.0
2,314
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import ...
akintolga/superdesk-aap
server/aap/publish/formatters/aap_newscentre_formatter_test.py
Python
agpl-3.0
9,537
__description__ = """""" __author__ = "Michael J. Harms" __date__ = "" import base, experiments, instruments from base import AvivError class ATF_Titration(base.Parser,instruments.ATF,experiments.Titration): """ Processes an ATF Titration experiment. """ pass class CD_Titration(base.Parser,instrumen...
pansapiens/process-aviv
aviv/parsers.py
Python
gpl-3.0
2,653
import csv import json import zipfile from pprint import pformat from cStringIO import StringIO import grequests from crowdflower import logger def read_zip_csv(zf): for zipinfo in zf.filelist: zipinfo_fp = zf.open(zipinfo) reader = csv.DictReader(zipinfo_fp) for row in reader: ...
jfrazee/crowdflower
crowdflower/job.py
Python
mit
7,986
#!/usr/bin/env python import sys import pygtk pygtk.require("2.0") import gtk import gtk.glade import commands import os import gettext from user import home import webkit import string # i18n gettext.install("xswelcome", "/usr/share/ututo/locale") class MintWelcome(): def __init__(self): gladefile = "/...
PROYECTO-UTUTO/uget
usr/lib/ututo/xsWelcome/xsWelcome.py
Python
gpl-3.0
4,668
from __future__ import absolute_import, print_function from rest_framework.response import Response from sentry.api.base import Endpoint, EnvironmentMixin from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.serializers import ( serialize, SharedEventSerializer, SharedGroupSerializer, ...
mvaled/sentry
src/sentry/api/endpoints/shared_group_details.py
Python
bsd-3-clause
1,669
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
m038/superdesk-content-api
content_api/publish/resource.py
Python
agpl-3.0
984
# Copyright 2014: Mirantis 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 b...
gluke77/rally
rally/plugins/openstack/cleanup/resources.py
Python
apache-2.0
25,404
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Training.total_views' db.add_column('website_training', 'total_views', self.gf('django.db.models.fields.IntegerFiel...
UniShared/unishared
UniShared_python/website/migrations/0010_auto__add_field_training_total_views.py
Python
mit
10,657
# Copyright IBM Corp. 2015, 2015 All Rights Reserved # Copyright (c) 2010-2016 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
openstack/storlets
storlets/tools/utils.py
Python
apache-2.0
4,999
#!/usr/bin/env python """A small wrapper around nosetests. Avoids disruptive messages when viewing error messages. """ import sys import nose if __name__ == "__main__": import logging logging.basicConfig(level=logging.DEBUG) # Suppress sigma-clipping debug log: logging.getLogger('tkp.sourcefinder.image...
transientskp/tkp
tests/runtests.py
Python
bsd-2-clause
436
# Copyright 2008 Nokia Siemens Networks Oyj # # 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...
qitaos/robotframework-mabot
src/mabot/ui/ui.py
Python
apache-2.0
7,825
import tkinter from tkinter_async import * import asyncio from functools import partial def make_submitter(root, label, button_text, callback_coro, respawn=Respawn.CONCURRENT): frame = tkinter.Frame(root) label = tkinter.Label(frame, text=label) label.grid(row=0, column=0, sticky='w') entry = tkinter...
Lucretiel/tkinter-async
demo.py
Python
lgpl-3.0
2,383
from components.base.ecu.types.abst_ecu import AbstractECU from components.base.ecu.hardware.impl_transceiver_std import StdTransceiver from components.base.ecu.hardware.impl_controller_can_std import StdCanController from components.base.ecu.software.ecu_software import ECUSoftware from components.base.ecu.hardware.im...
PhilippMundhenk/IVNS
ECUSimulation/components/base/gateways/impl_can_gateway.py
Python
mit
12,344
""" About this library ================== Jenkins is the market leading continuous integration system, originally created by Kohsuke Kawaguchi. This API makes Jenkins even easier to use by providing an easy to use conventional python interface. Jenkins (and It's predecessor Hudson) are fantastic projects - but they a...
117111302/jenkinsapi
jenkinsapi/__init__.py
Python
mit
2,160
import sys import cherrypy def process_body(): """Return (params, method) from request body.""" try: import xmlrpclib return xmlrpclib.loads(cherrypy.request.body.read()) except Exception: return ('ERROR PARAMS', ), 'ERRORMETHOD' def patched_path(path): """Ret...
cread/ec2id
cherrypy/lib/xmlrpc.py
Python
apache-2.0
1,470
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import unittest from pymatgen.core import Lattice from pymatgen.electronic_structure.core import Orbital, Spin, Magmom import numpy as np class SpinTest(unittest.TestCase): def test_init(self): ...
dongsenfo/pymatgen
pymatgen/electronic_structure/tests/test_core.py
Python
mit
5,553
# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LI...
masayukig/tempest
tempest/tests/lib/services/volume/v3/test_extensions_client.py
Python
apache-2.0
2,693
# 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 ...
v-iam/azure-sdk-for-python
azure-graphrbac/azure/graphrbac/models/check_group_membership_parameters.py
Python
mit
1,230
from larray_editor.api import * __version__ = '0.34-dev'
larray-project/larray-editor
larray_editor/__init__.py
Python
gpl-3.0
58
#!/usr/bin/env python # *-* coding:utf-8 *-* """ Date : Author : Vianney Gremmel loutre.a@gmail.com """ from math import factorial from time import time start = time() digits_factorial_sum = lambda n: sum(factorial(int(d)) for d in str(n)) class FactorialLoopsBuilder(dict): def __missing__(self, k): r...
vianney-g/python-exercices
eulerproject/pb0074.py
Python
gpl-2.0
629
""" Command line utility for the Mesosphere Datacenter Operating System (DCOS) 'dcos help' lists all available subcommands. See 'dcos <command> --help' to read about a specific subcommand. Usage: dcos [options] [<command>] [<args>...] Options: --help Show this screen --version ...
Yhgenomics/dcos-cli
cli/dcoscli/main.py
Python
apache-2.0
4,242
from django.http import HttpResponse from django.views.generic import TemplateView, View from django import template from core.models import * import json import os import time import tempfile class MCordView(TemplateView): head_template = r"""{% extends "admin/dashboard/dashboard_base.html" %} {% load adm...
cboling/xos
xos/services/mcord/view.py
Python
apache-2.0
6,362
from django.conf.urls import patterns, url from imager_images.views import AlbumAddView, AlbumUpdateView, AlbumDeleteView from imager_images.views import PhotoAddView, PhotoUpdateView, PhotoDeleteView from django.contrib.auth.decorators import login_required urlpatterns = patterns('', url(r'libr...
henrykh/django-imager
imager_images/urls.py
Python
mit
2,083
import ert.util from cwrap import BaseCClass from ert.enkf import EnkfPrototype, LocalObsdata, LocalObsdataNode, LocalDataset class LocalMinistep(BaseCClass): TYPE_NAME = "local_ministep" _alloc = EnkfPrototype("void* local_ministep_alloc(char*)", bind = False) _add_node = EnkfPro...
Ensembles/ert
python/python/ert/enkf/local_ministep.py
Python
gpl-3.0
2,602
import test_utils class TestLocaleMiddleware(test_utils.TestCase): def test_default_redirect(self): # User wants en-us, we send en-US response = self.client.get('/', follow=True, HTTP_ACCEPT_LANGUAGE='en-us') self.assertRedirects(response, '/en-US/', stat...
mastizada/kuma
kuma/core/tests/test_locale_middleware.py
Python
mpl-2.0
1,930
# -*- coding: utf-8 -*- from crypt import Crypt import base64 from gi.repository import Gtk import ntpath class Controller: def __init__(self): self.text_tabs = {'None(0)': 'Sin nombre'} self.tabs = {0: 'None(0)'} def base64_encode(self, gui): textview = self.get_current_textview(gu...
vladzur/textcrypt
src/controller.py
Python
gpl-3.0
5,267
#!/usr/bin/env python # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author: @Marc...
hyperwang/bitcoin
contrib/devtools/check-doc.py
Python
mit
1,702
from utils import set_state_task from utils import operation_task from utils import link_tasks from utils import CustomContext from utils import generate_native_node_workflows # content of this fn can be generated by workflow plugin (see workflows.py in generated blueprint) def _build_tasks(ctx, graph, custom_context)...
victorkeophila/alien4cloud-cloudify3-provider
src/test/python/workflows/tasks.py
Python
apache-2.0
9,581
# TODO: clean up from django.template import RequestContext, Template, Context, loader from django.shortcuts import render_to_response, get_object_or_404 from django.contrib.admin.views.decorators import staff_member_required from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden fro...
lucasvo/django-gallery
gallery/admin_views.py
Python
bsd-3-clause
4,672
from spec.python import db_connection import pytest import cPickle import datetime from sam.pages import alerts from sam.models.security.alerts import Alerts as AlertsModel, AlertFilter from spec.python.models.security import test_warnings from sam.models.security import anomaly_plugin as model_ap from sam import error...
JoePelz/SAM
spec/python/pages/test_alerts.py
Python
gpl-3.0
23,407
from __future__ import division from math import sqrt def solve(s1, s2, q, L): side = L * sqrt(2) - sqrt(2.0 * q) return side / abs(s2 - s1) if __name__ == '__main__': L, s1, s2 = map(int, raw_input().strip().split()) Q = int(raw_input()) for _ in range(Q): q = int(raw_input()) ...
m00nlight/hackerrank
algorithm/contests/Ad-Infinitum-10/A.py
Python
gpl-2.0
357
# OfflineIMAP synchronization master code # Copyright (C) 2002-2007 John Goerzen # <jgoerzen@complete.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; either version 2 of the Lice...
avsm/lifedb-plugins
IMAP/offlineimap/offlineimap/syncmaster.py
Python
gpl-2.0
1,949
import os from pythonforandroid.recipes.libffi import LibffiRecipe from pythonforandroid.util import load_source util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) assert LibffiRecipe._version == "v3.3" assert LibffiRecipe.depends == [] assert LibffiRecipe.python_depends...
GroestlCoin/electrum-grs
contrib/android/p4a_recipes/libffi/__init__.py
Python
gpl-3.0
575
#!/usr/bin/env python """Game context and configuration classes.""" import offer import cspparser import problem class Config(object): """Represents a CSP configuration object.""" def __init__(self, gamekind=None, turnduration=None, mindecrement=None, initacc=None, maxProposals=0, minProposals=0, ...
compbrain/Athena-SCG-Bot
src/playercontext.py
Python
bsd-3-clause
3,093
import sys, socket from flask import Flask, request, Response # Carregando a classe Pokemon from pokemon.pokemon import Pokemon # Tarefas comuns para o servidor e o cliente ficaram no módulo battle.py from battle import validate, simple_duel, make_battle_state, command_line # Permitindo apenas erros como mensagens do...
andredalton/bcc
2014/MAC0242/Projeto/battle_server.py
Python
apache-2.0
3,422
"""celery_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
bugsnag/bugsnag-python
example/celery+django/celery_django/urls.py
Python
mit
1,125
from cspreporter.core.plugins import LogFormat import json class Nginx(LogFormat): title = 'Clean up log' desc = 'This plugin cleans up log entries to JSON data only' def setup(self): pass def process(self, s): tmp = s.decode('unicode-escape') return tmp[tmp.rfind('{"csp-repor...
yandex/csp-reporter
cspreporter/plugins/nginx/nginx.py
Python
gpl-2.0
379
# -*- coding: utf-8 -*- import unittest from cliez.component import Component class ComponentTestCase(unittest.TestCase): def test_load_resource(self): """ 资源加载测试,正常情况以下功能不抛出异常 :return: """ a = Component() a.load_resource('component.py', root='cliez') a.loa...
9nix00/cliez
tests/component.py
Python
mit
545
"""Collection of helper methods. All containing methods are legacy helpers that should not be used by new components. Instead call the service directly. """ from homeassistant.components.vacuum import ( ATTR_FAN_SPEED, ATTR_PARAMS, DOMAIN, SERVICE_CLEAN_SPOT, SERVICE_LOCATE, SERVICE_PAUSE, ...
jawilson/home-assistant
tests/components/vacuum/common.py
Python
apache-2.0
6,031
''' inherit_docstrings.py - this file is part of S3QL (http://s3ql.googlecode.com) Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org> This program can be distributed under the terms of the GNU GPLv3. --- This module defines a metaclass and function decorator that allows to inherit the docstring for a function from ...
krnflake/s3ql
src/s3ql/inherit_docstrings.py
Python
gpl-3.0
4,064
"""add view_count column in posts Revision ID: eb64b7b3d4c2 Revises: fc532e183eaa Create Date: 2016-07-08 11:01:40.948143 """ # revision identifiers, used by Alembic. revision = 'eb64b7b3d4c2' down_revision = 'fc532e183eaa' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql def up...
yelongyu/chihu
migrations/versions/eb64b7b3d4c2_add_view_count_column_in_posts.py
Python
gpl-3.0
814
x = "There are %d types of people." % 10 binary = "binary" do_not = "don't" y = "Those who %s and those who %s." % (binary, do_not) print x print y print "I said: %r." % x print "I also said: %s." % y hilarious = False joke_evaluation = "Isn't that joke so funny! %r" print joke_evaluation % hilarious w = "This is ...
SaileshPatel/Python-Exercises
ex6.py
Python
mit
387
# -*- coding: utf-8 -*- __author__ = """JanFan""" __email__ = 'guangyizhang.jan@gmail.com' __version__ = '0.1.0'
JanFan/py-aho-corasick
py_aho_corasick/__init__.py
Python
mit
114
""" Magnolya: de novo copy number variation detection Usage: magnolya [OPTIONS] -i [FILE] Input: -i Tab delimited text file with read counts (required) -l Tab delimited text file with contig locations on reference Output: -o CNV calls [stdout] -f Model parameters Parameters: ...
1dayac/CNVera
tools/magnolia.py
Python
gpl-3.0
31,332
# -*- coding: utf-8 -*- # # AzimuthSwath documentation build configuration file, created by # sphinx-quickstart on Sun Feb 12 17:11:03 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
popkinj/azimuth-swath
help/source/conf.py
Python
mit
7,131
# 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...
nburn42/tensorflow
tensorflow/contrib/model_pruning/python/layers/layers.py
Python
apache-2.0
15,360
# Copyright 2012, VMware, 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 agre...
barnsnake351/neutron
neutron/tests/unit/agent/linux/test_utils.py
Python
apache-2.0
15,628
""" This example routine simulates a number of pure Gaussian white noise signals, then fits each one in terms of two regressors: a constant baseline, and a linear function of time. The voxelwise t statistics associated with the baseline coefficient are then computed. """ print __doc__ import numpy as np from nipy....
yarikoptic/NiPy-OLD
examples/neurospin/glm_lowlevel.py
Python
bsd-3-clause
1,335
import argparse parser = argparse.ArgumentParser(description='This is a simple script to show argparser') parser.add_argument('--version', action='version', version='%(prog)s 0.1') parser.add_argument('--arg1', dest='arg1', action='store', help='The frist argument') parser.add_argument('--req1', de...
fernandoalex/stuff
python/examples/argparser/simple.py
Python
mit
517
""" Configuration utilities. Settings are stored in a dictionary-like configuration object. All settings are modifiable by environment variables that encode the path in the dictionary tree. Inner nodes in the dictionary tree can be any dictionary. A leaf node in the dictionary tree is represented by an inner node tha...
PolyJIT/benchbuild
benchbuild/utils/settings.py
Python
mit
20,533
# -*- coding: utf-8 -*- # # Copyright 2017 - 2019 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics 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, e...
dursobr/Pythics
pythics/opengl.py
Python
gpl-3.0
13,535
# Copyright (c) 2008 Yann Ramin # This file is part of quickmovie. # # quickmovie 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. # # q...
theatrus/quickmovie
quickmovie/model/__init__.py
Python
gpl-3.0
2,250
from django.conf import settings from django import forms from django.forms.widgets import HiddenInput from crits.core.widgets import CalWidget class AddCommentForm(forms.Form): """ Django form for adding a new Comment. """ error_css_class = 'error' required_css_class = 'required' comment = fo...
cfossace/crits
crits/comments/forms.py
Python
mit
1,498
#!/usr/bin/env python """ This example is similar to while(<>) in perl which processes input both from standard input and from command line arguments. """ import fileinput for line in fileinput.input(): line = line.rstrip() print(line)
veltzer/demos-python
src/examples/short/systems_programming/input_processing.py
Python
gpl-3.0
247
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # 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 ANS...
ravibhure/ansible
lib/ansible/modules/cloud/azure/azure_rm_resourcegroup_facts.py
Python
gpl-3.0
4,030
# ======================================================================== # Copyright (c) 2007, Metaweb Technologies, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistribution...
artzub/code_swarm-gource-my-conf
tools/codeswarm/lib/freebase/api/session.py
Python
gpl-3.0
17,231
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Diceware documentation build configuration file, created by # sphinx-quickstart on Mon Oct 26 22:19:13 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
Treggats/DicewarePassphrase
docs/conf.py
Python
gpl-2.0
11,767
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-12-09 16:37 import logging from typing import Dict, Any, Union, Iterable, Callable, List import torch from hanlp.common.dataset import SamplerBuilder, PadSequenceDataLoader from hanlp.common.transform import VocabDict from hanlp.components.lemmatizer import Transfor...
hankcs/HanLP
hanlp/components/mtl/tasks/lem.py
Python
apache-2.0
6,308
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, fields class AccountChartTemplate(models.Model): _inherit = 'account.chart.template' @api.model def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):...
ddico/odoo
addons/l10n_lu/models/account_chart_template.py
Python
agpl-3.0
684