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
#!/usr/bin/env python """Query and aggregate data from log files using SQL-like syntax""" import sys import argparse import os import re import ast import readline import atexit import time import inspect from multiprocessing import cpu_count try: from collections import OrderedDict except ImportError: # pyth...
spuriousdata/logrok
logrok/logrok.py
Python
mit
8,948
0.004582
from .connection import MongoConnection
sopython/kesh
kesh/api/__init__.py
Python
bsd-3-clause
39
0.025641
# Configuracion para una versin semi-privada en el servidor de produccion. Beta - Alfa
damianpv/skeleton_django
sk_django/sk_django/settings/staging.py
Python
gpl-3.0
86
0.023256
# 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 ...
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/security_rules_operations.py
Python
mit
18,911
0.002327
import wx import wx.html from ..utils.generic_class import GenericClass from ..utils.constants import control, dtype from ..utils.validator import CharValidator import pkg_resources as p class VMHC(wx.html.HtmlWindow): def __init__(self, parent, counter = 0): from urllib2 import urlopen wx.html.H...
sgiavasis/C-PAC
CPAC/GUI/interface/pages/vmhc.py
Python
bsd-3-clause
3,737
0.025957
import datetime import os import re import time from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: # The mod_python version is more efficient, so try importing it first. fr...
tjsavage/sfcsdatabase
sfcs/django/http/__init__.py
Python
bsd-3-clause
23,818
0.002393
"""Simple CLIP tokenizer wrapper.""" from absl import logging import functools from typing import Any, Callable, Optional, Sequence, Union from clip.simple_tokenizer import SimpleTokenizer import jax.numpy as jnp import numpy as np from scenic.projects.baselines.clip import download # pylint: disable=line-too-long ...
google-research/scenic
scenic/projects/baselines/clip/tokenizer.py
Python
apache-2.0
1,853
0.008095
import shutil import os import re import logging class RenameTo(object): """ Renames a given file. Performs a case sensitive search and replace on the filename, then renames it. Also supports regular expressions. """ config_name = 'rename-to' def __init__(self, parameters): self.logge...
jashort/SmartFileSorter
smartfilesorter/actionplugins/renameto.py
Python
bsd-3-clause
2,257
0.004431
from __future__ import unicode_literals from django.db import models import datetime from django.db.models.signals import pre_save from django.urls import reverse from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from source_utils.starters import CommonInfo, GenericCategor...
michealcarrerweb/LHVent_app
stock/models.py
Python
mit
4,911
0.007738
from hashlib import sha512 from uuid import uuid4 from vFense.db.client import validate_session class TokenManager(): def __init__(self, session): self.session = session # DB session def save_access_token(self, token): self.session = validate_session(self.session) self.session.add(tok...
vFense/vFense
tp/src/server/oauth/token.py
Python
lgpl-3.0
484
0.006198
# DO NOT IMPORT THIS BEFORE django.configure() has been run! import os from django.conf import settings DATABASES = getattr(settings, 'DBBACKUP_DATABASES', list(settings.DATABASES.keys())) BACKUP_DIRECTORY = getattr(settings, 'DBBACKUP_BACKUP_DIRECTORY', os.getcwd()) # Days to keep backups CLEANUP_KEEP = getattr(se...
BloodyD/django-dbbackup
dbbackup/settings.py
Python
bsd-3-clause
2,525
0.005149
""" A few practical conventions common to all printers. """ from __future__ import print_function, division import re import collections _name_with_digits_p = re.compile(r'^([a-zA-Z]+)([0-9]+)$') def split_super_sub(text): """Split a symbol name into a name, superscripts and subscripts The first part ...
NikNitro/Python-iBeacon-Scan
sympy/printing/conventions.py
Python
gpl-3.0
2,504
0
import re from main import sc __author__ = 'minh' class Utils: def __init__(self): pass not_allowed_chars = '[\/*?"<>|\s\t]' numeric_regex = r"\A((\\-)?[0-9]{1,3}(,[0-9]{3})+(\\.[0-9]+)?)|((\\-)?[0-9]*\\.[0-9]+)|((\\-)?[0-9]+)|((\\-)?[0" \ r"-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?)...
alseambusher/SemanticTyping
lib/utils.py
Python
mit
1,139
0.005268
import logging import traceback from django.conf import settings from django.core.paginator import Paginator from django.http import HttpResponse, HttpResponseServerError, Http404 from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.template.loader i...
viswimmer1/PythonGenerator
data/python_files/32677285/views.py
Python
gpl-2.0
15,766
0.000698
#!/usr/bin/env python # coding:utf-8 class Ob(object): def __init__(self, *args, **kwds): for i in args: self.__dict__.update(args) self.__dict__.update(kwds) def __getattr__(self, name): return self.__dict__.get(name, '') def __setattr__(self, name, value): ...
noman798/dcny
lib/f42/f42/ob.py
Python
mpl-2.0
1,570
0.000639
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import tarfile from io import BytesIO from queue import Queue from threading import Event, Thread from xml.etree.ElementTree import Element, ElementTree import requests import unicodecsv as csv class DownloadThread(Thread): def __init__(self, stock_id, que...
quietcoolwu/python-playground
imooc/python_advanced/8_1_multi_threading.py
Python
mit
4,077
0
# noinspection PyPackageRequirements import wx import gui.globalEvents as GE import gui.mainFrame from gui.contextMenu import ContextMenuSingle from service.fit import Fit class AmmoToDmgPattern(ContextMenuSingle): visibilitySetting = 'ammoPattern' def __init__(self): self.mainFrame = gui.mainFrame...
DarkFenX/Pyfa
gui/builtinContextMenus/ammoToDmgPattern.py
Python
gpl-3.0
1,296
0.002315
from .extensions import db, resizer class Upload(db.Model): __tablename__ = 'upload' id = db.Column(db.Integer, autoincrement=True, primary_key=True) name = db.Column(db.Unicode(255), nullable=False) url = db.Column(db.Unicode(255), nullable=False) if resizer: for size in resizer.sizes.iterkeys(...
FelixLoether/flask-uploads
flask_uploads/models.py
Python
mit
458
0.002183
from django.db import models class DataCategory(models.Model): id = models.IntegerField(primary_key=True) title = models.CharField(max_length=150) year = models.IntegerField() def __unicode__(self): # Ideadlly would be title but its too big return u"{} - {}".format(self.year, self.id)...
papaloizouc/migrants
migrants/base/models.py
Python
gpl-2.0
1,356
0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import logging from math import ceil import sys import numpy as np import tensorflow as tf VGG_MEAN = [103.939, 116.779, 123.68] class FCN16VGG: def __init__(self, vgg16_npy_path=None): ...
jpapon/minimal_ros_nodes
cnn_classifier/src/cnn_classifier/tensorflow_fcn/fcn16_vgg.py
Python
bsd-3-clause
16,410
0
import collections import json import unittest import responses from requests import HTTPError from mock import patch from batfish import Client from batfish.__about__ import __version__ class TestClientAuthorize(unittest.TestCase): def setUp(self): with patch('batfish.client.read_token_from_conf', ...
kura/batfish
tests/test_client_authorize.py
Python
mit
1,645
0
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals """This file is part of the django ERP project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ...
mobb-io/django-erp
djangoerp/menus/signals.py
Python
mit
2,406
0.007897
"""Agrega alturas.codprov y alturas.cp Revision ID: f5195fe91e09 Revises: fccbcd8362d7 Create Date: 2017-07-09 22:01:51.280360 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f5195fe91e09' down_revision = 'fccbcd8362d7' branch_labels = None depends_on = None ...
OpenDataCordoba/codigo-postal-argentino
alembic/versions/f5195fe91e09_agrega_alturas_codprov_y_alturas_cp.py
Python
gpl-2.0
796
0.001256
import tkinter window = tkinter.Tk() window.mainloop() print('Anybody home?')
simontakite/sysadmin
pythonscripts/practicalprogramming/gui/mainloop.py
Python
gpl-2.0
78
0
# OCFS2Console - GUI frontend for OCFS2 management and debugging # Copyright (C) 2002, 2005 Oracle. 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 Software Foundation; either version 2 of th...
Thermi/ocfs2-tools
ocfs2console/ocfs2interface/process.py
Python
gpl-2.0
4,541
0.002202
import mysql import pymysql from model.group import Group from model.contact import Contact class DbFixture: def __init__(self, host, name, user, password): self.host = host self.name = name self.user = user self.password = password self.connection = pymysql.connect(host=ho...
aalekperov/Task1
fixture/db.py
Python
apache-2.0
2,534
0.005919
from sys import stdin as sin list_index=[] list=dict() def fn(n): f=1 #check if a value less that that has already been calculated for i in range(1,n+1): f*=i return f t=int(input()) for i in range(t): n=int(sin.readline().rstrip()) print(fn(n))
parthapritam2717/CodeChef
FCTRL2.py
Python
gpl-3.0
283
0.038869
from hearthstone.enums import GameTag from . import enums class Manager(object): def __init__(self, obj): self.obj = obj self.observers = [] def __getitem__(self, tag): if self.map.get(tag): return getattr(self.obj, self.map[tag], 0) raise KeyError def __setitem__(self, tag, value): setattr(self.obj...
Ragowit/fireplace
fireplace/managers.py
Python
agpl-3.0
7,048
0.027667
from nbodykit.lab import * from nbodykit import setup_logging setup_logging("debug") # initialize a linear power spectrum class cosmo = cosmology.Planck15 Plin = cosmology.LinearPower(cosmo, redshift=0.55, transfer='CLASS') # get some lognormal particles source = LogNormalCatalog(Plin=Plin, nbar=3e-7, BoxSize=1380.,...
nickhand/nbodykit
nersc/example.py
Python
gpl-3.0
578
0.012111
# -*- coding: utf-8 -*- # File: model_box.py import numpy as np from collections import namedtuple import tensorflow as tf from tensorpack.tfutils.scope_utils import under_name_scope from config import config @under_name_scope() def clip_boxes(boxes, window, name=None): """ Args: boxes: nx4, xyxy ...
eyaler/tensorpack
examples/FasterRCNN/model_box.py
Python
apache-2.0
7,519
0.001197
# -*- coding: utf-8 -*- # # 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 ...
jhsenjaliya/incubator-airflow
airflow/executors/local_executor.py
Python
apache-2.0
2,991
0
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Test.content' db.alter_column(u'itest_test', 'content'...
xuender/test
testAdmin/itest/migrations/0007_auto__chg_field_test_content.py
Python
apache-2.0
1,756
0.006834
from MeshInfo import * ''' Provides Information about ExodusII meshes ''' class ExodusIIMeshInfo(MeshInfo): def __init__(self, mesh_item_data, file_name): MeshInfo.__init__(self, mesh_item_data) self.file_name = file_name import vtk reader = vtk.vtkExodusIIReader() reader.SetFileName(self.file_na...
gleicher27/Tardigrade
moose/gui/mesh_info/ExodusIIMeshInfo.py
Python
lgpl-2.1
1,654
0.015719
# These color schemes come from d3: http://d3js.org/ # # They are licensed under the following license: # # Copyright (c) 2010-2015, Michael Bostock # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
rmenegaux/bqplot
bqplot/colorschemes.py
Python
apache-2.0
2,813
0.003199
# -*- coding: utf-8 -*- from . import saas_portal_tagging from . import wizard
thinkopensolutions/odoo-saas-tools
saas_portal_tagging/models/__init__.py
Python
lgpl-3.0
79
0
import unittest, StringIO, robotparser from test import test_support from urllib2 import urlopen, HTTPError class RobotTestCase(unittest.TestCase): def __init__(self, index, parser, url, good, agent): unittest.TestCase.__init__(self) if good: self.str = "RobotTest(%d, good, %s)" % (inde...
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_robotparser.py
Python
mit
6,753
0.003998
#! /usr/bin/env python3 from gi.repository import Gtk, GObject import gui import logging import argparse import threading # Commandline arguments parser = argparse.ArgumentParser(description='2-way syncronisation for folders') parser.add_argument('config', help='name of the configuration file') parser.add_argument('-d...
BigBart/2sync
2sync.py
Python
gpl-3.0
1,089
0.01011
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compl...
quattor/aquilon
tests/broker/test_add_rack.py
Python
apache-2.0
11,937
0.001508
# Copyright 2019 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...
ppwwyyxx/tensorflow
tensorflow/python/tpu/tpu_test_wrapper_test.py
Python
apache-2.0
6,679
0.005989
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
QISKit/qiskit-sdk-py
qiskit/pulse/commands/instruction.py
Python
apache-2.0
9,538
0.001887
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
tkruse/rosinstall
test/local/test_setupfiles.py
Python
bsd-3-clause
14,673
0.002726
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
LockScreen/Backend
venv/lib/python2.7/site-packages/boto3/s3/transfer.py
Python
mit
27,752
0.000036
"""Assign a WFO to sites in the metadata tables that have no WFO set.""" from pyiem.util import get_dbconn, logger LOG = logger() def main(): """Go Main""" mesosite = get_dbconn("mesosite") postgis = get_dbconn("postgis") mcursor = mesosite.cursor() mcursor2 = mesosite.cursor() pcursor = pos...
akrherz/iem
scripts/dbutil/set_wfo.py
Python
mit
2,127
0
#!/usr/local/bin/python3 """OmniFocus export to Dayone. Usage: omnifocus_export_dayone.py omnifocus_export_dayone.py <date> [--show] omnifocus_export_dayone.py (-s | --show) Options: -h --help Show this screen. --version Show version. -s --show Only echo to screen. """ import sys import sqlit...
nsdont/dotfiles
bin/omnifocus_export_dayone.py
Python
mit
6,596
0
""" Django settings for comunidad project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
gvizquel/comunidad
comunidad/1settings.py
Python
gpl-3.0
3,105
0.001288
""" ============= Generic Views ============= Class based helper views. """ class GenericManyToMany(object): """Generic view to edit many to many relations with extra fields.""" left_table = None right_table = None allow_multiple = True
tjnapster555/django-edu
djangoedu/core/generic_views.py
Python
mit
264
0.015152
# -*- coding:utf-8 -*- import random import unittest class TestSequenceFunctionsWorld(unittest.TestCase): def setUp(self): self.seq = range(10) def test_shuffle(self): # make sure the shuffled sequence does not lose any elements random.shuffle(self.seq) self.seq.sort() ...
mapix/utknows
examples/test_world.py
Python
bsd-3-clause
860
0.004651
"""Climatecontrol extension for using pydantic schemas as source.""" from typing import Generic, Mapping, Type, TypeVar from pydantic import BaseModel from climatecontrol.core import Climate as BaseClimate from climatecontrol.core import SettingsItem as BaseSettingsItem from climatecontrol.fragment import FragmentPa...
daviskirk/climatecontrol
climatecontrol/ext/pydantic.py
Python
mit
2,447
0.001226
"""Clean Plugin for EasyEngine.""" from ee.core.shellexec import EEShellExec from ee.core.aptget import EEAptGet from ee.core.services import EEService from ee.core.logging import Log from cement.core.controller import CementBaseController, expose from cement.core import handler, hook import os import urllib.request ...
mehulsbhatt/easyengine
ee/cli/plugins/clean.py
Python
mit
4,861
0.000823
# -*- coding: utf-8 -*- ############################################################################### # # # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # ...
Endika/account-financial-tools
account_move_batch_validate/account.py
Python
agpl-3.0
6,169
0
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, ) class KontrTubeIE(InfoExtractor): IE_NAME = 'kontrtube' IE_DESC = 'KontrTube.ru - Труба зовёт' _VALID_URL = r'http://(?:www\.)?kontrtube\.ru/...
Buggaarde/youtube-dl
youtube_dl/extractor/kontrtube.py
Python
unlicense
2,732
0.002276
class Solution: def reorderedPowerOf2(self, N): """ :type N: int :rtype: bool """ if N is None or N == 0: return False binary = [] while N > 0: binary.append(N%2) N = N//2 binary.sort() binary.pop() # remov...
euccas/CodingPuzzles-Python
leet/source/pickone/recordered_power_of_2.py
Python
mit
690
0.010145
# Copyright (c) 2016 RIPE NCC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the h...
RIPE-NCC/ripe.atlas.sagan
ripe/atlas/sagan/http.py
Python
gpl-3.0
3,498
0
# 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 # distributed under t...
rahulunair/nova
nova/tests/functional/wsgi/test_services.py
Python
apache-2.0
19,683
0
import pytest class TestAsBoolConverter(object): @pytest.fixture def target(self): from asbool.converter import AsBoolConverter return AsBoolConverter @pytest.mark.parametrize( "true_values, false_values, input, expected", [ (['t'], ['f'], 't', True), ...
aodag/asbool
tests/test_it.py
Python
mit
2,013
0
""" @brief test log(time=8s) @author Xavier Dupre """ import sys import os import unittest import shutil from contextlib import redirect_stdout from io import StringIO from pyquickhelper.pycode import ExtTestCase from pyquickhelper.pycode import process_standard_options_for_setup_help, get_temp_folder from pyq...
sdpython/pyquickhelper
_unittests/ut_pycode/test_missing_function_pycode.py
Python
mit
3,947
0.000507
import sys PY2 = sys.version_info[0] == 2 if PY2: from urllib import urlopen else: from urllib.request import urlopen
r-darwish/pushjournal
pushjournal/_compat.py
Python
bsd-3-clause
128
0
#!/usr/bin/python # -*- coding: utf-8 -*- r""" ========================================================== Comparing different variants of squared exponential kernel ========================================================== Three variants of the squared exponential covariance function are compared: * Isotropic squar...
jmetzen/skgp
examples/plot_gp_learning_curve.py
Python
bsd-3-clause
3,042
0.001644
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 30 20:51:31 2017 @author: mje """ import numpy as np import mne import matplotlib.pyplot as plt from mne.stats import permutation_cluster_test from my_settings import (subjects_select, tf_folder, epochs_folder) d_ali_ent_right = [] for subject i...
MadsJensen/CAA
calc_itc_ali.py
Python
bsd-3-clause
2,791
0
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_A_R_ENT_CRE_COUNT').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc....
cysuncn/python
spark/crm/PROC_A_R_ENT_CRE_COUNT.py
Python
gpl-3.0
3,402
0.015805
"""Modulo que contiene la clase directorio de funciones ----------------------------------------------------------------- Compilers Design Project Tec de Monterrey Julio Cesar Aguilar Villanueva A01152537 Jose Fernando Davila Orta A00999281 ----------------------------------------------------------------- DOCUM...
davilajose23/ProjectCobra
functions_dir.py
Python
mit
10,907
0.004034
""" URL routing for blogs, entries and feeds """ from django.conf.urls.defaults import patterns, url from django.conf import settings from feeds import LatestEntriesByBlog, LatestEntries #, EntryComments from models import Blog from views import generic_blog_entry_view, blog_detail from viewpoint.settings import USE_C...
callowayproject/django-viewpoint
viewpoint/urls_defaultblog.py
Python
apache-2.0
2,705
0.026248
from setuptools import setup import os.path setup( name='State Fragility', version='1', py_modules=['state_fragility'], data_files=[('', [ "./state_fragility.db" ])] )
RealTimeWeb/datasets
datasets/python/state_fragility/setup.py
Python
gpl-2.0
198
0.005051
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from .textEditDialog import cTextEditDialog class cCellRendererText(Gtk.CellRendererText): """ Label entry cell which calls TextEdit_Dialog upon editing """ __gtype_name__ = 'CellRendererCustomText' def __init__(self, parent): ...
jtk1rk/xsubedit
gcustom/cellRendererText.py
Python
gpl-3.0
923
0.004334
# encoding: utf-8 """ Admin interface for the sphinxdoc app. """ from django.contrib import admin from sphinxdoc.models import Project, Document class ProjectAdmin(admin.ModelAdmin): """Admin interface for :class:`~sphinxdoc.models.Project`.""" list_display = ('name', 'path',) prepopulated_fields = {'sl...
yawd/django-sphinxdoc
sphinxdoc/admin.py
Python
bsd-3-clause
659
0
# -*- coding: utf-8 -*- ############################################################################## # # Author Vincent Renaville. Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publis...
yvaucher/account-financial-tools
__unported__/account_compute_tax_amount/__openerp__.py
Python
agpl-3.0
1,342
0.003726
########################################################################## # # Copyright (c) 2017, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
lucienfostier/gaffer
python/GafferUI/ButtonPlugValueWidget.py
Python
bsd-3-clause
3,794
0.03611
import ure as re r = re.compile('( )') try: s = r.split("a b c foobar") except NotImplementedError: print('NotImplementedError')
mhoffma/micropython
tests/extmod/ure_split_notimpl.py
Python
mit
138
0
import numpy as np import matplotlib.pyplot as plt def generate_random(a, M, c, seed): for i in range(1000 * seed // 10): seed = (a * seed + c) % M return seed / M y = [generate_random(45, 989993, 12, i) for i in range(1000)] plt.plot(np.arange(1000), y) plt.show()
LorenzoBi/courses
UQ/rand_gen.py
Python
mit
286
0.003497
#!/usr/bin/python2 # -*- coding: utf-8 -*- from setuptools import setup, find_packages import re, os PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__)) with open(os.path.join(PACKAGE_PATH, 'pythonvideoannotator','__init__.py'), 'r') as fd: content = fd.read() version = re.search( r'^__versio...
UmSenhorQualquer/pythonVideoAnnotator
base/pythonvideoannotator/setup.py
Python
mit
2,475
0.013737
from django.db import models import socket,logging # Create your models here. class Sensor(models.Model): timestamp = models.DateTimeField(auto_now_add=True) env_light = models.IntegerField() env_humid = models.IntegerField() env_raindrop = models.IntegerField() env_temperature = models.IntegerFie...
izhaohui/gardener
controller/home/flower/models.py
Python
gpl-3.0
2,048
0.001953
# Read from an MQTT queue and write events to Influxdb import argparse import asyncio import time import sys from collections import namedtuple from thingflow.base import Scheduler, SensorEvent from thingflow.adapters.mqtt import MQTTReader import thingflow.filters.select # adds select() method import thingflow.filte...
jfischer/micropython-iot-hackathon
example_code/server_mqtt_to_influx.py
Python
mit
2,908
0.003783
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django_countries import CountryField from django.contrib.localflavor.us.models import * from django.contrib.localflavor.us.us_states im...
jedp/oakland_pm
core/models.py
Python
mit
8,624
0.007189
from __future__ import print_function import os import argparse import re import six import yaml DEFAULT_CONFIG_FILE = 'ynab.yaml' class ConfigEnvArgumentParser(argparse.ArgumentParser): def __init__(self, *args, **kwargs): super(ConfigEnvArgumentParser, self).__init__(*args, **kwargs) try: ...
rienafairefr/pynYNAB
pynYNAB/scripts/helpers.py
Python
mit
2,659
0.001128
# # Copyright 2013 Quantopian, 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 wr...
DVegaCapital/zipline
tests/test_exception_handling.py
Python
apache-2.0
3,339
0
# *************************************************************************** # * * # * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
timthelion/FreeCAD
src/Mod/Fem/_CommandBeamSection.py
Python
lgpl-2.1
2,767
0.001084
# -*- coding: utf-8 -*- from distutils.core import setup from pyrobotics.BB import __version__ setup(name='pyRobotics', version=__version__, author='Adrián Revuelta Cuauhtli', author_email='adrianrc.89@gmail.com', url='http://bioroboticsunam.github.io/pyRobotics', license='LICENSE.txt', data_fil...
BioRoboticsUNAM/pyRobotics
setup.py
Python
mit
513
0.017578
# Copyright 2017 The Oppia 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 applicable ...
himanshu-dixit/oppia
core/controllers/learner_playlist_test.py
Python
apache-2.0
14,127
0.001628
""" audio device support class(es) https://libvirt.org/formatdomain.html#audio-devices """ from virttest.libvirt_xml import accessors from virttest.libvirt_xml.devices import base class Audio(base.UntypedDeviceBase): __slots__ = ('id', 'type', 'attrs', 'input_attrs', 'input_settings', 'output_...
avocado-framework/avocado-vt
virttest/libvirt_xml/devices/audio.py
Python
gpl-2.0
1,707
0
import unittest import numpy as np import pydrake from pydrake.solvers import ik import os.path class TestRBTIK(unittest.TestCase): def testPostureConstraint(self): r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf")) q = -0.9 posture_con...
billhoffman/drake
drake/bindings/python/pydrake/test/testRBTIK.py
Python
bsd-3-clause
1,165
0.006009
#File: default.py """ Provides a default style for bib4txt.py Produces a list of citations that to be included in a reStructuredText document. (In very simple documents, can also provide citation reference formatting by substituting in the document text for the citation references.) A style includes: - citation templ...
matthew-brett/bibstuff
bibstuff/bibstyles/default.py
Python
mit
4,900
0.02102
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import sys from powerline.lint.selfcheck import havemarks class WithPath(object): def __init__(self, import_paths): self.import_paths = import_paths def __enter__(self): self.oldpath = sys.path ...
xfumihiro/powerline
powerline/lint/imp.py
Python
mit
1,573
0.028043
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0005_question_event'), ] operations = [ migrations.CreateModel( name='Topic', fields=[ ...
javierwilson/forocacao
forocacao/app/migrations/0006_auto_20160808_1041.py
Python
bsd-3-clause
1,212
0.0033
# # Copyright (c) 2008-2015 Citrix Systems, 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...
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationwebauthpolicy_systemglobal_binding.py
Python
apache-2.0
5,383
0.036597
import collections import lxml.objectify import mock import zeit.cms.repository.interfaces import zeit.cms.tagging.interfaces import zeit.cms.tagging.tag import zope.component import zope.interface NAMESPACE = "http://namespaces.zeit.de/CMS/tagging" KEYWORD_PROPERTY = ('testtags', NAMESPACE) class DummyTagger(objec...
ZeitOnline/zeit.cms
src/zeit/cms/tagging/testing.py
Python
bsd-3-clause
5,795
0
# # IIT Kharagpur - Hall Management System # System to manage Halls of residences, Warden grant requests, student complaints # hall worker attendances and salary payments # # MIT License # """ @ authors: Madhav Datt, Avikalp Srivastava """ from ..database import db_func as db from ..database import password_validatio...
madhav-datt/kgp-hms
src/workers/mess_manager.py
Python
mit
2,480
0.000806
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
Python
bsd-3-clause
22,390
0.002635
""" gdalinfo tests/gis_tests/data/rasters/raster.tif: Driver: GTiff/GeoTIFF Files: tests/gis_tests/data/rasters/raster.tif Size is 163, 174 Coordinate System is: PROJCS["NAD83 / Florida GDL Albers", GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010002...
cloudera/hue
desktop/core/ext-py/Django-1.11.29/tests/gis_tests/gdal_tests/test_raster.py
Python
apache-2.0
21,062
0.000902
import os import sys from Bio.Seq import Seq def main(*args, **kwargs): fpath = os.path.join(os.getcwd(), args[-2]) tmp = [] with open(fpath,'r') as f: for line in f: txt = line.strip() tmp.append(txt) S1 = set(tmp) S2 = set([str(Seq(s).reverse_complement()) for s ...
crf1111/Bio-Informatics-Learning
Bio-StrongHold/src/Constructing_a_De_Bruijn_Graph.py
Python
mit
685
0.013139
from django.contrib import messages from django.shortcuts import render, redirect from django.template.loader import render_to_string from tower import ugettext as _ from .forms import ReportForm from ..base.utils import notify_admins from ..base.decorators import throttle_view @throttle_view(methods=['POST'], durat...
mozilla/popcorn_maker
popcorn_gallery/reports/views.py
Python
bsd-3-clause
1,003
0
import os import unittest from conans.model.ref import ConanFileReference, PackageReference from conans.test.utils.conanfile import TestConanFile from conans.test.utils.tools import TestClient, TestServer,\ NO_SETTINGS_PACKAGE_ID from conans.util.files import set_dirty class PackageIngrityTest(unittest.TestCase)...
memsharded/conan
conans/test/functional/old/package_integrity_test.py
Python
mit
2,451
0.00204
''' Core Abstraction ================ This module defines the abstraction layers for our core providers and their implementations. For further information, please refer to :ref:`architecture` and the :ref:`providers` section of the documentation. In most cases, you shouldn't directly use a library that's already cove...
JulienMcJay/eclock
windows/kivy/kivy/core/__init__.py
Python
gpl-2.0
4,391
0
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import pytest from io import BytesIO from rinoh.backen...
brechtm/rinohtype
tests/test_pdf_reader.py
Python
agpl-3.0
3,238
0
import setuptools with open("README.rst") as f: long_description = f.read() setuptools.setup( name='django-diplomacy', version="0.8.0", author='Jeff Bradberry', author_email='jeff.bradberry@gmail.com', description='A play-by-web app for Diplomacy', long_description=long_description, ...
jbradberry/django-diplomacy
setup.py
Python
mit
915
0.001093
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # OK anaconda2 + freeglut+pyopengl # sous windows: # - telecharger freeglut ici: http://freeglut.sourceforge.net/ # - renommer freeglut.dll en freeglut64.vc14.dll et la mettre dans le path # en cas de non chargement regarder ce qui se passe dans C:\Python37\Lib\site-pac...
rboman/progs
sandbox/pyopengl/ball_glut.py
Python
apache-2.0
1,601
0.021861
# Copyright DataStax, 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, softwa...
mambocab/python-driver
tests/integration/cqlengine/statements/test_update_statement.py
Python
apache-2.0
3,975
0.001761
# -*- coding: utf-8 -*- # Copyright 2017 Stein & Gabelgaard ApS # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, fields, models, _, exceptions import logging _logger = logging.getLogger(__name__) class CamposActivitySignupMembers(models.TransientModel): _name = 'campos.act...
sl2017/campos
campos_activity/wizards/campos_activity_signup_wiz.py
Python
agpl-3.0
10,652
0.008261
import pandas import tensorflow as tf from threading import Thread from math import ceil from six.moves import range from util.audio import audiofile_to_input_vector from util.gpu import get_available_gpus from util.text_RHL import ctc_label_dense_to_sparse, text_to_char_array class DataSets(object): def __init_...
pandeydivesh15/AVSR-Deep-Speech
util/data_set_helpers_RHL.py
Python
gpl-2.0
7,982
0.004009
# -*- coding: utf-8 -*- """ :copyright: (c) 2014 by the mediaTUM authors :license: GPL3, see COPYING for details """ from core.test.asserts import assert_deprecation_warning def test_getContainerChildren(some_node): container_children = assert_deprecation_warning(some_node.getContainerChildren) assert...
mediatum/mediatum
core/test/test_containertype.py
Python
gpl-3.0
581
0.008606
"""Discover devices that implement the Spotify Connect platform.""" from . import MDNSDiscoverable class Discoverable(MDNSDiscoverable): """Add support for discovering Spotify Connect service.""" def __init__(self, nd): """Initialize the Cast discovery.""" super(Discoverable, self).__init__(n...
balloob/netdisco
netdisco/discoverables/spotify_connect.py
Python
mit
355
0