code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
import matlab.engine as mateng from time import time import IPython import numpy as np import matplotlib.pyplot as plt from matplotlib import offsetbox from sklearn import (manifold, datasets, decomposition, ensemble, lda, random_projection, preprocessing, covariance) from scipy import linalg import argparse import pic...
BerkeleyAutomation/vtsc
scripts/tsne.py
Python
mit
6,008
# 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 ...
jkonecki/autorest
AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureParameterGrouping/autorestparametergroupingtestservice/models/parameter_grouping_post_optional_parameters.py
Python
mit
924
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
rvs/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/walreceiver/test_pg_stat_replication.py
Python
apache-2.0
4,676
# encoding: utf-8 # module PyQt4.QtXml # from /usr/lib/python2.7/dist-packages/PyQt4/QtXml.so # by generator 1.135 # no doc # no imports from QXmlContentHandler import QXmlContentHandler from QXmlErrorHandler import QXmlErrorHandler from QXmlDTDHandler import QXmlDTDHandler from QXmlEntityResolver import QXmlEntity...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyQt4/QtXml/__init__/QXmlDefaultHandler.py
Python
gpl-2.0
5,937
# -*- coding: utf-8 -*- from base import WindowReaderBase, WindowHandlerBase from lib import util import xbmc T = util.T class PlayerStatus(WindowHandlerBase): ID = 'playerstatus' def init(self): self.mode = None self.progress = '' return self def updateMode(self,new_mode): ...
ruuk/service.xbmc.tts
lib/windows/playerstatus.py
Python
gpl-2.0
3,761
__author__ = '1' from pytest_bdd import given, when, then from model.group import Group import random @given('a group list') def group_list(db): return db.get_group_list() @given('a group with <name>, <header> and <footer>') def new_group(name, header, footer): return Group(name=name, header=header, footer=f...
liliasapurina/python_training
bdd/group_steps.py
Python
apache-2.0
1,525
#coding:utf-8 from django.core.management.commands.makemessages import Command as MakeMessagesCommand from django.core.management.commands.compilemessages import Command as CompileMessagesCommand from cactus.utils.filesystem import chdir DEFAULT_COMMAND_KWARGS = { # Command Options "verbosity": 3, "setti...
eudicots/Cactus
cactus/i18n/commands.py
Python
bsd-3-clause
1,581
# -*- coding: utf-8 -*- import re import math import unicodedata from collections import Counter def strip_accents(s): return ''.join(c for c in unicodedata.normalize('NFKD', s) if unicodedata.category(c) != 'Mn') # Returns a dial code string for a word. ## Omits special characters def word_to_number(word): num...
Acmezon/text-prediction
functions.py
Python
gpl-3.0
1,841
#! /usr/bin/env python """ UFW-profiles Copyright (C) 2013 Danilo Queiroz 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. Thi...
daniloqueiroz/ufw-profiles
src/ufw_profiles_notifier.py
Python
gpl-3.0
1,494
from cme.helpers.powershell import * from cme.helpers.logger import write_log from io import StringIO from datetime import datetime class CMEModule: ''' Digs up saved session information for PuTTY, WinSCP, FileZilla, SuperPuTTY, and RDP using SessionGopher https://github.com/fireeye/SessionGopher ...
jorik041/CrackMapExec
cme/modules/invoke_sessiongopher.py
Python
bsd-2-clause
2,809
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005-2009, TUBITAK/UEKAE # # 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 ...
ertugerata/iso-work
pisiman/repotools/packages.py
Python
gpl-2.0
13,307
# -*- coding: UTF-8 -*- import numpy as np from numpy import linspace from igakit.nurbs import NURBS from .op_nurbs import opNURBS from .io import XML, TXT, NML import sys from caid.core import bspline as bsplinelib _bsp = bsplinelib.bsp from numpy import pi, sqrt, array, zeros # ... TODO to move from here def coupl...
ratnania/caid
caid/cad_geometry.py
Python
mit
142,872
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Pychart 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, or (at your option) any # later version. # # Pychart is dis...
cecep-edu/refactory
requirements/PyChart-1.39/demos/tickmarks.py
Python
gpl-3.0
1,167
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.1.4" class CMakeIncludeGuardConan(ConanFile): name = "cmake-include-guard" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" url = "http://github.com/polysquare/cmake-include-gu...
polysquare/cmake-include-guard
conanfile.py
Python
mit
1,085
import operator import os from datetime import datetime from flask import (Blueprint, render_template, flash, redirect, url_for, g, session, current_app, request, Markup, abort) from flask_babel import gettext from sqlalchemy.exc import IntegrityError import crypto_util import store from db import...
garrettr/securedrop
securedrop/source_app/main.py
Python
agpl-3.0
8,639
# -*- coding: utf-8 -*- # # Copyright 2019 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...
tseaver/google-cloud-python
phishingprotection/google/cloud/phishingprotection_v1beta1/__init__.py
Python
apache-2.0
1,064
# # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without restrict...
longde123/MultiversePlatform
server/config/common/extensions.py
Python
mit
1,807
from setuptools import ( setup, find_packages, ) setup( name='chromalog', url='http://chromalog.readthedocs.org/en/latest/index.html', author='Julien Kauffmann', author_email='julien.kauffmann@freelan.org', maintainer='Julien Kauffmann', maintainer_email='julien.kauffmann@freelan.org', ...
freelan-developers/chromalog
setup.py
Python
mit
1,855
# -*- coding: utf-8 -*- # # Molo documentation build configuration file, created by # sphinx-quickstart on Fri May 29 11:39:46 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
praekelt/molo
docs/conf.py
Python
bsd-2-clause
9,427
from django.shortcuts import render, get_object_or_404 from .models import InternationalOrganization def organization_list(request): countries = InternationalOrganization.objects.all() return render(request, "intl_orgs/organization_list.html", {"countries": countries}) def organization_detail(r...
bennylope/ciafactbook
intl_orgs/views.py
Python
bsd-2-clause
513
from tkinter import * # Set up dictionaries to hold any windows, along with their widgets. # Keeps things organised, in my opinion. windows = {} widgets = {} class MainWindow(): def __init__(self, windows): # Assign the main window to self.parent, since it will serve as the parent of all the widgets in this class....
fschirinzi/PersonalFinancialPlan
Midas_UI.py
Python
gpl-2.0
3,446
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'mr.S' from kernel.db import Base from sqlalchemy import Column, Integer, String, ForeignKey from sqlalchemy.orm import relationship, backref class UserRole(Base): __tablename__ = 's_user_role' id = Column(Integer, primary_key=True) c...
s-tar/project_kate
entities/s_user_role.py
Python
mit
403
print_timers = False """ Timers from SO """ def tic(): import time global startTime_for_tictoc startTime_for_tictoc = time.time() def toc(label): import time if 'startTime_for_tictoc' in globals(): if print_timers: print(" > {:f}s in {:s}".format(time.time() - startTime_for_tictoc...
maxhutch/nek-analyze
tictoc.py
Python
gpl-3.0
382
from django import forms from django.contrib.auth.models import User from models.Author import Author from models.Post import Post VISIBILITY_OPTIONS = (('PUBLIC','PUBLIC'), ('PRIVATE','PRIVATE'), ('FRIENDS','FRIENDS'), ('FOAF','FOAF'), ('SERVERONLY','SERVERONLY')) CONTENT_TYPE = (('text/plain','text/plain'),('text/ma...
CMPUT404Team/CMPUT404-project-socialdistribution
cmput404project/service/PostForm.py
Python
apache-2.0
1,631
import numpy as np from scipy._lib.decorator import decorator as _decorator __all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d'] @_decorator def _held_figure(func, obj, ax=None, **kw): import matplotlib.pyplot as plt # type: ignore[import] if ax is None: fig = plt.figure() ...
andyfaff/scipy
scipy/spatial/_plotutils.py
Python
bsd-3-clause
7,059
#nice trick with counting letter import pprint message = '''sjfaghuklfsdhg klhfsghdfslkjghdfsulh glkfsdhg shg;adiofasd;vn cnvalhgughadsjg hfashklghae rlghaf lkghafsljkgh alfkhg''' count = {} for character in message.lower(): count.setdefault(character, 0) #defaultne setne, ze pro kazdy charakter, pokud nema ...
taryodor/Automate
dict_trick.py
Python
gpl-3.0
397
''' Created on 16.04.2014 @author: Christoph Gerneth ''' import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,parentdir) from optparse import OptionParser from stundenplanparser.stundenplanparser import Timetableparser from stundenplanparser.ical import ICal usage ...
monz/TimetableParser
examples/create_calendar.py
Python
mit
931
# -*- coding: utf-8 -*- import gzip import os from tempfile import mkdtemp import urllib from django.conf import settings from django.core.management.base import NoArgsCommand from shutil import rmtree class Command(NoArgsCommand): help = "Update the GeoIP-Database" url = "http://geolite.maxmind.com/download/...
tdf/tdc
counter/management/commands/geoip_update.py
Python
gpl-3.0
1,130
from PIL import Image def parse_rgb5a3(data, width): if ((len(data))/2) % width != 0: raise ValueError("Invalid number of tiles for width {}".format(width)) height = (len(data))//(width * 2) img = Image.new("RGBA", size=(width, height)) imgdata = reorder_tiles(data, (4, 4), width, 16) pixma...
sopoforic/cgrr-gamecube
graphics.py
Python
gpl-3.0
2,996
from django.shortcuts import render, get_object_or_404 from .models import * from django.contrib.auth.decorators import user_passes_test def view_page(request, slug): page = get_object_or_404( Page, slug=slug, visible=True ) page.views += 1 page.save() return render(request, 'page.html', { 'page': page }) @user_p...
xXcoronaXx/Dblog
statics_pages/views.py
Python
mit
501
################################################################ # CreditPiggy - Volunteering Computing Credit Bank Project # Copyright (C) 2015 Ioannis Charalampidis # # 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 Fr...
wavesoft/creditpiggy
creditpiggy-server/creditpiggy/api/admin.py
Python
gpl-2.0
1,840
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sheeshmohsin.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
sheeshmohsin/sheeshmohsin
manage.py
Python
mit
255
# # 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 us...
chuckchen/spark
python/pyspark/sql/tests/test_arrow.py
Python
apache-2.0
28,676
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 Daniel Estevez <daniel@destevez.net> # # This file is part of gr-satellites # # SPDX-License-Identifier: GPL-3.0-or-later # from gnuradio import gr, blocks from ... import pdu_to_kiss from ...utils.options_block import options_block from ...grtypes impo...
daniestevez/gr-satellites
python/components/datasinks/kiss_file_sink.py
Python
gpl-3.0
1,743
import datetime import base64 import binascii import logging import socket import json import time from pajbot.web.utils import requires_level from pajbot.models.user import User from pajbot.models.command import Command, CommandManager from pajbot.models.module import ModuleManager, Module from pajbot.models.timer im...
gigglearrows/anniesbot
pajbot/web/models/api.py
Python
mit
19,664
# -*- coding: utf-8 -*- # wasp_general/network/web.py # # Copyright (C) 2016 the wasp-general authors and contributors # <see AUTHORS file> # # This file is part of wasp-general. # # Wasp-general is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as pub...
a1ezzz/wasp-general
wasp_general/network/web/request.py
Python
lgpl-3.0
4,630
from BakedPie import BakedPie def implemented_instance(): return BakedPie( # these fields will set upon initialization visible = 'visible', virtual = 'virtual', list = [], # these following fields will be ignored completely read_only = 'read_only', not_implemented = 'not_implemented', is_dirty = True ...
cripplet/mudpy
TestMud.py
Python
mit
3,605
default_app_config = 'workflow.apps.WorkflowAppConfig'
toladata/TolaActivity
workflow/__init__.py
Python
apache-2.0
55
""" Miscellaneous stuff. """ from django.core.urlresolvers import reverse import datetime import re import mimetypes import BeautifulSoup import logging logging = logging.getLogger('donomo-archive') # # pylint: disable-msg=C0103,W0142 # # C0103 - variables at module scope must be all caps # W0142 - use of * a...
alexissmirnov/donomo
donomo_archive/lib/donomo/archive/utils/misc.py
Python
bsd-3-clause
7,225
# Copyright 2012 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
cmin764/cloudbase-init
cloudbaseinit/osutils/windows.py
Python
apache-2.0
42,295
# -*- coding: utf-8 -*- # Copyright (C) 2018 Mathew Topper # # 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 vers...
DTOcean/dtocean-app
dtocean_app/widgets/extendedcombobox.py
Python
gpl-3.0
2,900
#!/usr/bin/env python # This is loosely based on RunClientServer.py and TestClient.py, but # is heavily modified to work in fbcode. In particular, all the assertions # are borrowed from testClient.py # # This starts up a bunch of servers, one for each of the server type # and socket typecombinations we have. It then ...
Orvid/fbthrift
thrift/test/py/TestClientServer.py
Python
apache-2.0
14,423
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-07-11 16:18 import django.contrib.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0008_alter_user_username_max_length'), ('essauth', '0014_auto_20180528_1501'), ] o...
ESSolutions/ESSArch_Core
ESSArch_Core/auth/migrations/0015_proxypermission.py
Python
gpl-3.0
852
# definitions which are not being deprecated from wagtail.admin.forms from .models import ( # NOQA FORM_FIELD_OVERRIDES, DIRECT_FORM_FIELD_OVERRIDES, formfield_for_dbfield, WagtailAdminModelFormMetaclass, WagtailAdminModelForm ) from .pages import WagtailAdminPageForm # NOQA
mikedingjan/wagtail
wagtail/admin/forms/__init__.py
Python
bsd-3-clause
282
from sorl.thumbnail import default def thumbnail(file_, geometry, **kwargs): thumbnail = default.backend.get_thumbnail(file_, geometry, **kwargs) return thumbnail
softak/webfaction_demo
utils/thumbnail.py
Python
bsd-3-clause
172
import os, sys import numpy as np import pickle import zipfile import cv2 import glob import shutil def split(root_src, root_tar, train_ratio, val_ratio): fns = np.array(glob.glob(os.path.join(root_src, '**', '*.jpg'))) i_rnd = np.random.permutation(len(fns)) fns = fns[i_rnd] n = len(fns) n_tr...
googleinterns/intern2020_cocal
uncertainty/data/init_officehome32.py
Python
apache-2.0
3,205
#!/usr/bin/python command = testtex_command (parent + "/oiio-images/grid.tx", " -width 0") outputs = [ "out.exr" ]
jeremyselan/oiio
testsuite/texture-pointsample/run.py
Python
bsd-3-clause
117
import json import struct from whacked4.dehacked.table import ThingFlag class ExecutableReader: def __init__(self, engine): self.engine = engine def read_executable(self, engine_filename, exe_filename): """ Reads engine data from a game executable, using a JSON file as base. ...
GitExl/WhackEd4
src/whacked4/dehacked/executable_reader.py
Python
bsd-2-clause
7,589
import unittest from os import getcwd, path from maisen_core.helpers.runprogram import run_program class TestRunProgram(unittest.TestCase): def test_outputs(self): "Test outputs from program runner." pass def test_catching_program_errors(self): pass
mdziurzynski/maisen_core
tests/testrunprogram.py
Python
mit
287
# amazon plugin by ine (2020) from util import hook from utilities import request from bs4 import BeautifulSoup import re def parse(html): soup = BeautifulSoup(html, 'lxml') container = soup.find(attrs={'data-component-type': 's-search-results'}) if container is None: return [] results = cont...
FrozenPigs/Taigabot
plugins/amazon.py
Python
gpl-3.0
2,394
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2019-09-20 13:45 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import cmj.mixins class Migration(migrations.Migration): dependencies = [ ('conten...
cmjatai/cmj
cmj/core/migrations/0020_certidaopublicacao.py
Python
gpl-3.0
2,140
import tablib from django.db import migrations from ..utils import import_data def run_data_import(resource, filename): def import_initial_data(apps, schema_editor): import_data(resource, f'municipal_finance/fixtures/initial/{filename}') return migrations.RunPython(import_initial_data)
Code4SA/municipal-data
municipal_finance/migrations/__init__.py
Python
mit
310
# Copyright 2012 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 # # Unless required by applicable law or agreed to in...
Sazzadmasud/Keystone_hash_token
keystone/common/sql/migrate_repo/versions/007_add_domain_tables.py
Python
apache-2.0
2,846
import json import os import datetime for i in range(9): try: os.chdir('../call_record/') with open('callsSortedperson_'+str(i)+'.json','r') as f: data=json.load(f) print 'User: ',i #print len(data) friends=[] for j in range(len(data)): #print data[j][0] friends.append(data[j][0]) ...
shreya2111/Recommender-System
outgoing_call_count.py
Python
gpl-2.0
1,175
# *-* coding: UTF-8 *-* from google.appengine.api import app_identity from google.appengine.api import taskqueue from audi.contrib import jinja_bootstrap import os import sys import i18n import logging import traceback import webapp2 import httpagentparser def handle_error(request, response, exception): exc_type...
sangwonl/audi
audi/contrib/error_handler.py
Python
mit
3,927
import numpy from chainer import backend from chainer.backends import cuda from chainer import function from chainer.utils import type_check def _hinge_fwd_kernel(): return cuda.elementwise( 'S t', 'raw T bottom_diff', 'int ind[] = {i, t}; bottom_diff[ind] *= -1', 'hinge_fwd') class Hin...
okuta/chainer
chainer/functions/loss/hinge.py
Python
mit
6,291
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2011 Tim G L Lyons # # 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; eith...
Forage/Gramps
gramps/gen/filters/rules/person/_hastextmatchingsubstringof.py
Python
gpl-2.0
8,835
""" WSGI config for ngs project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` sett...
eco32i/ngs
ngs/wsgi.py
Python
mit
1,410
# -*- coding: utf-8 -*- # # wheezy.core documentation build configuration file, created by # sphinx-quickstart on Fri Sep 9 20:36:50 2011. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
ezotrank/wheezy.template
doc/conf.py
Python
mit
7,922
# Copyright (C) 2012 Daniil Egorov <datsideofthemoon@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 3 of the License, or # (at your option) any later version. # This...
datsideofthemoon/openbts-webui
urls.py
Python
gpl-3.0
1,973
""" A wrap of Maya's Vector, Point, Color, Matrix, TransformationMatrix, Quaternion, EulerRotation types """ import sys import math, copy import operator, colorsys import pymel.util as util import pymel.api as _api from pymel.util.arrays import * from pymel.util.arrays import _toCompOrArrayInstance import pymel.inter...
CountZer0/PipelineConstructionSet
python/maya/site-packages/pymel-1.0.5/pymel/core/datatypes.py
Python
bsd-3-clause
156,088
# geotecha - A software suite for geotechncial engineering # Copyright (C) 2018 Rohan T. Walker (rtrwalker@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 3 of the L...
rtrwalker/geotecha
geotecha/mathematics/fourier.py
Python
gpl-3.0
31,968
# Written by Raynor Vliegendhart # see LICENSE.txt for license information """ This module contains a class to read stopwords from files in the Snowball format. """ import os ## For some reason, this sometimes fails on my machine: #from Tribler.__init__ import LIBRARYNAME #DEFAULT_STOPWORDS_FILE = os.path.j...
egbertbouman/tribler-g
Tribler/Core/Tag/StopwordsFilter.py
Python
lgpl-2.1
1,161
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import argparse import numpy as np from sklearn.svm import SVC from sklearn.decomposition import RandomizedPCA from sklearn.ensemble import ExtraTreesClassifier from sklearn.cross_validation import train_test_split from pre_process import load_npz, merge_geno_ph...
celiacintas/prediction_tests
methods.py
Python
gpl-2.0
4,035
# -*- coding: utf-8 -*- # This file is subject to the terms and conditions defined in # file 'LICENSE', which is part of this source code package. # Copyright (c) 2013 R Pratap Chakravarthy """This package contain a collection of directives for reStrucutred text. """ try : import pagd.rst.sourcecode im...
prataprc/pagd
pagd/rst/__init__.py
Python
gpl-3.0
424
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # Copyright (C) 2011 Khaled Ben Bahri - Institut Telecom # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundati...
pombredanne/TSP-CloudStack
src/it/tsp/cloudstack/pimf/extract_cr.py
Python
gpl-3.0
2,778
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright Eezee-It # # 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, eith...
QinerTech/QinerApps
openerp/addons/payment_sips/__openerp__.py
Python
gpl-3.0
1,335
import ops
pastephens/pysal
pysal/contrib/geotable/__init__.py
Python
bsd-3-clause
11
# Copyright (C) 2014 Kiyonari Harigae <lakshmi at cloudysunny14 org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
Zouyiran/ryu
ryu/app/rest_qos.py
Python
apache-2.0
39,701
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, # # Diego Muñoz Escalante. # # (pacoqueen@users.sourceforge.ne...
pacoqueen/ginn
ginn/formularios/tipos_material_balas.py
Python
gpl-2.0
6,729
"""Calculate how many years for population to hit value p.""" def nb_year(p0, percent, aug, p): """Calculate how many years for population to hit value p.""" perc = (float(percent) / 100) count = 0 while p0 < p: new_people = p0 * perc + aug p0 += new_people count += 1 retur...
pasaunders/code-katas
src/np_year.py
Python
mit
328
import json from collections import defaultdict from django.conf import settings from django.contrib import messages from django.contrib.auth.models import User from django.contrib.auth.views import PasswordResetConfirmView from django.core.exceptions import ValidationError from django.http import Http404, HttpRespons...
dimagi/commcare-hq
corehq/apps/domain/views/settings.py
Python
bsd-3-clause
20,232
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Build and install the TweetNaCl wrapper. """ from __future__ import print_function import sys, os from distutils.core import setup, Extension, Command from distutils.util import get_platform def setup_path(): # copied from distutils/command/build.py plat_name...
warner/python-tweetnacl
setup.py
Python
mit
4,417
from django.urls import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from django.core.cache import cache from django.db import connection from lfs.core.fields.thumbs import ImageWithTh...
diefenbach/django-lfs
lfs/manufacturer/models.py
Python
bsd-3-clause
8,542
from consonance.protocol import WANoiseProtocol from consonance.streams.segmented.segmented import SegmentedStream from consonance.exceptions.handshake_failed_exception import HandshakeFailedException from consonance.config.client import ClientConfig from consonance.structs.keypair import KeyPair from consonance.struct...
tgalal/yowsup
yowsup/layers/noise/workers/handshake.py
Python
gpl-3.0
1,636
# Copyright (c) 2010-2012 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 # # Unless required by applicable law or agree...
williamthegrey/swift
test/unit/common/test_utils.py
Python
apache-2.0
225,885
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-22 22:06 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gardens', '0002_auto_20170722_2155'), ] operations = [ migrations.AddField(...
bengosney/rhgd3
gardens/migrations/0003_garden_sub_title.py
Python
gpl-3.0
465
#!/usr/bin/env python """ 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");...
alexryndin/ambari
ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
Python
apache-2.0
12,374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
Alex-Zamora/cms-basico-django
blog/migrations/0001_initial.py
Python
gpl-3.0
1,660
#!/usr/local/bin/python import http.cookies as Cookie from io import open import os import sys import enviro # noqa class Security(object): cfgfile = None def __init__(self, siteid=None): self.cgibin = '../cgi-bin' self.is_beta = False self.is_alpha = False self.read_versio...
ddierschow/bamca
bin/secure.py
Python
mit
4,951
../../../../../../share/pyshared/mx/DateTime/mxDateTime/test.py
Alberto-Beralix/Beralix
i386-squashfs-root/usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/test.py
Python
gpl-3.0
63
#!/usr/bin/env python3 import os from pathlib import Path from ruamel import yaml import torchvision def download_mnist(base, name, is_train=True): dataset = torchvision.datasets.MNIST( root=base.joinpath(".cache"), train=is_train, download=True ) converted_path = base.joinpath(name) converte...
FederatedAI/FATE
examples/scripts/download_mnist_data_as_images.py
Python
apache-2.0
1,627
''' Created on Jan 16, 2014 @author: sean ''' from __future__ import absolute_import, division, print_function import json import os from conda.compat import PY3 from .environ import get_dict as get_environ _setuptools_data = None def load_setuptools(setup_file='setup.py'): global _setuptools_data if _set...
mwcraig/conda-build
conda_build/jinja_context.py
Python
bsd-3-clause
1,276
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Frontend.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
vitoss/Corpo-Chat
Frontend/manage.py
Python
mit
251
from __future__ import absolute_import import gzip from webassets.filter import Filter __all__ = ('GZip',) class GZip(Filter): """Applies gzip compression to the content given. This can be used if you are unable to let the webserver do the compression on the fly, or just want to do precaching for add...
mozilla/verbatim
vendor/lib/python/webassets/filter/gzip.py
Python
gpl-2.0
682
# -*- coding: utf-8 -*- from .tools import append_menuitem_copy from .tools import set_menu_handlers from .tools import unset_menu_handlers from .tools import clone_mnu from .tools import DIALOG_DICT from .tools import edit
melviso/phycpp
beatle/app/ui/tools/__init__.py
Python
gpl-2.0
225
#-*- coding: utf-8 -*- from django.core.exceptions import PermissionDenied def popup_status(request): return '_popup' in request.REQUEST or 'pop' in request.REQUEST def selectfolder_status(request): return 'select_folder' in request.REQUEST def popup_param(request): if popup_status(request): r...
hzlf/openbroadcast
website/__filer/admin/tools.py
Python
gpl-3.0
1,521
# coding: utf-8 problem = """ Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5: 2^2=4, 2^3=8, 2^4=16, 2^5=32 3^2=9, 3^3=27, 3^4=81, 3^5=243 4^2=16, 4^3=64, 4^4=256, 4^5=1024 5^2=25, 5^3=125, 5^4=625, 5^5=3125 If they are then placed in numerical order, with any repeats removed, we get the followin...
lorenyu/project-euler
problem-029.py
Python
mit
646
""" Tests to ensure only the report files we want are returned as part of run_quality. """ import unittest from unittest.mock import patch import pavelib.quality class TestGetReportFiles(unittest.TestCase): """ Ensure only the report files we want are returned as part of run_quality. """ @patch('...
edx/edx-platform
pavelib/paver_tests/test_paver_get_quality_reports.py
Python
agpl-3.0
1,515
"""A simple event tracking library"""
GbalsaC/bitnamiP
venv/src/event-tracking/eventtracking/__init__.py
Python
agpl-3.0
38
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
cvandeplas/plaso
plaso/parsers/olecf_plugins/summary_test.py
Python
apache-2.0
4,825
import numpy as np from golem import DataSet from golem.nodes import BaseNode from ..utils import sliding_window_indices class SlidingWindow(BaseNode): def __init__(self, win_size, win_step, ref_point=.5): BaseNode.__init__(self) self.win_size = win_size self.win_step = win_step self.ref_frame = int(...
breuderink/psychic
psychic/nodes/window.py
Python
bsd-3-clause
1,701
# # Copyright (c) 2006-2009 Advanced Micro Devices, Inc. All Rights Reserved. # This software is subject to the Apache v2.0 License. # from __future__ import with_statement # Utility module for Framewave's SCons scripts import glob import os from string import replace from os.path import * import sys ...
svn2github/framewave-trunk
BuildTools/buildscripts/fwutil.py
Python
apache-2.0
8,470
# -*- coding: utf-8 -*- # # 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 #...
Tagar/incubator-airflow
airflow/contrib/operators/jira_operator.py
Python
apache-2.0
4,279
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Demo of using Cedrus RB730 hardware """ from psychopy.hardware import cedrus from psychopy import core import sys rb730 = cedrus.RB730(7, baudrate=115200) # Get RB info print(rb730.getInfo()) # this is the time taken to send a signal to the unit and back via USB: pr...
psychopy/psychopy
psychopy/demos/coder/hardware/cedrusRB730.py
Python
gpl-3.0
902
""" course_catalog models tests """ import pytest from course_catalog.constants import AvailabilityType, OfferedBy, PlatformType from course_catalog.factories import ( CourseFactory, LearningResourceOfferorFactory, LearningResourceRunFactory, ProgramFactory, UserListFactory, UserListItemFactor...
mitodl/open-discussions
course_catalog/models_test.py
Python
bsd-3-clause
4,446
#!/usr/bin/env python3 # # Author: Chema Garcia (aka sch3m4) # @sch3m4 # https://github.com/thiber-org/userline # import sys import time import json import logging import argparse from datetime import timedelta,datetime from dateutil import parser as dateparser from elasticsearch_dsl import Search,Q,...
THIBER-ORG/userline
src/userline.py
Python
bsd-3-clause
12,747
from __future__ import absolute_import import functools __all__ = ['memo','retry'] def retry(maxRetries, *exceptions): """ Retry Decorator. Realizar un retry de la funcion si esta levanta alguna de las ``exceptions``. Hace tantos retries como ``maxRetries``. """ def _doDecoration(fn): ...
santisiri/popego
popego/popserver/popserver/lib/functional.py
Python
bsd-3-clause
2,849
# -*- coding: utf-8 -*- from flask import Blueprint asset_manager = Blueprint('asset_manager', '__name__')
Arbotk/GroupHelper
grouphelper/asset_manager/__init__.py
Python
gpl-2.0
108
# -*- coding: utf-8 -*- # flickr downloader # By Oros # Licence Public Domaine import json, os, sys, itertools try: import urllib.request as u except ImportError: import urllib as u for site in sys.argv[1:]: d="./{s}/".format(s=site.rstrip('/').split('/')[-1]) if not os.path.exists(d): os.makedirs(d) for p in it...
Oros42/flickr_downloader
flickr_downloader.py
Python
unlicense
831