repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
f-forcher/crystal-channeling-analysis
various/STF110_bend_vs_time.py
1
1638
from matplotlib.colors import LogNorm import matplotlib.pyplot as plt; plt.ion(); import matplotlib plt.figure() plt.title(r'$\theta_{b}$ in each run') plt.xlabel("Run number") plt.ylabel(r'$\theta_{b}\ [\mu rad]$') runs = [4372,5508,5693] htc_eff = [67.5,67.5,62.6] htc_eff_err = [0.3,0.2,0.4] htc_tb = [49.3,59.3,63.7...
gpl-3.0
-8,488,194,346,494,970,000
27.241379
82
0.639194
false
2.135593
false
true
false
rosenvladimirov/addons
hw_datecs_bg/datecs/printer.py
1
4263
#!/usr/bin/python import usb.core import usb.util import serial import socket from datecs import * from exceptions import * from time import sleep class Usb(Datecs): """ Define USB printer """ def __init__(self, idVendor, idProduct, interface=0, in_ep=0x82, out_ep=0x01): """ @param idVendor ...
agpl-3.0
-9,106,166,105,262,716,000
29.021127
194
0.57049
false
4.017908
false
false
false
Honzin/ccs
ccs/cexio/__init__.py
1
2933
# -*- coding: utf8 -*- """ This file implementns: * class adapter which offer unificated API for requests ticker, trades, orderbook, ... * class for symbol """ __author__ = "Jan Seda" __copyright__ = "Copyright (C) Jan Seda" __credits__ = [] __license__ = "" __version__ = "0.1" __maintainer__ = "Jan Seda" __email__...
agpl-3.0
431,518,107,233,960,800
26.679245
115
0.444255
false
4.477863
false
false
false
googleads/google-ads-python
google/ads/googleads/v6/resources/types/bidding_strategy.py
1
6348
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
1,435,416,918,971,258,400
38.428571
101
0.659735
false
4.043312
false
false
false
hughsons/saltwaterfish
classes_bkp.py
1
15646
from models import * from django.db import connection import collections class Error(object): def __init__(self): self.IsError = False self._error_number = 0 self._error_message = '' def RaiseError(self, p_message): self.IsError = True self._error_message = p_message def Error(self...
bsd-3-clause
750,237,689,013,469,300
33.386813
267
0.613639
false
3.528642
false
false
false
eginer/qp_old
quantum_package-master/scripts/module/qp_install_module.py
1
8151
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Usage: qp_install_module.py create -n <name> [<children_modules>...] qp_install_module.py download -n <name> [<path_folder>...] qp_install_module.py install <name>... qp_install_module.py list (--installed | --available-local) qp_insta...
gpl-2.0
-2,417,308,057,725,217,300
31.090551
129
0.498834
false
3.281401
false
false
false
mburq/Deep_rl_stochastic_opt
src/environment/matching.py
1
1677
import numpy as np from numpy.random import rand, binomial class simple_matching(object): """ Implements a simple dynamic matching environment, where arrivals and departures are generated stochastically. """ def __init__(self, types, weight_matrix, ar...
mit
-5,736,227,409,681,122,000
33.9375
89
0.607036
false
4.03125
false
false
false
vidartf/hyperspyUI
hyperspyui/pluginmanager.py
1
10810
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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 #...
gpl-3.0
1,498,538,949,422,261,800
33.208861
82
0.556059
false
4.185056
false
false
false
PySimulator/PySimulator
PySimulator/Plugins/Analysis/LinearSystemAnalysis/LinearizeFMU.py
1
9884
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C) 2011-2014 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.), Institute of System Dynamics and Control All rights reserved. This file is part of PySimulator. PySimulator is free software: you can redistribute it and/or modify...
lgpl-3.0
6,312,511,066,484,572,000
38.059289
142
0.562234
false
3.411115
false
false
false
imarin2/PCBMill
python/dxf.py
1
14683
#!/usr/bin/python # -*- coding: latin1 -*- # $Id$ # # Copyright and User License # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright Vasilis.Vlachoudis@cern.ch for the # European Organization for Nuclear Research (CERN) # # All rights not expressly granted under this license are reserved. # # Installation, use, reproduction, disp...
gpl-3.0
1,230,716,091,763,442,700
30.174098
80
0.483552
false
3.59437
false
false
false
divio/askbot-devel
askbot/migrations/0185_populate_post_current_revision.py
1
38596
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from askbot.utils.console import ProgressBar class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." posts = orm['askbot.Post'].objec...
gpl-3.0
4,098,645,279,688,382,500
88.75814
644
0.555213
false
3.639759
false
false
false
squarenomad/historia
backend/migrations/versions/f17134fe3cc9_.py
1
1888
"""empty message Revision ID: f17134fe3cc9 Revises: Create Date: 2017-04-13 11:17:43.739703 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f17134fe3cc9' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
mit
2,218,496,879,653,196,000
35.307692
93
0.665784
false
3.283478
false
false
false
ReanGD/sublime-powerslim
Fitnesse.py
1
1236
import sublime, sublime_plugin import os.path import webbrowser class FitnesseSelectCommand(sublime_plugin.EventListener): def check_syntax(self, view): if os.path.basename(view.file_name()) == "content.txt": current_syntax = view.settings().get('syntax') if current_syntax != "Packages/Fitnesse/Fitnesse.tmLa...
apache-2.0
-5,581,229,350,521,254,000
25.297872
73
0.708738
false
2.874419
false
false
false
ralfonso/theory
scripts/package.py
1
1138
#!/usr/bin/env python import os import shutil import sys import subprocess import cairo def main(): version = '0.1.11' script_location = sys.argv[0] script_path = os.path.abspath(script_location) app_path = os.sep.join(script_path.split(os.sep)[:-3]) src = os.path.join(app_path,'theory') d...
mit
-221,471,823,811,661,000
23.212766
107
0.629174
false
3.034667
false
false
false
jordanosborn/misc
conway.py
1
3020
import pygame, functools, itertools from typing import Set, Tuple from random import randint from time import sleep def main(state: Set[Tuple[int, int]], width: int = 500, height: int = 500, max_x: int = 100, max_y: int = 100): pygame.init() screen = pygame.display.set_mode((width, height)) size_x, size_y...
mit
1,081,898,348,489,753,600
43.411765
120
0.531126
false
3.404735
false
false
false
brguez/TEIBA
src/python/makeActivityMatrix_srcElements.py
1
6486
#!/usr/bin/env python #coding: utf-8 def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def info(string): """ Display basic information """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print ...
gpl-3.0
6,640,061,442,922,196,000
31.537688
158
0.626873
false
3.804348
false
false
false
quaddra/engage
python_pkg/engage/drivers/genforma/python.py
1
4090
"""Resource manager for python. Main purpose of this class is to check that it is installed correctly. """ import commands import os import os.path import copy import fixup_python_path import engage.drivers.resource_manager as resource_manager import engage_utils.process as procutils import engage.utils.log_setup fro...
apache-2.0
3,324,321,370,958,563,300
36.522936
106
0.654768
false
3.769585
false
false
false
ORGAN-IZE/register
widget/migrations/0002_auto_20151110_0510.py
1
1222
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import shortuuidfield.fields class Migration(migrations.Migration): dependencies = [ ('widget', '0001_initial'), ] operations = [ migrations.CreateModel( name='WidgetHost...
gpl-3.0
2,449,631,274,369,556,000
33.914286
134
0.55892
false
4.318021
false
false
false
bhaugen/foodnetwork
producer/forms.py
1
2941
from django import forms from django.db.models.query import QuerySet import datetime from distribution.models import * class InventoryItemForm(forms.ModelForm): prod_id = forms.CharField(widget=forms.HiddenInput) freeform_lot_id = forms.CharField(required=False, widget=...
mit
4,149,591,279,828,705,300
47.213115
153
0.608296
false
3.90571
false
false
false
prasannav7/ggrc-core
src/ggrc_workflows/models/cycle_task_group.py
2
2726
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com """Module for cycle task group model. """ from sqlalchemy import orm from ggrc i...
apache-2.0
729,945,833,733,602,300
28
78
0.674248
false
3.572739
false
false
false
vesellov/bitdust.devel
CodernityDB3/rr_cache.py
1
4433
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.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/L...
agpl-3.0
3,850,931,909,760,035,300
33.364341
74
0.504624
false
4.556012
false
false
false
jelly/calibre
src/calibre/db/tests/profiling.py
2
1030
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, cProfile from tempfile import gettempdir from calibre.db.legacy ...
gpl-3.0
-2,665,573,486,301,466,600
22.409091
68
0.63301
false
3.188854
false
false
false
peplin/ecomcat_to_openxc
ecomcat_to_openxc.py
1
1279
#!/usr/bin/env python """Convert ECOMCat CAN message trace files to the OpenXC raw message format. $ ./ecomcat_to_openxc example.dat > example-openxc.json """ import fileinput import json ID_HIGH_NAME = "IDH" ID_LOW_NAME = "IDL" DATA_NAME = "Data" LENGTH_NAME = "Len" REQUIRED_INPUT_ATTRS = (ID_HIGH_NAME, ID_LOW_...
bsd-3-clause
-6,574,488,138,198,226,000
29.452381
78
0.56294
false
3.533149
false
false
false
borg-project/borg
borg/domains/asp/__init__.py
1
4998
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os import os.path import shutil import resource import tempfile import subprocess import contextlib import borg from . import solvers from . import features logger = borg.get_logger(__name__, default_level = "INFO") class LP2SAT_FailedException(Exception)...
mit
2,975,656,975,946,625,000
26.921788
85
0.542617
false
3.98247
false
false
false
CSD-Public/stonix
src/stonix_resources/logdispatcher.py
1
25320
#!/usr/bin/env python3 ############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contrac...
gpl-2.0
-1,160,746,433,079,365,600
36.400295
190
0.540916
false
4.502934
false
false
false
collectiveacuity/labPack
labpack/platforms/apscheduler.py
1
21580
__author__ = 'rcj1492' __created__ = '2016.11' __license__ = 'MIT' ''' APScheduler Documentation https://apscheduler.readthedocs.io/en/latest/index.html APScheduler Trigger Methods https://apscheduler.readthedocs.io/en/latest/modules/triggers/date.html https://apscheduler.readthedocs.io/en/latest/modules/tr...
mit
8,038,004,618,654,931,000
33.672727
197
0.47924
false
4.49677
false
false
false
HybridF5/jacket
jacket/storage/zonemanager/drivers/driver_utils.py
1
3083
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
-1,020,571,657,187,466,800
38.025316
78
0.594226
false
4.317927
false
false
false
snowflakedb/snowflake-connector-python
test/unit/test_encryption_util.py
1
2977
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved. # import codecs import glob import os from os import path from snowflake.connector.constants import UTF8 from snowflake.connector.encryption_util import SnowflakeEncryptionUtil from snowflake.connect...
apache-2.0
-1,392,948,724,123,002,600
30.336842
83
0.636883
false
3.494131
false
false
false
monash-merc/mytardis-desktop-sync-macosx
DatafileModel.py
1
2745
import requests import traceback import unicodedata import re from Foundation import NSLog class DatafileModel: def __init__(self,mytardisUrl,username,password,datafileID,datafileName): self.mytardisUrl = mytardisUrl self.username = username self.password = password self.datafileID...
gpl-3.0
4,712,832,158,253,360,000
37.125
119
0.637523
false
4.336493
false
false
false
smartybit/stepic_webtech1
web/ask/qa/forms.py
1
2979
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User import models as models class AskForm(forms.Form): title = forms.CharField(max_length=255) text = forms.CharField(widget=forms.Textarea) user = User() def clean_title(self): ...
mit
4,642,841,865,380,189,000
32.1
75
0.621685
false
4.097662
false
false
false
anryko/ansible
lib/ansible/module_utils/crypto.py
1
98388
# -*- coding: utf-8 -*- # # (c) 2016, Yanis Guenane <yanis+ansible@guenane.org> # # Ansible 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
-8,847,723,531,790,490,000
47.300442
139
0.579583
false
2.412062
false
false
false
robertoesteban/sccs_supereduc
cometidos/models.py
1
5502
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import models from django.contrib.auth.models import User from personas.models import * from territorios.models import * from establecimientos.models import * from mediosdetransporte.models import * from djan...
gpl-3.0
1,952,423,682,809,851,100
44.65
116
0.751004
false
2.991808
false
false
false
davidbarkhuizen/blackwidow
core/node.py
1
1735
class Node(object): last_id = 0 @classmethod def next_id(cls): if (len(Node.tree.keys()) > 0) and (Node.last_id == 0): Node.last_id = max([id for id in Node.tree.keys()]) id = Node.last_id + 1 Node.last_id = id return id # tree = { node_id : node } tree = {} ...
mit
4,383,399,298,170,050,000
25.140625
180
0.58732
false
3.230912
false
false
false
shawncaojob/LC
QUESTIONS/135_candy.py
1
1181
# 135. Candy QuestionEditorial Solution My Submissions # Total Accepted: 60931 # Total Submissions: 257062 # Difficulty: Hard # Contributors: Admin # There are N children standing in a line. Each child is assigned a rating value. # # You are giving candies to these children subjected to the following requirements: ...
gpl-3.0
4,290,189,526,147,513,300
26.465116
83
0.57663
false
3.345609
false
false
false
facelessuser/Rummage
rummage/lib/gui/actions/export_csv.py
1
3224
"""Export CSV.""" import time import codecs import subprocess from ..localization import _ from .. import util from ... import rumcore if util.platform() == "windows": from os import startfile RESULT_ROW = '%(file)s,%(matches)s,%(extensions)s,%(size)s,%(path)s,%(encoding)s,%(modified)s,%(created)s\n' RESULT_CONTE...
mit
2,513,678,526,561,171,500
27.530973
114
0.520161
false
3.638826
false
false
false
chadspratt/AveryDB
optionsmanager.py
1
1293
"""Retrieves, stores, and otherwise manages program options.""" ## # Copyright 2013 Chad Spratt # 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/...
apache-2.0
-2,979,934,736,007,378,400
33.026316
105
0.681361
false
3.942073
false
false
false
TreesLab/NCLscan
bin/AssembleJSeq.py
1
1825
#! /usr/bin/env python2 import argparse import os import sys import re def AssembleJSeq(jseq1_file, jseq2_file): jseq1 = get_ID_and_seq(jseq1_file) jseq2 = get_ID_and_seq(jseq2_file) get_ID = lambda seq: seq[0] common_IDs = list(set(map(get_ID, jseq1)) & set(map(get_ID, jseq2))) jseq1_common = i...
mit
-8,039,534,149,208,656,000
26.651515
100
0.556712
false
2.883096
false
false
false
hughperkins/kgsgo-dataset-preprocessor
GoString.py
1
1426
# Copyright Hugh Perkins 2015 hughperkins at gmail # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at http://mozilla.org/MPL/2.0/. import Bag2d # represents a string of contiguous pieces of one c...
mpl-2.0
5,672,901,135,658,711,000
30
100
0.654979
false
3.478049
false
false
false
zitkino/backend
zitkino/processors.py
1
5794
# -*- coding: utf-8 -*- import re import decimal from os import path from datetime import datetime, date, time, timedelta from .names import MonthNames from .utils import absolutize_url, now class NormalizeSpace(object): _whitespace_re = re.compile( ur'[{0}\s\xa0]+'.format( re.escape(''.jo...
agpl-3.0
-6,598,171,986,090,748,000
23.974138
78
0.48136
false
4.186416
false
false
false
littlepea/beijing-python-meetup
2020/202001_refactoring_workshop/tennis_before.py
1
5602
class TennisGameDefactored1: def __init__(self, player1Name, player2Name): self.player1Name = player1Name self.player2Name = player2Name self.p1points = 0 self.p2points = 0 def won_point(self, playerName): if playerName == self.player1Name: self.p1...
mit
-6,123,765,039,108,176,000
30.829545
101
0.462335
false
3.46444
false
false
false
nsmoooose/csp
csp/data/fcs/f16/pitch.py
1
3347
# Copyright 2005 Mark Rose <mkrose@users.sourceforge.net> # All rights reserved. from NodeConstructor import * RegisterNetwork(globals()) ####################################################################### # pitch control laws class filtered_pitch_rate(LeadFilter): a = 1.0 input = "pitch_rate" gain = Radians...
gpl-2.0
2,778,231,763,316,863,500
23.610294
124
0.669256
false
2.495899
false
false
false
mgautierfr/devparrot
devparrot/commands/core/split.py
1
1475
# This file is part of DevParrot. # # Author: Matthieu Gautier <matthieu.gautier@devparrot.org> # # DevParrot 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 ...
gpl-3.0
3,676,266,588,809,158,000
34.97561
90
0.736949
false
3.762755
false
false
false
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/swampdragon/serializers/object_map.py
1
3770
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor, SingleRelatedObjectDescriptor, \ ForeignRelatedObjectsDescriptor, ManyRelatedObjectsDescriptor, ReverseManyRelatedObjectsDescriptor def _construct_graph(parent_type, child_type, via, is_collection, property_name): return { ...
gpl-2.0
-7,383,117,934,936,619,000
36.326733
114
0.627321
false
4.298746
false
false
false
cikelengfeng/HTTPIDL
Sources/Compiler/antlr4/Utils.py
11
1085
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # from io import StringIO def str_collection(val, begin, end): with StringIO() as buf: buf.write(begin) firs...
mit
-5,393,045,501,023,648,000
26.820513
65
0.519816
false
3.715753
false
false
false
fake-name/IntraArchiveDeduplicator
dbPhashApi.py
1
7040
#!/usr/bin/python # -*- coding: utf-8 -*- import dbApi import time import collections import gc import pyximport pyximport.install() import deduplicator.cyHamDb as hamDb import traceback import server.decorators @server.decorators.Singleton class TreeProxy(hamDb.BkHammingTree): pass ''' The idea here is that we ha...
bsd-3-clause
-4,690,370,595,199,473,000
32.051643
132
0.694034
false
3.034483
false
false
false
kuangliu/pytorch-cifar
models/efficientnet.py
1
5719
'''EfficientNet in PyTorch. Paper: "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks". Reference: https://github.com/keras-team/keras-applications/blob/master/keras_applications/efficientnet.py ''' import torch import torch.nn as nn import torch.nn.functional as F def swish(x): return x ...
mit
-242,561,625,559,419,600
31.68
106
0.481728
false
3.757556
false
false
false
martinjrobins/hobo
pints/tests/test_toy_gaussian_logpdf.py
1
5743
#!/usr/bin/env python # # Tests the Gaussian logpdf toy distribution. # # This file is part of PINTS. # Copyright (c) 2017-2019, University of Oxford. # For licensing information, see the LICENSE file distributed with the PINTS # software package. # import pints import pints.toy import unittest import numpy as np ...
bsd-3-clause
3,434,215,237,677,431
34.89375
78
0.527947
false
3.344787
true
false
false
mspcvsp/cincinnati311Data
category_count_reducer.py
1
3443
#!/usr/local/bin/python2.7 """ Counts the number of occurrences for each 311 service category http://www.michael-noll.com/tutorials/ writing-an-hadoop-mapreduce-program-in-python/""" from collections import defaultdict import csv import json import sys class Reducer(object): """ Counts the number of occurrenc...
gpl-3.0
-8,105,830,187,368,237,000
28.689655
73
0.465582
false
5.224583
false
false
false
njittam/python-telegram-bot
telegram/dispatcher.py
1
24448
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2016 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
2,319,710,164,989,263,400
32.721379
153
0.593955
false
4.71514
false
false
false
rhinstaller/python-simpleline
simpleline/event_loop/event_queue.py
1
5216
# Default event queue for Simpleline application. # # This class is thread safe. # # This file is part of Simpleline Text UI library. # # Copyright (C) 2020 Red Hat, Inc. # # Simpleline is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by...
gpl-2.0
-467,647,127,966,103,040
33.091503
97
0.654908
false
4.247557
false
false
false
srjoglekar246/sympy
sympy/printing/tests/test_mathml.py
1
16710
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \ tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \ pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float from sympy.printing.mathml import mathml, MathMLPrinter from xml.dom.minidom import parseString from ...
bsd-3-clause
2,793,477,496,128,577,500
40.056511
93
0.631179
false
2.994087
true
false
false
jhonatancasale/learning-python
Part III/random_pieces/csv/parse_csv.py
1
1456
#!env python3 # -*- coding: utf-8 -*- # from https://www.youtube.com/watch?v=Xi52tx6phRU import csv from datetime import datetime def main(): '''Perform the video example''' path = 'google_stock_data.csv' f = open(path, newline='') reader = csv.reader(f) header = next(reader) # The first line ...
apache-2.0
2,461,008,735,970,433,500
27.54902
79
0.578297
false
3.257271
false
false
false
opendesk/winnow
src/winnow/tests/set_validation_tests.py
1
21336
import unittest import winnow from winnow.exceptions import OptionsExceptionFailedValidation class TestReferenceValidation(unittest.TestCase): def test_basic_set(self): # empty doc = { u"schema": u"https://opendesk.cc/schemata/options.json", u"type": u"option", ...
unlicense
6,506,983,463,477,965,000
48.16129
146
0.262748
false
5.727785
true
false
false
mcepl/ropeide
ropeidetest/outlinetest.py
1
2311
import unittest from ropeide.outline import PythonOutline from ropetest import testutils class OutlineTest(unittest.TestCase): def setUp(self): super(OutlineTest, self).setUp() self.project = testutils.sample_project() self.outline = PythonOutline(self.project) def tearDown(self): ...
gpl-2.0
4,783,739,306,644,380,000
36.274194
82
0.61402
false
3.464768
true
false
false
katsikas/gnuradio
gr-dvbt/python/dvbt_utils.py
1
3045
# # Copyright 2006 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
-5,022,974,170,071,645,000
29.757576
88
0.592118
false
3.15544
false
false
false
low-sky/py-low-sky
neatparser.py
1
2618
import sys import numpy as np from astropy.table import Table, Column import csv import os.path as path import re filelist = sys.argv[1:] scriptloc = sys.argv[0] tagloc = scriptloc.replace('neatparser.py','neat_tags.txt') names = ('MaskName','ObsDate','Slit','Object','DBKey') dtypes = ('S10','S10','S10','S10','S40') un...
mit
-4,892,073,599,019,484,000
34.863014
106
0.515661
false
3.142857
false
false
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/flake8/reporter.py
1
2914
# -*- coding: utf-8 -*- # Adapted from a contribution of Johan Dahlin import collections import sys try: import multiprocessing except ImportError: # Python 2.5 multiprocessing = None import pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] class BaseQReport(pep8.BaseReport): """Base...
bsd-3-clause
1,437,782,648,958,345,000
29.673684
72
0.586479
false
4.168813
false
false
false
monasysinfo/pyodbcOpenEdge
OpenEdge/pyodbc/introspection.py
1
5916
from django.db.backends import BaseDatabaseIntrospection import pyodbc as Database import decimal,datetime SQL_AUTOFIELD = -777555 class DatabaseIntrospection(BaseDatabaseIntrospection): # Map type codes to Django Field types. data_types_reverse = { int: 'IntegerField', boo...
mit
-4,756,334,909,428,033,000
39.251701
179
0.552569
false
4.280753
false
false
false
robmcmullen/peppy
peppy/major_modes/edje.py
1
1593
# peppy Copyright (c) 2006-2009 Rob McMullen # Licenced under the GPLv2; see http://peppy.flipturn.org for more info """Edje programming language editing support. Major mode for editing Edje files. Supporting actions and minor modes should go here only if they are uniquely applicable to this major mode and can't be u...
gpl-2.0
-8,219,197,253,065,184,000
30.235294
86
0.719397
false
3.571749
false
false
false
matpow2/opensnd
config.py
1
1383
# Copyright (c) Mathias Kaerlev 2012. # This file is part of OpenSND. # OpenSND 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. # Op...
gpl-3.0
3,552,793,645,786,086,400
30.431818
70
0.697758
false
3.528061
false
false
false
eayunstack/neutron
neutron/pecan_wsgi/app.py
1
1841
# Copyright (c) 2015 Mirantis, 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 requir...
apache-2.0
-6,988,175,976,737,177,000
37.354167
78
0.668658
false
4.137079
false
false
false
shajoezhu/server
ga4gh/client.py
1
9317
""" Client classes for the GA4GH reference implementation. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import requests import posixpath import logging import ga4gh.protocol as protocol class HttpClient(object): """ GA4GH Http ...
apache-2.0
6,715,685,451,603,209,000
35.681102
79
0.636149
false
4.736655
false
false
false
metalfiiish/ts-gw2-verifyBot
bot_messages.py
1
3824
####################################### ## BOT Messages ####################################### # Message in response to someone asking us to verify them bot_msg_verify=''' Hello there! I believe you requested verification? If so please reply back to THIS PRIVATE MESSAGE with your Account Name (name with numbers) ...
mit
9,154,739,133,053,215,000
37.626263
168
0.719142
false
3.369163
false
false
false
dvarrazzo/Pyrseas
pyrseas/dbobject/column.py
1
10014
# -*- coding: utf-8 -*- """ pyrseas.dbobject.column ~~~~~~~~~~~~~~~~~~~~~~~ This module defines two classes: Column derived from DbSchemaObject and ColumnDict derived from DbObjectDict. """ from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id from pyrseas.dbobject.privileges import privi...
bsd-3-clause
-5,037,978,780,609,626,000
39.54251
79
0.55682
false
4.080685
false
false
false
njuaplusplus/duoshuo-python-sdk
duoshuo/utils.py
1
3032
# -*- coding:utf-8 -*- #!/usr/bin/env python # # Copyright 2012 Duoshuo import binascii import base64 import hashlib import hmac import time import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.error, urllib.parse import urllib.parse import json import jwt try: from django.conf import s...
apache-2.0
-2,847,915,296,639,470,600
29.295918
106
0.646226
false
3.134108
false
false
false
sysbio-vo/bnfinder
BNfinder/pyroc.py
1
12119
""" Eithon Cadag, University of Washington, 2009 pyroc.py is released under GPL Python module for calculating the area under the receiver operating characteristic curve, given a dataset. matplotlib package is needed to generate plots from the ROC. Example usage: >> from pyroc import * >> rmm = random_mixture_model()...
gpl-2.0
7,823,718,999,624,957,000
33.925072
184
0.666144
false
2.804026
false
false
false
att-comdev/deckhand
deckhand/types.py
1
1930
# Copyright 2017 AT&T Intellectual Property. All other 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...
apache-2.0
3,614,308,308,546,424,000
25.081081
74
0.711917
false
3.594041
false
false
false
a1406/setting
gdbpy/mv.py
1
2125
# move.py # 1. 导入gdb模块来访问gdb提供的python接口 import gdb import re map_re = re.compile('\[([0-9]*)\] = (0x[0-9a-f]*)') # 2. 用户自定义命令需要继承自gdb.Command类 class Move(gdb.Command): # 3. docstring里面的文本是不是很眼熟?gdb会提取该类的__doc__属性作为对应命令的文档 """Move breakpoint Usage: jack old_breakpoint_num new_breakpoint Example: ...
gpl-3.0
1,640,588,221,974,351,600
31.839286
94
0.537249
false
2.375969
false
false
false
parttimenerd/temci
tests/test_run.py
1
5208
""" Tests for runners and related code """ from temci.run.run_driver import is_perf_available from temci.scripts.cli import ErrorCode from tests.utils import run_temci, run_temci_proc def test_parse_output_option(): out = run_temci("short exec 'echo foo: 3' --runner time --parse_output").out assert "time " ...
gpl-3.0
1,756,628,973,180,848,400
28.76
145
0.494048
false
3.621697
true
false
false
saicoco/leetcode
array/380_Inser_Del_GetRandom.py
1
1585
from collections import defaultdict import random class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ self.l = [] self.d = defaultdict(set) def insert(self, val): """ Inserts a value to the set. Returns ...
gpl-3.0
5,959,945,923,313,906,000
26.807018
106
0.506625
false
3.764846
false
false
false
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/MediaPortal/additions/fun/hoerspielchannels.py
1
3321
# -*- coding: utf-8 -*- from Plugins.Extensions.MediaPortal.plugin import _ from Plugins.Extensions.MediaPortal.resources.imports import * from Plugins.Extensions.MediaPortal.additions.fun.youtube import YT_ListScreen HSC_Version = "HÖRSPIEL-Channels v0.94" HSC_siteEncoding = 'utf-8' class show_HSC_Genre(MPScreen):...
gpl-2.0
-2,682,299,925,310,696,000
42.394737
152
0.713679
false
2.676136
false
false
false
widowild/messcripts
exercice/python2/solutions/exercice_9_09.py
1
1936
#! /usr/bin/env python # -*- coding: Latin-1 -*- # Ajouter des informations dans le fichier du club def traduire(ch): "convertir une ligne du fichier source en liste de données" dn = "" # chaîne temporaire pour extraire les données tt = [] # la liste à produire i = 0 ...
gpl-3.0
8,477,858,830,579,212,000
30.737705
75
0.552169
false
2.863905
false
false
false
robotbill/VIctor
victor/app.py
1
5807
import collections import pyglet import pyglet.gl as gl import pyglet.window.key as pkey import re, sys, time from itertools import chain import victor.mode as vmode from victor.command_area import CommandArea from victor.cursor import Cursor from victor.keystroke import Keystrokes from victor.movement_grid import Mo...
mit
1,947,161,533,925,817,300
30.053476
96
0.602893
false
3.538696
false
false
false
globocom/database-as-a-service
dbaas/physical/migrations/0022_auto__add_replicationtopology__add_field_plan_replication_topology.py
1
12372
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ReplicationTopology' db.create_table(u'physical_replicati...
bsd-3-clause
3,635,365,300,632,118,000
78.825806
227
0.576705
false
3.61543
false
false
false
defunSM/code
pyth/ex22.py
1
1154
#!/usr/bin/env python import gtk, sys, os mynumber="5555555555" calnum=0 fakenum=0 def press(widget): num = entry.get_text() pnum = widget.get_label() entry.set_text(num + pnum) def send_press(widget): print("Dialing: " + entry.get_text()) def add_call(widget): callnum = entry.get_text() entry.set_text("") d...
mit
6,309,402,609,893,891,000
16.238806
49
0.664645
false
2.364754
false
false
false
QuantiModo/QuantiModo-SDK-Python
swagger_client/models/inline_response_200_22.py
1
3296
# coding: utf-8 """ Copyright 2015 SmartBear Software 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...
gpl-2.0
8,484,859,120,894,173,000
25.15873
77
0.564927
false
4.616246
false
false
false
swift-lang/swift-e-lab
parsl/tests/low_latency/executor.py
1
6945
import argparse import time import logging from statistics import mean, stdev import zmq from multiprocessing import Process, Manager from ipyparallel.serialize import pack_apply_message, unpack_apply_message from ipyparallel.serialize import deserialize_object from constants import CLIENT_IP_FILE from parsl.addresse...
apache-2.0
2,281,906,431,622,446,300
36.139037
78
0.572642
false
3.897306
false
false
false
rasky/nfstest
packet/application/rpc_creds.py
1
4175
#=============================================================================== # Copyright 2014 NetApp, Inc. All Rights Reserved, # contribution by Jorge Mora <mora@netapp.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 ...
gpl-2.0
4,068,768,895,913,507,000
33.221311
80
0.599042
false
3.643106
false
false
false
mlassnig/Databases-Introductory-Course
hands-on/student-solutions/mikhail/print_statistics.py
1
1120
#!/usr/bin/env python from __future__ import print_function import psycopg2 as pg from multiprocessing import Process from random import randint from time import sleep import loremipsum # How often statistics is printed (in seconds) UPDATE_PERIOD = 0.1 def get_row_count(cur): cur.execute('select count(*) from...
gpl-3.0
-917,551,639,531,874,400
20.960784
96
0.634821
false
3.510972
false
false
false
flysmoke/ijizhang
ijizhang_prj/jizhang/data_format_func.py
1
1914
#coding=utf-8 import re #[id, name, pid] def sort_category(category_list,pid,row_start,level): row_num = len(category_list) tmp=[] for row_i in range(row_start,row_num): category = category_list[row_i] #print(row_i,row_start, level, pid,category, category[1]==pid, row_start<=row_num) if category[...
mit
-4,612,083,799,859,273,000
23.971429
212
0.550055
false
2.417553
false
false
false
whitews/dpconverge
test_hdp_init_bem_real_data.py
1
2393
from dpconverge.data_set import DataSet from dpconverge.data_collection import DataCollection import sys import numpy as np import flowio import flowutils fcs_files = [ sys.argv[1], sys.argv[2] ] spill_text = """4, Blue B-A, Blue A-A, Red C-A, Green E-A, 1, 6.751e-3, 0, 2.807e-3, 0, 1, 0.03, 0, 0, 5.559e-3, 1...
bsd-3-clause
-2,502,161,471,414,536,700
23.171717
75
0.666945
false
2.972671
false
false
false
dexter2206/asc
source/asc-0.1/src/asc/core.py
1
10656
import numpy import asc class TimeSeries(numpy.ndarray): r""" Class for representing time series. It has fields for representing both time series data and time axis, as well as methods for basic manipulation on time series. Inherits from numpy.ndarray and can be created from virtually anything th...
mit
1,174,247,976,707,970,300
27.190476
79
0.572354
false
4.187033
false
false
false
mistio/mist.io-api-examples
list_machines.py
1
4265
#!/usr/bin/env python2 """List available machines on all clouds, using mist.io API This will show all machines on all clouds, no matter if they are enabled or disabled from the mist.io dashboard """ import json import sys import time import json import multiprocessing.pool try: import requests except ImportError...
agpl-3.0
-3,981,352,881,985,922,600
34.840336
124
0.615475
false
3.923643
false
false
false
rvasilev/django-markitup-widget
tests/tests.py
1
14946
import re from django.template import Template, Context, get_library from django.test import TestCase, Client from django.conf import settings as django_settings from markitup.templatetags.markitup_tags import _get_markitup_context from django.core import serializers from django.forms.models import modelform_factory f...
bsd-3-clause
-1,964,863,229,466,627,800
37.921875
123
0.598956
false
3.8186
true
false
false
flyballlabs/threatdetectionservice
api/notification/endpoint.py
1
13917
''' @Summary: Handles all notifications for api, including alerts from metron. @Author: devopsec ''' #TODO: Ensure username and password needs hidden / parsed from encrypted file. import base64 import os import requests import subprocess import sys import traceback from flask import jsonify, request from flask_mail ...
apache-2.0
-7,328,426,426,799,572,000
43.463259
150
0.522455
false
4.48646
true
false
false
niclabs/ratadns-filters
tests/test_qps.py
1
4004
import unittest import StringIO from time import time from packetsexample import PacketsExample from prers import QueriesPerSecond class TestQueriesPerSecond(unittest.TestCase): def reinit(self): self.__stringbuffer1 = StringIO.StringIO() self.__stringbuffer2 = StringIO.StringIO() self._...
mit
-7,316,538,645,899,271,000
24.503185
75
0.551199
false
3.724651
true
false
false
bdrumheller/drf-image-upload
quickstart/serializers.py
1
2688
import tempfile from os import walk import os from django.contrib.auth.models import User, Group from quickstart.models import Image, ImageContainer from rest_framework import serializers from django.core.files import File import urllib.request from versatileimagefield.serializers import VersatileImageFieldSe...
gpl-3.0
-2,621,304,513,604,267,500
33.84
93
0.626488
false
4.193448
false
false
false
marscher/PyEMMA
pyemma/msm/tests/birth_death_chain.py
1
7627
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA 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 vers...
lgpl-3.0
-1,567,282,906,663,474,000
26.941392
97
0.519208
false
3.742395
false
false
false
raphaelvalentin/Utils
spectre/simulator/simulator.py
1
5087
__version__ = '0.0.2' import os, time, tempfile from spectre.psfascii import psfascii from subprocess import Popen, PIPE, STDOUT from functions.system import rm, source from config import * __all__ = ['spectre'] class spectre(object): __parameters__ = { 'log':'spectre.log', 'path':'', 'filename':'spectre.c...
gpl-2.0
-570,303,410,191,883,300
42.853448
205
0.588166
false
4.040508
false
false
false
rdussurget/py-altimetry
altimetry/tools/others.py
1
9972
# -*- coding: utf-8 -*- import numpy as np import datetime from dateutil import tz from Tkinter import Tk import inspect import getpass, socket, platform #User and Host names from warnings import warn import collections import __main__, os, sys def get_zero_element(array): try : array = array.flat.next...
lgpl-3.0
291,485,377,005,453,800
28.968944
145
0.548636
false
2.961687
false
false
false
raphaelm/python-fints
tests/test_message_serializer.py
1
7353
import pytest from conftest import TEST_MESSAGES from fints.formals import NumericField from fints.parser import FinTS3Parser, FinTS3Serializer from fints.segments.base import FinTS3Segment def test_serialize_1(): class ITST1(FinTS3Segment): a = NumericField(count=3) i1 = ITST1(a=[1, 3]) i1.heade...
lgpl-3.0
-1,358,420,438,717,284,900
51.521429
174
0.499932
false
4.173099
true
false
false
pajowu/computer-sience
as/vigenre.py
1
1599
def encrypt(text, key, alphabet): al_len = len(alphabet) key_len = len(key) table = [] result = "" for i in range(al_len): table.append(alphabet[i:] + alphabet[:i]) for i,char in enumerate(text): if char.lower() in alphabet: lower = False if char.lower() == char: lower = True char = char.lower(...
gpl-2.0
5,095,588,740,651,021,000
26.118644
125
0.649156
false
2.977654
false
false
false
jmiserez/sts
plot.py
1
14429
#!/usr/bin/env python import argparse import csv import glob import os import itertools from pylab import * import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from asyncore import loop # Values we care about keys = [] keys.append('num_read') keys.append('num_writes') keys.append('n...
apache-2.0
8,186,728,188,688,870,000
36.971053
168
0.624783
false
3.245389
false
false
false
espenak/enkel
enkel/wansgli/apprunner.py
1
6555
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # 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...
gpl-2.0
-8,606,776,446,999,709,000
29.068807
81
0.697788
false
3.550921
false
false
false
Keisuke69/libcloud
libcloud/common/types.py
1
3462
# 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
-3,424,953,485,347,264,500
29.368421
74
0.599076
false
4.101896
false
false
false
vlegoff/tsunami
src/primaires/joueur/commandes/retnom/__init__.py
1
3198
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 ...
bsd-3-clause
-1,093,648,136,304,676,000
45.882353
79
0.696989
false
3.677047
false
false
false
henriquegemignani/randovania
randovania/generator/item_pool/pickup_creator.py
1
7093
from typing import Optional, List from randovania.game_description.item.ammo import Ammo from randovania.game_description.item.item_category import ItemCategory from randovania.game_description.item.major_item import MajorItem from randovania.game_description.resources.pickup_entry import ResourceConversion, PickupEnt...
gpl-3.0
201,737,035,116,768,450
34.288557
118
0.636543
false
3.75291
false
false
false
M-griffin/Enthral
src/scripts/onelinerz.py
1
4153
#!/usr/bin/env python2.7 # uses python2-requests-2.2.1-1 import requests import xml.etree.ElementTree import bbs_io import string import re #garbage Collection (Needed to Clear Memory!) import gc bbs = 'hTc' usrname = u'mrmisticismo@hotmail.com' pssword = u'******' # Minus the header/Footer real_limit = bbs_io.pyGe...
gpl-2.0
-6,746,693,501,038,287,000
29.762963
130
0.634963
false
2.908263
false
false
false
Idematica/django-oscar
oscar/profiling/middleware.py
1
3451
import sys import tempfile import hotshot import hotshot.stats from cStringIO import StringIO import cProfile import pstats def profile_this(fn): def profiled_fn(*args, **kwargs): filepath = "/tmp/%s.profile" % fn.__name__ prof = cProfile.Profile() ret = prof.runcall(fn, *args, **kwargs) ...
bsd-3-clause
-9,035,269,999,554,834,000
29.008696
95
0.584468
false
4.198297
false
false
false
ximion/Clementine-LibDanceTag
doc/python/generate_python_docs.py
1
6239
import epydoc import epydoc.apidoc import epydoc.cli import epydoc.docbuilder import epydoc.docintrospecter import epydoc.docwriter.html import epydoc.markup.epytext import inspect import PyQt4.QtCore import sys import types DOC_PAGES = [ ("Hello world!", "doc-hello-world"), ] OUTPUT_DIR = "output" # SIP does som...
gpl-3.0
6,963,849,785,759,271,000
31.836842
105
0.699311
false
3.276786
false
false
false