text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
import math import sys import re valuePattern = re.compile('= (.+)$') def extractValue(line): match = re.search(valuePattern, line) if match: return float.fromhex(match.group(1)) else: return "ERROR" intervalPattern = re.compile('= \[(.*?), (.*?)\]') def extractInterval(line): match = re.search(interv...
jacekburys/csmith
programs/validate.py
Python
bsd-2-clause
1,157
0.025929
# create a Session object by sessionmaker import os import ConfigParser import sqlalchemy.orm # get path to taskmanager. it is assumed that this script is in the lib directory of # the taskmanager package. tmpath = os.path.normpath( os.path.join( os.path.dirname( os.path.realpath(__file__) ) + '/..' ) ) etcpath =...
call-me-jimi/taskmanager
taskmanager/lib/hDBSessionMaker.py
Python
gpl-2.0
4,630
0.019654
#!/usr/bin/env python # coding:utf-8 import errno import socket import ssl import urlparse import OpenSSL NetWorkIOError = (socket.error, ssl.SSLError, OpenSSL.SSL.Error, OSError) from proxy import xlog import simple_http_client import simple_http_server from cert_util import CertUtil from config import config imp...
hexlism/xx_net
gae_proxy/local/proxy_handler.py
Python
bsd-2-clause
14,990
0.002935
def func(bar): """ \\some comment @param bar: The parameter value. @type bar: Its type.""" pass
dahlstrom-g/intellij-community
python/testData/refactoring/rename/epydocRenameParameter_after.py
Python
apache-2.0
120
0
# Copyright 2018 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...
kevin-coder/tensorflow-fork
tensorflow/python/autograph/operators/control_flow.py
Python
apache-2.0
14,926
0.007571
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Bien', fields=[ ('id', models.AutoField(verbose...
lanacioncom/ddjj_admin_lanacion
admin_ddjj_app/migrations/0001_initial.py
Python
mit
15,375
0.003187
import os import json import urllib import socket import subprocess as sub import string import sys MPCONF = "/etc/magicpool.conf" MPURL = "https://magicpool.org/main/download_config/${U}/${W}/${G}" SGCONF = "/home/crypto/.sgminer/sgminer.conf" def niceprint(data): return json.dumps(data,sort_keys=True,indent=4, se...
p4u/magicOS
files/home/crypto/mp-agent.py
Python
gpl-3.0
2,955
0.045685
""" RUN RUN RUN ! """ from buttersalt import create_app from flask_script import Manager, Shell app = create_app('default') manager = Manager(app) def make_shell_context(): return dict(app=app) manager.add_command("shell", Shell(make_context=make_shell_context)) @manager.command def test(): """Run the u...
lfzyx/ButterSalt
manage.py
Python
mit
505
0
#!/usr/bin/env python3 # Copyright Istio 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 agr...
istio/tools
perf/load/auto-mtls/scale.py
Python
apache-2.0
4,271
0.000937
from sklearn.feature_extraction.text import TfidfVectorizer import xgboost as xgb import cPickle as pickle from string import punctuation from nltk import word_tokenize from nltk.stem import snowball import numpy as np import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style...
mgupta011235/TweetSafe
tfidf/train_xgboost.py
Python
gpl-3.0
7,095
0.00902
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
SKIRT/PTS
core/prep/sphconvert.py
Python
agpl-3.0
6,914
0.019818
from OpenGLCffi.GLES1 import params @params(api='gles1', prms=['target', 'numAttachments', 'attachments']) def glDiscardFramebufferEXT(target, numAttachments, attachments): pass
cydenix/OpenGLCffi
OpenGLCffi/GLES1/EXT/EXT/discard_framebuffer.py
Python
mit
181
0.016575
""" :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ import pytest from tests.helpers import login_user def test_view_for_brand(jobs_admin_client): url = '/admin/jobs/' response = jobs_admin_client.get(url) assert response.status_code == 200 @pytest...
homeworkprod/byceps
tests/integration/blueprints/admin/jobs/test_views.py
Python
bsd-3-clause
693
0
DEPS = [ 'chromium', 'chromium_android', 'gsutil', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', ]
eunchong/build
scripts/slave/recipe_modules/cronet/__init__.py
Python
bsd-3-clause
187
0
from core_tests_base import CoreTestsBase, FakeTessagon, FakeTileSubClass class TestTile(CoreTestsBase): # Note: these tests are highly dependent on the behavior of # FakeTessagon and FakeAdaptor def test_add_vert(self): tessagon = FakeTessagon() tile = FakeTileSubClass(tessagon, u_rang...
cwant/tessagon
tests/core/test_tile.py
Python
apache-2.0
2,833
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #-------------------------------------------------------------------------------------------------- # Program Name: Lychee # Program Description: MEI document manager for formalized document control # # Filename: lychee/__init__.py # Purpose: ...
nCoda/lychee
lychee/__init__.py
Python
gpl-3.0
1,444
0.00277
import unittest from artifice.models import usage, tenants, resources, Session from sqlalchemy import create_engine from sqlalchemy.exc import IntegrityError, InvalidRequestError from sqlalchemy.orm.exc import FlushError import os from artifice.models.usage import Usage from artifice.models.tenants import Tenant from ...
aurynn/openstack-artifice
tests/test_models.py
Python
apache-2.0
6,823
0.003957
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
EmadMokhtar/Django
tests/model_fields/models.py
Python
mit
12,373
0.000162
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from petl.compat import next, string_types from petl.util.base import iterpeek, ValuesView, Table from petl.util.materialise import columns def infer_dtype(table): import numpy as np # get numpy to infer dtype it = ...
Marketing1by1/petl
petl/io/numpy.py
Python
mit
5,251
0.00019
# -*- coding: utf-8 -*- from nose.tools import ( eq_, raises, ) from py3oauth2.utils import ( normalize_netloc, normalize_path, normalize_query, normalize_url, ) def test_normalize_url(): eq_(normalize_url('http://a/b/c/%7Bfoo%7D'), normalize_url('hTTP://a/./b/../b/%63/%7bfoo%7d')...
GehirnInc/py3oauth2
py3oauth2/tests/test_utils.py
Python
mit
1,798
0
import os from PyQt4 import QtCore, QtGui from Extensions.Global import sizeformat class SearchWidget(QtGui.QLabel): def __init__(self, parent): QtGui.QLabel.__init__(self, parent) self._parent = parent self.setStyleSheet("""background: rgba(0, 0, 0, 50); border-radius: 0...
fortharris/RedCenter
Extensions/VaultManager.py
Python
gpl-3.0
6,621
0.005588
# -*- coding: utf-8 -*- """ This is part of HashBruteStation software Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station License: MIT Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Integration tests f...
hack4sec/hbs-cli
tests/integration/test_HashlistsByAlgLoaderThread.py
Python
mit
8,236
0.004492
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Weapon() result.template = "object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_s1_gen2.iff"...
anhstudios/swganh
data/scripts/templates/object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_s1_gen2.py
Python
mit
500
0.044
############################################################################### # # Copyright (c) 2007, 2008 OpenHex SPRL. (http://openhex.com) All Rights # Reserved. # # 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 ...
jakogut/python-relatorio
relatorio/templates/base.py
Python
gpl-3.0
1,717
0.000582
from gerencianet import Gerencianet from credentials import CREDENTIALS gn = Gerencianet(CREDENTIALS) params = { 'txid': '' } body = { 'calendario': { 'expiracao': 3600 }, 'devedor': { 'cpf': '', 'nome': '' }, 'valor': { 'original': '0.50' }, 'chave': '...
gerencianet/gn-api-sdk-python
examples/pix_create_charge.py
Python
mit
463
0.004338
from alphatwirl.selection.factories.AllFactory import AllFactory from alphatwirl.selection.modules.basic import All from alphatwirl.selection.modules.basic import Any from alphatwirl.selection.modules.LambdaStr import LambdaStr import unittest ##__________________________________________________________________|| clas...
TaiSakuma/AlphaTwirl
tests/unit/selection/factories/test_AllFactory.py
Python
bsd-3-clause
685
0.020438
# This file is part of FiberModes. # # FiberModes 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. # # FiberModes is distributed in the ...
cbrunet/fibermodes
fibermodes/slrc.py
Python
gpl-3.0
9,544
0.000105
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Princessgladys/googleresourcefinder
app/bubble_test.py
Python
apache-2.0
5,468
0.000549
# # 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...
DinoCow/airflow
tests/providers/amazon/aws/hooks/test_kinesis.py
Python
apache-2.0
2,545
0.001572
from myhdl import always, always_seq, block, delay, enum, instance, intbv, ResetSignal, Signal, StopSimulation @block def uart_tx(tx_bit, tx_valid, tx_byte, tx_clk, tx_rst): index = Signal(intbv(0, min=0, max=8)) st = enum('IDLE', 'START', 'DATA') state = Signal(st.IDLE) @always(tx_clk.posedg...
josyb/myhdl
example/uart_tx/uart_tx.py
Python
lgpl-2.1
2,870
0.009408
import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='poloniex', version=...
absortium/poloniex-api
setup.py
Python
mit
909
0
########################################################################## # # Copyright (c) 2013-2014, John Haddon. 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 ...
lucienfostier/gaffer
python/GafferOSLUI/OSLImageUI.py
Python
bsd-3-clause
9,411
0.040697
class Zone: def __init__(self, id_zone, name, region, description): self.id = id_zone self.name = name self.region = region self.description = description
Crystal-SDS/dashboard
crystal_dashboard/dashboards/crystal/zones/models.py
Python
gpl-3.0
192
0
#!/usr/bin/env python # Copyright 2018 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. import glob import os import shutil import subprocess import sys netlog_viewer_root_path = os.path.abspath( os.path.join(os.pa...
endlessm/chromium-browser
third_party/catapult/netlog_viewer/netlog_viewer_build/build_for_appengine.py
Python
bsd-3-clause
1,450
0.004138
# Copyright (C) 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...
petrutlucian94/nova
nova/objects/dns_domain.py
Python
apache-2.0
2,520
0
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def increasingBST(self, root: TreeNode) -> TreeNode: def dfs(node): if not node.left and not node.right: return node ...
zuun77/givemegoogletshirts
leetcode/python/897_increasing-order-search-tree2.py
Python
apache-2.0
796
0.003769
#! /usr/bin/env python # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 4233 $ # Date: $Date: 2005-12-29 00:48:48 +0100 (Thu, 29 Dec 2005) $ # Copyright: This module has been placed in the public domain. """ Tests for docutils.transforms.references.Substitutions. """ from __ini...
alon/polinax
libs/external_libs/docutils-0.4/test/test_transforms/test_substitutions.py
Python
gpl-2.0
9,979
0.004109
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin from django.conf.urls.i18n import i18n_patterns admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'votainteligente.views.home', name='home'), ...
lfalvarez/nouabook
votainteligente/urls.py
Python
gpl-3.0
1,050
0.013333
''' Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. Note: You may...
wufangjie/leetcode
011. Container With Most Water.py
Python
gpl-3.0
2,524
0.001981
import os import discord import requests from utils import functions description = "Show bot log" perm = 2 async def ex(message, client): if not os.path.isfile("screenlog.0"): await client.send_message(message.channel, embed=discord.Embed(colour=discord.Color.red(), ...
zekroTJA/regiusBot
commands/cmd_log.py
Python
mit
1,480
0.004054
#!/usr/bin/env python3 import calendar if __name__ == "__main__": for num in range(1, 13): month = calendar.month_name[num] print(f"{num:02} - {month}")
ammongit/scripts
print-months.py
Python
mit
175
0
import theano import numpy as np from sklearn.preprocessing import OneHotEncoder from sklearn import cross_validation, metrics, datasets from neupy import algorithms, layers, environment environment.reproducible() theano.config.floatX = 'float32' mnist = datasets.fetch_mldata('MNIST original') target_scaler = OneHo...
stczhc/neupy
examples/gd/mnist_mlp.py
Python
mit
1,266
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 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/LICENSE-2.0 # # Unle...
dsiddharth/access-keys
keystone/contrib/oauth1/__init__.py
Python
apache-2.0
690
0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.utils.iers package provides access to the tables provided by the International Earth Rotation and Reference Systems Service, in particular allowing interpolation of published UT1-UTC values for given times. These are used in `astropy.time`...
larrybradley/astropy
astropy/utils/iers/iers.py
Python
bsd-3-clause
46,942
0.000639
#!/usr/bin/env python # coding: utf-8 # Copyright (C) USC Information Sciences Institute # Author: Vladimir M. Zaytsev <zaytsev@usc.edu> # URL: <http://nlg.isi.edu/> # For more information, see README.md # For license information, see LICENSE import logging from mokujin.logicalform import POS from mokujin.index imp...
zaycev/mokujin
mokujin/sourcesearch.py
Python
apache-2.0
9,946
0.001609
# Copyright (c) 2012 Intel # Copyright (c) 2012 OpenStack, LLC. # Copyright (c) 2015 EMC Corporation # # 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 # # ...
weiting-chen/manila
manila/scheduler/filters/capacity_filter.py
Python
apache-2.0
5,433
0
""" altgraph.ObjectGraph - Graph of objects with an identifier ========================================================== A graph of objects that have a "graphident" attribute. graphident is the key for the object in the graph """ from __future__ import print_function from __future__ import absolute_import from altgr...
catapult-project/catapult
telemetry/third_party/altgraph/altgraph/ObjectGraph.py
Python
bsd-3-clause
6,431
0.000622
"""Base test suite for extension arrays. These tests are intended for third-party libraries to subclass to validate that their extension arrays and dtypes satisfy the interface. Moving or renaming the tests should not be done lightly. Libraries are expected to implement a few pytest fixtures to provide data for the t...
harisbal/pandas
pandas/tests/extension/base/__init__.py
Python
bsd-3-clause
2,015
0
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 BarraDev Consulting (<http://www.barradev.com>). # # This program is free software: you can redistribute it and/or modify # it ...
shingonoide/odoo_ezdoo
addons/http_session_redis/__init__.py
Python
agpl-3.0
1,038
0.000963
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apach...
394954369/horizon
openstack_dashboard/api/cinder.py
Python
apache-2.0
13,116
0
# 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...
derekjchow/models
research/object_detection/builders/model_builder.py
Python
apache-2.0
23,976
0.005172
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
rnirmal/openstack-dashboard
django-openstack/django_openstack/middleware/keystone.py
Python
apache-2.0
2,747
0.000364
# -*- encoding: utf-8 -*- import time import logging from openerp import tools from dateutil.relativedelta import relativedelta from datetime import datetime, timedelta from openerp.tools.translate import _ from openerp.osv import fields,osv import json import hashlib from openerp.addons.ebiz_cn.top import setDefaultA...
vnsofthe/odoo-dev
addons/ebiz_cn/ebiz.py
Python
agpl-3.0
45,688
0.013284
"""JSON implementation of pystorm serializer""" from __future__ import absolute_import, print_function, unicode_literals import io import logging import simplejson as json from six import PY2 from ..exceptions import StormWentAwayError from .serializer import Serializer log = logging.getLogger(__name__) class J...
pystorm/pystorm
pystorm/serializers/json_serializer.py
Python
apache-2.0
3,417
0.000585
import tempfile import shutil import sys from unittest import mock import pytest from tools.wpt import run from tools import localpaths # noqa: F401 from wptrunner.browsers import product_list @pytest.fixture(scope="module") def venv(): from tools.wpt import virtualenv class Virtualenv(virtualenv.Virtuale...
CYBAI/servo
tests/wpt/web-platform-tests/tools/wpt/tests/test_run.py
Python
mpl-2.0
1,969
0
import logging import sqlite3 from pyfcm import FCMNotification def insert_token(token): try: con = sqlite3.connect('fcm.db') cur = con.cursor() cur.execute('CREATE TABLE IF NOT EXISTS tokens(token TEXT)') cur.execute('INSERT INTO tokens VALUES (?)', (token, )) con.commi...
walkover/auto-tracking-cctv-gateway
gateway/firebase/fcm.py
Python
mit
1,072
0.000933
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: David Coninckx <david@coninckx.com> # # The licence is in the file __ope...
emgirardin/compassion-modules
sponsorship_tracking/models/__init__.py
Python
agpl-3.0
501
0
# Copyright 2013,2014 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Dunya # # Dunya 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 (FSF), either version 3 of the License, or...
MTG/dunya
andalusian/api_urls.py
Python
agpl-3.0
3,931
0.008395
import _plotly_utils.basevalidators class FontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="font", parent_name="box.hoverlabel", **kwargs): super(FontValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/box/hoverlabel/_font.py
Python
mit
1,855
0.000539
'''OpenGL extension OES.read_format This module customises the behaviour of the OpenGL.raw.GLES1.OES.read_format to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/OES/read_format.txt ''' from OpenGL import platform, constant, arra...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/GLES1/OES/read_format.py
Python
lgpl-3.0
750
0.009333
import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) from . import * # Signals from .signal import (Signal, EpicsSignal, EpicsSignalRO, DerivedSignal) # Positioners from .positioner import (PositionerBase, SoftPositioner) from .epics_motor import EpicsMotor from .pv_position...
dchabot/ophyd
ophyd/__init__.py
Python
bsd-3-clause
946
0.014799
import pygame from pygame.locals import * # pour les constantes touches... from constantes import * from fichiers import * from general import * from aide import * def edit(screen, levelNumber ,mode, lang, langu, levelFinal): motionX = 0 motionY = 0 alsoMario = 0 carte = [[int for lgn in range(NB_BLO...
litzler/marioSokoBan
edit.py
Python
gpl-3.0
8,847
0.006107
# -*- coding: utf-8 -*- from distutils.core import setup setup( name='popy', description='Parser for GNU Po files', long_description=open('README.rst').read(), version='0.3.0', packages=['popy'], author='Murat Aydos', author_email='murataydos@yandex.com', url='https://github.com/muratay...
murataydos/popy
setup.py
Python
gpl-2.0
402
0
#!/usr/bin/env python import jumeg import os.path raw_fname = "109925_CAU01A_100715_0842_2_c,rfDC-raw.fif" if not os.path.isfile(raw_fname): print "Please find the test file at the below location on the meg_store2 network drive - \ cp /data/meg_store2/fif_data/jumeg_test_data/109925_CAU01A_100715_0842_...
fboers/jumegX
jumeg_test.py
Python
bsd-3-clause
1,802
0.008324
from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView from .mixins import GenerateActionMixin class DetailViewWithActionStream(GenerateActionMixin, DetailView): def dispatch(self, request, *args, **kwargs): if not self.request.user.is_anonymous...
JoshStegmaier/django-nimbus
nimbus/views/generic.py
Python
mit
1,761
0.003407
import random import uuid from math import gcd import numpy as np from ._population import Population from pychemia import Composition, Structure, pcm_log from pychemia.analysis import StructureAnalysis, StructureChanger, StructureMatch from pychemia.analysis.splitting import SplitMatch from pychemia.utils.mathematics ...
MaterialsDiscovery/PyChemia
pychemia/population/relaxstructures.py
Python
mit
19,699
0.002944
#!/usr/bin/python # openvpn.py: library to handle starting and stopping openvpn instances import subprocess import threading import time class OpenVPN(): def __init__(self, config_file=None, auth_file=None, timeout=10): self.started = False self.stopped = False self.error = False ...
ben-jones/centinel
centinel/vpn/openvpn.py
Python
mit
2,675
0
#!/usr/bin/python from __future__ import absolute_import from __future__ import print_function import sys if len(sys.argv) != 3: sys.stderr.write("Usage: %s 'Host Name' 'Service Description'\n" % (sys.argv[0])) sys.exit(2) ## This is for the custom nagios module sys.path.insert(1, '../') from pynag.Parsers ...
pynag/pynag
examples/Parsers/get_service_info.py
Python
gpl-2.0
495
0.010101
# # Copyright (C) 2012-2014, Quarkslab. # # This file is part of qb-sync. # # qb-sync 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. ...
nihilus/qb-sync
ext_gdb/sync.py
Python
gpl-3.0
16,046
0.002306
import time def start(): return time.time()
Kyziridis/recommender_system
helpers/Time.py
Python
gpl-3.0
51
0.019608
# Copyright 2012 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 ...
atljohnsen/adlcoursebuilder
modules/review/stats.py
Python
apache-2.0
5,775
0.000173
# This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE from numpy import * import datetime import numpy as np from functools import reduce arcsecperrad = 3600. * 180. / np.pi axistilt = 23.44 # degrees def ra_normalize(ra): return np.mod(ra, 360.) def ra_rang...
olebole/astrometry.net
util/starutil_numpy.py
Python
bsd-3-clause
18,610
0.010586
""" A "mirroring" ``stdout`` context manager. While active, the context manager reverses text output to ``stdout``:: # BEGIN MIRROR_GEN_DEMO_1 >>> from mirror_gen import looking_glass >>> with looking_glass() as what: # <1> ... print('Alice, Kitty and Snowdrop') ... print(what) ...
YuxuanLing/trunk
trunk/code/study/python/Fluent-Python-example-code/15-context-mngr/mirror_gen.py
Python
gpl-3.0
1,453
0
import numpy as np import pytest from pandas._libs.tslib import iNaT from pandas.core.dtypes.dtypes import PeriodDtype import pandas as pd from pandas.core.arrays import PeriodArray from pandas.tests.extension import base @pytest.fixture def dtype(): return PeriodDtype(freq='D') @pytest.fixture def data(dtyp...
GuessWhoSamFoo/pandas
pandas/tests/extension/test_period.py
Python
bsd-3-clause
4,336
0
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
srajag/nova
nova/tests/integrated/v3/test_evacuate.py
Python
apache-2.0
3,892
0.002569
#!/usr/bin/python2.7 # # This file is part of drizzle-ci # # Copyright (c) 2013 Sharan Kumar M # # drizzle-ci 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 ...
pcrews/drizzle-ci-salt
test-install.py
Python
gpl-3.0
3,724
0.005908
import curses import functools from stem.control import EventType, Controller from stem.util import str_tools # colors that curses can handle COLOR_LIST = { "red": curses.COLOR_RED, "green": curses.COLOR_GREEN, "yellow": curses.COLOR_YELLOW, "blue": curses.COLOR_BLUE, "cyan": curses.COLOR_CYAN, "magenta"...
tparks5/tor-stem
docs/_static/example/event_listening.py
Python
lgpl-3.0
5,286
0.015513
#/u/GoldenSights import praw import time import datetime import sqlite3 '''USER CONFIGURATION''' APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/ USERAGENT = "" #This is a short description of what the bot does. For example "/u/GoldenS...
TacticalGoat/reddit
FlairTimer/flairtimer.py
Python
mit
3,977
0.026402
#!/usr/bin/env python # -*- coding: ascii -*- r""" LazGUI helps to create Lazarus Pascal GUI project. LazGUI will place all of the required files for the Lazarus project into a subdirectory by project name. The project can be built using "lazbuild" that comes with a Lazarus install, or by opening the <project_name>....
sonofeft/LazGUI
lazgui/laz_gui.py
Python
gpl-3.0
8,605
0.020686
# -*- coding: utf-8 -*- import re from pyload.plugin.Account import Account class StahnuTo(Account): __name = "StahnuTo" __type = "account" __version = "0.05" __description = """StahnuTo account plugin""" __license = "GPLv3" __authors = [("zoidberg", "zoidberg@mujmail.cz")] ...
ardi69/pyload-0.4.10
pyload/plugin/account/StahnuTo.py
Python
gpl-3.0
991
0.008073
# 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, ...
google-research/lag
libml/train_sr.py
Python
apache-2.0
5,712
0.002276
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Simple agent which chooses a random label. Chooses from the label candidates if they are available. If candidates ar...
facebookresearch/ParlAI
parlai/agents/random_candidate/random_candidate.py
Python
mit
2,698
0
from django.shortcuts import render from django.shortcuts import render_to_response from django.template import RequestContext from django.shortcuts import redirect from main.models import Link from main.models import Tag # Create your views here. def index(request): context = RequestContext(request) ...
cntnboys/410Lab6
bookmarks/main/views.py
Python
apache-2.0
1,325
0.020377
""" Written by Harry Liu (yliu17) and Tyler Nickerson (tjnickerson) """ import sys import os.path import pprint from classes.bag import Bag from classes.item import Item from classes.constraint import Constraint from classes.csp import CSP from classes.solver import Solver def main(): # Read command line argument...
WPI-CS4341/CSP
main.py
Python
mit
5,541
0.002888
#!/usr/bin/env python """Dump instances for bunny, in Promela and SlugsIn.""" import argparse import itertools import pprint import logging import re from tugs import utils log = logging.getLogger(__name__) INPUT_FILE = 'bunny.pml' PROMELA_PATH = 'pml/bunny_many_goals_{i}.txt' SLUGSIN_PATH = 'slugsin/bunny_many_goals...
johnyf/gr1experiments
examples/bunny_many_goals/make_instances.py
Python
bsd-3-clause
2,595
0
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description':'End to end solution for bitcoin data gathering, backtesting, and live trading', 'author': 'ross palmer', 'url':'http://rosspalmer.github.io/bitQuant/', 'license':'MIT', 'version': '0.2.10', 'install...
multidis/bitQuant02
setup.py
Python
mit
464
0.043103
# -*- encoding: utf-8 -*- import os import subprocess def graph( expr, image_format='pdf', layout='dot', graph_attributes=None, node_attributes=None, edge_attributes=None, **kwargs ): r'''Graphs `expr` with graphviz and opens resulting image in the default image viewer. ::...
mscuthbert/abjad
abjad/tools/topleveltools/graph.py
Python
gpl-3.0
2,398
0.000834
"""NDG XACML ElementTree based reader for subject match type NERC DataGrid """ __author__ = "P J Kershaw" __date__ = "16/03/10" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __contact__ = "Philip.Kershaw@stfc.ac.uk" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Phi...
cedadev/ndg_xacml
ndg/xacml/parsers/etree/subjectmatchreader.py
Python
bsd-3-clause
979
0.003064
# 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 use ...
Kami/libcloud
libcloud/test/dns/test_auroradns.py
Python
apache-2.0
13,377
0.00015
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.utils import translation import pytest from shoop.front.apps.si...
jorge-marques/shoop
shoop_tests/front/test_simple_search.py
Python
agpl-3.0
1,843
0.00217
import sys import numpy import math from foldyFloatList import foldyFloatList class OOBError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) from KMCLib.PluginInterfaces.KMCAnalysisPlugin import KMCAnalysisPlugin from KMCLib.Utilities.CheckU...
joshuahellier/PhDStuff
codes/thesisCodes/kmc/customAnalysis/DensHist.py
Python
mit
2,799
0.005359
#!/usr/bin/python ######################################################################## # Copyright (c) 2017 # Daniel Plohmann <daniel.plohmann<at>mailbox<dot>org> # All rights reserved. ######################################################################## # # This file is part of apiscout # # apiscout...
danielplohmann/apiscout
apiscout/db_builder/DatabaseBuilder.py
Python
bsd-2-clause
11,496
0.003392
import unittest import transaction from pyramid import testing from .models import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') from .models i...
XertroV/nvbclient
nvbclient/tests.py
Python
mit
1,501
0.000666
import pytest import re from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.core.urlresolvers import reverse from shuup.core.models import SavedAddress from shuup.core.models import get_person_contact from shuup.core.models._contacts import get_company_contact from shu...
suutari/shoop
shuup_tests/front/test_addressbook.py
Python
agpl-3.0
6,230
0.001605
format_testing_audio = "audio_pipeline\\test\\test_files\\audio\\tag_test_files" write_testing_audio = "audio_pipeline\\test\\test_files\\audio\\write_test_files" release_mbids = "audio_pipeline/test/test_files/test_mbids/release_mbids.json" artist_mbids = "audio_pipeline/test/test_files/test_mbids/artist_mbids.json" m...
hidat/audio_pipeline
audio_pipeline/test/References.py
Python
mit
3,286
0.018564
import numpy as np import pandas as pd from ElectionsTools.Seats_assignation import DHondt_assignation from previous_elections_spain_parser import * import os pathfiles = '../data/spain_previous_elections_results/provincia/' pathfiles = '/'.join(os.path.realpath(__file__).split('/')[:-1]+[pathfiles]) fles = [pathfil...
tgquintela/ElectionsTools
ElectionsTools/cases/previous_elections_spain_analysis.py
Python
mit
2,527
0.004353
#!/usr/bin/env python3 # this copies over all files in admin0:~/stripe/ to the ~/stripe folder in the statistics project import sys import os sys.path.insert(0, os.path.expanduser("~/bin/")) os.chdir(os.path.join(os.environ['SMC_ROOT'], "smc-build/smc-ansible")) # host of statistics project from smc_rethinkdb import p...
timothyclemansinsea/smc
src/smc-build/smc-ansible/export-stripe-to-marketing-project.py
Python
gpl-3.0
667
0.005997
# Functions and Variables def cheese_and_crackers(cheese_count, boxes_of_crackers): print "You have %d cheeses!" % cheese_count print "You have %d boxes of crackers!" % boxes_of_crackers print "Man that's enough for a party!" print "Get a blanket.\n" print "We can just give the function numbers direct...
myisabella/LearnPythonTheHardWay
ex19.py
Python
mit
712
0.002809
import unittest from katas.beta.number_to_bytes import to_bytes class NumberToBytesTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(to_bytes(0), ['00000000']) def test_equals_2(self): self.assertEqual(to_bytes(1), ['00000001']) def test_equals_3(self): self.a...
the-zebulan/CodeWars
tests/beta_tests/test_number_to_bytes.py
Python
mit
827
0
# -*- coding: utf-8 -*- from app import create_app forms_app = create_app()
OVERLOADROBOTICA/OVERLOADROBOTICA.github.io
mail/formspree-master/formspree/__init__.py
Python
mit
77
0