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 logging from kid_readout.utils import log root_logger = logging.getLogger('kid_readout') roach_logger = logging.getLogger('kid_readout.roach.interface') root_logger.setLevel(logging.DEBUG) stream_handler = log.default_handler stream_handler.setLevel(logging.INFO) stream_handler.addFilter(log.RoachFilter()) ...
ColumbiaCMB/kid_readout
apps/data_taking_scripts/cooldown/2016-06-21_hpd/logtest.py
Python
bsd-2-clause
736
#!/usr/bin/env python # Copyright 2018-present Facebook, 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 applica...
SeleniumHQ/buck
programs/tracing.py
Python
apache-2.0
4,241
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 = {'metadata_version': '1.1', ...
andmos/ansible
lib/ansible/modules/network/f5/bigip_asm_policy_import.py
Python
gpl-3.0
14,687
# Reversi is a multiplayer reversi game with dedicated server # Copyright (C) 2012-2013, Juan Antonio Aldea Armenteros # 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 Lic...
JuantAldea/LUT-2013-CSPA-Reversi
src/ITCPInd.py
Python
gpl-3.0
1,149
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
microcom/microcom-runbot
runbot/res_config.py
Python
agpl-3.0
2,935
default_app_config = 'wiki.plugins.links.apps.LinksConfig'
floemker/django-wiki
src/wiki/plugins/links/__init__.py
Python
gpl-3.0
59
from django.conf import settings from keystoneclient.v2_0 import client as keystoneclient from karaage import datastores KEYSTONE_CONF = getattr(settings, 'KEYSTONE_CONFIG', {}) def keystone_authenticate(person): """Authenticate a user as their default tenant. """ details = datastores.get_person_detail...
NeCTAR-RC/karaage-auth
kgauth/services/keystone/models.py
Python
gpl-3.0
699
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Sean Poyser - With acknowledgement to some original code by twinther (Tommy Winther) # TRTV modifications done by Lee Randall (whufclee) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
Quihico/repository.spartacus
script.trtv/gui.py
Python
gpl-2.0
90,638
"""Test the image_info plugin""" import email import os import unittest import tests.util from tests.util.image_utils import new_email, new_image TESTDATA_DIR = os.path.join(os.getcwd(), "tests", "data") CONFIG_NAMED = r""" body DC_IMAGE001_GIF eval:image_named('image001.gif') describe DC_IMAGE001...
SpamExperts/SpamPAD
tests/functional/test_plugins/test_image_info.py
Python
gpl-2.0
8,163
""" PhyRawIO is a class to handle Phy spike sorting data. Ported from: https://github.com/SpikeInterface/spikeextractors/blob/ f20b1219eba9d3330d5d7cd7ce8d8924a255b8c2/spikeextractors/ extractors/phyextractors/phyextractors.py Author: Regimantas Jurkus """ from .baserawio import (BaseRawIO, _signal_channel_dtype, _si...
INM-6/python-neo
neo/rawio/phyrawio.py
Python
bsd-3-clause
9,185
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
pair-code/lit
lit_nlp/api/types.py
Python
apache-2.0
15,238
import os import sys def update_env(envfile): """ Update environemnt with env vars in ``envfile``. """ envvars = {} with open(os.path.abspath(envfile)) as fp: for line in fp.readlines(): if line[0:6] == 'export': line_list = line[6:].strip().split('=') ...
qsic/qsic3
project_settings/settings/local.py
Python
bsd-3-clause
2,064
import time import numpy as np from collections import Counter from collections import defaultdict import matplotlib.pyplot as plt def unzip(pairs): """ Splits list of pairs (tuples) into separate lists Parameter(s) -------------- pairs(list of tuples): List of pairs to be split ...
LMML-Team/AlexaSkills
GenerateText/Generate_text.py
Python
mit
4,460
# -*- coding: utf-8 -*- """Form and cookie based authentication middleware As with all the other AuthKit middleware, this middleware is described in detail in the AuthKit manual and should be used via the ``authkit.authenticate.middleware`` function. The option form.status can be set to "200 OK" if the Pylons error ...
cedadev/AuthKit
authkit/authenticate/form.py
Python
mit
10,231
#!/usr/bin/env python """ Filter gcprdb csv alignment by removing unwanted positions. Generates a fasta file. Usage: gpcrdb_spreadsheet_filter.py -n gpcrdb_gapped_tm_numbering.csv \ -f gpcr-a.members.json\ < gpcrdb_human_swissprot_tm_aligment.csv > gpcrdb_human_swissprot2.fa The gcprdb csv alignment can be obtaine...
3D-e-Chem/snooker-alignment
scripts/gpcrdb_spreadsheet_filter.py
Python
apache-2.0
3,547
#import warehousing import numberentry import dateentry import subjects import utility import gobject import pygtk import gtk from sqlalchemy.orm import sessionmaker, join from sqlalchemy.orm.util import outerjoin from sqlalchemy.sql import and_, or_ from sqlal...
AhmadHamzeei/Amir-Accounting
amir/customergroup.py
Python
gpl-3.0
10,051
import csv from collection_reader import CollectionReader import sys from dataset_importer.utils import HandleDatasetImportException csv.field_size_limit(sys.maxsize) class CSVReader(CollectionReader): @staticmethod def get_features(**kwargs): directory = kwargs['directory'] for file_path ...
cbentes/texta
dataset_importer/document_reader/readers/collection/csv_reader.py
Python
gpl-3.0
1,188
# Copyright (c) 2020 PaddlePaddle 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 appli...
luotao1/Paddle
python/paddle/fluid/tests/unittests/dygraph_to_static/test_resnet_v2.py
Python
apache-2.0
11,928
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
google-research/google-research
ipagnn/datasets/control_flow_programs/control_flow_programs_version.py
Python
apache-2.0
949
#!/usr/bin/python # This script is part of a SugarSync Linux client and handles authentication. # Normal flow for authentication: # user credentials(formatted as XML) are sent by a HTTP Post method as a # request for a Refresh Token. # using the Refresh Token you request by HTTP Post an Access Token which # ...
andri-ch/sugarsync-linux
auth.py
Python
gpl-2.0
5,321
from cx_Freeze import setup, Executable setup( name = "bglconverter", version = "0.1", description = "A tool to convert Babylon dictionaries into other formats", executables = [ Executable("bglconverter.py", includes=['getopt', 'subprocess', 'cStringIO', 'codecs', 'lib', 'Exception']...
parnurzeal/bglconverter
setup.py
Python
bsd-3-clause
477
"""Views for the node settings page.""" # -*- coding: utf-8 -*- import httplib as http import logging from flask import request, make_response from framework.exceptions import HTTPError from addons.base import generic_views from addons.bitbucket.api import BitbucketClient from addons.bitbucket.apps import bitbucket_...
pattisdr/osf.io
addons/bitbucket/views.py
Python
apache-2.0
4,664
from __future__ import unicode_literals from django.test import TestCase from django.utils import six from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import ( ErrorDetail, Throttled, _get_error_details ) class ExceptionTestCase(TestCase): def test_get_error_details(se...
dmwyatt/django-rest-framework
tests/test_exceptions.py
Python
bsd-2-clause
1,635
import sys import logging import platform import yaml import os import time from collections import OrderedDict, defaultdict from email import message_from_string from pkg_resources import get_distribution, DistributionNotFound from PyQt5 import QtCore, QtWidgets, QtGui import testbeam_analysis from testbeam_analysi...
SiLab-Bonn/testbeam_analysis
testbeam_analysis/gui/main.py
Python
mit
58,125
# -*- coding: utf-8 -*- # Copyright 2014, 2017 Nick Boultbee # # 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 s...
elbeardmorez/quodlibet
quodlibet/quodlibet/ext/_shared/squeezebox/server.py
Python
gpl-2.0
8,203
#!/usr/bin/python import re import cgi import cgitb import sys import json import uuid import subprocess as sp import sys import os.path cgitb.enable(); schjson_exec = "/home/meow/pykicad/schjson.py" staging_base = "/home/meow/stage" u_id = -1 # DISABLED # ############## # # to enable this script, cut out this blo...
timofonic/bleepsix
cgi/bleepsixUploadManager.py
Python
agpl-3.0
931
from django.db import connection, models from .fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HStoreField, IntegerRangeField, JSONField, ) class PostgreSQLModel(models.Model): class Meta: abstract = True required_db_vendor = 'postgre...
jhoos/django
tests/postgres_tests/models.py
Python
bsd-3-clause
3,435
class Item: def __init__(self, use_function=None, targeting=False, targeting_message=None, is_blessed=False, is_cursed=False, **kwargs): self.use_function = use_function self.targeting = targeting self.targeting_message = targeting_message self.is_b...
WrogueOne/Wrogue
components/item.py
Python
gpl-3.0
422
# coding=utf-8 # Copyright (c) 2014-2018, F5 Networks, 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...
F5Networks/f5-openstack-agent
f5_openstack_agent/lbaasv2/drivers/bigip/listener_service.py
Python
apache-2.0
16,053
#!/usr/bin/python # coding: utf-8 from datetime import datetime import deform import colander import jinja2 from deform import ValidationFailure from deform.widget import CheckedPasswordWidget from pyramid.view import view_config from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTP...
toway/towaymeetups
mba/views/logout.py
Python
gpl-3.0
1,106
# vim:set fileencoding=utf-8 import unittest import blivet from blivet.devices import StorageDevice from blivet.devices import LVMLogicalVolumeDevice from blivet.devices import LVMSnapShotDevice from blivet.devices import LVMThinLogicalVolumeDevice from blivet.devices import LVMThinPoolDevice from blivet.devices imp...
karmix/blivet
tests/devices_test/lvm_test.py
Python
gpl-2.0
7,333
def read_stock(): """ txt파일을 읽어 coffee_list를 반환해준다. :return: coffee_list는 커피번호, 제품명, 가격, 제고로 이뤄진 2차원 배열이다. error는 오류가 있을 경우 오류메세지와 함께 반환되는 값이다. """ try: error = "" coffee_stock = open("coffee_stock.txt", 'r', encoding="utf-8") except FileNotFoundError as error: ...
imn00133/pythonSeminar17
exercise/vending_machine/vending_machine.py
Python
mit
5,253
# Code is from Black Hat Python # https://www.nostarch.com/blackhatpython import win32gui import win32ui import win32con import win32api from os import getcwd # grab a handle to the main desktop window hdesktop = win32gui.GetDesktopWindow() # determine the size of all monitors in pixels width = win32api.GetSystemMe...
CDC-UI/cdc-ui
botnet/screenshotter.py
Python
mit
1,193
from build import evaluate_callables class WhenEvaluatingADictWithNoCallables: def when_i_evaluate_the_dict(self): self.result = evaluate_callables({"abc": 123, "def": 456, "xyz": 789}) def it_should_return_the_same_dict(self): assert self.result == {"abc": 123, "def": 456, "xyz": 789} clas...
benjamin-hodgson/build
test/evaluate_callables_tests.py
Python
mit
2,020
"""Helpers for the student app. """ import logging import mimetypes import urllib from datetime import datetime from django.conf import settings from django.core.urlresolvers import NoReverseMatch, reverse from django.utils import http from oauth2_provider.models import AccessToken as dot_access_token from oauth2_prov...
fintech-circle/edx-platform
common/djangoapps/student/helpers.py
Python
agpl-3.0
14,840
# Copyright (C) 2012 David Morton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribut...
davidlmorton/spikepy
spikepy/builtins/methods/auxiliary_resample/__init__.py
Python
gpl-3.0
1,744
#! /usr/bin/python -tt # 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. # # This program is distributed in the hope that ...
nickjacek/yum-cron
yum/plugins.py
Python
gpl-2.0
27,570
import json import seamless from seamless.highlevel import load_graph, Context graph = json.load(open("twopi-result.seamless")) zipfile = "twopi-result.zip" """ # Does not work well... ctx = load_graph(graph) ctx.add_zip(zipfile) ctx.translate(force=True) print(ctx.pi.value) """ ctx = Context() ctx.add_zip(zipfile) ...
sjdv1982/seamless
tests/highlevel/load-graph.py
Python
mit
803
#! /usr/python2.6/python import xml.dom.minidom as xdom from optparse import OptionParser # option parse parser = OptionParser(usage="usage: %prog [options]") parser.add_option("-l","--list",dest="autoGenList",metavar="FEATURELIST",help="get the user feature list") (options,args) = parser.parse_args() if len(args) !=...
luckasfb/OT_903D-kernel-2.6.35.7
mediatek/build/tools/usesFeature.py
Python
gpl-2.0
3,762
# -*- coding: utf-8 -*- """ *************************************************************************** lasnoise.py --------------------- Date : September 2013 Copyright : (C) 2013 by Martin Isenburg Email : martin near rapidlasso point com ****************...
mhugent/Quantum-GIS
python/plugins/processing/algs/lidar/lastools/lasnoise.py
Python
gpl-2.0
3,609
# OpenShot Video Editor is a program that creates, modifies, and edits video files. # Copyright (C) 2009 Jonathan Thomas # # This file is part of OpenShot Video Editor (http://launchpad.net/openshot/). # # OpenShot Video Editor is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
zaenalarifin/openshot_jmd
openshot/windows/TransitionProperties.py
Python
gpl-3.0
6,330
# -*- coding: utf-8 -*- """ Created on Sun Mar 06 00:27:21 2016 @author: maheshwa """ from __future__ import print_function import requests import time import binascii import hashlib import json # Authentication class AdobeAnalytics: def __init__(self, user_name, shared_secret, endpoint='', debug=False): ...
andymaheshw/AdobeAnalytics
src/pyadobemc/pyadobemc.py
Python
mit
21,700
#!/usr/bin/python # -*- coding: utf-8 -*- import sys sys.path += ['../'] import mingus.core.intervals as intervals import unittest class test_intervals(unittest.TestCase): def setUp(self): pass def test_seconds(self): secs_c = {'C': 'D', 'E': 'F', 'D': 'E'} secs_fsharp = {'F#': 'G#',...
anthonyt/mingus-counterpoint
unittest/test_intervals.py
Python
gpl-3.0
13,041
# Copyright (c) 2010 Cloud.com, Inc # Copyright (c) 2012 Cloudbase Solutions Srl # # 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....
stackforge/compute-hyperv
compute_hyperv/nova/driver.py
Python
apache-2.0
20,482
import json import matplotlib.pyplot as plt import numpy as np import math import pymongo from pymongo import MongoClient client = MongoClient('sd-work2.ece.vt.edu', 27017) db = client.baseball collection = db.career_stats allstats = ['BB%','K%','ISO','BABIP','AVG','SLG', \ 'WAR','H','RBI','SB','OBP','w...
ajribeiro/baseball
static/assets/find_sim_car.py
Python
bsd-3-clause
1,639
import sys from qt import * from frmpreferences import frmPreferences from kuralib import kuraapp from kuragui.guiconfig import guiConf from kuragui.comboproxy import ComboProxy from resource import * class dlgPreferences(frmPreferences): """ Proxy class for the generated frmPreferences. """ def _...
boudewijnrempt/kura
kuraclient/dlgpreferences.py
Python
bsd-2-clause
3,495
# -*- coding: utf-8 -*- from __future__ import division, absolute_import from __future__ import print_function from builtins import hex from builtins import object # Copyright (C) 2007 Samuel Abels # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Pu...
knipknap/SpiffWorkflow
SpiffWorkflow/specs/WorkflowSpec.py
Python
lgpl-3.0
6,691
# 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-batch/azure/batch/models/auto_pool_specification.py
Python
mit
3,014
import unittest import os import shutil from iva import qc_external modules_dir = os.path.dirname(os.path.abspath(qc_external.__file__)) data_dir = os.path.join(modules_dir, 'tests', 'data') class TestQcExternal(unittest.TestCase): def test_run_gage(self): '''test run_gage''' ref = os.path.join(d...
satta/iva
iva/tests/qc_external_test.py
Python
gpl-3.0
1,357
# Copyright 2019 The Kubeflow 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...
kubeflow/pipelines
test/sample-test/sample_test_launcher.py
Python
apache-2.0
10,023
from .parseStateProtoFile import * from .StateTreeModel import *
poobalan-arumugam/stateproto
src/extensions/lang/python/reader/__init__.py
Python
bsd-2-clause
65
# the original json is encoded in utf-8 and is shown in ascii in text editor, # This script is used to convert the json in utf-8 shown, notice that the encoding of both files is utf-8 import json import sys import codecs file_path = sys.argv[1] file_output_path = ''.join(sys.argv[1].split('.')[:-1]) + '.cn.json' json...
jianjian0dandan/Zhihu_Spider
zhihu/json_convert_cn.py
Python
apache-2.0
546
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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...
CERNDocumentServer/invenio
modules/websearch/lib/websearch_yoursearches.py
Python
gpl-2.0
6,692
from setuptools import setup, find_packages tests_require = [ 'pytest', 'pytest-tornasync', 'mypy' ] setup( name='bert_transformer_v2', version='0.1.0', author_email='dsun20@bloomberg.net', description='BertTransformerV2', python_requires='>=3.6', packages=find_packages("bert_trans...
kubeflow/kfserving-lts
docs/samples/v1beta1/triton/bert/bert_tokenizer_v2/setup.py
Python
apache-2.0
496
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
mbohlool/client-python
kubernetes/client/models/v1_pod_template_list.py
Python
apache-2.0
6,495
""" WSGI config It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webserver.settings") from django.core.wsgi import get_wsgi...
karlgluck/heroes-of-the-storm-replay-parser
webserver/wsgi.py
Python
mit
406
#!/usr/bin/env python # -*- coding: utf-8 -*- import urlparse import re def en_punycode(x): 'Encode a segment of text. Return the origin if only contains ascii.' if not x: return x en = x.encode('punycode') if en.endswith('-'): #only ASCII return x else: return "xn--%s"%en ...
tr33oph/zhurl
zhurl.py
Python
gpl-3.0
1,836
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
JohnGarbutt/taskflow-1
taskflow/tests/utils.py
Python
apache-2.0
1,552
import unittest import settings_mock from activity.activity_VerifyImageServer import activity_VerifyImageServer import test_activity_data as test_data from mock import patch, MagicMock from classes_mock import FakeSession from ddt import ddt, data class FakeStorageContext: def list_resources(self, resource): ...
jhroot/elife-bot
tests/activity/test_activity_verify_image_server.py
Python
mit
3,442
# 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...
ghchinoy/tensorflow
tensorflow/python/kernel_tests/spacetobatch_op_test.py
Python
apache-2.0
26,125
from .base import analyze_vot
MontrealCorpusTools/PolyglotDB
polyglotdb/acoustics/vot/__init__.py
Python
mit
30
######################################################################## # # File: dejagnu_base.py # Author: Mark Mitchell # Date: 05/15/2003 # # Contents: # DejaGNUBase # # Copyright (c) 2003 by CodeSourcery, LLC. All rights reserved. # ######################################################################## ...
MentorEmbedded/qmtest
qm/test/classes/dejagnu_base.py
Python
gpl-2.0
2,219
from dfilter import Dfilter class TestCountries(object): """ Do some queries on countries.json: Got this file from someone on github. I should go look from who and give them some credit. But, thanks so long. """ def setup(self): self.df = Dfilter() self.df.read_json('tests/count...
martinslabber/pyDfilter
tests/test_countries.py
Python
mit
813
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('module', '0003_dep_stream'), ] operations = [ migrations.AddField( model_name='UnreleasedVariant', n...
release-engineering/product-definition-center
pdc/apps/module/migrations/0004_modulemd.py
Python
mit
437
import re import os import operator import subprocess k_free_mem = 0 k_free_cores = 1 k_used_cores = 2 k_node = 0 k_max = 3 k_njobs = 4 k_mem = 11 mem_free_dict = {} result_dict = {} def beginBlock(text): print("{:-^30}".format(text)) def endBlock(): print() def error(text): print() print("-" *...
research-team/NEUCOGAR
NEST/cluster/mpi_calc.py
Python
gpl-2.0
3,549
#!/usr/bin/env python3 #coding: utf-8 import json import nrn_validation as V V.override_defaults_from_args() model = V.VModel() model.add_soma(18.8, Ra=100) model.add_iclamp(10, 100, 0.1) data = V.run_nrn_sim(100, report_dt=None, model='soma') print(json.dumps(data)) V.nrn_stop()
halfflat/nestmc-proto
validation/ref/neuron/soma.py
Python
bsd-3-clause
287
import superdesk from liveblog.blogs.blogs import BlogService, BlogsResource def init_app(app): endpoint_name = 'blogs' service = BlogService(endpoint_name, backend=superdesk.get_backend()) BlogsResource(endpoint_name, app=app, service=service)
nistormihai/liveblog-server
liveblog/blogs/__init__.py
Python
lgpl-3.0
260
# Demonstration of a curve from Nurbs import Crv cntrl = [[-50., -75., 25., 0., -25., 75., 50.], [25., 50., 50., 0., -50., -50., 25.]] knots = [0., 0., 0., .2, .4, .6, .8, 1., 1., 1.] crv = Crv.Crv(cntrl, knots) crv.plot()
morris254/polymode
other/Nurbs/demos/Crv.py
Python
gpl-3.0
245
#!/usr/bin/env python # # Copyright (c) 2013-2015 Corey Goldberg # # This file is part of: sauceclient # https://github.com/cgoldberg/sauceclient # # 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 ...
cgoldberg/sauceclient
setup.py
Python
apache-2.0
1,947
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: protobuf/ImFea.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as...
tuan3w/visual_search
visual_search/lib/es/ImFea_pb2.py
Python
mit
5,132
#encoding:utf-8 t_channel = '@r_SwitchHacks' subreddit = 'SwitchHacks' def send_post(submission, r2t): return r2t.send_simple(submission)
Fillll/reddit2telegram
reddit2telegram/channels/~inactive/r_switchhacks/app.py
Python
mit
145
# Copyright 2015 iNuron NV # # Licensed under the Open vStorage Modified Apache License (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.openvstorage.org/license # # Unless required by applicable law or agreed to in writing,...
openvstorage/openvstorage-flocker-driver
openvstorage_flocker_plugin/__init__.py
Python
apache-2.0
1,409
import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils def checkpoint_new_category_in_response(): sv = h2o.upload_file(pyunit_utils.locate("smalldata/iris/setosa_versicolor.csv")) iris = h2o.upload_file(pyunit_utils.locate("smalldata/iris/iris.csv")) m1...
pchmieli/h2o-3
h2o-py/tests/testdir_algos/deeplearning/pyunit_DEPRECATED_checkpoint_new_category_in_response.py
Python
apache-2.0
891
from __future__ import division import sys import datetime import itertools import ntpath import multiprocessing as mp try: import simplejson as json except ImportError: import json import numpy as np from pymongo.errors import PyMongoError from pymongo import MongoClient, GEOSPHERE from netCDF4 import Dataset ...
RDCEP/atlas-viewer
atlas/nc4_to_mongodb.py
Python
apache-2.0
8,364
import copy import tools do={'swap':(lambda l: [l[1]]+[l[0]]+l[2:]), 'drop':(lambda l: l[1:]), '*':(lambda l: [l[0]*l[1]]+l[2:]), '/':(lambda l: [l[0]/l[1]]+l[2:]), '-':(lambda l: [l[0]-l[1]]+l[2:]), '+':(lambda l: [l[0]+l[1]]+l[2:])} def forth(f, stack): if len(f)==0: return stack try: ...
jtremback/FlyingFox
docs/stablecoin/stablecoin.py
Python
unlicense
2,623
# -*- coding: utf-8 -*- """ test_scrape_entity ~~~~~~~~~~~~~~~~~~ Test scraping using Entity class directly. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import unittest import six from chemda...
mcs07/ChemDataExtractor
tests/test_scrape_entity.py
Python
mit
9,220
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
CMUSV-VisTrails/WorkflowRecommendation
vistrails/db/versions/v0_3_0/domain/__init__.py
Python
bsd-3-clause
1,866
# -*- encoding: utf-8 -*- from django.shortcuts import render, redirect from forms import FormItemAgenda from django.contrib.auth.decorators import login_required #def index(request): # lista_itens = ItemAgenda.objects.all() # return render(request, "lista.html", # {'lista_itens': lista_itens...
renanalencar/congrefor
congrefor/agenda/views.py
Python
mit
1,447
import csv def readFile(filename): ''' (str) => list of dicts loads file filename into a list. Each item is a dict encoding one run in the model. ''' with open (filename, 'r') as csvFile: csvReader = csv.DictReader (csvFile, delimiter = ',', quotechar = '"') table = [] for r...
albertocottica/community-management-simulator
Code to apply on BS output/Python/prepare_viz_experiment_1.py
Python
mit
6,766
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Locale.mon_grouping' db.alter_column('localedb_locale', 'mon_grouping', self.gf('dja...
cuker/django-localedb
localedb/migrations/0003_grouping.py
Python
bsd-3-clause
8,521
# # secret.py # Created by pira on 2017/08/09. # #coding: utf-8 u"""For Secret informations.""" import random import numpy as np def generateSecret(n): u"""Generate 0 or 1 random secret information for simulation. @param n : length @return secret : secret information list """ secret = np.random.randint(2,...
piraaa/VideoDigitalWatermarking
src/secret.py
Python
mit
345
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-11-26 12:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name='chatSession...
OpenSourceHelpCommunity/OpenSourceHelpCommunity.github.io
oshc/main/migrations/0001_initial.py
Python
mit
2,137
#!/usr/bin/env python # Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org> # # This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details. """ Description here """ import logging as log def check_liveness(ax, model, args, simconfig, timestep): dif...
mmadsen/axelrod-ct
madsenlab/axelrod/utils/convergence.py
Python
apache-2.0
839
import discord import os import sys from discord.ext import commands import logging #import emoji from collections import Counter import json import asyncio import pip def init_logging(bot): logging.root.setLevel(logging.INFO) logger = logging.getLogger('Logger') logger.setLevel(logging.INFO) log = lo...
iamDangerous420/Deddy
bot.py
Python
mit
9,315
#!/usr/bin/env python # -*- coding: utf-8 -*- # # bts_tools - Tools to easily manage the bitshares client # Copyright (c) 2014 Nicolas Wack <wackou@gmail.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 Softwa...
wackou/bts_tools
bts_tools/monitor.py
Python
gpl-3.0
10,236
import requests from requests import HTTPError, RequestException from cloudbot import hook from cloudbot.util.web import Pastebin, pastebins, ServiceHTTPError, ServiceError class Sprunge(Pastebin): def __init__(self, base_url): super().__init__() self.url = base_url def paste(self, data, ext...
tiredtyrant/CloudBot
plugins/pastebins/sprunge.py
Python
gpl-3.0
1,135
#!/usr/bin/env python3 # -*- coding: UTF-8 -*-# enable debugging import config, cgi, os, re, time from datetime import datetime class PageNotFoundException(Exception): pass """ [ env ] CONTEXT_DOCUMENT_ROOT, CONTEXT_PREFIX, DOCUMENT_ROOT, GATEWAY_INTERFACE, HTTP_ACCEPT, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE, HT...
Daruzon/twitter-profile-mgmt
app/includes/lib/request.py
Python
mit
2,573
#!/usr/bin/env vpython3 # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Using colorama.Fore/Back/Style members # pylint: disable=no-member from __future__ import print_function import argparse import c...
ric2b/Vivaldi-browser
chromium/build/android/apk_operations.py
Python
bsd-3-clause
73,936
# -*- coding: utf-8 -*- """ pyinfluxql ~~~~~~~~~~ InfluxDB SQL generator """ __version__ = '0.0.1' from .query import Query class Engine(object): def __init__(self, client): self.client = client def execute(self, query): return self.client.query(str(query)) def query(self,...
jjmalina/pyinfluxql
pyinfluxql/__init__.py
Python
mit
371
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from __future__ import with_statement import logging from sleekxmpp import Presence from sleekxmpp.plugins import BasePlugin, register_plugin fr...
emesene/emesene
emesene/e3/xmpp/SleekXMPP/sleekxmpp/plugins/xep_0045.py
Python
gpl-3.0
14,622
""" Searchcode (It) @website https://searchcode.com/ @provide-api yes (https://searchcode.com/api/) @using-api yes @results JSON @stable yes @parse url, title, content """ from urllib import urlencode from json import loads # engine dependent config categories = ['it'] paging = True # ...
framasoft/searx
searx/engines/searchcode_code.py
Python
agpl-3.0
1,771
# Copyright (c) 2013,Vienna University of Technology, # Department of Geodesy and Geoinformation # 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...
TUW-GEO/SMDC-performance
smdc_perftests/visual.py
Python
bsd-3-clause
3,524
from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.db.models.indexes import Index class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 17: ...
dracos/django
django/db/backends/postgresql/introspection.py
Python
bsd-3-clause
10,014
# MIT License # # Copyright The SCons Foundation # # 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, ...
mapnik/mapnik
scons/scons-local-4.1.0/SCons/Scanner/D.py
Python
lgpl-2.1
2,383
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2011 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 obt...
plumgrid/plumgrid-nova
nova/tests/api/openstack/compute/test_extensions.py
Python
apache-2.0
28,909
from tkinter import * import tkinter import HoursParser class UserInterface(tkinter.Frame): def __init__(self, master): self.master = master self.events_list = [] # Set window size master.minsize(width=800, height=600) master.maxsize(width=800, height=600) ...
itsknob/TechnicalServicesScheduler-Python
interface.py
Python
mit
3,856
""" Package for custom classes.""" from .error_classes import UserNotFoundError
NMisko/monkalot
bot/error_classes/__init__.py
Python
mit
82
"""Celery tasks for user management""" import logging from celery import task from django.db import IntegrityError import games.models from games.notifier import send_daily_mod_mail from games.util.steam import create_game from accounts.models import User from accounts import spam_control from common.util import slug...
lutris/website
accounts/tasks.py
Python
agpl-3.0
2,220
# # Copyright 2018 Microsoft Corporation # # 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 ...
hglkrijger/WALinuxAgent
azurelinuxagent/common/osutil/suse.py
Python
apache-2.0
3,756
"""empty message Revision ID: c1a39bca68bc Revises: None Create Date: 2016-09-16 16:28:41.863139 """ # revision identifiers, used by Alembic. revision = 'c1a39bca68bc' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
tlake/dungeonbot
migrations/versions/c1a39bca68bc_.py
Python
mit
1,582