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
dgjnpr/py-junos-eznc
lib/jnpr/junos/factory/viewfields.py
1
1923
class ViewFields(object): """ Used to dynamically create a field dictionary used with the RunstatView class """ def __init__(self): self._fields = dict() def _prockvargs(self, field, name, **kvargs): if not len(kvargs): return field[name].update(kvargs) ...
apache-2.0
5,510,952,686,028,726,000
28.136364
77
0.558502
false
Used to dynamically create a field dictionary used with the RunstatView class field string value will be passed to function :astype: This is typically used to do simple type conversions, but also works really well if you set :astype: to a function that does a basic converstion like look at the value and change it to a...
575
en
0.837981
missionpinball/mpf
setup.py
1
3976
"""Mission Pinball Framework (mpf) setup.py.""" import re from setuptools import setup # http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package VERSIONFILE = "mpf/_version.py" VERSION_STRING_LONG = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" _MO = r...
mit
4,193,858,183,606,862,000
27.604317
115
0.617203
false
Mission Pinball Framework (mpf) setup.py. http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package MANIFEST.in picks up the rest
166
en
0.564476
jddeal/python-cmr
tests/test_collection.py
1
1877
import unittest from cmr.queries import CollectionQuery class TestCollectionClass(unittest.TestCase): def test_archive_center(self): query = CollectionQuery() query.archive_center("LP DAAC") self.assertIn("archive_center", query.params) self.assertEqual(query.params["archive_cent...
mit
3,611,592,017,431,405,600
31.929825
102
0.605221
false
0
en
0.110449
genialis/resolwe
resolwe/flow/tests/test_manager.py
1
8154
# pylint: disable=missing-docstring import os from asgiref.sync import async_to_sync from guardian.shortcuts import assign_perm from resolwe.flow.managers import manager from resolwe.flow.managers.utils import disable_auto_calls from resolwe.flow.models import ( Collection, Data, DataDependency, Desc...
apache-2.0
1,628,991,398,672,439,000
35.895928
88
0.625215
false
Test that manager is run when new object is created. Test that manager handles dependencies correctly. Test that manager is run for spawned processes and permissions are copied. Test that manager is run for workflows. pylint: disable=missing-docstring Patch the process to create Entity, so its bahaviour can be tested...
771
en
0.946622
jreback/pandas
pandas/plotting/_matplotlib/hist.py
1
11983
from typing import TYPE_CHECKING import numpy as np from pandas.core.dtypes.common import is_integer, is_list_like from pandas.core.dtypes.generic import ABCDataFrame, ABCIndex from pandas.core.dtypes.missing import isna, remove_na_arraylike from pandas.io.formats.printing import pprint_thing from pandas.plotting._m...
bsd-3-clause
6,666,785,963,615,121,000
25.106754
88
0.548026
false
Grouped histogram Parameters ---------- data : Series/DataFrame column : object, optional by : object, optional ax : axes, optional bins : int, default 50 figsize : tuple, optional layout : optional sharex : bool, default False sharey : bool, default False rot : int, default 90 grid : bool, default True legend: : bool...
1,005
en
0.348525
vedmathai/dateCorroborator
corroboratorPOC.py
1
6019
from subprocess import * import re import treetaggerwrapper import sparqlQuerypy from bs4 import BeautifulSoup CONSTANTKEYVERBS="die, died, death, born, birth, sworn in" #Set of words that if present in the sentence, then don't discard the sentence, we are interested. tagger = treetaggerwrapper.TreeTagger(TAGLANG = 'e...
gpl-3.0
-6,094,858,273,225,851,000
39.668919
157
0.587805
false
Set of words that if present in the sentence, then don't discard the sentence, we are interested. The helper function to use the jar file.helper function to map the verb to a property. This will be small considering the number of date properties in DBpedia. helper function to remove the references annotation, that appe...
937
en
0.837415
rsjohnco/rez
src/rez/build_process_.py
1
12128
from rez.packages_ import get_developer_package, iter_packages from rez.exceptions import BuildProcessError, BuildContextResolveError, \ ReleaseHookCancellingError, RezError, ReleaseError, BuildError from rez.resolved_context import ResolvedContext from rez.release_hook import create_release_hooks from rez.resolver...
gpl-3.0
1,182,070,438,105,260,300
37.996785
85
0.601995
false
iterate over variants save context before possible fail, so user can debug test that the release path exists test that the repo is in a state to release check UUID. This stops unrelated packages that happen to have the same name, being released as though they are the same package test that a newer package version hasn'...
507
en
0.953078
fluggo/Canvas
fluggo/editor/model/connectors.py
1
9949
# This file is part of the Fluggo Media Library for high-quality # video and audio processing. # # Copyright 2012 Brian J. Crowell <brian@fluggo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Founda...
gpl-3.0
-7,344,997,437,159,359,000
35.577206
145
0.555232
false
Resolves a reference into an audio stream. This class publishes alerts for any error that happens when finding the stream. Resolves a reference into a video stream. This class publishes alerts for any error that happens when finding the stream. This file is part of the Fluggo Media Library for high-quality video an...
1,502
en
0.919674
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/utils/version.py
1
2539
from __future__ import unicode_literals import datetime import os import subprocess from django.utils.lru_cache import lru_cache def get_version(version=None): "Returns a PEP 386-compliant version number from VERSION." version = get_complete_version(version) # Now build the two parts of th...
mit
-5,298,214,203,842,086,000
29.7375
79
0.624655
false
Returns a tuple of the django version. If version argument is non-empty, then checks for correctness of the tuple provided. Returns a numeric identifier of the latest git changeset. The result is the UTC timestamp of the changeset in YYYYMMDDHHMMSS format. This value isn't guaranteed to be unique, but collisions are v...
644
en
0.783776
jurcicek/extended-hidden-vector-state-parser
semantics-4/batch/cued_tune_scale.py
1
2845
# Script name : tune_scale.py # Semantics version: semantics-4 # Description : Tento skript umoznuje ladeni scaling faktoru # SCALE_CONCEPT12 a SCALE_PUSHPOP. Vychozi hodnoty jsou # brany ze souboru settings, vychozi rozsah je +-0.6 a krok # 0.2. Pro ot...
gpl-2.0
-8,246,472,734,814,509,000
32.470588
98
0.611599
false
0
en
0.110449
dorianpula/learn-django
charleston/models.py
1
5628
from datetime import datetime from django.core.urlresolvers import reverse, reverse_lazy from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.utils.encoding import smart_str from tagging.fields import TagField from markdown import markdown class Cate...
bsd-2-clause
5,318,329,303,083,099,000
33.740741
114
0.63344
false
Categories of stories. Entry or blog post model. Links model hyperlinks to various URLs both external and internal. Gets only the entries that have a live status. Gets the absolute URL for an entry. Gets the absolute URL of the link. Recreate the HTML from Markdown before saving the entry. Saves a link. Updates the re...
723
en
0.82253
The-Compiler/qutebrowser
qutebrowser/completion/models/listcategory.py
1
3679
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2020 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # This file is part of qutebrowser. # # qutebrowser 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...
gpl-3.0
2,326,568,685,677,522,000
33.064815
79
0.613754
false
Expose a list of items as a category for the CompletionModel. Custom sorting implementation. Prefers all items which start with self._pattern. Other than that, uses normal Python string sorting. Args: lindex: The QModelIndex of the left item (*left* < right) rindex: The QModelIndex of the right item (left < *...
1,309
en
0.792745
abhipec/pec
emailApp/emailApp/migrations/0001_squashed_0009_dashboard.py
1
2395
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): replaces = [(b'emailApp', '0001_initial'), (b'emailApp', '0002_email_textcleaned'), (b'emailApp', '0003_email_removedcontent'), (b'emailApp', '0004_auto_20150329_0757')...
mit
4,397,749,009,530,095,600
48.895833
374
0.56952
false
-*- coding: utf-8 -*-
21
en
0.767281
mwalercz/virus-total-helper
server/dispatcher.py
1
1180
import inspect from server.customhttp import HTTPResponse class NoSuchUrl(Exception): def __init__(self, url): self.url = url class Dispatcher: def __init__(self, urls, scheduler, deque): self.deque = deque self.urls = urls self.scheduler = scheduler def dispatch(self, ...
bsd-3-clause
8,067,938,445,552,639,000
26.44186
72
0.616949
false
0
en
0.110449
blitzmann/Pyfa
gui/builtinContextMenus/spoolUp.py
1
3085
# noinspection PyPackageRequirements import wx import eos.config import gui.mainFrame from eos.utils.spoolSupport import SpoolType, SpoolOptions from gui import globalEvents as GE from gui.contextMenu import ContextMenu from service.settings import ContextMenuSettings from service.fit import Fit class SpoolUp(Contex...
gpl-3.0
-3,779,389,863,283,970,600
36.621951
153
0.65705
false
noinspection PyPackageRequirements Show default only for current value and when not overriden
93
en
0.511353
SpectoLabs/hoverpy
hoverpy/decorators.py
1
1513
from .hp import HoverPy class capture(object): def __init__(self, dbpath="requests.db", capture=True, **kwargs): self.dbpath = dbpath self.capture = capture self.kwargs = kwargs def __call__(self, f): def wrapped_f(*args): with HoverPy(capture=self.capture, dbpath=...
apache-2.0
4,016,808,002,218,339,300
27.54717
92
0.576999
false
0
en
0.110449
christ2go/pycal
src/tree/treeprint.py
1
1219
def write(x): print(x,end="") class treeprinter: """ Prints an abstract syntax tree as a XML-Document tree has to be instaneceof node (tree is the AST to be printed) """ def __init__(self,tree): self.tree = tree def printt(self): if not self....
apache-2.0
-6,523,374,612,603,958,000
28.731707
58
0.437244
false
Prints an abstract syntax tree as a XML-Document tree has to be instaneceof node (tree is the AST to be printed) write("\n")
128
en
0.931679
aksampath123/Python_Development_Projects
Dungeon_game/character.py
1
1226
import random from combat import Combat class Character(Combat): attack_limit = 10 experience = 0 base_hit_points = 10 def attack(self): roll = random.randint(1, self.attack_limit) if self.weapon == 'sword': roll += 1 elif self.weapon == 'axe': roll += 2 elif self.weapon ==...
unlicense
-2,503,536,181,508,784,600
23.039216
124
0.579119
false
0
en
0.110449
hn0/hzzapp
lib/config.py
1
2968
#_**_ coding: utf-8 _*_ """ Module for parsing configuration files Application will use hard coded configuration file for its behaviur hzzapp.conf in root directory should be written according to RFC 8822 style Created 10. Dec 2014 Author: Hrvoje Novosel<hnovosel@live.com> """ import ConfigParser #classes for e...
gpl-2.0
2,611,523,763,958,312,400
32.738636
113
0.600404
false
Module for parsing configuration files Application will use hard coded configuration file for its behaviur hzzapp.conf in root directory should be written according to RFC 8822 style Created 10. Dec 2014 Author: Hrvoje Novosel<hnovosel@live.com> _**_ coding: utf-8 _*_classes for exceptionsexception risen when speci...
702
en
0.710738
mablae/weblate
weblate/trans/south_migrations/0017_auto__add_field_change_action.py
1
14562
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.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, eithe...
gpl-3.0
-8,901,180,927,229,123,000
72.903553
182
0.548595
false
-*- coding: utf-8 -*- Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> This file is part of Weblate <http://weblate.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...
798
en
0.873552
OSGConnect/bandwidth-monitors
submit/testnetwork.py
1
2452
#!/usr/bin/env python import urllib import urllib2 import time import getopt import sys import os import timeit import platform import subprocess import re REFERENCE_URL = 'http://stash.osgconnect.net/+sthapa/100MB_ref' WSGI_URL = 'http://web-dev.ci-connect.net/~sthapa/record_network_test.wsgi' def download_file(): ...
apache-2.0
-1,105,823,344,387,599,200
27.511628
121
0.597879
false
!/usr/bin/env python
20
fr
0.225372
miltonsarria/dsp-python
images/5_tf_deepNet_text.py
1
5124
import os import nltk from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer #apagar wanings os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import tensorflow as tf import numpy as np import pickle import random from collections import Counter lemmatizer = WordNetLemmatizer() hm_lines = 10000000 #fi...
mit
5,958,327,614,851,862,000
31.846154
92
0.556206
false
apagar waningsfileswith open ('/home/sarria/data/lexicon/sentimen_set.pickle','wb') as fh: pickle.dump([train_x,train_y,test_x,test_y],fh)dims = 28 x 28 = 784entrada*weights + biases
185
en
0.541107
EvilCult/moviecatcher
View/ResultView.py
1
4486
#!/usr/bin/env python # -*- coding: utf-8 -*- import tkinter import tkinter.messagebox from Bl import Play from Lib import Tools class GUI : def __init__ (self, master) : self.master = master self.Tools = Tools.Tools() self.listRst = '' self.resRst = '' self.getDetail = '' def showList (self, searchKey)...
mit
-3,049,180,664,325,927,000
29.906475
156
0.649674
false
!/usr/bin/env python -*- coding: utf-8 -*-
42
en
0.34282
ramineni/myironic
ironic/tests/drivers/ilo/test_power.py
1
9414
# Copyright 2014 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
apache-2.0
-3,160,510,754,953,371,000
44.259615
79
0.621521
false
Test class for IloPower module. Copyright 2014 Hewlett-Packard Development Company, L.P. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/...
661
en
0.847934
matt77hias/Clipping
src/surfacearea.py
1
2427
import numpy as np ############################################################################### ## Surface Area ## --------------------------------- ## Planar polygon ############################################################################### # Theorem of Green #------------------------------------------------...
gpl-3.0
-9,147,105,581,252,938,000
28.962963
113
0.409971
false
Surface Area --------------------------------- Planar polygon Theorem of Green------------------------------------------------------------------------------ integral_contour(L dx + M dy) = integral_area((dM/dx - dL/dy) dx dy) contour = oriented, piecewise smooth, simple closed curve in a plane area = regio...
693
en
0.616709
kmee/pySigepWeb
pysigepweb/pysigep_exception.py
1
1805
# -*- coding: utf-8 -*- # ############################################################################# # # Brazillian Carrier Correios Sigep WEB # Copyright (C) 2015 KMEE (http://www.kmee.com.br) # @author: Michell Stuttgart <michell.stuttgart@kmee.com.br> # # Sponsored by Europestar www.europestar.com.br ...
agpl-3.0
-7,700,560,116,779,816,000
30.666667
79
0.633795
false
-*- coding: utf-8 -*- Brazillian Carrier Correios Sigep WEB Copyright (C) 2015 KMEE (http://www.kmee.com.br) @author: Michell Stuttgart <michell.stuttgart@kmee.com.br> Sponsored by Europestar www.europestar.com.br This program is free software: you can redistribute it and/or modify it under the terms...
887
en
0.856699
CCBatIIT/AlGDock
Pipeline/prep_complex_for_AlGDock.py
1
3734
# Prepares a complex for AlGDock try: import argparse parser = argparse.ArgumentParser() parser.add_argument('ligand_mol2', default=None, help='Input mol2 of the ligand with sybyl atom types') parser.add_argument('receptor_pdb', default=None, help='Input PDB of the receptor with AMBER atom types') pa...
mit
8,426,347,556,647,662,000
32.63964
92
0.686931
false
Prepares a complex for AlGDock The receptor file name ends with '.pdb2pqr_amber.pqr', which is 18 characters long Compresses the complex files in a tarball
155
en
0.810236
lmazuel/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/models/metric_trigger.py
1
4030
# 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
7,079,760,800,057,811,000
46.411765
86
0.644913
false
The trigger that results in a scaling action. All required parameters must be populated in order to send to Azure. :param metric_name: Required. the name of the metric that defines what the rule monitors. :type metric_name: str :param metric_resource_uri: Required. the resource identifier of the resource the rule m...
2,253
en
0.721011
robe16/kiosk.grandparent-message-board
src/axiscare/url_process.py
1
2732
from multiprocessing import Process from bs4 import BeautifulSoup import time from google.google_gmail import get_gmail_lists, get_gmail_message_mime, delete_gmail_message from config.cfg import put_config_axiscare_url from log.log import log_general, log_error def eml_list(): return get_gmail_lists() def get_...
gpl-3.0
-8,363,137,163,987,299,000
27.458333
113
0.515739
false
Assumption that html version appears before pdf versionDelete email5mins
72
en
0.92102
dariocorral/panoanda
panoanda/hourOffset.py
1
1849
""" Created on Sun Sep 17 07:26:03 2017 @author: dariocorral """ from datetime import datetime, date, timedelta import pytz class Hour(object): """ Auxiliary class for converting GMT - NY - local time hours """ #Local time hour property @property def current_local(self): """ ...
mit
-2,291,861,256,432,731,100
20.511628
66
0.53272
false
Auxiliary class for converting GMT - NY - local time hours Returns GMT current hour :return:integer Returns New York current hour :return:integer Returns local current hour :return:integer Operate with hours Returns New York current hour GMT current hour difference :return: integer Returns Local current hour vs GM...
550
en
0.370764
olcf/pcircle
legacy/pcircle/path.py
1
2783
import os class CopyType: """ A fake enum, define three type of copy job """ FILE2FILE = 0 FILE2DIR = 1 DIR2DIR = 2 def copytype2str(t): if t == CopyType.FILE2FILE: return "file to file" elif t == CopyType.FILE2DIR: return "file(s) to dir" elif t == CopyType.DIR2DIR: ...
apache-2.0
-2,806,440,448,711,826,000
29.922222
83
0.614445
false
A fake enum, define three type of copy job remove unreable files and directories from the input path collection, skipped include two type of elements: unwanted directories if removedir is True or unaccessible files/directories verify and return target destination case 1: source: multiple files destination is a...
716
en
0.850749
phase-dev/phase
libmproxy/protocol/__init__.py
1
3448
from ..proxy import ServerConnection, AddressPriority KILL = 0 # const for killed requests class ConnectionTypeChange(Exception): """ Gets raised if the connetion type has been changed (e.g. after HTTP/1.1 101 Switching Protocols). It's up to the raising ProtocolHandler to specify the new conntype before...
gpl-3.0
-1,467,776,239,148,009,500
32.803922
114
0.645012
false
Gets raised if the connetion type has been changed (e.g. after HTTP/1.1 101 Switching Protocols). It's up to the raising ProtocolHandler to specify the new conntype before raising the exception. This mixin allows safe modification of the target server, without any need to expose the ConnectionHandler to the Flow. This ...
874
en
0.872566
Davideddu/garden.namedboxes
__init__.py
1
3796
#!/usr/bin/env python # -*- coding: utf-8 -*- # __init__.py # Copyright (C) 2014 Davide Depau <me@davideddu.org> # # NamedBoxes 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,...
mit
8,088,089,841,062,187,000
29.620968
79
0.644889
false
BoxLayout with a background color and with a label on top of it. Use it like you would use a BoxLayout, but don't change the orientation property. Add another layout inside of it instead, and change its orientation. A simple box layout with a label on top of it. Use it like you would use a BoxLayout, but don't change t...
1,305
en
0.886685
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/tkinter/tix.py
1
74062
# -*-mode: python; fill-column: 75; tab-width: 8 -*- # # $Id: tix.py 63418 2008-05-17 18:39:55Z georg.brandl $ # # Tix.py -- Tix widget wrappers. # # For Tix, see http://tix.sourceforge.net # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. # based on an idea of Jean-Marc Lugrin (lugrin@ms.com) # # N...
mit
-4,159,879,401,223,015,400
38.165521
96
0.605074
false
Balloon help widget. Subwidget Class --------- ----- label Label message Message ButtonBox - A container for pushbuttons. Subwidgets are the buttons added with the add method. This file implements the Canvas Object View widget. This is a base class of IconView. It implements automatic pla...
23,402
en
0.799525
BlackLight/evesp
evesp/event/__init__.py
1
2976
class Event(object): """ Base class for events Fabio Manganiello, 2015 <blacklight86@gmail.com> """ def __init__(self, component=None, **kwargs): """ Constructor kwargs -- key-value associations for the attributes of the object """ self.__kwargs = kwargs ...
apache-2.0
6,722,185,896,443,257,000
27.615385
120
0.600806
false
When an event attribute type is AttributeValueAny, that attribute won't be taken into account when two events are compared through == operator or explicit __eq__ method invocation. Fabio Manganiello, 2015 <blacklight86@gmail.com> Base class for events Fabio Manganiello, 2015 <blacklight86@gmail.com> A special event us...
1,046
en
0.80425
Shrews/PyGerrit
webapp/django/core/handlers/wsgi.py
1
8460
from threading import Lock from pprint import pformat try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django import http from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_prefix from django.utils impo...
apache-2.0
-8,111,166,442,822,824,000
34.546218
134
0.590662
false
A version of shutil.copyfileobj that will not read more than 'size' bytes. This makes it safe from clients sending more than CONTENT_LENGTH bytes of data in the body. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Sometimes PATH_INFO exists, but is empty (e.g. accessing the SCRIPT_NAME URL without a trail...
1,079
en
0.925025
drwyrm/Flexget
flexget/tests/conftest.py
1
12285
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import jsonschema from future.utils import PY2 from future.backports.http import client as backport_client import re import os import sys import yaml import logging import...
mit
275,408,962,429,524,500
31.414248
119
0.624094
false
By marking test with chdir flag we will change current working directory to that module location. Task configuration can then assume this being location for relative paths If used inside a test class, uses the `config` class attribute of the class. This is used by `manager` fixture, and can be parametrized. Use to exec...
1,945
en
0.836699
petewarden/tensorflow
tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py
1
68032
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
1,295,234,925,009,800,400
39.08957
81
0.594367
false
Tests for Keras text vectorization preprocessing layer. Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/license...
5,166
en
0.789216
Sapphirine/Predicting-The-United-States-Presidential-Election-Results-Using-TwitterSentiment
src/calculate_state_prob.py
1
1641
import pandas as pd import csv #Open file to save Trump tweets sentiment used to estimate probability csvfile=open("/home/ubuntu/project/output_data/trump_pos_sentiment.csv", "w") csvwriter=csv.writer(csvfile, delimiter=",") #Assign header row csvwriter.writerow(["Index"]+["State"]+["Sentiment"]) #Initialize counter...
apache-2.0
-6,014,421,773,318,569,000
33.1875
103
0.678245
false
Open file to save Trump tweets sentiment used to estimate probabilityAssign header rowInitialize counter for tweetsOpen Trump results and load in fileOpen Clinton results, flip sentiment and load in fileClose csv fileLoad data into data frameprint dataGroup sentiment by stateaggregations = { "Sentiment":'mean'}group...
461
en
0.590105
jaantollander/CrowdDynamics
crowddynamics/core/motion/tests/test_motion.py
1
2448
import numpy as np from hypothesis import given from crowddynamics.core.motion.adjusting import force_adjust, torque_adjust from crowddynamics.core.motion.contact import force_contact from crowddynamics.core.motion.fluctuation import force_fluctuation, \ torque_fluctuation from crowddynamics.core.motion.helbing im...
gpl-3.0
1,157,326,579,588,317,200
30.384615
75
0.658497
false
0
en
0.110449
stoq/kiwi
examples/validation/datatypes.py
1
1096
import datetime from gi.repository import Gtk from kiwi.currency import currency from kiwi.ui.widgets.entry import ProxyEntry from kiwi.ui.widgets.label import ProxyLabel window = Gtk.Window() window.connect('delete-event', Gtk.main_quit) window.set_border_width(6) vbox = Gtk.VBox() window.add(vbox) data_types = [ ...
lgpl-2.1
-7,734,861,046,727,665,000
22.826087
55
0.666058
false
0
en
0.110449
vinta/django-email-confirm-la
email_confirm_la/models.py
1
7024
# coding: utf-8 import datetime from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.mail import EmailMessage from django.db import IntegrityError from django.db import models from django.template.loader import render_to_string from django.urls import reverse fr...
mit
-1,843,030,772,394,282,500
39.837209
147
0.685222
false
Once an email is confirmed, it will be delete from this table. In other words, there are only unconfirmed emails in the database. delete all confirmations for the same content_object and the same field Create an email confirmation for `content_object` and send a confirmation mail. The email will be directly saved to `...
469
en
0.850171
h2020-endeavour/iSDX
xctrl/flowmodmsg.py
1
2846
#!/usr/bin/env python # Author: # Rudiger Birkner (Networked Systems Group ETH Zurich) class FlowModMsgBuilder(object): def __init__(self, participant, key): self.participant = participant self.key = key self.flow_mods = [] def add_flow_mod(self, mod_type, rule_type, priority, match...
apache-2.0
162,722,739,256,632,800
30.977528
105
0.382642
false
!/usr/bin/env python Author: Rudiger Birkner (Networked Systems Group ETH Zurich) request body format: {"auth_info": { "participant": 1, "key": "xyz" } "flow_mods": [ { "cookie": (1, 2**16-1), "mod_type": "insert/remove", "rule_type": "inbo...
1,473
en
0.493418
Nadeflore/dakara-player-vlc
tests/test_text_generator.py
1
10404
from unittest import TestCase from unittest.mock import mock_open, patch from dakara_base.resources_manager import get_file from path import Path from dakara_player_vlc.text_generator import ( IDLE_TEMPLATE_NAME, TextGenerator, TRANSITION_TEMPLATE_NAME, ) from dakara_player_vlc.resources_manager import g...
mit
6,179,296,149,975,221,000
33.450331
86
0.597174
false
Test the text generator class in real conditions Test the text generator class unitary Test the convertion of an available icon name to its code Test the convertion of a null icon name is handled Test the convertion of an unavailable icon name to a generic code Test the convertion o...
2,049
en
0.688879
ben-jones/centinel
centinel/vpn/openvpn.py
1
2675
#!/usr/bin/python # openvpn.py: library to handle starting and stopping openvpn instances import subprocess import threading import time class OpenVPN(): def __init__(self, config_file=None, auth_file=None, timeout=10): self.started = False self.stopped = False self.error = False ...
mit
-5,255,765,130,357,951,000
31.621951
77
0.541308
false
!/usr/bin/python openvpn.py: library to handle starting and stopping openvpn instances
86
en
0.671764
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/verification/tests/test_token_creation.py
1
1773
# Copyright 2009, 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). __metaclass__ = type import random import testtools from lp.services.database.constants import UTC_NOW from lp.services.tokens import ( create_token, create_unique...
agpl-3.0
-8,056,143,793,439,895,000
35.183673
76
0.707276
false
Copyright 2009, 2011 Canonical Ltd. This software is licensed under the GNU Affero General Public License version 3 (see the file LICENSE). Calling create_unique_token_for_table() twice with the same random.seed() will generate two identical tokens, as the token was never inserted in the table. Now insert the token in...
418
en
0.7418
openstack/smaug
karbor/tests/unit/protection/test_cinder_protection_plugin.py
1
18217
# 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 # dist...
apache-2.0
-7,685,870,856,915,176,000
37.925214
79
0.582697
false
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under th...
546
en
0.872906
DTOcean/dtocean-core
dtocean_core/utils/moorings.py
1
21601
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 Mathew Topper # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
-1,758,551,616,762,855,000
39.679849
81
0.432711
false
-*- coding: utf-8 -*- Copyright (C) 2016-2018 Mathew Topper This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Th...
1,007
en
0.849496
Letractively/portable-movie-organizer
movie-organizer/MovieDataEditor.py
1
9673
# # portable-movie-organizer # # Copyright (c) 2010 Ali Aafee # # This file is part of portable-movie-organizer. # # portable-movie-organizer 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 ...
gpl-3.0
-6,006,860,567,625,273,000
33.546429
101
0.721493
false
portable-movie-organizer Copyright (c) 2010 Ali Aafee This file is part of portable-movie-organizer. portable-movie-organizer 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, o...
800
en
0.885471
IsCoolEntertainment/debpkg_libcloud
libcloud/compute/drivers/openstack.py
1
57541
# 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 use ...
apache-2.0
-4,493,782,231,637,883,000
32.37645
79
0.53063
false
A Virtual Network. Base OpenStack node driver. Should not be used directly. NodeSize class for the OpenStack.org driver. Following the example of OpenNebula.org driver and following guidelines: https://issues.apache.org/jira/browse/LIBCLOUD-119 A Security Group. A Rule of a Security Group. OpenStack node driver. Extr...
13,828
en
0.66641
Cinntax/home-assistant
homeassistant/components/zha/core/channels/security.py
1
6806
""" Security channels module for Zigbee Home Automation. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zha/ """ import logging import zigpy.zcl.clusters.security as security from homeassistant.core import callback from homeassistant.helpers.dispatche...
apache-2.0
7,192,171,406,314,994,000
34.612565
99
0.626286
false
Channel for the IASZone Zigbee cluster. IAS Ancillary Control Equipment channel. IAS Warning Device channel. Handle attribute updates on this cluster. Handle commands received to this cluster. Get the specified bit from the value. Set the specified bit in the value. Security channels module for Zigbee Home Automation. ...
503
en
0.814855
SRabbelier/Melange
scripts/gci_statistic_seeder.py
1
7157
#!/usr/bin/python2.5 # # Copyright 2010 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
-4,528,827,782,894,037,000
25.3125
76
0.586139
false
!/usr/bin/python2.5 Copyright 2010 the Melange authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
575
en
0.848463
shuque/pydig
pydiglib/rr_svcb.py
1
3490
""" SVCB and HTTPS RR Types class. """ import socket import struct from .name import name_from_wire_message # SVCB (Service Binding RR) Parameter Types SVCB_PARAM = { 0: "mandatory", 1: "alpn", 2: "no-default-alpn", 3: "port", 4: "ipv4hint", 5: "echconfig", 6: "ipv6hint", } class Rdat...
gpl-2.0
-2,864,752,358,938,569,000
32.883495
77
0.439542
false
SVCB RR RDATA Class SVCB and HTTPS RR Types class. SVCB (Service Binding RR) Parameter Types list(key=value strings) mandatory alpn port ipv4hint ipv6hint
156
en
0.371114
hbs/python-oauth2
oauth2/__init__.py
1
24945
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
mit
-6,773,699,701,043,492,000
32.938776
134
0.616837
false
OAuthClient is a worker to attempt to execute a request. A consumer of OAuth-protected services. The OAuth consumer is a "third-party" service that wants to access protected resources from an OAuth service provider on behalf of an end user. It's kind of the OAuth client. Usually a consumer must be registered with the...
6,486
en
0.828305
GrognardsFromHell/TemplePlus
tpdatasrc/tpgamefiles/rules/races/race011_troll.py
1
1219
from toee import * import race_defs ################################################### def GetCategory(): return "Core 3.5 Ed Classes" print "Registering race: Troll" raceEnum = race_troll raceSpec = race_defs.RaceSpec() raceSpec.modifier_name = "Troll" # Python modifier to be applied raceSpec...
mit
-6,833,448,202,129,764,000
32.888889
96
0.604594
false
Python modifier to be applied basic level modifier str, dex, con, int, wis, cha offset into rules/material_ext.mes file
119
en
0.615295
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/cogent/util/modules.py
1
1377
#!/usr/bin/env python """Compiled modules may be out of date or missing""" import os, sys __author__ = "Peter Maxwell" __copyright__ = "Copyright 2007-2012, The Cogent Project" __credits__ = ["Peter Maxwell"] __license__ = "GPL" __version__ = "1.5.3" __maintainer__ = "Peter Maxwell" __email__ = "pm67nz@gmail.com" __s...
mit
7,593,111,555,751,964,000
32.585366
66
0.580973
false
Compiled modules may be out of date or missing !/usr/bin/env python
68
en
0.435269
fiam/blangoblog
blango/forms.py
1
1444
from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.contrib.auth.models import User from django import forms from blango.models import Comment from blango.jsforms import JSModelForm # This violates the DRY principe, but it's the only # way I found for editing ...
bsd-3-clause
-577,320,069,726,871,300
31.088889
136
0.668975
false
This violates the DRY principe, but it's the only way I found for editing staff comments from the Django admin application
122
en
0.921833
stryder199/RyarkAssignments
Assignment2/web2py/applications/cqg/question/hamming.py
1
4192
import os import file_util import html_util import hamming_util # table properties BORDER = 1 MIN_CELL_WIDTH = 36 MIN_CELL_HEIGHT = 16 # superclass for our two question types class hamming: def __init__(self,question_library_path,question_path): self.question_library_path = question_library_path self.question_pa...
mit
5,480,421,653,543,299,000
28.111111
66
0.671756
false
table properties superclass for our two question types replace code_word hotspots with None generate question description generate a list of selects with bits specified by answer bits = list of len(code_word) items where bits[i]: code_word[i] if code_word[i] in [0,1] a select box if code_word[i] is None one-relative ge...
654
en
0.663472
gwct/core
core2/isofilter.py
1
9979
#!/usr/bin/python ######################################################################################## #Script to filter out isoforms from peptide files in FASTA ENSEMBL or NCBI format. This #script can also add an easier to read species label to each sequence within the file. # #Sample ENSEMBL usage: python isofor...
gpl-3.0
8,496,657,265,609,689,000
32.712838
573
0.605772
false
!/usr/bin/pythonScript to filter out isoforms from peptide files in FASTA ENSEMBL or NCBI format. Thisscript can also add an easier to read species label to each sequence within the file.Sample ENSEMBL usage: python isoform_filter.py -i [input_fasta_file] -t ens -l [species_label] -o [output_filename]Sample NCBI usage:...
3,560
en
0.427944
dodger487/MIST
data/makeSnippets.py
1
5346
#!/usr/bin/env python # Chris Riederer # Google, Inc # 2014-07-25 import test_detect import numpy as np import os import json import random import sys def makeNegativeSnippets(runData, number, snipPrefixTime=100000000, snipPostfixTime=500000000): return makeSnippets(runData, True, numberNegative=number, snipPrefi...
apache-2.0
-2,253,044,168,712,271,600
39.195489
123
0.721848
false
!/usr/bin/env python Chris Riederer Google, Inc 2014-07-25 generate start point for snippets, and ensure snippet is entirely in recorded data convert back to python list, so JSON can serialize todo: filename convert back to python list, so JSON can serialize TODO: initially writing this just for negative runData files....
502
en
0.60314
rhildred/rhildred.github.io
tag_generator.py
1
1427
#!/usr/bin/env python ''' tag_generator.py Copyright 2017 Long Qian Contact: lqian8@jhu.edu This script creates tags for your Jekyll blog hosted by Github page. No plugins required. ''' import glob import os import re post_dir = '_posts/' tag_dir = 'tag/' filenames = glob.glob(post_dir + '*') total_tags = [] for...
mit
1,607,549,321,355,180,300
25.924528
274
0.573931
false
tag_generator.py Copyright 2017 Long Qian Contact: lqian8@jhu.edu This script creates tags for your Jekyll blog hosted by Github page. No plugins required. !/usr/bin/env python
179
en
0.500365
Samfox2/motioneye
motioneye/v4l2ctl.py
1
11312
# Copyright (c) 2013 Calin Crisan # This file is part of motionEye. # # motionEye 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. # #...
gpl-3.0
-9,183,610,515,678,452,000
26.062201
129
0.573285
false
Copyright (c) 2013 Calin Crisan This file is part of motionEye. motionEye is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is di...
1,086
en
0.832241
oshtaier/robottelo
tests/foreman/cli/test_host_collection.py
1
20256
# -*- encoding: utf-8 -*- # vim: ts=4 sw=4 expandtab ai """Test class for Host Collection CLI""" from ddt import ddt from fauxfactory import gen_string from robottelo.cli.contentview import ContentView from robottelo.cli.lifecycleenvironment import LifecycleEnvironment from robottelo.cli.factory import ( CLIFacto...
gpl-3.0
1,622,137,752,100,094,200
32.370675
81
0.54063
false
Host Collection CLI tests. Make a host collection and asserts its success Tests for Host Collections via Hammer CLI @Test: Check if content host can be added to host collection @Feature: Host Collection @Assert: Host collection is created and content-host is added @Test: Check if content hosts added to host collectio...
2,471
en
0.873084
Atush/py_learning
generator/contact.py
1
1799
from model.contact import Contact import random import string import os.path import jsonpickle import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", 'file']) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "data/contacts.json" for o, ...
apache-2.0
-7,085,304,235,291,700,000
39.909091
466
0.679266
false
0
en
0.110449
yoshizow/global-pygments-plugin
test/test_global.py
1
1089
# # Copyright (c) 2014 # Yoshitaro Makise # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distrib...
gpl-3.0
4,583,215,890,235,020,000
33.03125
71
0.660239
false
Copyright (c) 2014 Yoshitaro Makise This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope tha...
647
en
0.912208
Debian/dput-ng
dput/uploader.py
1
10756
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Copyright (c) 2012 dput authors # # 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...
gpl-2.0
3,489,147,929,488,707,600
28.961003
79
0.577538
false
Abstract base class for all concrete uploader implementations. Figure out what logfile to write to. This is mostly an internal implementation. Returns the file to log to, given a changes and profile. Setup the things needed to upload a file. Usually this means creating a network connection & authenticating. .. warning:...
2,231
en
0.847801
BBN-Q/Auspex
src/auspex/instruments/hall_probe.py
1
1712
# Copyright 2016 Raytheon BBN Technologies # # 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 import numpy as np class HallProbe(object): ...
apache-2.0
-244,677,329,928,552,860
37.909091
97
0.620327
false
Simple wrapper for converting Hall probe voltage measurements to actual fields values. Copyright 2016 Raytheon BBN Technologies 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....
344
en
0.727308
avastjohn/maventy_new
registration/urls.py
1
3567
""" URLConf for Django user registration and authentication. If the default behavior of the registration views is acceptable to you, simply use a line like this in your root URLConf to set up the default URLs for registration:: (r'^accounts/', include('registration.urls')), This will also automatically set up th...
bsd-3-clause
-5,240,740,255,448,144,000
45.324675
99
0.540791
false
URLConf for Django user registration and authentication. If the default behavior of the registration views is acceptable to you, simply use a line like this in your root URLConf to set up the default URLs for registration:: (r'^accounts/', include('registration.urls')), This will also automatically set up the vi...
1,022
en
0.828562
France-ioi/taskgrader
tools/testSelect/zipImport.py
1
4094
#!/usr/bin/env python3 # Copyright (c) 2016 France-IOI, MIT license # # http://opensource.org/licenses/MIT # This tool imports solutions and test cases from a zip file. import os, subprocess, sys, zipfile SELFDIR = os.path.normpath(os.path.dirname(os.path.abspath(__file__))) CFG_TESTSELECT = os.path.join(SELFDIR, '...
mit
5,931,554,227,149,325,000
30.736434
112
0.581094
false
Unzip a zip export into testsPath and solsPath. !/usr/bin/env python3 Copyright (c) 2016 France-IOI, MIT license http://opensource.org/licenses/MIT This tool imports solutions and test cases from a zip file. Explore list of files in the zip archive Rename a/b/c.ext to b-c.ext Check type of file from extension Not a te...
602
en
0.768805
chenders/deadonfilm
app/deadonfilm.py
1
3643
import imdb import json import os import logging from logging.handlers import RotatingFileHandler from urllib.parse import urlparse from flask import ( Flask, redirect, make_response, request, send_from_directory, render_template ) import psycopg2.extras url = urlparse(os.environ.get('IMDB_DB...
mit
-4,903,017,006,393,662,000
27.912698
92
0.59429
false
Who died from the movie with the given IMDb id? Find movie by title search (using IMDb API). Query argument ``q``.
114
en
0.859495
admk/soap
soap/parser/program.py
1
1972
import re import sh from soap.datatype import type_cast from soap.expression import is_variable from soap.program import ProgramFlow, PragmaInputFlow, PragmaOutputFlow from soap.parser.common import _lift_child, _lift_dontcare, CommonVisitor from soap.parser.expression import DeclarationVisitor, ExpressionVisitor fro...
mit
7,840,282,045,129,042,000
32.423729
73
0.698783
false
0
en
0.110449
beeftornado/sentry
src/sentry/templatetags/sentry_avatars.py
2
2789
from __future__ import absolute_import from django import template from django.conf import settings from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from six.moves.urllib.parse import urlencode from sentry.models import User, UserAvatar from sentry.utils.avatar import get_ema...
bsd-3-clause
8,308,949,113,032,601,000
31.057471
85
0.66583
false
Adapted from http://en.gravatar.com/site/implement/images/django/ The "mm" default is for the grey, "mystery man" icon. See: http://en.gravatar.com/site/implement/images/ Don't use this in any situations where you're rendering more than 1-2 avatars. It will make a request for every user! user can be User or Organizat...
368
en
0.898672
zfrenchee/pandas
pandas/tests/series/test_alter_axes.py
1
9506
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest from datetime import datetime import numpy as np import pandas as pd from pandas import Index, Series from pandas.core.index import MultiIndex, RangeIndex from pandas.compat import lrange, range, zip from pandas.util.testing import assert_series_equal,...
bsd-3-clause
8,677,358,192,297,557,000
34.33829
78
0.528508
false
coding=utf-8 pylint: disable-msg=E1101,W0612 wrong type wrong length works dict partial dict index with name check inplace level With MultiIndex With single-level Index GH 12071 no change, position no change, labels rotate, position GH 15704 GH14636 inplace=True The FutureWarning comes from the fact that we would like ...
443
en
0.597406
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/system/filesystem.py
1
11234
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
gpl-2.0
-5,104,576,357,975,560,000
35.23871
140
0.619904
false
Copyright (C) 2010 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following discla...
2,040
en
0.905103
ekadhanda/bin
python/coda-scrip.py
1
9971
#! /usr/bin/env python # Written by Vasaant S/O Krishnan Friday, 19 May 2017 # Run without arguments for instructions. import sys usrFile = sys.argv[1:] if len(usrFile) == 0: print "" print "# Script to read in file of the CODA format and perform some basic" print "# statistical computations. An index.tx...
mit
5,365,606,739,219,322,000
40.032922
110
0.446094
false
! /usr/bin/env python Written by Vasaant S/O Krishnan Friday, 19 May 2017 Run without arguments for instructions.===================================================================== Define variables. Integers for regexfloats = '\s+?([+-]?\d+(?:\.\d+)?)' Floats or int Floats or int or scientific CODAindex a...
3,634
en
0.573661
flacjacket/dotfiles
jupyter/ipython_kernel_config.py
1
1849
import os import sys import matplotlib as mpl from matplotlib import cm from colormaps import ( inferno, magma, plasma, viridis, inferno_r, magma_r, plasma_r, viridis_r ) # Add the notebook dir to the path if os.name == 'nt': nbdir = 'D:/Dropbox/Notebooks' else: nbdir = '~/notebooks' nbdir = os.path.expan...
mit
-2,205,698,834,725,386,200
27.015152
76
0.716604
false
Add the notebook dir to the path Let's fix jet even before matplotlib 2.0 Load the default config Set a bunch of stuff to import automatically Setup the SymPy pretty printing
174
en
0.631993
ESOedX/edx-platform
common/djangoapps/third_party_auth/management/commands/remove_social_auth_users.py
1
2126
""" Management command to remove social auth users. Intended for use in masters integration sandboxes to allow partners reset users and enrollment data. """ from __future__ import absolute_import import logging from django.conf import settings from django.contrib.auth.models import User from django.core.management.b...
agpl-3.0
-630,919,036,611,812,900
32.21875
96
0.663688
false
Management command to remove all social auth entries AND the corresponding edX users for a given IDP. Usage: manage.py remove_social_auth_users gtx Management command to remove social auth users. Intended for use in masters integration sandboxes to allow partners reset users and enrollment data.
302
en
0.687526
akretion/odoo
addons/mrp/models/mrp_routing.py
7
5147
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class MrpRouting(models.Model): """ Specifies routings of work centers """ _name = 'mrp.routing' _description = 'Routings' name = fields.Char('Routing', required...
agpl-3.0
1,015,476,141,267,269,400
49.960396
168
0.63979
false
Specifies routings of work centers -*- coding: utf-8 -*- Part of Odoo. See LICENSE file for full copyright and licensing details.
132
en
0.882509
cts-admin/cts
cts/members/test_views.py
1
5788
from datetime import date, timedelta from django.test import TestCase from django.urls import reverse from .models import CorporateMember, IndividualMember, Team from .utils import get_temporary_image class IndividualMemberListViewTests(TestCase): url = reverse('members:individual-members') @classmethod ...
gpl-3.0
4,546,342,254,215,766,000
35.402516
97
0.621113
false
shouldn't sort by amount Sorted by name
39
en
0.993981
Xilinx/hopper
hopper/utils/git/watcher.py
1
5949
# Copyright (c) 2015 Xilinx 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 # to use, copy, modify, merge, publish, distrib...
mit
497,451,319,322,704,600
28.161765
102
0.675408
false
Copyright (c) 2015 Xilinx 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 to use, copy, modify, merge, publish, distribute, sublice...
1,190
en
0.849231
SLongofono/448_Project4
testMath.py
1
5536
import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import Variance import math def testVariance(): print ("1. Testing Variance") weighting = [2,2,2,2,2,2,2,2,2,2] test1 = [['artist1', 'ar...
mit
5,970,112,297,490,376,000
28.763441
112
0.621929
false
0
en
0.110449
alissonbf/easy-estoque
docs/conf.py
1
6983
# -*- coding: utf-8 -*- # # coopervap documentation build configuration file, created by # sphinx-quickstart on Wed Oct 6 18:00:51 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
gpl-2.0
836,110,182,731,122,000
31.328704
80
0.707719
false
-*- coding: utf-8 -*- coopervap documentation build configuration file, created by sphinx-quickstart on Wed Oct 6 18:00:51 2010. This file is execfile()d with the current directory set to its containing dir. Note that not all possible configuration values are present in this autogenerated file. All configuration value...
6,115
en
0.674066
delftrobotics/keras-retinanet
tests/layers/test_filter_detections.py
1
6618
""" Copyright 2017-2018 Fizyr (https://fizyr.com) 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 w...
apache-2.0
-4,984,361,034,989,192,000
37.254335
106
0.601239
false
Copyright 2017-2018 Fizyr (https://fizyr.com) 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 writi...
1,219
en
0.705644
ww-Kenya/rainbow6
motion_detection.py
1
5448
import argparse import datetime import imutils import time import cv2 import RPi.GPIO as GPIO import os import smtplib from servo import Servo RESIZE_WIDTH = 500 RESIZE_HEIGHT = 375 THRESHOLD = 30 MAXPIXELVAL = 255 MORNINGTIME = 7 NIGHTTIME = 19 MIN_RECTANGLE = 2000 MAX_RECTANGLE = 90000 HARDDRIVE_LOCATION = "/media/p...
mit
8,836,440,019,275,679,000
27.978723
193
0.581131
false
server.login("","")server.sendmail("","",msg)os.rename(HOME_LOCATION+TITLE , HARDDRIVE_LOCATION+TITLE)cv2.imshow("First Frame", firstFrame)
139
en
0.303444
architecture-building-systems/CEAforArcGIS
cea/datamanagement/terrain_helper.py
1
6135
""" This script extracts terrain elevation from NASA - SRTM https://www2.jpl.nasa.gov/srtm/ """ import os import gdal import numpy as np import pandas as pd import requests from geopandas import GeoDataFrame as Gdf from osgeo import ogr from osgeo import osr from shapely.geometry import Polygon import cea.config ...
mit
-4,838,354,374,274,120,000
40.734694
157
0.682152
false
Create the terrain.tif file :param config: :type config: cea.config.Configuration :return: this is where the action happens if it is more than a few lines in ``main``. NOTE: ADD YOUR SCRIPT'S DOCUMENATION HERE (how) NOTE: RENAME THIS FUNCTION (SHOULD PROBABLY BE THE SAME NAME AS THE MODULE) This script extracts terrai...
1,454
en
0.808424
babble/babble
include/jython/Lib/test/test_support.py
1
19785
"""Supporting definitions for the Python regression tests.""" if __name__ != 'test.test_support': raise ImportError, 'test_support must be imported from the test package' import sys import time class Error(Exception): """Base class for regression test exceptions.""" class TestFailed(Error): """Test fail...
apache-2.0
-4,226,911,653,028,837,000
33.710526
95
0.584837
false
Flag set to 0 by regrtest.py Flag set to [] by regrtest.py Option set by regrtest.py Disable bigmem tests (they will still be run with small sizes, to make sure they work.) _original_stdout is meant to hold stdout at the time regrtest began. This may be "the real" stdout, or IDLE's emulation of stdout, or whatever. The...
3,922
en
0.8668
markgw/jazzparser
src/jazzparser/formalisms/music_halfspan/songtools.py
1
20939
"""Interactive shell tools for the Halfspan formalism. These tools concern song recognition and allow utilities for recognising songs to be called from the shell. """ """ ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granrot...
gpl-3.0
-6,989,043,982,802,696,000
38.433145
93
0.570562
false
Try loading the named set Store this in the state so other tools can use it Try getting song data Get the song from the dataset Display the semantics Also display the TS coordinates Compare a song instead of a result Normal behaviour: compare a result to a song Do the comparison Print the alignment in three rows Wrap t...
1,221
en
0.858864
tobiz/OGN-Flight-Logger_V2
settings.py
1
9941
#------------------------------------- # OGN-Flight-Logger Settings #------------------------------------- # Python APRS/OGN program to log flight times, durations, maximum heights achieved and tracks # # This python program creates an SQlite db of flights from a given location and aircraft list # (the later two para...
gpl-3.0
1,513,637,528,252,753,400
62.318471
192
0.574489
false
------------------------------------- OGN-Flight-Logger Settings------------------------------------- Python APRS/OGN program to log flight times, durations, maximum heights achieved and tracks This python program creates an SQlite db of flights from a given location and aircraft list (the later two parameters are to ...
5,938
en
0.809352
StephanII/accelerator-toolkit
magnets.py
1
3901
from base import Device import math as math class SectorBendingMagnet(Device): def __init__(self, nomenclature="", width=0., height=0., length=0., angle=0.): Device.__init__(self, nomenclature, width, height, length) self.angle = angle def __repr__(self): r = str(self) + "(" ...
mit
-7,058,308,463,578,992,000
28.55303
91
0.471161
false
----------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------
181
en
0.117777
anortef/calico
calico/felix/test/test_frules.py
1
11864
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
8,944,739,970,673,061,000
42.944444
124
0.517701
false
-*- coding: utf-8 -*- Copyright 2015 Metaswitch Networks Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to ...
578
en
0.857026
dstufft/converge
converge/worker.py
1
2830
# Copyright 2014 Donald Stufft # # 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, so...
apache-2.0
7,776,162,057,832,432,000
29.106383
76
0.525088
false
Copyright 2014 Donald Stufft 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...
823
en
0.921834
seanpue/al340
lessons/textanalysis/Untitled0.py
1
1100
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import nltk %matplotlib inline # <codecell> import os from nltk.corpus.reader.plaintext import PlaintextCorpusReader corpusdir = 'data/texts/' # Directory of corpus. corpus0 = PlaintextCorpusReader(corpusdir, '.*') corpus = nltk.Text(corpus0.words(...
mit
-1,315,354,380,263,225,000
11.454545
62
0.686131
false
-*- coding: utf-8 -*- <nbformat>3.0</nbformat> <codecell> <codecell> Directory of corpus. <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell> <codecell>
276
en
0.311873
karrtikr/ete
ete3/tools/phylobuild_lib/interface.py
1
16365
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the...
gpl-3.0
3,725,017,766,903,037,000
29.935728
157
0.524962
false
Init logging and Screen. Then call main function START_LICENSE This file is part of the Environment for Tree Exploration program (ETE). http://etetoolkit.org ETE 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,...
2,820
en
0.735003
phenoxim/nova
nova/api/openstack/placement/handler.py
1
9631
# 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 # d...
apache-2.0
7,792,931,749,543,994,000
40.15812
78
0.668986
false
Serve Placement API. Dispatch to handlers defined in ROUTE_DECLARATIONS. Find a matching route for the current request. If no match is found, raise a 404 response. If there is a matching route, but no matching handler for the given method, raise a 405. Return a 405 response when method is not allowed. If _methods ar...
3,534
en
0.900178
christianbrodbeck/nipype
nipype/interfaces/tests/test_utility.py
1
2130
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import shutil from tempfile import mkdtemp from nipype.testing import assert_equal, assert_true from nipype.interfaces import utility import nipype.pipeline.engine as pe def test_rename(): ...
bsd-3-clause
-4,245,517,544,868,425,700
30.323529
165
0.664319
false
emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- vi: set ft=python sts=4 ts=4 sw=4 et: Test very simple rename Now a string-formatting version Test .input field creation Set the inputs Clean up Clean up
225
en
0.436817
babble/babble
include/jython/Lib/test/test_javashell.py
1
5503
import unittest from test import test_support from org.python.core import PyFile import re import os import javashell # testCmds is a list of (command, expectedOutput) # each command is executed twice, once in unitialized environment and # once with initialized environment # smaller set of commands for simple test ...
apache-2.0
-7,787,827,928,684,043,000
38.028369
89
0.590224
false
This test validates the subshell functionality (javashell, os.environ, popen*). Does some white box as well as black box testing. test commands (key) and compare output to expected output (value). this actually executes all the commands twice, testing the return code by calling system(), and testing some of the output ...
1,712
en
0.86521
fallen/artiq
artiq/language/scan.py
1
4762
""" Implementation and management of scan objects. A scan object (e.g. :class:`artiq.language.scan.LinearScan`) represents a one-dimensional sweep of a numerical range. Multi-dimensional scans are constructed by combining several scan objects. Iterate on a scan object to scan it, e.g. :: for variable in self.sca...
gpl-3.0
1,219,659,166,398,376,400
28.395062
81
0.625367
false
A scan object that yields values from an explicitly defined sequence. A scan object that yields a fixed number of increasing evenly spaced values in a range. A scan object that yields a single value. A scan object that yields a fixed number of randomly ordered evenly spaced values in a range. An argument (as defined in...
1,582
en
0.847538
restful-open-annotation/oa-adapter
formats/json_format.py
1
2113
#!/usr/bin/env python """JSON content-type support for Open Annotation.""" __author__ = 'Sampo Pyysalo' __license__ = 'MIT' import json # Default values for rendering options PRETTYPRINT_DEFAULT = True KEEPCONTEXT_DEFAULT = False # Short name for this format. format_name = 'json' # The MIME types associated with ...
mit
113,083,809,037,946,270
27.173333
71
0.658779
false
Render JSON-LD data into JSON string. This is intended to be used as a mimerender render function (see http://mimerender.readthedocs.org/en/latest/). If options['prettyprint'] is True, renders the data so that it is more easily readable by humans. If options['keepcontext'] is True, includes the JSON-LD @context in th...
1,121
en
0.564673
seprich/py-bson-rpc
bsonrpc/concurrent.py
1
2990
# -*- coding: utf-8 -*- ''' This module provides a collection of concurrency related object generators. These generators will create either native threading based or greenlet based objects depending on which threading_model is selected. ''' from bsonrpc.options import ThreadingModel __license__ = 'http://mozilla.org/M...
mpl-2.0
622,220,974,657,172,900
25.696429
66
0.644147
false
This module provides a collection of concurrency related object generators. These generators will create either native threading based or greenlet based objects depending on which threading_model is selected. -*- coding: utf-8 -*-
232
en
0.884895
MaxTakahashi/hammr
hammr/utils/publish_utils.py
1
14372
# Copyright 2007-2015 UShareSoft SAS, 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 requi...
apache-2.0
8,318,043,477,958,264,000
31.515837
95
0.695519
false
Copyright 2007-2015 UShareSoft SAS, 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 la...
1,073
en
0.847519