repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
ellisk42/TikZ
recognitionModel.py
1
68120
from spatial_transformer import * from mixtureDensityNetwork import * from distanceExamples import * from architectures import architectures from batch import BatchIterator from language import * from render import render,animateMatrices from utilities import * from distanceMetrics import blurredDistance,asymmetricBlur...
gpl-3.0
8,548,411,201,155,972,000
45.308634
206
0.558617
false
eokyere/ccdfgh
ccdf.py
1
17214
import datetime Mandatory = 100 RequiredConditional = 200 IfAvailable = 300 FIELD_NO = 0 FIELD_NAME = 1 FIELD_TYPE = 2 FIELD_LENGTH = 3 FIELD_OPTIONS = 4 OTHER_ID = ( ('', 'Not Available'), ('STAFF', 'Staff ID'), ('STUD', 'Student ID'), ('SERV', 'Service ID'), ('NHIS', 'National Health Insurance ID'), ) MARIT...
mit
6,816,729,376,058,748,000
33.222664
105
0.656733
false
AhmedArslan/Pyntheon
pyntheon/pyntheon.py
1
9694
#!/usr/bin/env python # # Pyntheon; A resource for common lab specimens from virus to human # to analyze their proteins for the presence of Posttranslational modifications (PTMs) # in a large set of proteins of interest, also analyze the presence of mutations # overlap with the modified residues. # Besides this, Pynt...
mit
-5,463,098,049,978,268,000
39.902954
144
0.666392
false
Wurldtech/beepy
beepy/core/frame.py
1
12855
# $Id: frame.py,v 1.11 2004/09/28 01:19:20 jpwarren Exp $ # $Revision: 1.11 $ # # BEEPy - A Python BEEP Library # Copyright (c) 2002-2004 Justin Warren <daedalus@eigenmagic.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # ...
lgpl-2.1
-7,086,396,115,041,308,000
32.046272
156
0.616725
false
tomatohater/django-staticshard
docs/conf.py
1
8202
# -*- coding: utf-8 -*- # # django-pgcryptoauth documentation build configuration file, created by # sphinx-quickstart on Wed Nov 21 01:32:47 2012. # # 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 f...
mit
-5,443,916,250,706,051,000
31.164706
80
0.705803
false
Azure/azure-sdk-for-python
sdk/powerbiembedded/azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/models/__init__.py
1
3021
# 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 ...
mit
291,678,717,651,188,300
41.549296
91
0.742469
false
atzengin/OCC
occ/occ_ocvc/blks2/packet.py
1
9789
# Copyright 2008,2009,2012-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later...
gpl-3.0
-6,145,824,515,688,930,000
38
136
0.590867
false
DarkStarSword/StereoCropper
directx/types.py
1
35586
from ctypes import * from ctypes.wintypes import * from comtypes import * #******************************************************************** # # Typedefs and constants # #******************************************************************** REFGUID = POINTER(GUID) UINT = c_uint INT = c_int ...
gpl-3.0
7,054,927,187,856,822,000
27.004075
86
0.444669
false
eavatar/ava
src/eavatar.ava/ava/cmds/cli.py
1
2333
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import os import sys import glob import logging import click from importlib import import_module from ava.runtime import environ _MODULES_DIR = os.path.join('mods', 'commands') # the package name for modules. _...
bsd-3-clause
-4,171,653,097,202,309,000
27.120482
135
0.626232
false
erobinson/cloop
device/processes/sync_device_phone.py
1
17255
# ############################################ # # Edward Robinson # # Python script to sync the device db # and the phone db. Sync via xml messages. # # ############################################ import os import MySQLdb import bluetooth import time import logging import signal import datetime import cloop_db # fro...
gpl-2.0
-742,701,840,596,971,000
40.678744
107
0.565227
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/work_bulk_v30.py
1
3129
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
-1,837,777,454,946,984,000
26.9375
119
0.541707
false
nicoddemus/pytest
testing/test_cacheprovider.py
1
42733
import os import shutil import sys from pathlib import Path from typing import List import pytest from _pytest.config import ExitCode from _pytest.monkeypatch import MonkeyPatch from _pytest.pytester import Pytester from _pytest.tmpdir import TempPathFactory pytest_plugins = ("pytester",) class TestNewAPI: def ...
mit
-1,121,340,439,791,011,600
33.517771
98
0.523928
false
nakednamor/naked-python
samples/methods.py
1
2379
# methods are created using the def keyword and brackets def first_method (): print("I'm the first method") # methods are called as expected first_method() # methods can have arguments def parameter_method(param1, param2, param3): print("passed param1: " + param1) print("passed param2: " + param2) pri...
mit
231,020,471,468,134,940
29.5
72
0.699033
false
pouyaAB/ros_teleoperate
al5d/scripts/test_network_robot.py
1
11897
import sys from local_config import config locals().update(config) sys.path.append("../../") import os from cv_bridge import CvBridge, CvBridgeError import sys import std_msgs.msg from sensor_msgs.msg import Image import rospy import threading import signal import cv2 import numpy as np import configparser import cs...
mit
8,649,533,933,775,080,000
41.187943
178
0.555602
false
jfinkels/PADS
tests/test_biconnectivity.py
1
1519
import unittest from pads.biconnectivity import is_biconnected from pads.biconnectivity import st_orientation from pads.biconnectivity import BiconnectedComponents from pads.partial_order import TopologicalOrder class BiconnectivityTest(unittest.TestCase): G1 = { 0: [1,2,5], 1: [0,5], 2: ...
mit
2,163,454,089,163,000,600
28.784314
75
0.539171
false
tetherless-world/dco-elasticsearch
ingest/ingestHelpers.py
1
8158
__author__ = 'Hao' from rdflib import Namespace, RDF from itertools import chain import argparse from SPARQLWrapper import SPARQLWrapper, JSON import json from rdflib import Namespace, RDF PROV = Namespace("http://www.w3.org/ns/prov#") BIBO = Namespace("http://purl.org/ontology/bibo/") VCARD = Namespace("http://www.w...
lgpl-3.0
-497,398,907,724,857,000
36.944186
143
0.644521
false
zacherytapp/wedding
weddingapp/apps/home/views.py
1
1697
from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.edit import CreateView, UpdateView, DeleteView from story.models import Story, Timeline from gallery.models import Gallery from party.models import PartyMember from information.models import InformationDetail fr...
bsd-3-clause
-5,974,705,921,774,026,000
41.425
78
0.776665
false
gogobody/lifebone
article/admin.py
1
1349
# coding: utf-8 from django.contrib import admin from comment.models import Comment from models import Article class CommentInline(admin.TabularInline): model = Comment readonly_fields = ("owner", "content", "status", "create_timestamp") fieldsets = ( (None, { "fields": ("owner", "con...
gpl-2.0
-5,963,574,223,190,653,000
29.340909
115
0.599251
false
shenfei/oj_codes
leetcode/python/n48_Rotate_Image.py
1
1054
def swap(m, coord): i0, j0 = coord[-1] tmp = m[i0][j0] for i, j in reversed(coord[:-1]): m[i0][j0] = m[i][j] i0, j0 = i, j m[i0][j0] = tmp def side_rotate(m, idx, size): for k in range(size - 1): coord = [(idx, idx + k), (idx + k, idx + size - 1), ...
mit
5,316,033,107,966,581,000
24.095238
76
0.426945
false
Hao-Liu/avocado
avocado/core/restclient/cli/app.py
1
4537
# 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...
gpl-2.0
-699,910,421,660,753,300
32.607407
78
0.59136
false
MatthewThe/kaggle
titanic/bin/random_forest.py
1
2193
#!/usr/bin/python import csv import numpy as np from sklearn import svm from sklearn.ensemble import RandomForestClassifier import matplotlib.pyplot as plt # 0: PassengerId, 1: Survived, 2: Pclass, 3: Name, 4: Sex (male,female), 5: Age, 6: SibSp, 7: ParCh, 8: Ticket, 9: Fare, 10: Cabin, 11: Embarked (S,C,Q) # 1,0,3,"...
apache-2.0
527,554,253,547,165,060
28.635135
152
0.644779
false
erdc/proteus
proteus/tests/CLSVOF/with_RANS3PF/ls_p.py
1
1124
from __future__ import absolute_import from builtins import object from proteus import * from proteus.default_p import * from .multiphase import * from proteus.mprans import NCLS3P LevelModelType = NCLS3P.LevelModel coefficients = NCLS3P.Coefficients(V_model=V_model, RD_model=RD_mode...
mit
-4,951,817,361,576,982,000
33.060606
68
0.530249
false
NervanaSystems/neon
neon/visualizations/data.py
1
7476
# ****************************************************************************** # Copyright 2014-2018 Intel Corporation # # 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.apa...
apache-2.0
-5,459,447,796,421,233,000
35.827586
99
0.59992
false
gpospelov/BornAgain
Doc/PhysicsManual/fig/drawing/Green.py
1
3056
#!/usr/bin/env python3 """ Compute radiation trajectories through multilayer sample for use in figure that explains the Green function. """ xd = 52 yd = 10 # detector s = 3 # source located at -s T = [6, 6] # layer thickness sd = T[0] - s # distance from source to lower interface DeltaLayer = [.05, .1] # refracti...
gpl-3.0
-5,298,009,045,656,751,000
26.531532
80
0.491165
false
bradmwalker/wanmap
wanmap/__init__.py
1
1274
import logging from pyramid.config import Configurator from pyramid.session import SignedCookieSessionFactory from sqlalchemy.orm import configure_mappers from .schema import Persistable # Import persistable subclasses without cycles. from . import ( # noqa network, scans, ) # run configure_mappers after def...
mit
-3,335,895,843,328,695,300
26.695652
66
0.708006
false
diefenbach/django-us
us/tests/browser_tests.py
1
4457
import re from django.core.urlresolvers import reverse import pytest from selenium.common.exceptions import NoSuchElementException @pytest.mark.browser_test def test_add_url_form(browser, user_with_perm, live_server): url = reverse("us_add_url_form") browser.get(live_server.url + url) _login(browser) ...
bsd-3-clause
8,229,795,121,381,634,000
33.284615
79
0.678483
false
TamiaLab/carnetdumaker
apps/licenses/admin.py
1
2019
""" Admin views for the licenses app. """ from django.contrib import admin from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _ from .models import License class LicenseAdmin(admin.ModelAdmin): """ Admin form for the ``License`` data model. """ list_disp...
agpl-3.0
-8,921,883,607,128,972,000
25.92
68
0.475978
false
makhomed/fabrix
contrib/create-server-partitions-2-devices/fabfile.py
1
6724
""" create partitions on bare metal server for zfs storage expected bare metal server with two *empty* HDDs /dev/sda and /dev/sdb in LiveCD mode $ fab server_create_partitions create partitions, /boot mdraid and LVM volumes on top of mdraid: GPT: /dev/sda1, /dev/sdb1 - 2014s - bios_grub partitions /dev/sda2, /d...
gpl-3.0
-875,203,391,519,666,200
32.287129
101
0.585961
false
kupferlauncher/kupfer
kupfer/plugin/thunderbird_support.py
1
12481
# -*- coding: utf-8 -*- ''' Module provide function to read Thunderbird's address book. Concept for mork parser from: - demork.py by Kumaran Santhanam - mork.cs from GnomeDo by Pierre Östlund 2021-01-01 Add support sqlite address book file format ''' import os import re from configparser import RawConfigPars...
gpl-3.0
-1,773,362,905,539,394,300
32.18883
83
0.485776
false
jbowes/yselect
test/fakes/package_sack.py
1
1108
# yselect - An RPM/Yum package handling frontend. # Copyright (C) 2006 James Bowes <jbowes@redhat.com> # Copyright (C) 2006 Devan Goodwin <dg@fnordia.org> # # 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...
gpl-2.0
-5,271,485,938,667,365,000
30.657143
72
0.704874
false
tjcsl/ion
intranet/apps/eighth/migrations/0001_initial.py
1
7379
# -*- coding: utf-8 -*- from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('auth', '__first__')] operations = [ migrations.CreateModel( name='EighthA...
gpl-2.0
-7,994,381,863,572,326,000
46.301282
145
0.573113
false
molski/pmag
models.py
1
3672
from . import base_models class Single11(base_models.SingleLabelModel): patch_size = 11 weight_shapes = { 'w_c1': [4, 4, 4, 1, 64], 'w_c2': [3, 3, 3, 64, 64], 'w_c3': [3, 3, 3, 64, 128], 'w_c4': [3, 3, 3, 128, 128], 'w_fc1': [1024, 512], 'w_fc2': [512, 512], ...
mit
-7,129,855,554,206,926,000
20.473684
45
0.405229
false
timpalpant/KaggleBillionWordImputation
scripts/find_missing_word_pos_ngram_gap.py
1
1938
#!/usr/bin/env python ''' Identify the location of a missing word in a sentence using a POS-tag n-gram model. Computes gap likelihood as: P(gap) = P(a, *, b) / P(a, b) ''' import sys, argparse, pickle from collections import defaultdict import numpy as np from scipy.misc import logsumexp from util import window, tok...
gpl-3.0
-1,279,219,915,256,001,000
30.258065
65
0.631579
false
henrysher/duplicity
duplicity/backends/jottacloudbackend.py
1
5657
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*- # # Copyright 2014 Håvard Gulldahl # # in part based on dpbxbackend.py: # Copyright 2013 jno <jno@pisem.net> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU ...
gpl-2.0
-7,411,561,866,758,260,000
35.025478
96
0.660361
false
Code4SA/umibukela
umibukela/migrations/0024_funder-fill.py
1
1502
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from umibukela.models import Programme, Funder def noop(apps, schema_editor): pass def create_funders(apps, schema_editor): mavc = Funder(name="MAVC") mavc.save() sash_funder = Funder(name="Brot fur die...
mit
-7,118,993,164,979,846,000
31.652174
174
0.650466
false
Esri/hermes
src/hermes/common.py
1
2027
""" Copyright 2015 Esri 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 ...
apache-2.0
-5,853,898,637,292,269,000
32.229508
75
0.607301
false
josecolella/PLD
src/TreasureHunters.py
1
1999
import pygame from game import Game from menu import * from gameoptions import * class TreasureHunters(object): """ This class represents the global game which includes the menu. Create to encapsulate the initialization of the game """ menu_music = "audio/menu.ogg" @staticmethod def star...
mit
-5,266,492,012,962,927,000
30.234375
69
0.6003
false
jmbeuken/abinit
developers/maintainers/list-cpp-options.py
1
1275
#!/usr/bin/env python from __future__ import print_function import os import re import sys fortran = re.compile("\.([Ff]|[Ff]90)$") cppline = re.compile("^#") cppkeys = ("define .*","include.*","ifdef","ifndef","elif","^if ","else","endif","defined","undef","!","&&","\|\|","\(","\)") def main(top): cppopts = dict(...
gpl-3.0
1,820,384,346,134,768,400
24.5
125
0.479216
false
dchud/sentinel
bin/scripts/fix-medline-metadata.py
1
2556
#!/usr/bin/env python2.3 # Fix one or all canary records by replacing all medline metadata # with results of a fresh pubmed query. # # $Id$ from optparse import OptionParser import pprint import time import canary.context from canary.loader import Parser, QueuedRecord from canary.search import PubmedSearch from cana...
mit
6,377,323,993,426,911,000
32.631579
84
0.623631
false
cpennington/edx-platform
common/djangoapps/terrain/stubs/lti.py
1
13171
""" Stub implementation of LTI Provider. What is supported: ------------------ 1.) This LTI Provider can service only one Tool Consumer at the same time. It is not possible to have this LTI multiple times on a single page in LMS. """ import base64 import hashlib import logging import os import textwrap from uuid i...
agpl-3.0
-5,977,926,249,054,291,000
40.031153
120
0.570496
false
Brazelton-Lab/lab_scripts
prokka_blast_pipeline.py
1
8272
#! /usr/bin/env python """ BLAST sequences from PROKKA annotations Takes a PROKKA FAA file and a file with an one or more IDs (each ID must be on its own line). If a PROKKA annotation description contains an ID in the IDs file, its sequence is BLASTed against NCBI BLAST and the results are written to a custom TSV. Th...
gpl-2.0
-3,402,509,142,417,538,600
39.748768
94
0.538443
false
tochikuji/pyPyrTools
pyrtools/steer2HarmMtx.py
1
2281
import numpy def steer2HarmMtx(*args): ''' Compute a steering matrix (maps a directional basis set onto the angular Fourier harmonics). HARMONICS is a vector specifying the angular harmonics contained in the steerable basis/filters. ANGLES (optional) is a vector specifying the angular p...
mit
-1,143,086,122,221,487,600
33.044776
100
0.560719
false
mikephp/basic_data_struct
src/python/str_tupe_list_dict.py
1
1031
#-*-coding:utf-8-*- #1¡¢×Öµä dict = {'name': 'Zara', 'age': 7, 'class': 'First'} print "dict" ,dict #×ÖµäתΪ×Ö·û´®£¬·µ»Ø£º<type 'str'> {'age': 7, 'name': 'Zara', 'class': 'First'} print type(str(dict)), str(dict) #×Öµä¿ÉÒÔתΪԪ×飬·µ»Ø£º('age', 'name', 'class') print tuple(dict.keys()) #×Öµä¿ÉÒÔתΪԪ×飬·µ»Ø£º(7, ...
gpl-2.0
-3,647,983,294,562,811,000
20.5
80
0.536372
false
pbugni/pheme.warehouse
pheme/warehouse/mirth_shell_commands.py
1
7753
"""Interface to a series of frequently used mirth shell commands. Project setup.py defines entry points for the functions below. """ import argparse import getpass import os import shutil import tempfile from pheme.util.config import Config from pheme.warehouse.mirth_channel_transform import TransformManager CHANN...
bsd-3-clause
-350,881,701,210,095,600
39.805263
78
0.60454
false
ray-project/ray
python/ray/util/collective/tests/distributed_cpu_tests/test_distributed_reducescatter.py
1
5205
"""Test the collective reducescatter API on a distributed Ray cluster.""" import pytest import ray import numpy as np import torch from ray.util.collective.types import Backend from ray.util.collective.tests.cpu_util import create_collective_workers, \ init_tensors_for_gather_scatter @pytest.mark.parametrize("b...
apache-2.0
3,969,932,730,724,788,700
39.348837
79
0.585783
false
Ebag333/Pyfa
eos/saveddata/crestchar.py
1
1399
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, ...
gpl-3.0
-1,484,187,016,517,416,700
30.795455
81
0.600429
false
silviuapostu/project-euler-solutions
51.py
1
1370
''' Prime digit replacements Find the smallest prime which, by replacing part of the number (not necessarily adjacent digits) with the same digit, is part of an eight prime value family. For a family of size 8, we can employ some optimizations: * only search for 3-repeated digits, since any other patterns will contai...
mit
-1,382,000,943,297,379,600
32.414634
79
0.59562
false
JanLaureys/chirp
Servo_Driver.py
1
2036
#!/usr/bin/python import time import math from Adafruit_I2C import Adafruit_I2C # ============================================================================ # Adafruit PCA9685 16-Channel PWM Servo Driver # ============================================================================ class PWM : i2c = None # Re...
mit
1,515,251,618,942,068,000
31.333333
78
0.54224
false
cjohnson318/geostatsmodels
geostatsmodels/simulation.py
1
2688
#!/usr/bin/env python import numpy as np import geostatsmodels.kriging as k import random def gridpath( xdim, ydim ): ''' Input: (xdim) iterable describing the start, stop, and no. steps (ydim) iterable describing the start, stop, and no. steps Output: (path) path through the 2D grid, a list ...
mit
2,718,245,654,744,868,000
34.84
69
0.565104
false
fbradyirl/home-assistant
homeassistant/components/opensky/sensor.py
1
5684
"""Sensor for the Open Sky Network.""" import logging from datetime import timedelta import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, CONF_LATITUDE, CONF_LO...
apache-2.0
3,807,361,929,285,148,700
29.395722
87
0.602393
false
pkilambi/python-kubernetes
kubernetes/pod.py
1
27703
#!/usr/bin/env python # # Copyright 2014 Cosmos.io # # 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 ...
apache-2.0
-6,371,762,940,621,166,000
25.896117
114
0.714688
false
bacemtayeb/Tierra
src/modules/attacks/beef_hook.py
1
3889
from attack import Attack from libmproxy import controller, proxy, platform from threading import Thread from zoption import Zoption import util class beef_hook(Attack): """ Injects BeEF hooks into poisoned traffic. Requires libmproxy and it's dependencies """ def __init__(self): super(be...
gpl-3.0
8,189,911,646,063,612,000
37.127451
111
0.519414
false
daviddrysdale/pynamo
vectorclock.py
1
6782
#!/usr/bin/env python """Vector clock class""" import copy # PART coreclass class VectorClock(object): def __init__(self): self.clock = {} # node => counter def update(self, node, counter): """Add a new node:counter value to a VectorClock.""" if node in self.clock and counter <= self...
gpl-2.0
2,458,317,359,843,545,600
34.883598
90
0.55839
false
depop/kombu
examples/simple_task_queue/client.py
1
1077
from __future__ import with_statement from kombu.common import maybe_declare from kombu.pools import producers from queues import task_exchange priority_to_routing_key = {'high': 'hipri', 'mid': 'midpri', 'low': 'lopri'} def send_as_task(connection, fun, args=(...
bsd-3-clause
8,975,392,671,591,617,000
33.741935
73
0.584958
false
umlsynco/umlsync
django_server/github/github/SSLMiddleware.2.py
1
2813
""" SSL Middleware Stephen Zabel This middleware answers the problem of redirecting to (and from) a SSL secured path by stating what paths should be secured in urls.py file. To secure a path, add the additional view_kwarg 'SSL':True to the view_kwargs. For example urlpatterns = patterns('some_site.some_app.views', ...
gpl-2.0
232,516,928,210,310,340
34.1625
85
0.714184
false
jandom/GromacsWrapper
staging/SunGridEngine.py
1
17146
# $Id: SunGridEngine.py 2765 2009-01-20 13:02:14Z oliver $ """ :mod:`staging.SunGridEngine` --- staging class for SunGridEngine ================================================================ Primitive framework for staging jobs in `Sun Grid Engine`_ via a customized :class:`Job` class. Example python submission scr...
gpl-3.0
3,551,175,902,556,135,000
38.874419
205
0.589059
false
jungla/ICOM-fluidity-toolbox
2D/RST/extract_Scalar_temp.py
1
3216
try: paraview.simple except: from paraview.simple import * import numpy as np from mpi4py import MPI import os import csv from scipy import interpolate import gc import sys gc.enable() comm = MPI.COMM_WORLD label = 'm_25_3b' labelo = 'm_25_3b' basename = 'mli' ## READ archive (too many points... somehow) # args: n...
gpl-2.0
-8,916,378,337,202,013,000
25.360656
113
0.650498
false
nanophotonics/nplab
nplab/utils/gui_generator.py
1
19497
from __future__ import print_function from nplab.utils.gui import QtWidgets, uic, QtCore, get_qt_app from nplab.ui.ui_tools import UiTools import nplab.datafile as df from nplab.utils.log import create_logger, ColoredFormatter import os import sys import inspect import numpy as np import pyqtgraph import pyqtgraph.do...
gpl-3.0
-839,913,068,192,220,300
46.437956
137
0.595528
false
vt-rocksat-2017/waveforms
command/v1/tx_scram_rand.py
1
9135
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Tx Scram Rand # Generated: Wed May 24 11:14:20 2017 ################################################## from gnuradio import blocks from gnuradio import digital from gnuradio import e...
mit
-316,759,349,539,431,040
38.717391
350
0.595731
false
venkatarun95/genericCC
parsing_scripts/plot_vary_mahimahi_configs.py
1
10059
import argparse from fractions import Fraction import math import matplotlib.pyplot as plt import numpy as np import os import re import time import parse_ctcp_output import parse_tcptrace import analyse_data # Format:- # key: cc_type eg. 10x, 1000x, cubic, cubicsfqCodel etc. # value: dictionary: key - (vary_type, v...
gpl-2.0
-2,882,641,616,217,414,700
31.76873
149
0.648971
false
kongxu633/QBotWebWrap
qqbot/qqrobot/qqbot.py
1
26991
# -*- coding: utf-8 -*- import re import random import json import os import sys import datetime import time import threading import logging import urllib from HttpClient import HttpClient reload(sys) sys.setdefaultencoding("utf-8") HttpClient_Ist = HttpClient() ClientID = int(random.uniform(111111, 888888)) PTWebQ...
gpl-3.0
7,200,754,149,509,369,000
34.871831
589
0.50799
false
ladybug-tools/honeybee
honeybee_plus/radiance/command/_commandbase.py
1
8941
"""Radiance base command.""" from ... import config from abc import ABCMeta, abstractmethod, abstractproperty import os import subprocess try: basestring except NameError: basestring = str # TODO: Implement piping as on option class RadianceCommand(object): """Base class for commands.""" __metaclass...
gpl-3.0
5,149,770,594,522,316,000
33.925781
90
0.582821
false
MariusWirtz/TM1py
TM1py/Services/AnnotationService.py
1
3455
# -*- coding: utf-8 -*- import collections import json from TM1py.Objects.Annotation import Annotation from TM1py.Services.ObjectService import ObjectService class AnnotationService(ObjectService): """ Service to handle Object Updates for TM1 CellAnnotations """ def __init__(self, rest): su...
mit
1,133,109,939,761,928,700
38.712644
114
0.619392
false
apache/airflow
tests/providers/amazon/aws/operators/test_datasync.py
2
31328
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-5,457,388,098,031,156,000
35.555426
110
0.615584
false
surdy/dcos
packages/adminrouter/extra/src/test-harness/tests/open/test_master.py
1
3453
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. import logging import pytest import requests from generic_test_code.common import overridden_file_content from mocker.endpoints.mesos import AGENT1_ID log = logging.getLogger(__name__) authed_endpoints = [ '/acs/api/v1/reflect/me', '/capabiliti...
apache-2.0
-5,454,270,317,365,590,000
33.41
84
0.587039
false
chrysante87/pyterpol
pyterpol_test/test_interpolation_pollux/test_spectra_interpolation.py
1
1322
import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('../../') import pyterpol import time # create the grid - custom does nothing sygri = pyterpol.SyntheticGrid('POLLUX', debug=True) # interpolate at keys_0 = ['Z', 'LOGG', 'TEFF'] values = [[1.0, 4.0, 12000],[1.0, 4.0, 12200],[1.0, 3.8, 1220...
gpl-2.0
-7,589,531,889,224,292
27.12766
86
0.615734
false
lsaffre/lino-welfare
old/userman/conf.py
1
7931
# -*- coding: utf-8 -*- # # Multilingual websites with Sphinx documentation build configuration file, created by # sphinx-quickstart on Thu Nov 13 11:09:54 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the names...
agpl-3.0
3,183,005,372,753,296,000
29.503846
86
0.710881
false
ireicht/MITK-CSI
Modules/Biophotonics/python/inverseMonteCarlo/randomForest.py
1
2574
# -*- coding: utf-8 -*- """ Created on Fri Feb 6 10:49:45 2015 @author: wirkert """ import numpy as np import time from sklearn.ensemble import RandomForestRegressor from sklearn.grid_search import GridSearchCV from sklearn.cross_validation import KFold from sklearn import decomposition from setup imp...
bsd-3-clause
-7,508,443,931,209,781,000
27.285714
93
0.725719
false
mikalstill/nova
nova/api/openstack/compute/baremetal_nodes.py
1
5862
# Copyright (c) 2013 NTT DOCOMO, INC. # Copyright 2014 IBM Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
apache-2.0
3,847,050,993,347,530,000
37.313725
78
0.613101
false
ceholden/glmnet-python
glmnet/utils.py
1
2509
""" Utility functions for helping compute GLMNET models """ import numpy as np def mse_path(X, y, coefs, intercepts): """ Return mean squared error for sets of estimated coefficients Args: X (np.ndarray): 2D (n_obs x n_features) design matrix y (np.ndarray): 1D dependent variable coef...
gpl-2.0
7,725,468,921,753,172,000
32.013158
74
0.614986
false
infinitewarp/trekipsum
trekipsum/dialog/sqlite.py
1
3977
import logging import random import sqlite3 from os import path from ..exceptions import NoDialogFoundException logger = logging.getLogger(__name__) DEFAULT_SQLITE_PATH = path.join(path.dirname(path.dirname(path.abspath(__file__))), 'assets', 'dialog.sqlite') class DialogChooser(obj...
mit
-1,442,615,503,549,719,800
38.376238
97
0.58436
false
googleinterns/nlu-seq2graph
src/fscore.py
1
2355
""" Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
apache-2.0
-889,365,399,966,447,000
27.719512
78
0.637792
false
jonocodes/gedit-code-assistance
backends/python/gcpbackendpython/backend.py
1
1686
# gcp python backend # Copyright (C) 2012 Jesse van den Kieboom <jessevdk@gnome.org> # # 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...
gpl-3.0
-4,535,501,780,231,729,700
31.423077
76
0.693357
false
necaris/python3-openid
openid/test/linkparse.py
1
2912
from openid.consumer.html_parse import parseLinkAttrs import os.path import codecs import unittest def parseLink(line): parts = line.split() optional = parts[0] == 'Link*:' assert optional or parts[0] == 'Link:' attrs = {} for attr in parts[1:]: k, v = attr.split('=', 1) if k[-1] ...
apache-2.0
-3,989,369,364,840,291,300
24.321739
73
0.544643
false
suever/MATL-Online
tests/test_utils.py
1
1949
"""Unit tests for utils module.""" import os import shutil from matl_online.utils import unzip from .mocks import MockZipFile class TestUnzip: """Test unzip functionality.""" def test_unzip_and_flatten(self, mocker, tmpdir): """Check that flattening of parent directories works as expected.""" ...
mit
-5,944,450,522,117,513,000
27.661765
76
0.628014
false
rshriram/api
python/istio_api/envoy/config/filter/http/authn/v2alpha1/config_pb2.py
1
6164
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: envoy/config/filter/http/authn/v2alpha1/config.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goog...
apache-2.0
2,475,099,444,822,425,600
44.659259
687
0.754543
false
Yepoleb/gogdb
gogdb/legacy/model/product.py
1
7873
import sqlalchemy as sql from sqlalchemy import orm from sqlalchemy import Column from gogdb.legacy.database import Base from gogdb.legacy.model.common import get_systems_list, set_systems_list class Product(Base): __tablename__ = "products" id = Column(sql.Integer, primary_key=True, autoincrement=False) ...
agpl-3.0
-121,311,483,122,139,360
32.7897
79
0.642195
false
holmqvisttobias/awsCrud
awsInstanceClasses.py
1
3578
#!/usr/bin/python # @Author: Tobias Holmqvist <tohol> # @Date: 2017-09-11 # @Email: tobias.m.holmqvist@gmail.com # @Project: awsCrud # @Last modified by: tohol # @Last modified time: 2017-09-11 # @License: GPLv3 class Instances: def __init__(self, response): # New instance object self.__insta...
gpl-3.0
669,386,238,064,529,700
31.234234
79
0.583287
false
leiserfg/flask-restplus
flask_restplus/api.py
1
30265
# -*- coding: utf-8 -*- from __future__ import unicode_literals import difflib import inspect import operator import re import sys from functools import wraps, partial from types import MethodType from flask import url_for, request, current_app from flask import make_response as original_flask_make_response from fla...
mit
5,843,273,044,682,983,000
38.717848
117
0.62042
false
comp-imaging/ProxImaL
proximal/tests/test_problem.py
1
4366
import numpy as np import pytest from proximal.tests.base_test import BaseTest from proximal.lin_ops import Variable, mul_elemwise, subsample from proximal.prox_fns import norm1, sum_squares from proximal.algorithms import Problem from proximal.utils.utils import Impl import cvxpy as cvx class TestProblem(BaseTest):...
mit
-2,827,798,927,692,872,700
36
75
0.564819
false
shelari/prereform_to_contemporary
transliterator.py
1
17684
# -*- coding: utf-8 -*- __author__ = 'ElenaSidorova' import re from copy import deepcopy from dict_settings import DictLoader signs = [u'!', u'?', u',', u'.', u':', u')', u'(', u'«', u'»', u'“', u'”', u'-', u'–',u'`', u';', u'\\', u'/', u'@', u'"', u' ', u'<', u'>', u'$'] prefix = { re.compile(ur'^воз([пт...
mit
-6,262,544,985,312,217,000
36.912946
209
0.500059
false
bruecksen/isimip
isi_mip/climatemodels/migrations/0052_auto_20170119_1313.py
1
2659
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-19 12:13 from __future__ import unicode_literals from django.db import migrations, models from django.utils.text import slugify def create_sectors(apps, schema_editor): SectorModel = apps.get_model('climatemodels', 'Sector') SectorModel.objects....
mit
-443,416,539,107,838,340
44.844828
148
0.659646
false
Smashman/mods.tf
app/scripts/scripts.py
1
13186
import steam import urllib2 import datetime import os from steam.api import HTTPError, HTTPTimeoutError from steam.user import ProfileNotFoundError from .. import db, sentry from ..models import get_or_create from ..tf2.models import TF2Item, TF2Class, TF2BodyGroup, TF2ClassModel, TF2EquipRegion, all_classes from ..tf2...
gpl-3.0
3,436,019,187,317,279,000
51.325397
132
0.516078
false
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/scatter/_error_x.py
1
19360
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ErrorX(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatter" _path_str = "scatter.error_x" _valid_props = { "array", "arrayminus...
mit
-8,118,280,332,756,490,000
29.730159
82
0.542355
false
jacquesqiao/Paddle
python/paddle/reader/decorator.py
1
11828
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
9,090,622,917,781,333,000
28.204938
79
0.573301
false
jness/plugin.video.futurama
default.py
1
3027
import urllib,urllib2,re,xbmcplugin,xbmcgui def getURL(url): useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' req = urllib2.Request(url) req.add_header('User-Agent', useragent) response = urllib2.urlopen(req) link=response.read() response.close() return li...
gpl-2.0
4,732,513,819,222,563,000
27.28972
155
0.680542
false
atulac/KNIT-Training-And-Placement-Cell-Automation
DataManipulatorAndBroadcasting/Mail.py
1
8414
import os import sys import wx import mymail try: from agw import gradientbutton as GB bitmapDir = "bitmaps/" except ImportError: # if it's not there locally, try the wxPython lib. import wx.lib.agw.gradientbutton as GB bitmapDir = "agw/bitmaps/" wildcard = "Text File (*.txt)|*.txt|" \ ...
mit
6,523,552,358,717,956,000
38.066667
133
0.536725
false
fbraem/mqweb
samples/python/event.py
1
1448
''' This sample will read all event messages from a queue. MQWeb runs on localhost and is listening on port 8081. ''' import json import httplib import socket import argparse parser = argparse.ArgumentParser( description='MQWeb - Python sample - Browse Event Queue', epilog="For more information: http://www.mqweb....
mit
-74,620,894,797,271,310
29.808511
91
0.678867
false
arizvisa/syringe
lib/mpdebug/dbgeng/task.py
1
5280
import logging import _PyDbgEng from . import internalstate import ndk class registers_INT32(object): pc = property(fget=lambda self: self['eip']) sp = property(fget=lambda self: self['esp']) def __init__(self, task): self.task = task self.interface = task.host.interface.Registers def...
bsd-2-clause
3,416,762,676,093,701,600
39.930233
201
0.648106
false
DataONEorg/d1_python
client_cli/src/d1_cli/impl/util.py
1
4705
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
-4,451,373,233,732,804,000
30.577181
88
0.60085
false
Epoptes/epoptes
epoptes/ui/send_message.py
1
1757
# This file is part of Epoptes, http://epoptes.org # Copyright 2010-2018 the Epoptes team, see AUTHORS. # SPDX-License-Identifier: GPL-3.0-or-later """ Send message dialog. """ from epoptes.common import config from epoptes.ui.common import locate_resource from gi.repository import Gtk class SendMessage: """Load ...
gpl-3.0
-3,401,245,285,870,414,300
38.044444
78
0.612977
false
auag92/n2dm
Asap-3.8.4/Examples/Melting.py
1
1345
"Melting a copper cluster." from numpy import * from asap3 import Atoms, EMT, units from ase.visualize.primiplotter import * from ase.lattice.cubic import FaceCenteredCubic from asap3.md.langevin import Langevin # Create the atoms atoms = FaceCenteredCubic(size=(5,5,5), symbol="Cu", pbc=False) # Associate the EMT p...
mit
6,208,361,236,516,244,000
25.9
79
0.695167
false
aldian/tensorflow
tensorflow/python/framework/test_util_test.py
1
16448
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
2,666,331,531,892,416,000
33.921444
81
0.64938
false
AlexGidiotis/Multimodal-Gesture-Recognition-with-LSTMs-and-CTC
skeletal_network/velocity.py
1
1142
import pandas as pd from scipy.spatial.distance import pdist # calculates the velocity of both hands as the distance in pixels each hand has moved between consecutive frames # args: df: dataframe with the joint positions # returns: df: with two more columns appended for left and right hand velocities def calcula...
mit
675,155,068,787,662,100
40.37037
112
0.672504
false
studybuffalo/studybuffalo
study_buffalo/hc_dpd/migrations/0003_subahfs_subahfspend.py
1
1031
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-11-20 17:56 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hc_dpd', '0002_auto_20171120_1055'), ] operations = [ migrations.CreateMode...
gpl-3.0
4,291,106,319,242,335,700
32.258065
114
0.562561
false
micronurse-iot/micronurse-webserver-django
micronurse_webserver/url/v1/urls.py
1
5502
from django.conf.urls import url, include from micronurse_webserver.view.v1.iot import account as iot_account from micronurse_webserver.view.v1.mobile import friend_juan from micronurse_webserver.view.v1.mobile import account as mobile_account from micronurse_webserver.view.v1.mobile import sensor from micronurse_webse...
gpl-3.0
-6,731,952,219,633,080,000
55.142857
164
0.637768
false
stack-of-tasks/sot-dynamic-pinocchio
tests/python/reach_left_hand.py
1
1696
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST from dynamic_graph.sot.dynamic_pinocchio.tools import checkFinalConfiguration, clt, reach, robot, solver, timeStep # Move left wrist reach(robot, 'left-wrist', 0.25, 0, 0.1) # Push tasks # Operational po...
bsd-2-clause
-5,880,646,647,277,906,000
43.631579
118
0.719929
false
clchiou/garage
py/g1/operations/cores/tests/test_alerts.py
1
9229
import unittest import unittest.mock import io import re from g1.bases import datetimes from g1.operations.cores import alerts class ConfigTest(unittest.TestCase): def test_destination_slack(self): with self.assertRaisesRegex(AssertionError, r'expect true'): alerts.Config.SlackDestination()...
mit
8,843,202,482,590,288,000
31.960714
79
0.390617
false
BeenzSyed/tempest
tempest/cli/simple_read_only/test_keystone.py
1
4955
# Copyright 2013 OpenStack Foundation # 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 requ...
apache-2.0
4,200,197,287,878,003,700
37.115385
79
0.625025
false
ngpitt/wrpi-web
public/views.py
1
2659
from django.shortcuts import render from django.db.models import F from members.models import Show class TimeSlot(): def __init__(self, time, shows): self.time = time self.shows = shows class TimeSlotItem(): def __init__(self, name='', host='', genre='Empty', description='', row_span=1): ...
apache-2.0
2,199,357,928,306,302,700
49.169811
174
0.57578
false