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 graph import dot from core import * import dataflow def make_inst(g, addr, dest, op, *args): def make_arg(a): if a is None: return None if isinstance(a, int): return VALUE(a) if isinstance(a, str): return REG(a) return a b = BBlock(add...
pfalcon/ScratchABlock
tests_unit/test_liveness.py
Python
gpl-3.0
2,105
0.003325
from ecgmeasure import ECGMeasure import pandas as pd import numpy as np # need to test what happens when have too little data to create a chunk # need to throw an exception if have too little data def get_raw_data(): """.. function :: get_raw_data() Creates dataframe with raw data. """ times = [x*0....
raspearsy/bme590hrm
test_hr.py
Python
mit
2,111
0.000947
from django.db import models from versatileimagefield.fields import VersatileImageField from versatileimagefield.placeholder import OnStoragePlaceholderImage class VersatileImagePostProcessorTestModel(models.Model): """A model for testing VersatileImageFields.""" image = VersatileImageField( upload_...
respondcreate/django-versatileimagefield
tests/post_processor/models.py
Python
mit
559
0
from os import walk from os.path import basename, splitext, dirname, join, exists from glob import glob import importlib from inspect import getmembers, isclass import sverchok from sverchok.utils.testing import * from sverchok.utils.logging import debug, info, error from sverchok.node_tree import SverchCustomTreeNod...
DolphinDream/sverchok
tests/ui_tests.py
Python
gpl-3.0
2,714
0.004422
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class KyzsPipeline(object): def process_item(self, item, spider): return item
MasLinoma/test
kyzs/kyzs/pipelines.py
Python
gpl-2.0
258
0
#!/usr/bin/env python # -*- coding: utf-8 -*- #important: before running this demo, make certain that you import the library #'paho.mqtt.client' into python (https://pypi.python.org/pypi/paho-mqtt) #also make certain that ATT_IOT is in the same directory as this script. import traceback ...
ATT-JBO/RPICameraRemote
RPICamera/RPICamera/RPICameraRemote.py
Python
mit
7,821
0.009973
import sys import os import time import logging import socket import string import collections import logging import atexit __version__ = "1.1.26" __all__ = ['main','amqp'] class client_interface(object): def get_cell(self, key, value=None): """Returns the contents of the cell""" raise NotImple...
mcornelio/synapse
synapse/__init__.py
Python
mit
29,118
0.033141
# 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...
brchiu/tensorflow
tensorflow/python/data/experimental/kernel_tests/optimization/map_vectorization_test.py
Python
apache-2.0
20,093
0.004977
""" Script to fetch historical data (since 2011) for matches (global, public). Gives results in a chronological order (ascending), as they happened. """ from __future__ import print_function from dota2py import api from time import sleep as wait_for_next_fetch def public_match_history(start_at_match_seq_num=None, mat...
ashishnitinpatil/dota2api_scripts
dota2api_scripts/historical_data.py
Python
bsd-2-clause
2,542
0.00236
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
caio2k/RIDE
src/robotide/searchtests/__init__.py
Python
apache-2.0
608
0.001645
# -*- test-case-name: twisted.mail.test.test_pop3client -*- # Copyright (c) 2001-2004 Divmod Inc. # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ POP3 client protocol implementation Don't use this module directly. Use twisted.mail.pop3 instead. @author: Jp Calderone """ import re from h...
ecolitan/fatics
venv/lib/python2.7/site-packages/twisted/mail/pop3client.py
Python
agpl-3.0
24,412
0.00168
# # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
mineo/dnf-plugins-core
plugins/config_manager.py
Python
gpl-2.0
9,979
0.000701
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('catalogue', '0001_initial'), ] operations = [ migrations.RenameModel( old_name='Cd', new_name='Relea...
ThreeDRadio/playlists
backend/catalogue/migrations/0002_auto_20160628_1024.py
Python
mit
342
0
import abc import asyncio import keyword import collections import mimetypes import re import os import sys import inspect import warnings from collections.abc import Sized, Iterable, Container from pathlib import Path from urllib.parse import urlencode, unquote from types import MappingProxyType from . import hdrs ...
jashandeep-sohi/aiohttp
aiohttp/web_urldispatcher.py
Python
apache-2.0
26,407
0
# -*- coding: utf-8 -*- """Umgang mit mehrdimensionalen Arrays. Im Folgenden wird der Umgang mit mehrdimensionalen Arrays veranschaulicht. Die Beispiele zeigen zweidimensionale Arrays (Matrizen), das Verhalten lässt sich jedoch auf Arrays höherer Dimensionen übertragen. """ import numpy as np # Definition zufälli...
lkluft/python-toolbox
scripts/matrixoperationen.py
Python
gpl-3.0
599
0
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
onshape-public/onshape-clients
python/onshape_client/oas/models/bt_default_unit_info.py
Python
mit
4,695
0
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import re from calibre.ebooks.docx.names import XPath, get class Field(obje...
insomnia-lab/calibre
src/calibre/ebooks/docx/fields.py
Python
gpl-3.0
4,524
0.0042
#!/usr/bin/env python # # Copyright 2007 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 o...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/google/appengine/api/files/records.py
Python
bsd-3-clause
11,204
0.006426
from django.db.models import Min from django.http import Http404 from django.utils.encoding import force_str from django.utils.translation import gettext as _ from django.views.generic import DetailView, YearArchiveView from django.views.generic.detail import SingleObjectMixin from spectator.core import app_settings f...
philgyford/django-spectator
spectator/events/views.py
Python
mit
8,037
0.000249
""" .. module:: CreateProfileForm :synopsis: A form for completing a user's profile. .. moduleauthor:: Dan Schlosser <dan@schlosser.io> """ from flask.ext.wtf import Form from wtforms import StringField, HiddenField from wtforms.validators import URL, Email, Required EMAIL_ERROR = 'Please provide a valid email a...
danrschlosser/eventum
eventum/forms/CreateProfileForm.py
Python
mit
1,023
0
import os import json import arcpy import types import general from .._abstract import abstract ######################################################################## class SpatialReference(abstract.AbstractGeometry): """ creates a spatial reference instance """ _wkid = None #-----------------------------...
achapkowski/ArcREST
src/arcrest/common/geometry.py
Python
apache-2.0
20,189
0.009114
game_type = 'input_output' parameter_list = [['$x1','int'], ['$y0','int'], ['$y1','int']] tuple_list = [ ['KnR_1-7b_',[-3,None,None]] ] global_code_template = '''\ d #include &lt;stdio.h> x #include <stdio.h> dx dx /* power: raise base to n-th power; n >= 0 */ dx /* (old-style version) */ dx power(base, n) dx in...
stryder199/RyarkAssignments
Assignment2/ttt/archive/_old/KnR/KnR_1-7b.py
Python
mit
689
0.015965
__author__ = 'jtsreinaldo' from radio_constants import * from validation_constants import * class TXConfigRadioGenerator(object): """ A class for the reception configuration of a radio. """ def __init__(self): """ CTOR """ pass @staticmethod def tx_generator(...
ComputerNetworks-UFRGS/OpERA
python/experiment_design/transmission_config.py
Python
apache-2.0
3,622
0.004694
# 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 it will be useful, # bu...
lujinda/iotop
iotop/ui.py
Python
gpl-2.0
24,215
0.000991
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
jferreir/mbed
workspace_tools/host_tests/host_registry.py
Python
apache-2.0
1,214
0.004942
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright (C) 2013-2019 British Crown (Met Office) & Contributors. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published ...
matthewrmshin/isodatetime
metomi/isodatetime/tests/test_datetimeoper.py
Python
lgpl-3.0
15,759
0
# -*- coding: utf-8 -*- from __future__ import absolute_import from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Duracloud' db.create_table( u"locations_duracloud", ( (u"i...
artefactual/archivematica-storage-service
storage_service/locations/south_migrations/0006_duracloud.py
Python
agpl-3.0
25,555
0.001722
## # Copyright (c) 2010-2017 Apple 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 applicab...
macosforge/ccs-calendarserver
contrib/performance/benchmarks/event_move.py
Python
apache-2.0
2,708
0
"""Output formatters using shell syntax. """ from .base import SingleFormatter import argparse import six class ShellFormatter(SingleFormatter): def add_argument_group(self, parser): group = parser.add_argument_group( title='shell formatter', description='a format a UNIX shell c...
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/cliff/formatters/shell.py
Python
mit
1,337
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """Test suite for language_check.""" from __future__ import unicode_literals import unittest import warnings from collections import namedtuple import language_check class TestLanguageTool(unittest.TestCase): CheckTest = namedtuple('CheckTest', ('text', 'matches'))...
myint/language-check
test.py
Python
lgpl-3.0
5,483
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import re import unicodedata import datetime import subprocess from py3compat import string_types, text_type from django.utils impo...
yeleman/uninond
uninond/tools.py
Python
mit
6,367
0
import csv from numpy import histogram def review_stats(count_ratings, length): # print "in extract_rows" ip_csv = "data\input\yelp_academic_dataset_review_ext.csv" with open(ip_csv, "rb") as source: rdr = csv.reader(source) firstline = True for r in rdr: if firstline: ...
abhirevan/Yelp-Rate-my-Review
src/review_stats.py
Python
mit
2,318
0.004745
from code_intelligence import graphql import fire import github3 import json import logging import os import numpy as np import pprint import retrying import json TOKEN_NAME_PREFERENCE = ["INPUT_GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_TOKEN"] for token in TOKEN_NAME_PREFERENCE: if os....
kubeflow/code-intelligence
py/notifications/notifications.py
Python
mit
6,630
0.008748
# -*- coding: utf-8 -*- from django.conf.urls import url from . import views urlpatterns = [ url(r"^/android/setup$", views.android_setup_view, name="notif_android_setup"), url(r"^/chrome/setup$", views.chrome_setup_view, name="notif_chrome_setup"), url(r"^/chrome/getdata$", views.chrome_getdata_view, na...
jacobajit/ion
intranet/apps/notifications/urls.py
Python
gpl-2.0
483
0.008282
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-04 09:25 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ...
erasche/galactic-radio-telescope
api/migrations/0001_initial.py
Python
agpl-3.0
3,931
0.003561
# Copyright (c) 2001-2016, 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...
kadhikari/navitia
source/jormungandr/tests/stif_tests.py
Python
agpl-3.0
7,989
0.005007
# The MIT License (MIT) # Copyright (c) 2009 Max Polk # 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, ...
toha10/python-cudet
cudet/flock.py
Python
gpl-2.0
3,884
0
#!/usr/bin/python # AUTHOR : liuxu-0703@163.com # used to extract keyword sets from xml # used by aplog_helper.sh and adblogcat.sh import os import sys import getopt from xml.dom.minidom import parse, parseString #======================================= class KeywordSet: def __init__(self, xml_node): ...
liuxu0703/lx_bash_script
android_script/keyword_manager.py
Python
mit
5,470
0.006764
"""# Components. You can adapt some component functions from the `gdsfactory.components` module. Each function there returns a Component object Here are two equivalent functions """ import gdsfactory as gf def straight_wide1(width=10, **kwargs) -> gf.Component: return gf.components.straight(width=width, **kwar...
gdsfactory/gdsfactory
gdsfactory/samples/20_components.py
Python
mit
482
0
from PyQt5 import QtCore, QtWidgets import chigger import peacock from peacock.ExodusViewer.plugins.ExodusPlugin import ExodusPlugin from MeshBlockSelectorWidget import MeshBlockSelectorWidget class BlockHighlighterPlugin(peacock.base.PeacockCollapsibleWidget, ExodusPlugin): """ Widget for controlling the visi...
yipenggao/moose
python/peacock/Input/BlockHighlighterPlugin.py
Python
lgpl-2.1
3,928
0.001527
""" Handle logging in a Message Box? """ from PyQt4 import QtGui, QtCore import logging import sys class MyQWidget(QtGui.QWidget): def center(self): frameGm = self.frameGeometry() screen = QtGui.QApplication.desktop().screenNumber(QtGui.QApplication.desktop().cursor().pos()) centerPoint =...
CNR-Engineering/ModelerTools
common/qt_log_in_textbrowser.py
Python
gpl-3.0
788
0.002538
""" Parser for HTML forms, that fills in defaults and errors. See ``render``. """ from __future__ import absolute_import import re from formencode.rewritingparser import RewritingParser, html_quote import six __all__ = ['render', 'htmlliteral', 'default_formatter', 'none_formatter', 'escape_formatter', ...
formencode/formencode
src/formencode/htmlfill.py
Python
mit
23,202
0.000431
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html # import codecs # import json # class stokeScrapyPipeline(object): # def __init__(self): # self.file=codecs.open...
disappearedgod/stokeScrapy
stokeScrapy/pipelines.py
Python
gpl-2.0
1,353
0.031042
# Copyright 2017 BrainPad 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...
BrainPad/FindYourCandy
robot-arm/calibration/adjust.py
Python
apache-2.0
4,494
0.00267
# -*- coding: utf-8 -*- from django import forms from django.core.validators import RegexValidator from ...models import EighthBlock block_letter_validator = RegexValidator(r"^[a-z A-Z0-9_-]{1,10}$", "A block letter must be less than 10 characters long, and include only alphan...
jacobajit/ion
intranet/apps/eighth/forms/admin/blocks.py
Python
gpl-2.0
1,644
0.003041
# bgscan tests # Copyright (c) 2014, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import time import logging logger = logging.getLogger() import os import hostapd def test_bgscan_simple(dev, apdev): """bgscan_simple""" hostapd...
wangybgit/Chameleon
hostapd-OpenWrt/tests/hwsim/test_bgscan.py
Python
apache-2.0
6,284
0.003024
""" WSGI config for lot project. 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.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_M...
Ecotrust/COMPASS
mp/wsgi.py
Python
apache-2.0
378
0
""" Django settings for systematic_review project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DI...
iliawnek/SystematicReview
systematic_review/settings.py
Python
mit
2,999
0
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/r-speedglm/package.py
Python
lgpl-2.1
1,759
0.000569
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@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 Software Foundation; either version 2 of the License...
gramps-project/addons-source
SetAttributeTool/SetAttributeTool.gpr.py
Python
gpl-2.0
1,411
0.02197
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, (int, long)): if default_handler == sign...
HiSPARC/station-software
user/python/Lib/unittest/signals.py
Python
gpl-3.0
2,411
0.002074
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software you can redistribute it and/or modify # it under...
numenta/nupic.research
projects/imagenet/experiments/sparse_r1.py
Python
agpl-3.0
5,411
0.00037
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 class StandaloneApplication(gunicorn.app.base.BaseApplication): de...
radical-software/mongrey
mongrey/web/worker.py
Python
bsd-3-clause
1,033
0.003872
# flake8: noqa from . import html, richtext, snippet try: import requests except ImportError: # pragma: no cover pass else: from . import external try: import imagefield except ImportError: # pragma: no cover pass else: from . import image
matthiask/feincms3
feincms3/plugins/__init__.py
Python
bsd-3-clause
269
0
#!/usr/bin/env python """ Match input spectrum to ID lines """ from __future__ import (print_function, absolute_import, division, unicode_literals) import pdb try: # Python 3 ustr = unicode except NameError: ustr = str def parser(options=None): import argparse # Parse parser = argparse.ArgumentP...
PYPIT/arclines
arclines/scripts/match.py
Python
bsd-3-clause
3,106
0.007727
#!/usrbin/python #encoding:utf-8 ''' Author: wangxu Email: wangxu@oneniceapp.com 任务更新 ''' import sys reload(sys) sys.setdefaultencoding("utf-8") import logging import tornado.web import json import os import time CURRENTPATH = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(CURRENTPATH, '...
cocofree/azkaban_assistant
schedule/webapp/handler/job_update.py
Python
apache-2.0
2,583
0.021624
#from distutils.core import setup from setuptools import setup, find_packages # http://guide.python-distribute.org/quickstart.html # python setup.py sdist # python setup.py register # python setup.py sdist upload # pip install epub_meta # pip install epub_meta --upgrade --no-deps # Manual upload to PypI # http://pypi....
paulocheque/epub-meta
setup.py
Python
agpl-3.0
1,554
0.001931
#!/usr/bin/env python # # Problem definition: # A-R Hedar and M Fukushima, "Derivative-Free Filter Simulated Annealing # Method for Constrained Continuous Global Optimization", Journal of # Global Optimization, 35(4), 521-549 (2006). # # Original Matlab code written by A. Hedar (Nov. 23, 2005) # http://www-optima.amp....
jcfr/mystic
examples2/g09.py
Python
bsd-3-clause
1,961
0.009179
#!/usr/bin/env python import os from setuptools import setup setup(name='pymarkdown', version='0.1.4', description='Evaluate code in markdown', url='http://github.com/mrocklin/pymarkdown', author='Matthew Rocklin', author_email='mrocklin@gmail.com', license='BSD', keywords='...
leosartaj/pymarkdown
setup.py
Python
bsd-3-clause
599
0.001669
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright: (2013-2017) Michael Till Beck <Debianguru@gmx.de> # License: GPL-2.0+ import http.server import socketserver import importlib import sys import getopt bind = 'localhost' port = 8000 configMod = 'config' try: opts, args = getopt.getopt(sys.argv[1:], ...
mtill/MailWebsiteChanges
mwcfeedserver.py
Python
gpl-2.0
1,039
0.002887
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # TerminalRoastDB, released under GPLv3 # Roaster Set Time import Pyro4 import sys new_roaster_time = sys.argv[1] roast_control = Pyro4.Proxy("PYRONAME:roaster.sr700") if int(new_roaster_time) > 0 and int(new_roaster_time) <1200: roast_control.set_time(new_roaster_ti...
infinigrove/TerminalRoastDB
cmds/Roaster_Set_Time.py
Python
gpl-3.0
324
0.003086
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('wiki', '0001_initial'), ('userstories', '0009_remove_userstory_is_archived'), ('issues', '0005_auto_20150623_1923'), ...
coopsource/taiga-back
taiga/searches/migrations/0001_initial.py
Python
agpl-3.0
1,689
0.002368
import os import json from urlparse import urlparse from pymongo import uri_parser def get_private_key(): with open('mistt-solution-d728e8f21f47.json') as f: return json.loads(f.read()).items() # Flask CSRF_SESSION_KEY = os.getenv('FLASK_SESSION_KEY', 'notsecret') SECRET_KEY = os.getenv('FLASK_SECRET_KEY'...
michaelnetbiz/mistt-solution
config.py
Python
mit
1,994
0.005015
from ovito import * from ovito.io import * from ovito.modifiers import * from ovito.vis import * import matplotlib # Activate 'agg' backend for off-screen plotting. matplotlib.use('Agg') import matplotlib.pyplot as plt import PyQt5.QtGui node = import_file("../../files/CFG/fcc_coherent_twin.0.cfg") node.modifiers.a...
srinath-chakravarthy/ovito
tests/scripts/test_suite/python_data_plot_overlay.py
Python
gpl-3.0
1,873
0.034704
# -*- coding: utf-8 -*- { '\n\nThank you!': '\n\nThank you!', '\n\nWe will wait and let you know when your payment is confirmed.': '\n\nWe will wait and let you know when your payment is confirmed.', '\n- %s from %s to %s': '\n- %s from %s to %s', '\nAmount: R$%.2f': '\nAmount: R$%.2f', "\nSomething happened and we cou...
juliarizza/web2courses
languages/ro.py
Python
mit
29,001
0.024039
# urllib3/_collections.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import deque from threading import RLock __all__ = ['RecentlyUsedContai...
samabhi/pstHealth
venv/lib/python2.7/site-packages/requests/packages/urllib3/_collections.py
Python
mit
4,119
0.000243
"""Unit test for treadmill.runtime. """ import errno import socket import unittest import mock import treadmill import treadmill.rulefile import treadmill.runtime from treadmill import exc class RuntimeTest(unittest.TestCase): """Tests for treadmill.runtime.""" @mock.patch('socket.socket.bind', mock.Mock...
keithhendry/treadmill
tests/runtime_test.py
Python
apache-2.0
4,097
0
""" Author: Maneesh Divana <mdaneeshd77@gmail.com> Interpreter: Python 3.6.8 Quick Sort Worst Case: O(n^2) Average Case: O(nlog n) Best Case: O(nlog n) """ from random import shuffle def partition(arr: list, left: int, right: int) -> int: """Partitions the given array based on a pivot element, then sorts the...
maneeshd/Algorithms-and-Data-Structures
algorithms/QuickSort.py
Python
mit
1,581
0
#### 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 = Tangible() result.template = "object/tangible/wearables/base/shared_base_sleeve_both.iff" result.attribute_templa...
anhstudios/swganh
data/scripts/templates/object/tangible/wearables/base/shared_base_sleeve_both.py
Python
mit
465
0.045161
# see ex50.py
cohadar/learn-python-the-hard-way
ex51.py
Python
mit
13
0.076923
# Python 2 and 3: try: # Python 3 only: from urllib.parse import urlencode, urlsplit, parse_qs, unquote except ImportError: # Python 2 only: from urlparse import parse_qs, urlsplit from urllib import urlencode, unquote
fasihahmad/django-rest-framework-related-views
rest_framework_related/py2_3.py
Python
gpl-3.0
239
0
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LI...
nikesh-mahalka/cinder
cinder/tests/unit/fake_hp_client_exceptions.py
Python
apache-2.0
3,077
0
#!/usr/bin/env python import sys, re, getopt class Menusystem: types = {"run" : "OPT_RUN", "inactive" : "OPT_INACTIVE", "checkbox" : "OPT_CHECKBOX", "radiomenu": "OPT_RADIOMENU", "sep" : "OPT_SEP", "invisible": "OPT_INVISIBLE", "rad...
ErwanAliasr1/syslinux
com32/cmenu/menugen.py
Python
gpl-2.0
10,693
0.033947
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-08-17 00:40 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('turnos', '0004_auto_20160519_0134'), ] operations = [ migrations.RenameField('Turno'...
mava-ar/sgk
src/turnos/migrations/0005_auto_20160816_2140.py
Python
apache-2.0
415
0
# -*- coding: utf-8 -*- from time import localtime, mktime, time, strftime from datetime import datetime from enigma import eEPGCache from Screens.Screen import Screen import ChannelSelection from ServiceReference import ServiceReference from Components.config import config, ConfigSelection, ConfigText, ConfigSubList...
mrnamingo/vix4-34-enigma2-bcm
lib/python/Screens/TimerEntry.py
Python
gpl-2.0
25,002
0.027718
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, 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 # ...
usc-isi/extra-specs
nova/tests/rpc/test_dispatcher.py
Python
apache-2.0
3,730
0.001072
from unittest import TestCase from unittest.mock import Mock from grapher import errors from grapher.parsers import QueryParser from grapher.parsers import query from nose_parameterized import parameterized class QueryParserTest(TestCase): def setUp(self): r = Mock() r.args = Mock() r.arg...
lucasdavid/grapher
tests/parsers/query_test.py
Python
mit
1,148
0.000871
# To make print working for Python2/3 from __future__ import print_function import ystockquote as ysq def _main(): for s in ["NA.TO", "XBB.TO", "NOU.V", "AP-UN.TO", "BRK-A", "AAPL"]: print("=============================================") print("s: {}".format(s)) print("get_name: {}".for...
mathieugouin/tradesim
demo/demo_ystockquote.py
Python
gpl-3.0
998
0.001002
# coding=utf-8 from django.core.paginator import Paginator, InvalidPage, EmptyPage from urllib import urlencode try: from urlparse import parse_qs except ImportError: from cgi import parse_qs class SimplePaginator(object): """A simple wrapper around the Django paginator.""" def __init__(self, request...
dbrgn/django-simplepaginator
simple_paginator/__init__.py
Python
lgpl-3.0
4,672
0.001712
from .discrete import DiscreteSimulation
Lucretiel/genetics
genetics/simulation/__init__.py
Python
lgpl-2.1
41
0
import asyncio import gta.utils # The following metadata will not be processed but is recommended # Author name and E-Mail __author__ = 'Full Name <email@example.com>' # Status of the script: Use one of 'Prototype', 'Development', 'Production' __status__ = 'Development' # The following metadata will be parsed and sh...
lgrahl/scripthookvpy3k
python/scripts/metadata.py
Python
mit
857
0.002334
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved. # Copyright (C) 2013 Yahoo! Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
jessicalucci/TaskManagement
taskflow/task.py
Python
apache-2.0
9,682
0
# -*- coding: utf-8 -*- """ Disease Case Tracking and Contact Tracing """ if not settings.has_module(c): raise HTTP(404, body="Module disabled: %s" % c) # ----------------------------------------------------------------------------- def index(): "Module's Home Page" module_name = settings.modules[c]...
flavour/eden
controllers/disease.py
Python
mit
8,481
0.008843
#!/usr/bin/env python import sys from fireplace import cards from fireplace.exceptions import GameOver from fireplace.utils import play_full_game sys.path.append("..") def test_full_game(): try: play_full_game() except GameOver: print("Game completed normally.") def main(): cards.db.initialize() if len(s...
jleclanche/fireplace
tests/full_game.py
Python
agpl-3.0
577
0.025997
# BlenderBIM Add-on - OpenBIM Blender Add-on # Copyright (C) 2021 Dion Moult <dion@thinkmoult.com> # # This file is part of BlenderBIM Add-on. # # BlenderBIM Add-on 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 Foundati...
IfcOpenShell/IfcOpenShell
src/blenderbim/test/bim/bootstrap.py
Python
lgpl-3.0
15,500
0.003032
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
chrismattmann/girder
tests/cases/api_describe_test.py
Python
apache-2.0
4,148
0
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, # 2010, 2011, 2012, 2013, 2014, 2015 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 Sof...
SDSG-Invenio/invenio
invenio/legacy/bibindex/engine.py
Python
gpl-2.0
101,575
0.002648
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django import test from django.core.exceptions import ValidationError from yepes.validators import ( CharSetValidator, ColorValidator, FormulaValidator, IdentifierValidator, PhoneNumberValidator, PostalCodeValidator, Rest...
samuelmaudo/yepes
tests/validators/tests.py
Python
bsd-3-clause
13,740
0.00102
#!/usr/bin/env python """Setup file for HT-BAC Tools. """ __author__ = "Ole Weidner" __email__ = "ole.weidner@rutgers.edu" __copyright__ = "Copyright 2014, The RADICAL Project at Rutgers" __license__ = "MIT" """ Setup script. Used by easy_install and pip. """ import os import sys import subprocess from s...
radical-cybertools/radical.ensemblemd.mdkernels
setup.py
Python
mit
5,031
0.015703
""" API v0 views. """ import datetime import json import logging import pytz from django.contrib.auth.models import User from django.db import transaction from django.http import Http404 from rest_framework import status from rest_framework.authentication import SessionAuthentication from rest_framework.generics impo...
devs1991/test_edx_docmode
lms/djangoapps/ccx/api/v0/views.py
Python
agpl-3.0
30,649
0.002545
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities from mixbox import fields import cybox.bindings.win_service_object as win_service_binding from cybox.common import HashList from cybox.objects.win_process_object import WinProcess from c...
CybOXProject/python-cybox
cybox/objects/win_service_object.py
Python
bsd-3-clause
2,132
0.002814
import cPickle import os import tarfile import PIL.Image from downloader import DataDownloader class Cifar100Downloader(DataDownloader): """ See details about the CIFAR100 dataset here: http://www.cs.toronto.edu/~kriz/cifar.html """ def urlList(self): return [ 'http://www....
winnerineast/Origae-6
origae/download_data/cifar100.py
Python
gpl-3.0
5,218
0.002491
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2008 - 2012 Hewlett-Packard Development Company, L.P. # # 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/...
rich-pixley/zoo-animals
statlog-rollup.py
Python
apache-2.0
3,874
0.004388
from django.conf.urls import include, url from django.contrib import admin from django.contrib import auth admin.autodiscover() import templog.urls import control.urls from thermoctrl import views urlpatterns = [ # Examples: # url(r'^$', 'thermoctrl.views.home', name='home'), # url(r'^blog/', include('bl...
DrChat/thermoctrl
thermoctrl/urls.py
Python
mit
645
0.006202
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
tomkralidis/geonode
geonode/monitoring/__init__.py
Python
gpl-3.0
3,733
0.000804
# -*- coding: utf-8 -*- """ Catch-up TV & More Original work (C) JUL1EN094, SPM, SylvainCecchetto Copyright (C) 2016 SylvainCecchetto This file is part of Catch-up TV & More. Catch-up TV & More is free software; you can redistribute it and/or modify it under the terms of the GNU General Publi...
SylvainCecchetto/plugin.video.catchuptvandmore
plugin.video.catchuptvandmore/resources/lib/channels/fr/francetv.py
Python
gpl-2.0
14,146
0.001344
# -*- coding: utf-8 -*- # # This file is part of the python-chess library. # Copyright (C) 2012-2016 Niklas Fiekas <niklas.fiekas@backscattering.de> # # 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 Foundat...
johncheetham/jcchess
chess/pgn.py
Python
gpl-3.0
32,586
0.00043
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
EmreAtes/spack
var/spack/repos/builtin/packages/astyle/package.py
Python
lgpl-2.1
2,548
0.000392
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import A...
kinow-io/kinow-python-sdk
test/test_subtitle_file.py
Python
apache-2.0
747
0.001339
""" Trends library module. """ import datetime from lib import database as db from lib.twitter_api import authentication # Global object to be used as api connection. During execution of the insert # function, this can be setup once with default app then reused later, # to avoid time calling Twitter API. It can be l...
MichaelCurrin/twitterverse
app/lib/trends.py
Python
mit
3,038
0