repo_name
stringlengths
8
92
path
stringlengths
5
221
copies
stringclasses
10 values
size
stringlengths
4
6
content
stringlengths
974
828k
license
stringclasses
15 values
hash
int64
-9,212,977,344,346,658,000
9,220,224,517B
line_mean
float64
8.67
91.6
line_max
int64
15
966
alpha_frac
float64
0.29
0.86
autogenerated
bool
1 class
nl_text
stringlengths
0
164k
nl_size
int64
0
164k
nl_language
stringclasses
17 values
nl_language_score
float64
0.04
1
pansapiens/mytardis
tardis/apps/mx_views/views.py
3
2892
from django.conf import settings from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.http import HttpResponse from tardis.tardis_portal.auth import decorators as authz from tardis.tardis_portal.models import Dataset from tardis.tardis_portal.shortcuts import get_experiment_referer from tard...
bsd-3-clause
-8,726,488,663,588,781,000
37.052632
79
0.65491
false
Displays a MX Dataset and associated information. Shows a full (hundreds of images) dataset its metadata and a list of associated files with the option to show metadata of each file and ways to download those files. With write permission this page also allows uploading and metadata editing. Settings for this view: I...
687
en
0.873705
twidi/pytyrant
pytyrant.py
1
14361
"""Pure python implementation of the binary Tokyo Tyrant 1.1.17 protocol Tokyo Cabinet <http://tokyocabinet.sourceforge.net/> is a "super hyper ultra database manager" written and maintained by Mikio Hirabayashi and released under the LGPL. Tokyo Tyrant is the de facto database server for Tokyo Cabinet written and ma...
mit
-5,985,833,604,781,468,000
25.110909
114
0.572871
false
Tyrant Protocol constants Dict-like proxy for a Tyrant instance Hot-copy the database to path Call func(key, value) with opts opts is a bitflag that can be RDBXOLCKREC for record locking and/or RDBXOLCKGLB for global locking Get up to the first maxkeys starting with prefix Get the value of a key from...
2,884
en
0.728095
HonzaKral/curator
test_curator/integration/test_time_based.py
1
1872
from datetime import datetime, timedelta import curator from . import CuratorTestCase class TestTimeBasedDeletion(CuratorTestCase): def test_curator_will_properly_delete_indices(self): self.create_indices(10) self.run_curator(delete_older=3) mtd = self.client.cluster.state(index=self.args...
apache-2.0
-1,606,032,251,548,790,800
40.6
91
0.634615
false
wrong precision wrong prefix yesterday is always save since we reset to mignight and do <, not <=
97
en
0.87491
chaubold/hytra
tests/core/test_conflictingsegmentations.py
1
5839
from __future__ import print_function, absolute_import, nested_scopes, generators, division, with_statement, unicode_literals import logging from hytra.core.ilastik_project_options import IlastikProjectOptions from hytra.jst.conflictingsegmentsprobabilitygenerator import ConflictingSegmentsProbabilityGenerator from hy...
mit
-4,230,047,409,174,636,000
43.572519
125
0.679911
false
def test_twoSegmentations(): set up ConflictingSegmentsProbabilityGenerator ilpOptions = IlastikProjectOptions() ilpOptions.divisionClassifierPath = None ilpOptions.divisionClassifierFilename = None ilpOptions.rawImageFilename = 'tests/multiSegmentationHypothesesTestDataset/Raw.h5' ilpOptions.r...
4,642
en
0.494544
makelove/OpenCV-Python-Tutorial
ch21-轮廓Contours/21-findContour.py
1
1096
# -*- coding: utf-8 -*- import numpy as np import cv2 # im = cv2.imread('test.jpg')# # im = cv2.imread('poker5hearts.jpg')# # im = cv2.imread('../data/black-white-rect.png')#contour.jpg # im = cv2.imread('../data/chessboard.jpeg') imgray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) cv2.imshow("imgray", imgray) #需要注意的是cv2...
mit
-2,430,169,206,289,489,000
31.8
113
0.703252
false
-*- coding: utf-8 -*- im = cv2.imread('test.jpg') im = cv2.imread('poker5hearts.jpg') im = cv2.imread('../data/black-white-rect.png')contour.jpg 需要注意的是cv2.findContours()函数接受的参数为二值图,即黑白的(不是灰度图) 所以读取的图像要先转成灰度的,再转成二值图 ret, thresh = cv2.threshold(imgray, 0, 25, 0) ret, thresh = cv2.threshold(imgray, 0, 100, 0)src, thresh, ...
417
zh
0.186756
llllllllll/codetransformer
codetransformer/tests/test_code.py
1
5761
from dis import dis from io import StringIO from itertools import product, chain import random import sys import pytest from codetransformer.code import Code, Flag, pycode from codetransformer.instructions import LOAD_CONST, LOAD_FAST, uses_free @pytest.fixture(scope='module') def sample_flags(request): random....
gpl-2.0
-3,448,919,409,673,295,000
24.95045
79
0.571949
false
ayy lmao DO NOT ADD EXTRA LINES HERE pragma: no cover return None return None not in instrs pragma: no cover
108
en
0.443557
Azure/azure-sdk-for-python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_management_lock_client_enums.py
1
1363
# 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 may ...
mit
8,379,623,869,956,419,000
37.942857
94
0.599413
false
The lock level of the management lock. Return the enum member matching `name` We use __getattr__ instead of descriptors or inserting into the enum class' __dict__ in order to support `name` and `value` being both properties for enum members (which live in the class' __dict__) and enum members themselves. coding=...
765
en
0.715261
jvs/sourcer
tests/test_salesforce.py
1
5119
from sourcer import Grammar # This is work in progress. # See: https://help.salesforce.com/articleView?id=customize_functions.htm&type=5 g = Grammar(r''' ``` import ast ``` start = Expression Expression = OperatorPrecedence( Atom | "(" >> Expression << ")", Postfix(ArgumentList |...
mit
-7,452,110,781,552,088,000
27.126374
83
0.540535
false
This is work in progress. See: https://help.salesforce.com/articleView?id=customize_functions.htm&type=5 Incomplete collection of evaluators. Look up identifiers. Look up fields. Evaluate function calls and operators. Check if we're using an alias. Explicitly compare to True. Explicitly compare to False.
305
en
0.781889
lsaffre/timtools
timtools/sdoc/feeders.py
1
1705
## Copyright 2003-2009 Luc Saffre ## This file is part of the TimTools project. ## TimTools 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 v...
bsd-2-clause
5,341,080,861,915,417,000
27.416667
71
0.63871
false
Copyright 2003-2009 Luc Saffre This file is part of the TimTools project. TimTools 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. TimTools i...
745
en
0.879061
souravbadami/zulip
zerver/views/home.py
1
17065
from __future__ import absolute_import from typing import Any, List, Dict, Optional, Text from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, HttpRequest from django.shortcuts import redirect from django.utils import translation from...
apache-2.0
-2,616,524,014,721,912,000
44.75067
113
0.642309
false
Discrimiate CSS served to clients based on User Agent Due to QTBUG-3467, @font-face is not supported in QtWebKit. This may get fixed in the future, but for right now we can just serve the more conservative CSS to all our desktop apps. type: (HttpRequest) -> HttpResponse type: (UserProfile) -> int TODO: We may want t...
2,607
en
0.851039
ZeitOnline/zeit.newsletter
src/zeit/newsletter/browser/edit.py
1
2579
from zeit.cms.i18n import MessageFactory as _ from zope.cachedescriptors.property import Lazy as cachedproperty import os.path import zeit.cms.browser.view import zeit.cms.content.interfaces import zeit.cms.interfaces import zeit.content.image.interfaces import zeit.content.video.interfaces import zeit.edit.browser.for...
bsd-3-clause
-2,014,002,219,757,949,200
27.032609
79
0.67119
false
Handler to drop objects to the body's landing zone. Handler to drop objects after other objects. XXX copy&paste&tweak of zeit.content.cp.browser.blocks.teaser.Display
168
en
0.665579
vadyur/script.media.aggregator
anidub.py
1
12586
# coding: utf-8 import log from log import debug from settings import Settings from base import * import feedparser, urllib2, re from bs4 import BeautifulSoup from nfowriter import * from strmwriter import * import requests, filesystem ################################################################################...
gpl-3.0
2,000,693,373,387,839,200
26.610619
118
0.567228
false
coding: utf-8============================================================================================================================================================================================html_doc = '<?xml version="1.0" encoding="UTF-8" ?>\n<html>' + content.encode('utf-8') + '\n</html>'===================...
1,155
fr
0.288662
robdobsn/AmazonEchoShopping
WaitroseService/WaitroseScraper.py
1
20691
# Waitrose web scraper __author__ = 'robdobsn' from selenium import webdriver from selenium.webdriver.common.keys import Keys import selenium.webdriver.support.ui as webdriverui from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By from selenium.common.exceptions import...
isc
-783,531,863,977,082,500
46.895833
169
0.581654
false
Waitrose web scraper if self.execUsingJS: self.webDriver.execute_script("document.getElementsByClassName('" + elemId + "').value = '" + strToSend) else: Start the web driver (runs the browser) Clear current session file info Create WebDriver or add to your PATH Set the window size (seems to be n...
1,408
en
0.793458
kidscancode/gamedev
pygame template.py
1
1508
# Pygame Template # Use this to start a new Pygame project # KidsCanCode 2015 import pygame import random # define some colors (R, G, B) WHITE = (255, 255, 255) GREEN = (0, 255, 0) BLUE = (0, 0, 255) BLACK = (0, 0, 0) FUCHSIA = (255, 0, 255) GRAY = (128, 128, 128) LIME = (0, 128, 0) MAROON = (128, 0, 0) NAVYBLU...
mit
3,454,655,415,024,161,000
22.936508
55
0.63992
false
Pygame Template Use this to start a new Pygame project KidsCanCode 2015 define some colors (R, G, B) basic constants to set up your game initialize pygame initialize sound - uncomment if you're using sound pygame.mixer.init() create the game window and set the title start the clock set the 'running' variable to False t...
611
en
0.796027
JacobFischer/Joueur.py
games/anarchy/forecast.py
1
2074
# Forecast: The weather effect that will be applied at the end of a turn, which causes fires to spread. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from games.anarchy....
mit
66,524,175,843,730,740
37.407407
146
0.671167
false
The class representing the Forecast in the Anarchy game. The weather effect that will be applied at the end of a turn, which causes fires to spread. Initializes a Forecast with basic logic as provided by the Creer code generator. The Player that can use WeatherStations to control this Forecast when its the nextForecas...
1,437
en
0.896141
hhucn/git-vote
git-vote/__main__.py
1
3022
import argparse import collections import re import subprocess NOTES_REF = 'refs/notes/votes' Vote = collections.namedtuple('Vote', ['commit', 'user']) def vote(args): assert args.user, 'TODO: determine user automatically' vote = 'vote:%s' % args.user subprocess.check_call([ 'git', 'notes', '--ref', NOTES_R...
apache-2.0
2,600,720,082,252,724,000
28.627451
106
0.676704
false
Returns a dict commit id => set of users TODO: prevent voting twice as same user TODO use dulwich or something more efficient here TODO ignore invalid votes TODO check re for user spec TODO more algorithms
208
en
0.611144
DigitalCampus/django-nurhi-oppia
oppia/tests/av/test_permissions.py
1
2347
from django.urls import reverse from django.test import TestCase from oppia.tests.utils import * class PermissionsViewTest(TestCase): fixtures = ['user.json', 'oppia.json', 'quiz.json', 'permissions.json'] def setUp(self): super(PermissionsViewTest, self).setUp() self.login_url = reverse('pr...
gpl-3.0
-4,483,428,020,845,946,400
33.514706
79
0.608862
false
upload media file
17
en
0.967431
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/src/web.py
1
7411
# Copyright (c) 2014-2016 Cedric Bellegarde <cedric.bellegarde@adishatz.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 3 of the License, or # (at your option) any later vers...
gpl-3.0
2,696,436,820,573,915,000
36.619289
79
0.54716
false
Web helper Init helper Save item into collection as album @param item as SearchItem @param persistent as DbPersistent Save cover to store @param item as SearchItem @param album id as int Save item into collection as track @param item as SearchItem @param persistent as DbPersistent @param album artist as str @return (al...
1,679
en
0.90097
pybel/pybel
src/pybel/io/nodelink.py
1
7238
# -*- coding: utf-8 -*- """Conversion functions for BEL graphs with node-link JSON.""" import gzip import json from io import BytesIO from itertools import chain, count from operator import methodcaller from typing import Any, Mapping, TextIO, Union from networkx.utils import open_file from .utils import ensure_ver...
mit
2,647,336,991,651,230,700
31.168889
115
0.635811
false
Add the SHA-512 identifier to a node's dictionary. Return graph from node-link data format. Adapted from :func:`networkx.readwrite.json_graph.node_link_graph` Convert a BEL graph to a node-link format. :param graph: BEL Graph Adapted from :func:`networkx.readwrite.json_graph.node_link_data` Build a graph from node-l...
1,089
en
0.768174
seecr/meresco-examples
meresco/__init__.py
1
1394
## begin license ## # # "Meresco Examples" is a project demonstrating some of the # features of various components of the "Meresco Suite". # Also see http://meresco.org. # # Copyright (C) 2007-2008 SURF Foundation. http://www.surf.nl # Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl # Copyright (C) 2007...
gpl-2.0
-214,853,663,805,945,660
42.5625
95
0.738164
false
begin license "Meresco Examples" is a project demonstrating some of the features of various components of the "Meresco Suite". Also see http://meresco.org. Copyright (C) 2007-2008 SURF Foundation. http://www.surf.nl Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl Copyright (C) 2007-2009 Stichting Kenni...
1,252
en
0.812401
Mozu/mozu-python-sdk
mozurestsdk/platform/tenantextensions.py
1
2242
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
apache-2.0
-7,380,671,656,172,497,000
32.181818
266
0.727029
false
Retrieves the Arc.js configuration settings for a site. Args: | responseFields (string) - Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may ca...
1,036
en
0.586329
nigelb/SerialGrabber
examples/MQTT/SerialGrabber_Settings.py
1
2043
#!/usr/bin/env python # SerialGrabber reads data from a serial port and processes it with the # configured processor. # Copyright (C) 2012 NigelB # # 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 Foundatio...
gpl-2.0
1,560,382,958,900,706,000
33.05
75
0.751836
false
!/usr/bin/env python SerialGrabber reads data from a serial port and processes it with the configured processor. Copyright (C) 2012 NigelB 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 versi...
856
en
0.885872
lqmanh/daethon
test_daethon.py
1
1817
import os import sys import time import pytest from daethon import Daemon class TDaemon(Daemon): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) with open('testing_daemon', 'w') as f: f.write('inited') def run(self): time.sleep(1) with open(...
apache-2.0
-3,047,666,419,461,129,700
22.597403
66
0.603192
false
clean up files if necessary
27
en
0.147904
msteinhoff/foption-bot
src/python/core/messages.py
1
2244
# -*- coding: UTF-8 -*- """ $Id$ $URL$ Copyright (c) 2010 foption Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
mit
6,695,913,913,734,353,000
27.769231
77
0.750446
false
-*- coding: UTF-8 -*-reply.add('deine mutter hat gefailed.')return "OHFUCKOHFUCKOHFUCK Etwas lief schief! Datenbankfehler"return "Error 555!"reply.add('Deine Mutter hat die Datenbank gefressen')
194
de
0.81264
logicabrity/aeon
test/test_measurement.py
1
1229
import time import pytest from aeon.measurement import Measurement from aeon.errors import InvalidMeasurementState def test_cant_start_measurement_twice(): m = Measurement("name", "group") m.start() with pytest.raises(InvalidMeasurementState): m.start() def test_cant_stop_measurement_before_star...
mit
-1,662,716,423,659,156,000
21.345455
58
0.656631
false
0
en
0.110449
maas/maas
src/maasserver/middleware.py
1
18463
# Copyright 2012-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Access middleware.""" import http.client import json import logging from pprint import pformat import sys import traceback import attr from crochet import TimeoutError f...
agpl-3.0
-8,170,894,622,841,870,000
34.505769
96
0.611222
false
A middleware for handling RPC errors in API requests. Protect access to views. Most UI views are visible only to logged-in users, but there are pages that are accessible to anonymous users (e.g. the login page!) or that use other authentication (e.g. the MAAS API, which is managed through piston). A Middleware to deci...
4,482
en
0.836426
ivanamihalek/tcga
icgc/60_nextgen_production/65_reactome_tree.py
1
5057
#! /usr/bin/python3 # # This source code is part of icgc, an ICGC processing pipeline. # # Icgc 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 ...
gpl-3.0
-438,034,926,294,668,700
35.121429
120
0.677477
false
! /usr/bin/python3 This source code is part of icgc, an ICGC processing pipeline. Icgc 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. Icgc i...
1,453
en
0.884289
soccermetrics/marcotti-mls
marcottimls/models/financial.py
1
5658
from sqlalchemy import Column, Integer, String, Sequence, ForeignKey, ForeignKeyConstraint, Boolean from sqlalchemy.orm import relationship, backref from sqlalchemy.schema import CheckConstraint import enums from common import BaseSchema class AcquisitionPaths(BaseSchema): """ MLS player acquisition data mod...
mit
-645,660,621,350,676,700
42.19084
114
0.59597
false
MLS player acquisition data model. Captures **initial** entry path into league. Data model that captures player's partial-season tenure at a club. Player draft data model. Player salary data model.
198
en
0.938922
koepferl/FluxCompensator
fluxcompensator/cube.py
1
25142
from copy import deepcopy import os ROOT = os.path.dirname(os.path.abspath(__file__)) + '/' from astropy import log as logger from astropy.io import fits import numpy as np from numpy.random import normal from .psf import GaussianPSF, FilePSF, FunctionPSF from .filter import Filter from .utils.plot import MakePlots ...
bsd-2-clause
-1,980,972,553,126,057,000
31.483204
180
0.532655
false
SyntheticCube is part the FluxCompensator. It converts input_arrays (e. g. HYPERION ModelOutput) to "realistic" synthetic observations (e.g. accounts for PSF, filters & noise). It contains attributes like ModelOutput (see Notes). If input_array is already a SyntheticCube object, the attributes are passed. If input_ar...
10,105
en
0.61751
manimaul/MX-Cart
buildLin.py
1
4497
import os, hashlib from shutil import copy2 as copy from Resources import versionNum from subprocess import Popen from shutil import rmtree def md5sum(fd, block_size=2**20): md5 = hashlib.md5() while True: data = fd.read(block_size) if not data: break md5.update(data) re...
bsd-2-clause
551,775,681,851,644,600
38.104348
133
0.632866
false
clean any previouscreate DEBIAN directorywrite control filecopy over needed python filesprint os.path.dirname(__file__)+pyFile, mPathprint os.path.dirname(__file__)+pyFile, mPathcopy dependant imagesprint os.path.dirname(__file__)+pyFile, mPathcreate bincreate desktop entrywrite md5sum filemPath = os.path.dirname(__fil...
672
en
0.322582
jumoconnect/openjumo
jumodjango/cust_admin/templatetags/ext_admin_list.py
1
5314
import datetime from django.conf import settings from django.contrib.admin.util import lookup_field, display_for_field, label_for_field from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR from django.cor...
mit
-7,825,369,702,562,516,000
42.917355
153
0.605947
false
Generates the actual list of data. Displays the headers and data list together Strip HTML tags in the resulting text, except if the function has an "allow_tags" attribute set to True. If list_display_links not defined, add the link tag to the first field Convert the pk to something that can be used in Javascript. Pro...
643
en
0.704528
vhernandez/jwsProcessor
src/jwsprocessor/fc_calculator.py
1
7488
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ To convert from mdeg to molar elipticity (deg*cm2*dmol-1): m.e. = mdeg / (10*l*(C/MW)*Rn) where l = light path in cm C = concentration in mg/ml MW = molecular weight Rn = number of residue of the protein """ import pygtk pygtk.require("2.0") import gtk import gobject...
gpl-2.0
4,273,316,415,626,022,400
38.619048
89
0.581197
false
To convert from mdeg to molar elipticity (deg*cm2*dmol-1): m.e. = mdeg / (10*l*(C/MW)*Rn) where l = light path in cm C = concentration in mg/ml MW = molecular weight Rn = number of residue of the protein !/usr/bin/env python -*- coding: UTF-8 -*- uMmMmg/ml
260
en
0.681668
NewForester/apl-py
test/monadic.py
1
11954
#!/usr/bin/python3 """ doctest style unit tests for APL monadic functions WIP - grows as more monadic functions are implemented. The tests in this module exercise monadic functions with numeric scalar and vector arguments only. Other cases are covered in other test modules. Each test pa...
apache-2.0
-8,556,475,950,720,416,000
13.789203
73
0.363723
false
>>> test(r"∧ 1") VALENCE ERROR >>> test(r"⌈ 0") 0 >>> test(r"⌈ 0.25 0.5 1.1 9.9") 1 1 2 10 >>> test(r"⌈ ¯0.25 ¯0.5 ¯1.1 ¯9.9") 0 0 ¯1 ¯9 >>> test(r", 1.2") 1.2 >>> test(r"⍴ , 1.2") 1 >>> test(r", 1 2 3") 1 2 3 >>> test(r"⍴ , 1 2 3") 3 >>> test(r"/ 1") SYNTAX ERROR >>> test(r"⌿ 1") SYNTAX ERROR >>> test(r"+ 0") 0 >>...
7,390
en
0.215551
cropleyb/pentai
pentai/db/ai_factory.py
1
2712
#!/usr/bin/env python import pentai.ai.ai_player as aip_m from pentai.ai.priority_filter import * from pentai.ai.priority_filter_2 import * import pentai.db.openings_book as ob_m import pentai.db.games_mgr from pentai.ai.ai_genome import * class AIFactory: # TODO: These are just functions def create_player(sel...
mit
-9,205,106,758,263,038,000
27.547368
88
0.581121
false
!/usr/bin/env python TODO: These are just functions TODO: Cull
62
en
0.385649
atbentley/plank
setup.py
1
1311
import os import re from setuptools import setup as setup def read(path): global os with open(os.path.join(os.path.dirname(__file__), path), 'r') as f: data = f.read() return data.strip() def get_version(): global os, re, read _version_re = re.compile(r'\s*__version__\s*=\s*\'(.*)\'\s*')...
mit
8,118,092,918,294,471,000
28.133333
78
0.633105
false
0
en
0.110449
d33tah/macd
macd/views.py
1
3323
import datetime import subprocess from macd.models import SeenEvent, Device from django.shortcuts import render from django.utils import timezone def index(request): now = timezone.now() time_threshold = now - datetime.timedelta(minutes=10) items = SeenEvent.objects.filter(date__gte=time_threshold) de...
gpl-3.0
-2,758,185,787,429,000,700
37.195402
81
0.547397
false
0
en
0.110449
Esri/raster-functions
functions/BlockStatistics.py
1
4494
import numpy as np from skimage.transform import resize from skimage.util import view_as_blocks class BlockStatistics(): def __init__(self): self.name = "Block Statistics Function" self.description = ("Generates a downsampled output raster by computing a statistical " ...
apache-2.0
-8,694,753,335,761,033,000
37.078261
110
0.491322
false
inherit everything but the pixel type (1) and NoData (2) invalidate histogram, statistics, and key metadata output pixels values are floating-point
147
en
0.705405
arbor-jjones/idataco
idataco/widgets/calls.py
1
19598
#!/usr/bin/python ######################################################################## # Copyright (c) 2015-2016 # Jason Jones <jason<at>jasonjon<dot>es> # All rights reserved. ######################################################################## # # This file is part of IDA TACO # # IDATACO is free software: ...
gpl-3.0
-1,733,163,824,245,982,000
47.630273
130
0.566027
false
!/usr/bin/python Copyright (c) 2015-2016 Jason Jones <jason<at>jasonjon<dot>es> All rights reserved. This file is part of IDA TACO IDATACO 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 th...
976
en
0.823419
matematik7/CSSQC
cssqc/rules/singleLinePerProperty.py
1
1052
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # cssqc/singleLinePerProperty.py # # Do not allow property on multiple lines. # ---------------------------------------------------------------- # copyright (c) 2014 - Domen Ipavec # Distributed under The ...
mit
-9,212,977,344,346,658,000
31.90625
97
0.526616
false
!/usr/bin/env python3 -*- coding: utf-8 -*- ---------------------------------------------------------------- cssqc/singleLinePerProperty.py Do not allow property on multiple lines. ---------------------------------------------------------------- copyright (c) 2014 - Domen Ipavec Distributed under The MIT License, see ...
392
en
0.209003
ardi69/pyload-0.4.10
pyload/plugin/account/Keep2ShareCc.py
1
2271
# -*- coding: utf-8 -*- import re import time from pyload.plugin.Account import Account class Keep2ShareCc(Account): __name = "Keep2ShareCc" __type = "account" __version = "0.05" __description = """Keep2Share.cc account plugin""" __license = "GPLv3" __authors = [("aeronaut", "...
gpl-3.0
-3,576,954,663,591,912,000
30.109589
101
0.506385
false
-*- coding: utf-8 -*-
21
en
0.767281
Earthnuker/Universe
date_time.py
1
2439
from datetime import datetime import datetime as DT import time import calendar class Clock(object): def __init__(self,offset=None): self.timezone=None if offset is not None: self.timezone=DT.timezone(DT.timedelta(hours=offset)) def to_str(self,timestamp=None,with_orig=False): ...
mit
9,209,623,380,115,924,000
35.969697
99
0.522345
false
0
en
0.110449
JASON0916/testrail-library
testrail_client/api/__init__.py
1
1827
#!/usr/bin/env python # -*- coding: utf-8 -*- from .case import Case from .configurations import Config from .milestone import MileStone from .plan import Plan from .project i...
mit
-2,382,219,271,476,809,700
25.1
165
0.596606
false
!/usr/bin/env python -*- coding: utf-8 -*-
186
en
0.34282
nikha1/nyc-taxi
Tools/PostgresRDF/utils/postgresInterface.py
1
3639
from dateutil import parser from rdflib import Graph, Literal, BNode, Namespace, RDF, XSD, URIRef import queries global SSN global GEO global DUL # SSN Namespace SSN = Namespace('https://www.w3.org/2005/Incubator/ssn/ssnx/ssn#') # Geo Namespace GEO = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#') # DUL Name...
mit
2,477,461,874,589,206,500
33.009346
144
0.676834
false
SSN Namespace Geo Namespace DUL NamespaceconfigString = ("dbname=postgres user=waccess password=write")print configString Observation Time SensorOutput ObservationValue Start and End Location Start Location Adding the start location End Location Adding the start locationDurationprint str(graph.__len__() / 11)Commit and...
473
en
0.599436
jiaphuan/models
research/lfads/lfads.py
1
87185
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
7,097,405,529,075,089,000
42.418825
89
0.59828
false
Gated Recurrent Unit cell (cf. http://arxiv.org/abs/1406.1078). Gated Recurrent Unit cell (cf. http://arxiv.org/abs/1406.1078). This version is specialized for the generator, but isn't as fast, so we have two. Note this allows for l2 regularization on the recurrent weights, but also implicitly rescales the inputs...
22,399
en
0.831735
ali-abdullah/nlp
lda.py
1
1146
import gensim import logging import os.path class LineCorpus(gensim.corpora.textcorpus.TextCorpus): # Creates the corpus object that reads the document line by line def get_texts(self): with open(self.input) as f: for l in f: yield l.split() logging.basicConfig(format='%(asc...
mit
-7,397,097,240,201,630,000
32.705882
105
0.691972
false
Creates the corpus object that reads the document line by line Check if the model has previously been created if it has load the model and print out the different topics
169
en
0.957168
jmwright/cadquery-freecad-module
Libs/pint/testsuite/parameterized.py
1
5114
# -*- coding: utf-8 -*- # # Adds Parameterized tests for Python's unittest module # # Code from: parameterizedtestcase, version: 0.1.0 # Homepage: https://github.com/msabramo/python_unittest_parameterized_test_case # Author: Marc Abramowitz, email: marc@marc-abramowitz.com # License: MIT # # Fixed for to work in Python...
lgpl-3.0
1,117,024,097,544,180,100
32.644737
99
0.581736
false
Class decorator for creating a class with a metaclass. Decorator for parameterizing a test method - example: @ParameterizedTestCase.parameterize( ("isbn", "expected_title"), [ ("0262033844", "Introduction to Algorithms"), ("0321558146", "Campbell Essential Biology")]) -*- coding: utf-8 -*- Adds P...
1,278
en
0.336905
lsaffre/djangosite
djangosite/management/commands/run.py
1
1763
# -*- coding: UTF-8 -*- # Copyright 2012-2013 by Luc Saffre. # License: BSD, see LICENSE for more details. """ .. management_command:: run Execute a standalone Python script after having set up the Django environment. Also modify `sys.args`, `__file__` and `__name__` so that the invoked script sees them as if it ha...
bsd-2-clause
-2,832,075,735,557,221,000
31.62963
110
0.674801
false
.. management_command:: run Execute a standalone Python script after having set up the Django environment. Also modify `sys.args`, `__file__` and `__name__` so that the invoked script sees them as if it had been called directly. This is yet another answer to the frequently asked Django question about how to run sta...
1,240
en
0.781919
openwisp/netjsonconfig
tests/openwisp/test_backend.py
1
8872
import tarfile import unittest from copy import deepcopy from hashlib import md5 from time import sleep from netjsonconfig import OpenWisp from netjsonconfig.exceptions import ValidationError from netjsonconfig.utils import _TabsMixin class TestBackend(unittest.TestCase, _TabsMixin): """ tests for OpenWisp b...
gpl-3.0
-8,514,143,548,844,402,000
36.277311
173
0.51454
false
tests for OpenWisp backend ensures checksum of same config doesn't change noqa noqa esure is executable esure is executable esure is executable esure is executable md5 is good enough and won't slow down test execution too much
229
en
0.947965
andyzsf/django
tests/admin_views/tests.py
1
240212
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import re import datetime import unittest from django.conf import settings, global_settings from django.core import mail from django.core.checks import Error from django.core.files import temp as tempfile from django.core.exceptions import Impr...
bsd-3-clause
3,763,679,827,564,121,000
44.677763
251
0.628556
false
Ensure that one can easily customize the way related objects are saved. Refs #16115. Tests for Admin Views Permissions. Regression test for #17333 #23934 - When adding a new model instance in the admin, the 'obj' argument of get_formsets_with_inlines() should be None. When changing, it should be equal to the existing m...
31,643
en
0.8312
tpainter/df_everywhere
df_everywhere/util/wamp_local.py
1
5054
# DF Everywhere # Copyright (C) 2014 Travis Painter # 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...
gpl-2.0
6,578,624,898,795,414,000
41.125
118
0.691334
false
DF Everywhere Copyright (C) 2014 Travis Painter 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 ...
1,157
en
0.836285
andrzej-r/fusesoc
fusesoc/simulator/simulator.py
1
5975
from fusesoc.config import Config from fusesoc.coremanager import CoreManager from fusesoc.utils import Launcher, pr_info, pr_err import argparse import shutil import os import logging import sys if sys.version_info[0] >= 3: import urllib.request as urllib from urllib.error import URLError else: import url...
gpl-3.0
-1,031,246,171,377,463,400
38.569536
138
0.557992
false
0
en
0.110449
chouseknecht/galaxy
update-authors.py
1
1234
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import logging logger = logging.getLogger(__name__) import subprocess from collections import defaultdict user_scores = defaultdict(int) git_log = subprocess.check_output("git log --shortstat --n...
apache-2.0
1,582,264,523,541,947,400
32.351351
89
0.635332
false
!/usr/bin/env python -*- coding: utf-8 -*-
42
en
0.34282
mxgnene01/itester
itester/test_main.py
1
3065
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Meng xiangguo <mxgnene01@gmail.com> # # _____ ______ # ____==== ]OO|_n_n__][. | |] # [________]_|__|________)< |MENG| # oo oo 'oo OOOO-| oo\_ ~o~~~o~' # +--+--+--+--+--+--+--+--+--+--+--+--+--+ # ...
gpl-3.0
7,690,977,383,853,747,000
34.719512
125
0.556845
false
测试的主入口类 接口的测试 - 主方法 :param name: case 名称 :param desc: case的详细描述 :param method: GET/POST :param url: 调用的接口 :param headers: h1: v1 h2: v2 :param cookies: c1: v1 c2: v2 :param param: key1=value1&key2=value2 :param expect_value: 预计返回值 :param func:assert_...
752
zh
0.292628
davidfauth/neo4j-pubnub
server/stocktickerneo.py
1
8629
import sys import threading from Queue import Queue import time import datetime import random import json import py2neo from py2neo import Graph, Path NEO_PROTOCOL = 'http' NEO_HOST = 'localhost' NEO_PORT = 7474 NEO_USER = 'neo4j' NEO_PASSWORD = 'password' from Pubnub import Pubnub ''' Global Data - Queue ''' glo...
mit
-6,604,526,154,781,309,000
24.758209
113
0.676208
false
self.publishPriceHistory(req['name'],req['backtime'],req['channel'])Step 1 - Initialize MongoDB & PubNub Connection py2neo.set_auth_token('%s:%s' % (NEO_HOST, NEO_PORT), NEO_AUTH_TOKEN)YOUR PUBNUB KEYS - Replace the publish_key and subscriber_key below with your own keysStep 2 - Check and define the metadata ( index na...
1,643
en
0.632489
theodoregoetz/clas12-dc-wiremap
scratch/dcwiremap.py
1
1201
import time import numpy as np from numpy import random as rand from matplotlib import pyplot, gridspec, animation data = rand.uniform(0,100,(36,6,112)) fig = pyplot.figure(1, (18,8)) axs = [] pts = [] sector_grid = gridspec.GridSpec(2,3,wspace=0.3,hspace=0.3) for sec in range(6): slyr_grid = gridspec.GridSpecFr...
gpl-3.0
-583,575,538,828,056,300
25.688889
72
0.582015
false
0
en
0.110449
drnextgis/QGIS
python/plugins/processing/algs/gdal/warp.py
1
9529
# -*- coding: utf-8 -*- """ *************************************************************************** self.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************************...
gpl-2.0
8,993,122,762,215,593,000
44.8125
138
0.559975
false
*************************************************************************** self.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************************************************************...
953
en
0.611473
AntoinePrv/hyperNN
problem/runnee.py
1
2008
import sys import os dir = "/".join(sys.argv[0].split("/")[:-2]) if dir != "": os.chdir(dir) sys.path.append(".") import argparse from load_data import load_data_bis from train_MINST import train_model from logger import custom_logger def run(**kwargs): data = load_data_bis() acc, _ = train_model(data, *...
mit
-6,205,068,182,693,240,000
34.22807
79
0.590637
false
create logger gets arguments
28
da
0.041406
Lrcezimbra/google-python-exercises
logpuzzle/logpuzzle.py
1
2212
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import os import re import sys from urllib.request import urlretrieve from pathlib import Pat...
apache-2.0
3,068,062,891,926,408,000
27
192
0.639241
false
Given the urls already in the correct order, downloads each image into the given directory. Gives the images local filenames img0, img1, and so on. Creates an index.html in the directory with an img tag to show each local image file. Creates the directory if necessary. Returns a list of the puzzle urls from the given l...
671
en
0.729699
DigitalCampus/django-oppia
api/resources/category.py
1
4631
import json from django.conf.urls import url from django.db.models import Q from django.http import HttpResponse, Http404 from tastypie import fields from tastypie.authentication import ApiKeyAuthentication from tastypie.authorization import ReadOnlyAuthorization from tastypie.resources import ModelResource from tasty...
gpl-3.0
2,553,082,281,161,417,700
36.346774
79
0.521054
false
0
en
0.110449
evazyin/Capstoneproject
seedwords.py
1
2459
'''version1 seed words algorithm''' '''------------ input: a IR corpus, a expanding corpus(the candidate wordlist), a seed wordlist output: a expanded seed wordlist --------------''' import math file = open('D:/uw course/capstone/mypersonality/IRtest2.txt')#IR corpus file1 = open('D:/uw course/capstone/mypersonality/E...
agpl-3.0
-5,441,539,671,506,725,000
29.7375
86
0.611631
false
version1 seed words algorithm IR corpuscandidatekeywordto trace the processwhile total<=127679:may need debug for matrix demensions!!!!!!!print(cooccur)PMI[p][q]=math.log(cooccur[p][q]/(candidatecount[p]*keywordcount[q]))print(PMI)caution! and need further consideration
271
en
0.577082
bintlabs/python-sync-db
dbsync/server/conflicts.py
1
2225
""" .. module:: server.conflicts :synopsis: Conflict detection for the centralized push operation. """ from sqlalchemy.schema import UniqueConstraint from dbsync.lang import * from dbsync.utils import get_pk, class_mapper, query_model, column_properties def find_unique_conflicts(push_message, session): """ ...
mit
-572,390,988,439,292,000
38.035088
80
0.586067
false
Returns a list of conflicts caused by unique constraints in the given push message contrasted against the database. Each conflict is a dictionary with the following fields:: object: the conflicting object in database, bound to the session columns: tuple of column names in the unique constraint ...
529
en
0.774322
embedly/embedly-python
embedly/client.py
1
4750
""" Client ====== The embedly object that interacts with the service """ from __future__ import absolute_import, unicode_literals import re import httplib2 import json from urllib import quote, urlencode from .models import Url def get_user_agent(): from . import __version__ return 'Mozilla/5.0 (compatible;...
mit
-4,047,278,784,260,133,000
26.616279
80
0.533053
false
Client Initialize the Embedly client :param key: Embedly Pro key :type key: str :param user_agent: User Agent passed to Embedly :type user_agent: str :param timeout: timeout for HTTP connection attempts :type timeout: int :returns: None _get makes the actual call to api.embed.ly oembed get_services makes call to serv...
838
en
0.841897
lilchurro/vent
vent/menus/ntap.py
1
9189
import ast import npyscreen from vent.api.actions import Action class CreateNTap(npyscreen.ActionForm): """ For creating a new network tap container """ def create(self): self.add_handlers({"^T": self.quit, "^Q": self.quit}) self.add(npyscreen.Textfield, value='Create a netw...
apache-2.0
-5,499,286,685,946,207,000
34.342308
79
0.536293
false
Base class to inherit from. For creating a new network tap container Delete inheritance For listing all network tap capture containers For listing all available network interfaces Delete inheritance Delete inheritance When user cancels, return to MAIN When user cancels, return to MAIN When user cancels, return...
1,038
en
0.884452
janusnic/21v-python
unit_17/1.py
1
1114
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): self.text = u'\u041b\u0435\u0432 \u041d\u0438\u043a\u043e...
mit
-4,442,118,358,656,477,000
23.23913
78
0.568223
false
!/usr/bin/python -*- coding: utf-8 -*-
38
en
0.437977
wiki2014/Learning-Summary
alps/cts/apps/CameraITS/tests/inprog/test_rawstats.py
2
1620
# Copyright 2015 The Android Open Source Project # # 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 a...
gpl-3.0
-7,820,512,805,679,995,000
32.75
82
0.612963
false
Test capturing some rawstats data. Copyright 2015 The Android Open Source Project 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 require...
622
en
0.832329
AlienStudio/jpsp_python
jpsp/jpspapp/urls.py
1
2922
from django.urls import path from . import views urlpatterns = [ path('logout', views.student_logout, name="Logout"), path(r's/login', views.student_login_page, name="StudentLogin"), path('s/check_login', views.student_check_login, name="StudentCheckLogin"), path(r's/club/news/<int:page>', views.stude...
mit
4,627,145,095,779,551,000
66.953488
107
0.711841
false
0
en
0.110449
gnomex/analysis
src/arpspoof.py
1
5528
#!/usr/bin/python # src from https://github.com/rusec/scapy-arpspoof-demo from scapy.all import * from argparse import ArgumentParser import os IP_FORWARD = '/proc/sys/net/ipv4/ip_forward' TIMEOUT = 2 RETRY = 10 # This function uses argparse to parse command line # arguments passed to the script. def set_configs()...
gpl-3.0
-362,603,220,197,692,000
23.034783
107
0.611433
false
!/usr/bin/python src from https://github.com/rusec/scapy-arpspoof-demo This function uses argparse to parse command line arguments passed to the script. create a new ArgumentParser add definitions for command line arguments parse command line arguments according to those definitions use arguments to construct config di...
1,506
en
0.690539
js850/PyGMIN
pygmin/gui/double_ended_connect_runner.py
1
10710
""" tools to run the double ended connect in a separte process and make sure the the minima and transition states found are incorporated back into the master database """ import multiprocessing as mp import sys import signal import logging import numpy as np from PyQt4 import QtCore, QtGui from pygmin.utils.events...
gpl-3.0
-897,367,410,067,978,000
33.111465
103
0.585528
false
sys.stderr.write(":sending message:"+ m) self.message += m if len(self.message) > 100: self.flush() self.conn.send(("stdout", m)) if len(self.mes) if self.message[-1] == "\n": self.flush() self.conn.send(("stdout", self.message)) self.message = ...
1,081
en
0.330448
Yelp/pyramid_zipkin
pyramid_zipkin/tween.py
1
8038
# -*- coding: utf-8 -*- import functools import warnings from collections import namedtuple from py_zipkin import Encoding from py_zipkin import Kind from py_zipkin.exception import ZipkinError from py_zipkin.storage import get_default_tracer from py_zipkin.transport import BaseTransportHandler from pyramid_zipkin.re...
apache-2.0
5,364,765,440,840,491,000
38.596059
82
0.673177
false
Extracts Zipkin attributes and configuration from request attributes. See the `zipkin_span` context in py-zipkin for more detaied information on all the settings. Here are the supported Pyramid registry settings: zipkin.create_zipkin_attr: allows the service to override the creation of Zipkin attributes. For exam...
2,497
en
0.826627
alejob/mdanalysis
package/MDAnalysis/auxiliary/XVG.py
1
11423
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under th...
gpl-2.0
-4,506,006,415,492,942,300
30.46832
82
0.565263
false
Auxiliary reader to read (step at a time) from an .xvg file. An alternative XVG reader which reads each step from the .xvg file as needed (rather than reading and storing all from the start), for a lower memory footprint. Parameters ---------- filename : str Location of the file containing the auxiliary dat...
5,547
en
0.753022
Cobaltians-Fonts/fontToCobalt
parsers/css.py
1
1486
# # Created by Roxane P. on 15/01/2016 # Parse fonts styles.css from fontastic or icomoon # import tinycss names = [] glyphs = [] prefix = '' fontName = '' def parseCSS(file): parser = tinycss.make_parser('page3') stylesheet = parser.parse_stylesheet_file(file); global prefix global fontName firs...
mit
1,897,860,228,959,300,000
30.617021
96
0.541723
false
Created by Roxane P. on 15/01/2016 Parse fonts styles.css from fontastic or icomoon get raw glyph and name set fontName we dont have the prefix yet set the prefix we are looking for font selector with needed content appeared set a glyph in glyphs set a name in names
266
en
0.788754
rosedu/I.GameBot
snake_maze/game_bots/random_bot_02_python/snakemaze_play_turn.py
1
1318
import random from copy import deepcopy DIRECTIONS = ['right', 'left', 'up', 'down'] def locate_free_square(width, height, obstacles): square = {'x': 0, 'y': 0} while square in obstacles: square['x'] = random.choice( range(0,width) ) square['y'] = random.choice( range(0,height) ) retur...
agpl-3.0
-324,057,517,764,576,450
22.963636
74
0.54173
false
Python doesn't have case statements, so the following few IFs are necessarily ugly
82
en
0.98063
opevolution/pycrackcaptcha
pycrackcaptcha/data.py
1
1273
# -*- coding: utf-8 -*- # vim: set expandtab tabstop=4 shiftwidth=4: ############################################################### # # # Alexandre Defendi - 01/04/2014 # # ...
bsd-3-clause
-5,452,015,869,434,828,000
37.484848
63
0.289204
false
Interface para Implementações de Cracks -*- coding: utf-8 -*- vim: set expandtab tabstop=4 shiftwidth=4: Alexandre Defendi - 01/04/2014 Módulo Básico - PyCrackCaptc...
322
pt
0.558697
mariusbaumann/pyload
module/plugins/hoster/ZeveraCom.py
1
1124
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" __type__ = "hoster" __version__ = "0.25" __pattern__ = r'http://(?:www\.)?zevera\.com/.+' __description__ = """Zevera.com hoster plugin"...
gpl-3.0
-2,630,775,124,068,375,600
30.222222
121
0.617438
false
-*- coding: utf-8 -*-
21
en
0.767281
joemicro/Manufacturing
findform.py
1
31523
import os import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from sqlalchemy import * from sqlalchemy.orm import * from databaseschema import * from genericdelegates import * from functions import * import modelsandviews import ui_forms.ui_findform import receiveform import batchform import productionfor...
mit
5,236,492,352,790,907,000
44.886463
146
0.586207
false
================================================================== Form setup ============== Initializer ============== == Standard tab GUI setup == == Detail tab GUI setup == == stackWidget items setup == == Setup stackedWidget operations == == setup detail filter function calls == Form layout setup == Form op...
470
en
0.481067
sharmaking/PairTradeBTS
multipleStrategy/statisticalArbitrageMultiple.py
1
4640
#!/usr/bin/python # -*- coding: utf-8 -*- #statisticalArbitrageMultiple.py import baseMultiple import numpy, copy, csv class CStatisticalArbitrageMultiple(baseMultiple.CBaseMultiple): #------------------------------ #继承重载函数 #------------------------------ #自定义初始化函数 def customInit(self): self.name = "statistical...
mit
-3,109,636,028,187,212,000
36.371901
97
0.622512
false
!/usr/bin/python -*- coding: utf-8 -*-statisticalArbitrageMultiple.py------------------------------继承重载函数------------------------------自定义初始化函数行情数据触发函数计算S自动保存缓存触发函数----------------------实现函数体----------------------self.sendS(S, parameter["stocks"][0], data["dateTime"], Pa, Pb)还没开仓正反已经开仓正平止损反平止损正反
296
zh
0.179825
wackou/bts_tools
bts_tools/cmdline.py
1
24237
#!/usr/bin/env python # -*- coding: utf-8 -*- # # bts_tools - Tools to easily manage the bitshares client # Copyright (c) 2014 Nicolas Wack <wackou@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 Softwa...
gpl-3.0
-5,400,526,556,740,207,000
39.666107
119
0.564096
false
binary_type should be either 'witness' or 'wallet' bin_name is the base name template that will be used to name the resulting file. !/usr/bin/env python -*- coding: utf-8 -*- bts_tools - Tools to easily manage the bitshares client Copyright (c) 2014 Nicolas Wack <wackou@gmail.com> This program is free software; you ca...
2,438
en
0.866931
unsystemizer/counterparty-cli
counterpartycli/console.py
1
3966
import os from prettytable import PrettyTable from counterpartycli import wallet, util # TODO: inelegant def get_view(view_name, args): if view_name == 'balances': return wallet.balances(args.address) elif view_name == 'asset': return wallet.asset(args.asset) elif view_name == 'wallet': ...
mit
-7,392,429,104,027,358,000
32.294118
96
0.585815
false
TODO: inelegant vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
67
de
0.254805
Julian/home-assistant
homeassistant/components/media_player/demo.py
1
11274
""" Demo implementation of the media player. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.media_player import ( MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPO...
mit
8,502,807,707,185,662,000
30.480447
79
0.61189
false
A demo media players. A Demo media player that only supports YouTube. A Demo media player that only supports YouTube. A Demo media player that only supports YouTube. Initialize the demo device. Initialize the demo device. Initialize the demo device. Initialize the demo device. Return the current running application. Re...
2,714
en
0.870085
harigov/newsalyzer
crawler/YahooMailParser.py
1
1198
import urlparse import os from bs4 import BeautifulSoup import re from article_parser import ArticleParser class YahooMailParser(ArticleParser): def parse(self, url, article_text): ArticleParser.parse(self,url,article_text) def _get_title(self): head = self._soup.find('header', {'class' : 'can...
mit
5,628,196,657,293,056,000
31.378378
82
0.530885
false
Remove newlines
15
fa
0.095327
livoras/feifanote-server
apis/_helpers.py
1
1938
# -*- coding: utf-8 -*- from functools import wraps from flask import session, request from common.utils import message from models.notebook import Notebook from models.page import Page from common import db def require_login(route_fn): """ Decorator for router functions that need user to login first. """ ...
mit
-2,775,173,960,715,875,300
34.907407
70
0.610939
false
Decorator for router functions that need user to login first. -*- coding: utf-8 -*-
85
en
0.877415
sarwojowo/KerasProject
resnetcustom.py
1
3281
#python resnetcustom.py --file images/office.png from __future__ import print_function import numpy as np import json import os import time from keras import backend as K from keras.preprocessing import image from keras.applications import ResNet50 from keras.utils.data_utils import get_file CLASS_INDEX = None CLAS...
mit
4,369,614,500,541,529,600
30.548077
79
0.537031
false
Get parser object. python resnetcustom.py --file images/office.png 'RGB'->'BGR' 'RGB'->'BGR' Load model print('Input image shape:', x.shape)
141
en
0.267812
datascopeanalytics/scrubadub
scrubadub/post_processors/text_replacers/prefix_suffix.py
1
1176
from typing import Optional, Sequence from ...filth import Filth from ..base import PostProcessor class PrefixSuffixReplacer(PostProcessor): name = 'prefix_suffix_replacer' # type: str def __init__(self, prefix: Optional[str] = '{{', suffix: Optional[str] = '}}', name: Optional[str] = None): super(...
mit
-9,170,214,622,333,614,000
36.935484
111
0.64881
false
type: str
9
en
0.217975
austinbyers/esprima-ast-visitor
visitor_test.py
1
3065
"""Test the AST traversal.""" import gzip import json import unittest import visitor class TestTraverse(unittest.TestCase): """Verify that traversals progress in the correct order and terminate. Test cases are drawn from a variety of very large real-world JS examples, including popular libraries and cod...
mit
7,185,851,426,806,917,000
30.597938
86
0.610114
false
Verify that traversals progress in the correct order and terminate. Test cases are drawn from a variety of very large real-world JS examples, including popular libraries and code served by the Alexa top 10. Traverse the AST specified in the given test file. Test any node types which weren't already covered. Verify tra...
604
en
0.887258
GandhiNN/StarOS-cactipy
sgsnmme/get3gAttachSR.py
1
5758
#!/usr/bin/env python3 # # author == __gandhi__ # ngakan.gandhi@packet-systems.com import pexpect import sys import os import json import time import re # Load node user and password configuration file def load_node_config(node_config_file): with open(node_config_file) as node_confile: retu...
mit
-5,496,172,499,643,286,000
46
107
0.592741
false
!/usr/bin/env python3 author == __gandhi__ ngakan.gandhi@packet-systems.com Load node user and password configuration file Set conditional based on matched patterns returned by "i" pexpect instance Timeout -> expect method match TIMEOUT pattern SSH does not have the public key, just accept it Timeout Continue SSH alrea...
350
en
0.851094
vgrem/SharePointOnline-REST-Python-Client
office365/sharepoint/folder.py
1
2600
from office365.runtime.client_object import ClientObject from office365.runtime.client_query import UpdateEntityQuery, DeleteEntityQuery from office365.runtime.resource_path import ResourcePath from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation from office365.sharepoint.listitem ...
mit
-3,152,273,541,855,555,000
40.269841
128
0.673846
false
Represents a folder in a SharePoint Web site. Deletes the folder. Get a file collection Get a folder collection Specifies the list item field (2) values for the list item corresponding to the folder. Rename a Folder resource self.removeFromParentCollection() fallback: create a new resource path
297
en
0.566813
rth/PyAbel
examples/example_linbasex_hansenlaw.py
1
3092
# -*- coding: utf-8 -*- import numpy as np import abel import matplotlib.pyplot as plt IM = np.loadtxt("data/VMI_art1.txt.bz2") legendre_orders = [0, 2, 4] # Legendre polynomial orders proj_angles = range(0, 180, 10) # projection angles in 10 degree steps radial_step = 1 # pixel grid smoothing = 1 # smoothing 1/e...
mit
-238,230,129,545,215,360
41.944444
77
0.67044
false
-*- coding: utf-8 -*- Legendre polynomial orders projection angles in 10 degree steps pixel grid smoothing 1/e-width for Gaussian convolution smoothing threshold for normalization of higher order Newton spheres clip first vectors (smallest Newton spheres) to avoid singularities linbasex method - center ensures image ha...
596
en
0.634008
b1-systems/kiwi
kiwi/utils/size.py
1
1696
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
gpl-3.0
-5,083,597,701,060,993,000
33.612245
80
0.647995
false
**Performs size convertions from strings to numbers** Convert the given string representig a size into the appropriate number of bytes. :param str size_value: a size in bytes or specified with m=MB or g=GB :return: the number of bytes represented by size_value string :rtype: int Copyright (c) 2015 SUSE Linux GmbH. ...
953
en
0.861187
umitproject/network-admin
netadmin/users/forms.py
1
2410
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Adriano Monteiro Marques # # Author: Amit Pal <amix.pal@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, ei...
agpl-3.0
-4,128,243,789,339,901,000
34.970149
105
0.692116
false
!/usr/bin/env python -*- coding: utf-8 -*- Copyright (C) 2011 Adriano Monteiro Marques Author: Amit Pal <amix.pal@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of ...
755
en
0.870326
lehmannro/pootle
pootle/auth/ldap_backend.py
1
3490
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Mozilla Corporation, Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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...
gpl-2.0
-7,947,188,402,403,043,000
38.659091
188
0.638968
false
!/usr/bin/env python -*- coding: utf-8 -*- Copyright 2009 Mozilla Corporation, Zuza Software Foundation This file is part of Pootle. Pootle 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...
864
en
0.882998
westernmagic/NumPDE
series4/2d-rad-cooling/plot_on_mesh.py
1
1202
from numpy import * from pylab import * import matplotlib.tri from math import atan2 vertices = loadtxt("vertices.txt") indices = loadtxt("triangles.txt") uImplicit = loadtxt("u_implicit.txt") energyImplicit = loadtxt("energy_implicit.txt") uExplicitNoCfl = loadtxt("u_explicit_no_cfl.txt") energyExplicitNoCfl = loa...
mit
7,751,457,936,035,289,000
22.568627
75
0.748752
false
0
en
0.110449
DiamondLightSource/diffcalc
diffcalc/ub/reflections.py
1
5528
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
gpl-3.0
-8,610,430,123,077,464,000
37.388889
89
0.571274
false
A reflection adds a reflection, position in degrees num starts at 1 getReflection(idx) --> ( [h, k, l], position, energy, tag, time ) -- position in degrees getReflection(num) --> ( [h, k, l], (angle1...angleN), energy, tag ) -- position in degrees Copyright 2008-2011 Diamond Light Source Ltd. This file is p...
1,057
en
0.797332
redhatrises/classification-banner
classification-banner.py
1
14507
#!/usr/bin/python # Classification Banner # # Last update was 02 July 2018 # # Script: classification-banner.py # Description: Displays a Classification for an Xwindows session # Copyright: Frank Caviggia, 2017 # Author: Frank Caviggia <fcaviggia (at) gmail.com> # Version: 1.6.6 # License: GPLv2 import sys,os,optparse...
gpl-2.0
1,204,417,468,584,060,200
38.52861
136
0.559799
false
Class to create and refresh the actual banner. Display Classification Banner Message Set up and display the main window Keyword arguments: message -- The classification level to display fgcolor -- Foreground color of the text to display bgcolor -- Background color of the banner the text is against face -- Font face...
1,940
en
0.568836
jelly/calibre
src/calibre/db/cli/cmd_show_metadata.py
2
1416
#!/usr/bin/env python2 # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import absolute_import, division, print_function, unicode_literals import os import sys from calibre import prints from calibre.ebooks.metadata.opf2 import OPFCreator readonly = Tr...
gpl-3.0
-4,527,065,528,993,158,000
23.842105
82
0.636299
false
!/usr/bin/env python2 vim:fileencoding=utf-8 License: GPLv3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net> change this if you change signature of implementation()
170
en
0.56738
grimoirelab/sortinghat
sortinghat/parsing/gitdm.py
1
12677
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2021 Bitergia # # 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 ...
gpl-3.0
2,135,665,549,278,258,700
32.623342
124
0.580625
false
Parse identities and organizations using Gitdm files. Gitdm provides several files that include information about identities, organizations and affiliations. This parser is able to parse anyone of these file formats, together or separate. The unique identities are stored in an object named 'uidentities'. The keys of ...
3,508
en
0.822584
karesansui/karesansui
karesansui/gadget/static.py
1
1502
# -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2009-2012 HDE, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without lim...
mit
2,057,773,710,568,235,800
40.722222
79
0.724368
false
-*- coding: utf-8 -*- This file is part of Karesansui. Copyright (C) 2009-2012 HDE, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights...
1,109
en
0.872038
niphlod/ssis_dash
models/menu.py
1
2114
# -*- coding: utf-8 -*- # Copyright 2017 Niphlod <niphlod@gmail.com> # # This file is part of ssis_dash. # # ssis_dash 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; either version 3 of the License, or...
gpl-3.0
-8,550,410,080,521,734,000
31.030303
76
0.690161
false
-*- coding: utf-8 -*- Copyright 2017 Niphlod <niphlod@gmail.com> This file is part of ssis_dash. ssis_dash 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; either version 3 of the License, or (at your option...
775
en
0.874943
russellb/nova
nova/tests/api/openstack/compute/test_api.py
1
4523
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
apache-2.0
1,007,506,515,709,438,700
33.265152
78
0.646031
false
vim: tabstop=4 shiftwidth=4 softtabstop=4 Copyright 2010 OpenStack LLC. 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....
799
en
0.78287
Heikman/picongpu
src/tools/bin/observer.py
1
1286
#!/usr/bin/env python2.7 # # Copyright 2013 Richard Pausch # # This file is part of PIConGPU. # # PIConGPU 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)...
gpl-3.0
3,014,636,239,808,558,600
25.791667
70
0.664075
false
!/usr/bin/env python2.7 Copyright 2013 Richard Pausch This file is part of PIConGPU. PIConGPU 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....
681
en
0.887913
kubeflow/kfserving
python/kfserving/test/test_knative_url.py
1
1378
# Copyright 2020 kubeflow.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 applicable law or agreed to in writing,...
apache-2.0
3,694,224,059,007,468,500
24.518519
79
0.703919
false
KnativeURL unit test stubs Test KnativeURL KFServing Python SDK for KFServing # noqa: E501 OpenAPI spec version: v0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Copyright 2020 kubeflow.org. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
896
en
0.781012