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
#!/usr/bin/python3 # -*- coding: utf-8 -*- '''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar...
jjgomera/pychemqt
lib/mEoS/C1Oleate.py
Python
gpl-3.0
5,129
# PyeNalysis __author__ = "Edwin Dalmaijer" import copy import numpy from scipy.interpolate import interp1d # DEBUG # #from matplotlib import pyplot # # # # # def interpolate_blink(signal, mode='auto', velthresh=5, maxdur=500, margin=10, invalid=-1, edfonly=False): """Returns signal with interpolated results, ...
esdalmaijer/PyGazeAnalyser
pygazeanalyser/traces.py
Python
gpl-3.0
19,865
#### ##functions for running tune_main.py ##dpaiton import os import re ## Generator (most times) function to return a range of values with a float step ## This is inclusive, which is different from Python's range() function def frange(start, stop, step): if start == stop or stop == 0 or step == 0: yield ...
dpaiton/OpenPV
projects/HyPerRetina/tuning/tune_functions.py
Python
epl-1.0
1,131
import unittest from webtest import TestApp import helloworld import printenv class TestModules(unittest.TestCase): nosegae_modules = True nosegae_user = True nosegae_user_kwargs = { 'USER_IS_ADMIN': '1', 'USER_EMAIL': 'josh@example.org' } def test_frontend(self): """Test...
Trii/NoseGAE
examples/modules_example/test.py
Python
bsd-2-clause
1,022
# Copyright (c) 2013 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 writ...
sajuptpm/murano
murano/engine/system/common.py
Python
apache-2.0
1,076
"""This module imports all tests/unittests for the pyfrp_gmsh_geometry.""" from pyfrp.modules import pyfrp_gmsh_geometry from pyfrp.modules import pyfrp_misc_module from pyfrp.modules import pyfrp_gmsh_IO_module import numpy as np def test_surfaceFuse(): """Test surface fuse function. Reads in .stl, tries to fu...
mueller-lab/PyFRAP
pyfrp/tests/modules/test_gmsh_geometry.py
Python
gpl-3.0
1,754
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
whbruce/upm
examples/python/mpr121.py
Python
mit
2,534
# Copyright (c) 2010-2014, GEM Foundation. # # OpenQuake Risklib 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 your option) any later version. # # OpenQuake R...
g-weatherill/oq-risklib
openquake/risklib/tests/benefit_cost_ratio_test.py
Python
agpl-3.0
1,272
# -*- encoding: utf-8 -*- import os from abjad.tools.abctools import ContextManager class TemporaryDirectoryChange(ContextManager): r'''A context manager for temporarily changing the current working directory. ''' ### CLASS VARIABLES ### __documentation_section__ = 'Context managers' __slot...
mscuthbert/abjad
abjad/tools/systemtools/TemporaryDirectoryChange.py
Python
gpl-3.0
2,390
# -*- coding: utf-8 -*- ## Copyright 2008-2009 Luc Saffre. ## This file is part of the Lino project. ## Lino 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 ...
MaxTyutyunnikov/lino
obsolete/voc/tests.py
Python
gpl-3.0
5,073
# import bpy # def draw_wire(context): # area = context.area # if context.area.type == 'VIEW_3D': # target = bpy.context.area.spaces.active # # target.draw_handler_add()
TriumphLLC/FashionProject
modules/draw/wires.py
Python
gpl-3.0
183
"""User API""" import arrow from flask import render_template, request from flask_mail import Message from werkzeug.security import generate_password_hash, check_password_hash from purepage.ext import r, db, abort, g, auth, mail def gen_pwdhash(password): """生成密码hash""" return generate_password_hash(password,...
guyskk/kkblog
api/purepage/views/user.py
Python
mit
6,802
import hmac from functools import wraps from flask import make_response from flask import request import config import logger from middleware import received_message from middleware import received_postback from middleware import validate_token LOGGER = logger.getLogger(__name__) APP_SECRET = bytes(config.facebook['...
nico-arianto/dota2-messenger-platform
route.py
Python
gpl-3.0
3,193
from setuptools import setup, find_packages setup( name='django-wakawaka', version='0.4.dev7', description='A super simple wiki app written in Python using the Django Framwork', long_description=open('README.rst').read(), author='Martin Mahner', author_email='martin@mahner.org', url='http:/...
pinax-archives/django-wakawaka
setup.py
Python
bsd-3-clause
911
#!/usr/bin/env python # -*- coding: UTF-8 -*- ############################################################################### # chirribackup/actions/SnapshotDetails.py # # Print details about an snapshot # # ----------------------------------------------------------------------------- # Chirri Backup - Cheap and ugly...
killabytenow/chirribackup
chirribackup/actions/SnapshotDelete.py
Python
gpl-3.0
2,024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('userprofile', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='first_...
taedori81/e-commerce-template
saleor/userprofile/migrations/0002_auto_20150902_1728.py
Python
bsd-3-clause
571
# -*- mode: python; coding: utf-8 -*- # Copyright 2013-2016 Peter Williams <peter@newton.cx> and collaborators. # Licensed under the MIT License. """Insert a simple polarized point source model into a dataset. """ from __future__ import absolute_import, division, print_function, unicode_literals __all__ = str ('Conf...
pkgw/pwkit
pwkit/environments/casa/polmodel.py
Python
mit
5,781
import pyfits import numpy as np import psycopg2 as mdb import csv import os import fnmatch import cPickle as pickle from scipy import spatial import ftputil import getpass import copy from sclip.sclip import sclip from scipy.interpolate import UnivariateSpline import scipy from scipy import signal #from pyflann import...
sheliak/galah_tools
old_versions/galah_tools.py
Python
gpl-2.0
24,308
import pytest import networkx as nx from networkx.generators.classic import barbell_graph, cycle_graph, path_graph from networkx.testing.utils import assert_graphs_equal #numpy = pytest.importorskip("numpy") class TestConvertNumpy(object): @classmethod def setup_class(cls): global np global n...
sserrot/champion_relationships
venv/Lib/site-packages/networkx/tests/test_convert_numpy.py
Python
mit
17,291
import argparse import smtplib from email import charset from email.MIMEText import MIMEText import sys import socks import random from twitter import * def base64_char(i): if 0 <= i <= 25: # A-Z return chr(i + ord('A')) elif 26 <= i <= 51: # a-z return chr(i + ord('a') - 26) elif 52 <= i <= 61: # 0-9...
dismantl/NOISE
noise_dispatch.py
Python
gpl-3.0
6,128
# 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 u...
xhochy/arrow
python/pyarrow/tests/test_memory.py
Python
apache-2.0
2,890
""" Unit tests for django-registration. These tests assume that you've completed all the prerequisites for getting django-registration running in the default setup, to wit: 1. You have ``registration`` in your ``INSTALLED_APPS`` setting. 2. You have created all of the templates mentioned in this application's doc...
cc-archive/commoner
src/commoner/registration/tests.py
Python
agpl-3.0
12,845
# 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...
googleapis/python-aiplatform
.sample_configs/param_handlers/get_model_evaluation_image_object_detection_sample.py
Python
apache-2.0
735
# Definitions file for server API variables/strings. # Make calls to these variables in code instead of explicit definitions. # Definitions file for server API variables/strings. # Make calls to these variables in code instead of explicit definitions. class client_api: data_separator = "|" # Client ...
operant/knowledge-management
Server/server_c.py
Python
mit
577
import configparser import cv2 import numpy as np from Image.Cannify import Cannify from Image.IsolateDigits import IsolateDigits from Image.Straighten import Straighten class Pipeline: def __init__(self, filename: str): self.file = filename self.img = cv2.imread(self.file, 0) self.height...
spidgorny/energy-monitor
python/Image/Pipeline.py
Python
unlicense
2,753
""" Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its bottom-up level order traversal as: [ [15,7], [9,20], [3...
danielsunzhongyuan/my_leetcode_in_python
binary_tree_level_order_traversal_ii_107.py
Python
apache-2.0
1,341
import os, sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/../") import bz2 from pymcda.types import * from pymcda.generate import generate_criteria from pymcda.generate import generate_categories from pymcda.generate import generate_categories_profiles from pymcda.electre_tri import MRSort from p...
oso/pymcda
apps/test_coalition_additive_weights.py
Python
gpl-3.0
3,364
__all__ = ["bumbledriver", "dummydriver", "printcoredriver", "s3gdriver"]
qharley/BotQueue
bumblebee/drivers/__init__.py
Python
gpl-3.0
73
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # 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.0', ...
fernandezcuesta/ansible
lib/ansible/modules/net_tools/ipify_facts.py
Python
gpl-3.0
2,944
def makeTextFile(): import os ls = os.linesep # get filename while True: fname = raw_input('Enter file name: ') if os.path.exists(fname): print"*** ERROR: '%s' already exists" % fname else: break # get file content (text) lines all...
github641/python-journey
summarry read and make text.py
Python
bsd-2-clause
1,404
# This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # 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 # # Unl...
shakamunyi/pybuilder
src/main/python/pybuilder/plugins/python/pytddmon_plugin.py
Python
apache-2.0
1,683
## # # Copyright 2013 Netflix, 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 l...
korrelate/genie
genie-web/src/test/python/utils/eureka.py
Python
apache-2.0
4,342
from .performance import Performance from .junction import * def compare(args): if not args.multiclass: rp = set() rn = set() ref_entries = 0 if not args.labels: rp, ref_entries = Junction.createJuncSet(args.reference[0], use_strand=args.use_strand) else: rp, rn, ref_entries = Junction.createMarked...
maplesond/portcullis
scripts/junctools/junctools/compare.py
Python
gpl-3.0
3,895
''' Copyright (C) 2005-17 www.interpss.org 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...
interpss/DeepMachineLearning
lfGenNPred/py/single_net_mapping/predict_branchp2.py
Python
apache-2.0
3,105
""" Test everything related to contents """ from gabbletest import sync_stream from servicetest import ( make_channel_proxy, assertEquals, EventPattern) import constants as cs from jingletest2 import ( JingleTest2, JingleProtocol015, JingleProtocol031, test_dialects) from twisted.words.xish import xpath def ...
community-ssu/telepathy-gabble
tests/twisted/jingle/test-content-complex.py
Python
lgpl-2.1
10,117
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # create a scene with one of each ...
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Rendering/Core/Testing/Python/pickCells.py
Python
gpl-3.0
16,540
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from collections import defaultdict from datetime import datetime, time from dateutil import relativedelta from itertools import groupby from json import dumps from psycopg2 import OperationalError from o...
rven/odoo
addons/stock/models/stock_orderpoint.py
Python
agpl-3.0
27,180
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-13 05:07 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion import tagging.fields class Migration(migrations.Migration): dependencies = [...
ericchan2012/django-cms
cms/wolf/migrations/0002_auto_20160613_1307.py
Python
gpl-3.0
2,534
from itertools import repeat import numpy as np from tensorflow import keras import sys sys.path.append("../../Lekhaka") import telugu as lang from Lekhaka import Scribe, Deformer, Noiser from Lekhaka import DataGenerator as Gen from lab.model_by_function import build_model from banti2chamanti import banti2chamanti ...
rakeshvar/chamanti_ocr
lab/show_features.py
Python
apache-2.0
1,882
import os import re import time import logging from autotest.client import utils from autotest.client.shared import error from virttest import virsh from virttest import utils_libvirtd from virttest import utils_config from virttest import utils_misc from virttest import utils_libguestfs from virttest.libvirt_xml impor...
will-Do/tp-libvirt_v2v
libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py
Python
gpl-2.0
19,904
# dog http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n02084071 # cat import shutil import requests import uuid import os dog_url="http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n02084071" dog_response=requests.get(dog_url, stream=True) dogs=dog_response.text.split() for url in dogs: r...
wasit7/cs634
2017/cs634_project/image_loader.py
Python
bsd-2-clause
537
#! /usr/bin/env python import sys g = {} n = {} for line in sys.stdin: (n1, n2, p, q, t, tg, x) = line.strip().split(' ') t = int(t) x = float(x) key = ' '.join((n1,n2,p,q)) if not key in n: n[key] = 0 g[key] = 0 n[key] += t g[key] += x*t for key in n: print key, n...
vbeffara/Simulations
tools/massage-box.py
Python
gpl-3.0
341
# 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/edgegateway/azure-mgmt-edgegateway/azure/mgmt/edgegateway/models/trigger_paged.py
Python
mit
919
# Copyright (c) 2016 PyWPS Project Steering Committee # # 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, m...
PyWPS/pywps-4-demo
processes/sleep.py
Python
mit
3,360
# Weights layers from .cauchysimilarity import CauchySimilarity from .dropout import Dropout from .embed import Embed from .expand_window import expand_window from .hashembed import HashEmbed from .layernorm import LayerNorm from .linear import Linear from .lstm import LSTM, PyTorchLSTM from .logistic import Logistic f...
spacy-io/thinc
thinc/layers/__init__.py
Python
mit
3,230
# Standard Library Imports import logging # 3rd Party Imports from twilio.rest import TwilioRestClient # Local Imports from PokeAlarm.Alarms import Alarm from PokeAlarm.Utils import parse_boolean, require_and_remove_key, \ reject_leftover_parameters log = logging.getLogger('Twilio') try_sending = Alarm.try_sendi...
blsmit5728/PokeAlarm
PokeAlarm/Alarms/Twilio/TwilioAlarm.py
Python
agpl-3.0
5,378
from django.db import models from django.utils import timezone import json CHARFIELD_LEN_SMALL=128 CHARFIELD_LEN_LONG = 1024 class CreatedModel(models.Model): #When it was created/modified modified=models.DateTimeField(auto_now=True) created=models.DateTimeField(auto_now_add=True) #Properties of the ...
vdt/ml-service-api
ml_grading/models.py
Python
agpl-3.0
2,344
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "yevent.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
BdEINSALyon/yevent
manage.py
Python
gpl-3.0
804
#!/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...
grundprinzip/Impala
tests/query_test/test_mem_usage_scaling.py
Python
apache-2.0
5,147
import unittest from solution import * class Test_228_Easy(unittest.TestCase): def test_order(self): self.assertEqual(order("billowy"), "IN ORDER") self.assertEqual(order("defaced"), "NOT IN ORDER") self.assertEqual(order("sponged"), "REVERSE ORDER") if __name__ == "__main__": unittest...
marcardioid/DailyProgrammer
solutions/228_Easy/test_solution.py
Python
mit
327
#!/usr/bin/python import gst_player import clock import time import gobject import glob import os import random import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) # some global variables, will be moved elsewhere in the fut...
karlitos/Raspberry-Wake-Up-Light
main.py
Python
mit
2,963
import nose from nose.plugins.attrib import attr import logging import colorguard import os bin_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries')) @attr(speed='slow') def test_cromu_00070_caching(): # Test exploitation of CROMU_00070 given an input which causes a leak. Th...
mechaphish/colorguard
tests/test_cromu70_caching.py
Python
bsd-2-clause
1,245
"""Support for MyQ-Enabled Garage Doors.""" import logging import time from pymyq.const import ( DEVICE_STATE as MYQ_DEVICE_STATE, DEVICE_STATE_ONLINE as MYQ_DEVICE_STATE_ONLINE, DEVICE_TYPE as MYQ_DEVICE_TYPE, DEVICE_TYPE_GATE as MYQ_DEVICE_TYPE_GATE, KNOWN_MODELS, MANUFACTURER, ) import volup...
nkgilley/home-assistant
homeassistant/components/myq/cover.py
Python
apache-2.0
6,868
#!/usr/bin/python # # 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 ag...
GoogleCloudPlatform/datacatalog-connectors
google-datacatalog-connectors-commons/src/google/datacatalog_connectors/commons/cleanup/__init__.py
Python
apache-2.0
708
#!/usr/bin/env python from __future__ import print_function import os import sys import cubit cubit.init([""]) try: from geocubitlib import boundary_definition from geocubitlib import cubit2specfem3d except: import boundary_definition import cubit2specfem3d # two volumes separating 134000x134000x60000 block ...
geodynamics/specfem3d
EXAMPLES/homogeneous_halfspace_HEX8_elastic_no_absorbing/block_mesh-anisotropic.py
Python
gpl-3.0
2,355
# # spyne - Copyright (C) Spyne contributors. # # 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 Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
deevarvar/myLab
baidu_code/soap_mockserver/spyne/model/primitive/geo.py
Python
mit
8,026
import unittest from mox import MoxTestBase, IsA from slimta.relay.smtp.static import StaticSmtpRelay from slimta.relay.smtp.client import SmtpRelayClient class TestStaticSmtpRelay(MoxTestBase, unittest.TestCase): def test_add_client(self): static = StaticSmtpRelay('testhost') ret = static.add_c...
slimta/python-slimta
test/test_slimta_relay_smtp_static.py
Python
mit
713
import sys import unittest from argparse import ArgumentParser from collections import namedtuple from pprint import pprint from unittest.mock import patch from unittest.mock import MagicMock from python_bindings import constants from tests.harness import instrumentGooey from gooey.tests import * class TestGooeyAppl...
chriskiehl/Gooey
gooey/tests/test_application.py
Python
mit
5,268
# -*- coding: utf-8 -*- import os import glob # Import Data Resampling Class from user library from lib.pyoval import CS2RefOrbit from lib.pyoval import CS2OrbitResData from lib.data import read_embird_dat from lib.data import read_OIB from lib.helpers import EmptyObject class PathInfo(): """ Definition of path...
shendric/pyoval
tests_resample_uofa_orbits.py
Python
gpl-3.0
9,128
""" steward_salt client commands """ from pprint import pprint def do_salt(client, tgt, cmd, *args, **kwargs): """ Run a command using salt Parameters ---------- tgt : str The servers to run the command on cmd : str The salt module to run timeout : int, optional Ho...
mathcamp/steward_salt
steward_salt/client.py
Python
mit
3,087
# Copyright 2014 Red Hat 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...
scripnichenko/nova
nova/objects/instance_numa_topology.py
Python
apache-2.0
7,900
# Copyright 2012 Rackspace # 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, softwa...
racker/slogger
elasticsearch/core/models.py
Python
apache-2.0
4,651
# -*- coding: utf-8 -*- ############################################################################### # # MoneyReceived # Retrieves a list of successful charge events. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
jordanemedlock/psychtruths
temboo/core/Library/Stripe/Events/MoneyReceived.py
Python
apache-2.0
5,733
############################################################################### # Copyright (c) Intel Corporation - All rights reserved. # # This file is part of the LIBXSMM library. # # # ...
hfp/libxsmm
documentation/conf.py
Python
bsd-3-clause
1,370
#!/usr/bin/python def message(to, text): print "this is ", to, ":\n", text def add(a, b): return a + b; message('xichen', 'eyu') print add(1,2); def mul(a, b): return a * b; print mul(2, 3); print mul('a', 3); print mul(b=2, a='dd'); print 2 ** 100; print message; func = add; print func(1, 2);
cxsjabc/basic
python/message.py
Python
agpl-3.0
308
# # 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 # ...
jasondunsmore/heat
heat/tests/clients/test_cinder_client.py
Python
apache-2.0
5,085
# -*-python-*- # # Copyright (C) 1999-2013 The ViewCVS Group. All Rights Reserved. # # By using this file, you agree to the terms and conditions set forth in # the LICENSE.html file which can be found at the top level of the ViewVC # distribution or at http://viewvc.org/license-1.html. # # For more information, visit h...
marcellodesales/svnedge-console
svn-server/lib/viewvc/dbi.py
Python
agpl-3.0
2,184
from bucket.local import LocalProvider import config import statestore import logging import os import threading import traceback import messages from send2trash import send2trash from worker import BaseWorker class Download(BaseWorker): def __init__(self, objectStore, outputQueue): BaseWorker.__init__(se...
Sybrand/digital-panda
panda-tray/download.py
Python
mit
12,881
#!/usr/bin/python2 """ A loopback bot example using LibTeletap The following code waits for users to send messages. Upon receiving them, the program will send the same text message back to the sender. In case of group messages, the message is sent to the original sender and to the group. http://...
rohit-h/teletap
examples/loopback.py
Python
gpl-2.0
1,498
#!/usr/bin/env python3 """Example that shows how to easily save a variable number of atoms with a VLArray.""" import numpy as np import tables as tb N = 100 shape = (3, 3) np.random.seed(10) # For reproductible results f = tb.open_file("vlarray4.h5", mode="w") vlarray = f.create_vlarray(f.root, 'vlarray1', ...
avalentino/PyTables
examples/vlarray4.py
Python
bsd-3-clause
626
# -*- coding: utf-8 -*- from module.plugins.internal.DeadHoster import DeadHoster, parseFileInfo class DodanePl(DeadHoster): __name__ = "DodanePl" __type__ = "hoster" __version__ = "0.03" __pattern__ = r'http://(?:www\.)?dodane\.pl/file/\d+' __description__ = """Dodane.pl hoster plugin"""...
sebdelsol/pyload
module/plugins/hoster/DodanePl.py
Python
gpl-3.0
442
import osgtest.library.core as core import osgtest.library.files as files import osgtest.library.osgunittest as osgunittest class TestLcMaps(osgunittest.OSGTestCase): required_rpms = ['lcmaps', 'lcmaps-db-templates', 'vo-client', 'vo-client-lcmaps-voms'] def test_01_configure(self): core.config['lcma...
efajardo/osg-test
osgtest/tests/test_140_lcmaps.py
Python
apache-2.0
1,373
# encoding: utf8 from django.db import models, migrations import oluch.models class Migration(migrations.Migration): dependencies = [ ('oluch', '0014_contest_statement_file'), ] operations = [ migrations.AddField( model_name='contest', name='criteria_file', ...
gurovic/oluch2
oluch/migrations/0015_auto_20140214_2153.py
Python
gpl-2.0
736
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.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 witho...
jeremiedecock/snippets
python/tkinter/python3/file_dialog_open_directory.py
Python
mit
2,048
from django.core.management.base import BaseCommand from django.core.management.base import CommandError from kolibri.core.auth.management.utils import confirm_or_exit from kolibri.core.auth.models import FacilityUser class Command(BaseCommand): help = "To allow administrators to comply with GDPR requests, this ...
learningequality/kolibri
kolibri/core/auth/management/commands/deleteuser.py
Python
mit
2,266
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
Jgarcia-IAS/SAT
openerp/addons-extra/l10n_co_account/__init__.py
Python
agpl-3.0
1,428
#!/usr/bin/env python # -*- coding: utf-8 -*- from core.lib.linkedin.token import Reaction class ReactionCopy(Reaction): def __init__(self, *args, **kwargs): """docstring for __init__""" super(ReactionCopy, self).__init__()
vsilent/smarty-bot
core/brain/update/linkedin/token/reaction.py
Python
mit
247
import struct from .mm.addr import * class Proxy: def __init__(self, obj): self.__obj = obj def __getattr__(self, name): return getattr(self.__obj, name) class String(Proxy): pass class Integer(Proxy): pass class RawDump: instance = None def __init__(self, file): f = ...
byeoksan/MemScope
memscope/volatilitux_android_x86/core/raw_dump.py
Python
gpl-2.0
1,914
import theano.tensor as tt from theano import function
Delosari/dazer
bin/lib/Math_Libraries/functions_for_theano.py
Python
mit
55
from django.shortcuts import render # Create your views here. def about(request): return render(request, 'sitepages/about.html')
bestafubana/blogn
blogn/blogn/sitepages/views.py
Python
gpl-3.0
133
artist_answer = input("Search for an artist") import requests response = requests.get('https://api.spotify.com/v1/search?q='+artist_answer+'&type=artist&market=US&limit=50') #https://api.spotify.com/v1/search?type=artist artist = response.json() #print(artist.keys()) #print(artist['artists'].keys()) #print(type(artist...
mercybenzaquen/foundations-homework
foundations_hw/benzaquen_search_engine.py
Python
mit
1,470
from google.appengine.ext import ndb from google.appengine.api import memcache from google.appengine.api import urlfetch import urllib import logging import json #db table for pattern class DbNews(ndb.Model): pair = ndb.StringProperty() pr = ndb.StringProperty() alexa = ndb.StringProperty() positive = ndb.Int...
alibaba0507/fx-monitor
News.py
Python
gpl-2.0
1,355
# # Adapted from https://github.com/petewarden/pyparallelcurl/blob/master/pyparallelcurl.py # # This class is designed to make it easy to run multiple curl requests in parallel, rather than # waiting for each one to finish before starting the next. Under the hood it uses curl_multi_exec # but since I find that interfa...
zynga/zperfmon
server/db_cron/parallelcurl.py
Python
apache-2.0
7,312
BROKER_URL = 'amqp://couchbase:couchbase@172.23.97.73:5672/broker' BROKER_POOL_LIMIT = None CELERY_RESULT_BACKEND = 'amqp' CELERY_RESULT_EXCHANGE = 'perf_results' CELERY_RESULT_PERSISTENT = False CELERYD_HIJACK_ROOT_LOGGER = False
pavel-paulau/perfrunner
perfrunner/celeryremote.py
Python
apache-2.0
231
# # A script to find functional loci in cancer genes, using # reconstructed ancestors of kinase genes and a library # of mutations obeserved in many real cancer strains. # # Victor Hanson-Smith # 2014 # victorhansonsmith@gmail.com # import os, sys, re from argParser import * ap = ArgParser(sys.argv) msa_path = "../2...
vhsvhs/ratflic
runme.py
Python
gpl-2.0
15,185
""" The legend module defines the Legend class, which is responsible for drawing legends associated with axes and/or figures. The Legend class can be considered as a container of legend handles and legend texts. Creation of corresponding legend handles from the plot elements in the axes or figures (e.g., lines, patche...
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/lib/matplotlib/legend.py
Python
mit
37,156
import os import logging import report import problem import problem.config class DBusProxy(object): __instance = None def __init__(self, dbus): self._proxy = None self._iface = None self.dbus = dbus self.connected = False self.connect() def __new__(cls, *args, *...
airtimemedia/abrt
src/python-problem/problem/proxies.py
Python
gpl-2.0
6,562
from snakebite.client import Client client = Client('localhost', 9000) for f in client.copyToLocal(['/input/input.txt'], '/tmp'): print f
MinerKasch/HadoopWithPython
python/HDFS/copy_to_local.py
Python
mit
141
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/networks/subnets/set_iam_policy.py
Python
mit
1,265
import cs50 def main(): # Get inputs from user print("Key: ", end="") key = str.upper(cs50.get_string()) print("Text: ", end="") text = str.upper(cs50.get_string()) # Initialise cipher variable cipher = "" for i in text: if i.isalpha() == True: c = ord(i) +...
Caleb-Ellis/CS50
pset6/vigenere.py
Python
mit
556
from __future__ import print_function, division import warnings def flip_sublat(opstr,indx,lat=0): sign = 1 opstr = [str(s) for s in opstr] for s,i,j in zip(opstr,indx,range(len(indx))): if ((i % 2) == (lat % 2)): if (s in ['z','y']): sign *= -1 elif (s == "+"): opstr[j] = '-' elif (s == "-"...
weinbe58/QuSpin
quspin/basis/basis_1d/_check_1d_symm.py
Python
bsd-3-clause
3,277
# -*- coding: utf-8 -*- """ Created on Mon Feb 8 15:10:34 2016 Script to plot the results of RoBoCoP and RockyCoastCRN Martin Hurst, March 7th 2016 @author: mhurst """ #import modules import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt from matplotlib import cm from matplotlib import rc # Cus...
mdhurst1/RoBoCoP_CRN
plotting_functions/plot_kaikoura_animation.py
Python
gpl-3.0
2,926
__author__ = 'Eden Thiago Ferreira' import cProfile as cp import pstats as pst from collections import OrderedDict from grafos import * from banco_dados import * from caminhos_minimos import * class Coletor: def __init__(self,grafo,nome_mapa=None,path_grafos=None): """se path_grafo é None ele gera o grafo...
edenferreira/Grafo-e-Caminhos-Minimos
coletar_dados.py
Python
bsd-2-clause
3,475
""" Base class for UserStore """ from abc import ABC, abstractmethod import traceback from logging import getLogger from datetime import datetime from pytz import timezone as tz from ..serializer import dumps, loads from ..models import User class UserStore(ABC): """ Base class for UserStore to read/write us...
uezo/minette-python
minette/datastore/userstore.py
Python
apache-2.0
4,577
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
ballouche/navitia
source/tyr/tyr/helper.py
Python
agpl-3.0
6,649
# Rewritten by RayzoR import sys from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest qn = "140_ShadowFoxPart2" # NPCs KLUCK = 30895 XENOVIA = 30912 # ITEMs CRYSTAL = 10347 OXYDE ...
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/140_ShadowFoxPart2/__init__.py
Python
gpl-3.0
4,120
""" Etymology plugin Authors: - GhettoWizard - Scaevolus - linuxdaemon <linuxdaemon@snoonet.org> """ import re import requests from bs4 import BeautifulSoup from requests import HTTPError from cloudbot import hook @hook.command("e", "etymology") def etymology(text, reply): """<word> - retrieves the...
valesi/CloudBot
plugins/etymology.py
Python
gpl-3.0
1,175
#!/usr/bin/python # (c) 2018-2019, NetApp, 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', 'status': ['preview'], ...
thaim/ansible
lib/ansible/modules/storage/netapp/na_ontap_vscan_scanner_pool.py
Python
mit
9,108
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2017-01-24 03:41 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('product', '0004_overview_slideproduct_techspec'), ] ...
skylifewww/pangolin-fog
product/migrations/0005_auto_20170124_0341.py
Python
mit
741
# 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...
alshedivat/tensorflow
tensorflow/python/keras/layers/recurrent.py
Python
apache-2.0
100,102