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
jeeftor/alfredToday
src/lib/pyexchange/exchange2010/soap_request.py
1
19212
""" (c) 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
mit
973,815,431,249,674,600
30.087379
212
0.656725
false
if not send_only_to_changed_attendees: We want to resend invites, which you do by setting an attribute to the same value it has. Right now, events are always scheduled as Busy time, so we just set that again. update_node.append( update_property_node(field_uri="calendar:LegacyFreeBusyStatus", node_to_insert=...
355
en
0.643794
remap/fountainhead
src/fountain_script.py
1
1679
# -*- Mode:python c-file-style:"gnu" indent-tabs-mode:nil -*- */ # # Copyright (C) 2014-2015 Regents of the University of California. # Author: Zhehao Wang <wangzhehao410305gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
-16,898,439,618,260,620
41
82
0.723049
false
-*- Mode:python c-file-style:"gnu" indent-tabs-mode:nil -*- */ Copyright (C) 2014-2015 Regents of the University of California. Author: Zhehao Wang <wangzhehao410305gmail.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 Fr...
1,158
en
0.872434
flipdazed/SoftwareDevelopment
config.py
1
2168
# This class contains and builds the decks used in the game from logs import * import itertools, random import collections logger = logging.getLogger(__name__) defaults = { "central":{ "name":'Central', #"Central", "hand_size":5, "deck_settings":[ # Central deck paramss {"count"...
gpl-3.0
7,043,151,529,765,820,000
45.148936
90
0.473708
false
This class contains and builds the decks used in the game"Central", Central deck paramss"Player One", User's deck"Computer Player", computer deck
145
en
0.841809
tumi8/sKnock
common/modules/Utils.py
1
1624
import errno import stat import pwd import os from OpenSSL import crypto def convertDERtoPEM(key): return crypto.dump_publickey(crypto.FILETYPE_PEM, crypto.load_publickey(crypto.FILETYPE_ASN1, key)) def convertPEMtoDER(key): return crypto.dump_publickey(crypto.FILETYPE_ASN1, crypto.load_publickey(crypto.FILE...
gpl-3.0
235,730,516,789,654,750
30.230769
103
0.644089
false
Creates a file at the given path. If the directories in the given path are not existing, they are created recursively with the permissions on each of them deriving from the umask, but with an execute permission for others. The created file will be owned by `nobody` If the path already exists then the ownership is ch...
555
en
0.939217
hasadna/open-shot
polyorg/migrations/0001_initial.py
1
9185
# -*- coding: utf-8 -*- import 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 'CandidateList' db.create_table(u'polyorg_candidatelist', ( (u'id', self.gf('djan...
bsd-3-clause
8,433,865,259,077,570,000
69.122137
208
0.573435
false
-*- coding: utf-8 -*- Adding model 'CandidateList' Adding model 'Party' Adding model 'Candidate' Deleting model 'CandidateList' Deleting model 'Party' Deleting model 'Candidate'
177
en
0.649355
christabor/MoAL
MOAL/data_structures/graphs/hypergraph.py
1
1461
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import print_h3 from MOAL.helpers import datamaker as dmkr from MOA...
apache-2.0
-2,256,337,737,574,232,800
31.466667
75
0.609856
false
From mathworld.wolfram.com/Hypergraph.html: "A hypergraph is a graph in which generalized edges (called hyperedges) may connect more than two nodes." Also interesting, from en.wikipedia.org/wiki/Hypergraph "The collection of hypergraphs is a category with hypergraph homomorphisms as morphisms." -*- coding: utf-8 -*-...
358
en
0.915773
harlowja/zk_shell
zk_shell/tests/test_basic_cmds.py
1
17707
# -*- coding: utf-8 -*- """test basic cmds""" import socket from .shell_test_case import PYTHON3, ShellTestCase from kazoo.testing.harness import get_global_cluster from nose import SkipTest # pylint: disable=R0904 class BasicCmdsTestCase(ShellTestCase): """ basic test cases """ def test_create_ls(self):...
apache-2.0
5,503,494,347,214,765,000
44.025445
99
0.602487
false
basic test cases test authentication handle unknown scheme test child count for a given path create & delete a znode create & delete a znode recursively create a znode and fetch its value test listing znodes recursively create a path test tree's output test listing a path's size test find command test getti...
1,078
en
0.757639
DOAJ/doaj
portality/scripts/sage_update.py
1
4491
import csv from openpyxl import load_workbook from portality.models import Journal if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument("-i", "--infile", help="path to SAGE spreadsheet", required=True) parser.add_argument("-o", "--out", help="output file p...
apache-2.0
8,343,009,261,149,139,000
47.290323
119
0.498775
false
Loop through all rows of the spreadsheet and update the journals (skipping row 1, the heading row) if title of the journal in the sheet and in the system do not match - ignore if journal's id is not found in the system finished
227
en
0.831392
googleinterns/out-of-distribution
src/refinenet/adaptive_conv.py
1
1676
from typing import List import torch from torch import nn from src.refinenet.residual_conv_unit import ResidualConvUnit class AdaptiveConv(nn.Module): conv_list: nn.ModuleList rcus_list: nn.ModuleList out_channels: List[int] def __init__(self, in_channels_list: List[int], out_channels: int): ...
apache-2.0
9,180,643,431,226,882,000
37.976744
120
0.653341
false
Constructs the layers of this Adaptive Conv. A dimension-adapting conv layer (self.conv_list) is placed between each input and its respective RCUs. This conv layer is not explicitly mentioned in the papers, but is in the architecture diagram (https://github.com/guosheng/refinenet/blob/master/net_graphs/part2_cascaed_re...
493
en
0.830504
salimfadhley/jenkinsapi
jenkinsapi_tests/unittests/test_job_folders.py
3
7425
import pytest import mock from jenkinsapi.jenkins import JenkinsBase @pytest.fixture(scope='function') def jenkinsbase(): return JenkinsBase('http://localhost:8080/', poll=False) def test_called_in__poll(jenkinsbase, monkeypatch, mocker): def fake_poll(cls, tree=None): # pylint: disable=unused-argument ...
mit
736,008,613,852,080,000
26.197802
78
0.443232
false
pylint: disable=unused-argument pylint: disable=unused-argument pylint: disable=unused-argument pylint: disable=unused-argument first call second call pylint: disable=unused-argument first call second call
205
en
0.373567
Outernet-Project/librarian
librarian/routes/firmware.py
1
1624
import logging from bottle_utils.i18n import lazy_gettext as _ from streamline import XHRPartialFormRoute, RouteBase from ..core.contrib.templates.renderer import template from ..core.exts import ext_container as exts from ..forms.firmware import FirmwareUpdateForm from ..helpers.firmware import update_firmware, FIRM...
gpl-3.0
2,844,891,010,243,496,000
32.142857
71
0.678571
false
Translators, shown when firmware upload failed
46
en
0.753215
mhvlug/ical2mailman
ical2mailman.py
1
3412
#!/usr/bin/env python # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
-8,760,569,111,229,455,000
31.807692
79
0.646249
false
Find the next N meetings from our ical. After getting the ical, run through it looking for Events, which are in the future, and include 'meetings' in the url, which means they are Drupal meeting types, and not other kinds of events like Lunch or Conferences. Because we know that July (7) and August (8) we'll be at Lo...
1,395
en
0.937603
Huyuwei/tvm
rust/runtime/tests/build_model.py
2
2571
#!/usr/bin/env python3 # 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 # "L...
apache-2.0
7,480,344,979,134,752,000
35.211268
74
0.651886
false
Builds a simple NNVM graph for testing. !/usr/bin/env python3 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 ...
815
en
0.872963
informeren/qgis-cartogram
resources_rc.py
1
16075
# -*- coding: utf-8 -*- # Resource object code # # Created: Thu Jul 23 16:26:35 2015 # by: The Resource Compiler for PyQt (Qt v4.8.6) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x0e\x0d\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
gpl-2.0
2,922,580,266,374,114,300
57.454545
96
0.725412
false
-*- coding: utf-8 -*- Resource object code Created: Thu Jul 23 16:26:35 2015 by: The Resource Compiler for PyQt (Qt v4.8.6) WARNING! All changes made in this file will be lost!
181
en
0.773231
tonyin/optionstg
run.py
1
9422
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import argparse import json import os import shutil import sys import time from main import config ############################################################################### # Options ###################################################...
mit
3,240,041,015,489,999,400
26.469388
87
0.609425
false
!/usr/bin/env python -*- coding: utf-8 -*- Options Directories Helpers Main
75
en
0.390282
CroissanceCommune/autonomie
autonomie/tests/views/admin/main/test_site.py
1
1481
# -*- coding: utf-8 -*- # * Copyright (C) 2012-2013 Croissance Commune # * Authors: # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; # * Pettier Gabriel; # * TJEBBES Gaston <g.t@majerti.fr> # # This file is part of Autonomie : Progiciel de gestion de CAE. # # Autonomie is...
gpl-3.0
6,709,779,369,749,557,000
35.121951
74
0.690749
false
-*- coding: utf-8 -*- * Copyright (C) 2012-2013 Croissance Commune * Authors: * Arezki Feth <f.a@majerti.fr>; * Miotte Julien <j.m@majerti.fr>; * Pettier Gabriel; * TJEBBES Gaston <g.t@majerti.fr> This file is part of Autonomie : Progiciel de gestion de CAE. Autonomie is free software: you ca...
913
en
0.785506
igel-kun/pyload
module/plugins/internal/UnTar.py
1
1811
# -*- coding: utf-8 -*- from __future__ import with_statement import sys import tarfile from .Extractor import ArchiveError, CRCError, Extractor from .misc import encode, fsjoin class UnTar(Extractor): __name__ = "UnTar" __type__ = "extractor" __version__ = "0.05" __status__ = "stable" __descr...
gpl-3.0
7,260,781,826,180,916,000
24.507042
71
0.555494
false
-*- coding: utf-8 -*-
21
en
0.767281
kubeflow/testing
py/kubeflow/testing/delete_kf_instance.py
1
2404
"""Delete a kubeflow instance.""" import fire import json import logging import retrying from googleapiclient import discovery from googleapiclient import errors from oauth2client.client import GoogleCredentials from kubeflow.testing import util @retrying.retry(stop_max_delay=10*60*1000, wait_exponential_max=60*100...
apache-2.0
50,440,597,814,513,940
37.774194
80
0.665141
false
Delete a KF instance with the specified name in the specified project. Delete a kubeflow instance. pylint: disable=no-else-return TODO(jlewi): This is a bit of a hack due to the fact that kfctl doesn't properly handle deletion just given the name of a kubeflow deployment. Once that's fixed we should just use that. TO...
385
en
0.881524
morepath/more.jwtauth
more/jwtauth/main.py
1
15396
"""Provides the JWTIdentityPolicy. The following settings are available: * master_secret: A secret known only by the server, used for the default HMAC (HS*) algorithm. * private_key: An Elliptic Curve or an RSA private_key used for the EC (EC*) or RSA (PS*/RS*) algorithms. * private_key...
bsd-3-clause
8,533,879,541,043,725,000
36.009615
79
0.626137
false
Morepath Identity Policy implementing JWT Access Auth. This class provides an IdentityPolicy implementation based on signed requests, using the JSON Web Token Authentication standard. Reference: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html Initiate the JWTIdentityPolicy with the given settings. C...
7,240
en
0.791292
ned2/typediff
typediff/typediff.py
1
8044
import sys import os import argparse import json import pickle import functools from itertools import chain from . import delphin from . import config from . import gram """typediff.py Author: Ned Letcher https://github.com/ned2/typediff Typediff is a tool to allow you to quickly explore the types used in the proce...
mit
-3,276,857,596,572,645,000
26.175676
83
0.617976
false
Print the type list to the terminal, sorting and colorizing as specified by the TYPES variable. pos_items and neg_items are lists of either Fragment or Reading objects TODO move help text into argparse update various config files to reflect LOGONROOT variable currently only works when there are pos and neg items cur...
750
en
0.861277
stormi/tsunami
src/primaires/salle/cherchables/__init__.py
1
1798
# -*-coding:Utf-8 -* # Copyright (c) 2012 NOEL-BARON Léo # 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 # li...
bsd-3-clause
8,668,133,806,592,736,000
46.289474
79
0.786311
false
Ce package contient les objets cherchables du module. -*-coding:Utf-8 -* Copyright (c) 2012 NOEL-BARON Léo 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 ...
1,562
en
0.871202
pyta-uoft/pyta
nodes/if.py
1
2300
""" If astroid node An if statement. Attributes: - test (NodeNG) - Holds the node to evaluate such as Compare. - body (list[NodeNG]) - A list of nodes that will execute if the test condition passes. - orelse (list[NodeNG]) - A list of nodes executed when the test condi...
gpl-3.0
-7,077,060,367,189,977,000
22.469388
73
0.423478
false
If astroid node An if statement. Attributes: - test (NodeNG) - Holds the node to evaluate such as Compare. - body (list[NodeNG]) - A list of nodes that will execute if the test condition passes. - orelse (list[NodeNG]) - A list of nodes executed when the test condition...
2,079
en
0.172414
open-rnd/ros3d-dev-controller
ros3ddevcontroller/mqtt/mqttornado.py
1
4038
# # Copyright (c) 2015 Open-RnD Sp. z o.o. # # 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, publ...
mit
-2,852,210,188,878,344,700
32.932773
69
0.604755
false
Adapter for interfacing MQTT Client with Tornado framework Create new adapter for given client instance :param mqtt.Client client: MQTT client instance :param tornado.ioloop.IOLoop loop: Tonardo IOLoop instance, None to use default loop Return MQTT client FD if already set otherwise ...
1,777
en
0.80622
iwm911/plaso
plaso/parsers/firefox_cache.py
1
7488
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the L...
apache-2.0
-1,733,855,490,218,381,600
33.666667
79
0.670005
false
Convenience class for an firefox cache record event. Extract cached records from Firefox. Extract records from a Firefox cache file. Determine whether the candidate is a valid cache record. Determine cache file block size. Raises exception if not found. Provide the next cache record. Implements a parser for Firefox cac...
1,802
en
0.763605
opencorato/mapit
mapit_gb/controls/2015-05.py
1
1662
# A control file for importing May 2015 Boundary-Line. # This control file assumes previous Boundary-Lines have been imported, # because it uses that information. If this is a first import, use the # first-gss control file. def code_version(): return 'gss' def check(name, type, country, geometry): """Shoul...
agpl-3.0
-8,454,783,055,558,965,000
30.358491
79
0.696751
false
Should return True if this area is NEW, False if we should match against an ONS code, or an Area to be used as an override instead. A control file for importing May 2015 Boundary-Line. This control file assumes previous Boundary-Lines have been imported, because it uses that information. If this is a first import, us...
1,357
en
0.758119
ThunderGemios10/The-Super-Duper-Script-Editor
wrd/bin.py
1
5171
################################################################################ ### Copyright © 2012-2013 BlackDragonHunt ### ### This file is part of the Super Duper Script Editor. ### ### The Super Duper Script Editor is free software: you can redistribute it ### and/or modify it under the terms of the GNU Genera...
gpl-3.0
-3,351,541,255,566,452,700
31.509434
101
0.555728
false
Copyright © 2012-2013 BlackDragonHunt This file is part of the Super Duper Script Editor. The Super Duper Script Editor 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 you...
1,418
en
0.869794
cedadev/eos-db
eos_db/views.py
1
25449
"""API functions for controlling the Cloudhands DB This module contains all the API functions available on the Cloudhands RESTful API. Modifications requests to the database are mediated through functions in the "server" module. """ import json, uuid import hashlib, base64, random from pyramid.response import Respons...
bsd-3-clause
8,918,893,795,204,798,000
42.060914
127
0.643876
false
This is passed to pyramid.config.Configurator in __init__.py, and defines the permissions attributed to each group. No-operations here. Function given a request works out the VM we are talking about and whether the current user actually has permission to do stuff to it. Also returns the internal ID for the user, as w...
8,332
en
0.87418
icaoberg/cellorganizer-galaxy-tools
datatypes/sequence.py
1
47418
""" Sequence classes """ import gzip import json import logging import os import re import string from cgi import escape from galaxy import util from galaxy.datatypes import metadata from galaxy.util.checkers import is_gzip from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.sniff import get_h...
gpl-3.0
-7,907,747,532,020,869,000
44.16
337
0.574887
false
Class describing an alignment Class describing an axt alignment Class representing a FASTA sequence Class representing a generic FASTQ sequence Class representing a Color Space FASTQ sequence ( e.g a SOLiD variant ) Class representing a FASTQ sequence ( the Illumina 1.3+ variant ) Class representing a FASTQ sequence ( ...
15,050
en
0.797193
sdss/marvin
tasks.py
1
6407
# !usr/bin/env python2 # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2017-06-10 16:46:40 # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2018-11-14 19:37:22 from __future__ import absolute_import, division, print_function i...
bsd-3-clause
-28,274,147,638,332,620
31.18593
140
0.667291
false
Builds the Sphinx docs Cleans up the crap Cleans up the docs Deploy to pypi Setup the package at Utah and update the release Shows the Sphinx docs Switch to the marvin module of the specified version and start it Update the current symlink Updates the default version module file Update the git package at Utah U...
1,191
en
0.358726
Kronos3/HTML_PARSER
src/config.py
1
6102
#!/usr/bin/env python # -*- coding: utf-8 -*- # # config.py # # Copyright 2016 Andrei Tumbar <atuser@Kronos> # # 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 Li...
gpl-3.0
-1,421,159,499,639,127,300
28.196172
104
0.621599
false
!/usr/bin/env python -*- coding: utf-8 -*- config.py Copyright 2016 Andrei Tumbar <atuser@Kronos> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your...
824
en
0.868977
intuition-io/intuition
tests/data/test_universe.py
1
2697
''' Tests for intuition.data.universe ''' import os import unittest from nose.tools import raises, eq_ import dna.test_utils import intuition.data.universe as universe from intuition.errors import LoadMarketSchemeFailed class MarketTestCase(unittest.TestCase): def setUp(self): dna.test_utils.setup_logge...
apache-2.0
-2,435,537,797,693,956,600
34.486842
77
0.652948
false
Tests for intuition.data.universe NOTE It also tests market._load_market_scheme()eq_(market.open, self.default_open)eq_(market.close, self.default_close)
155
en
0.460273
kfoss/neon
neon/datasets/sparsenet.py
1
5254
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. # 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.o...
apache-2.0
-2,070,562,520,108,554,800
41.032
79
0.557099
false
Sets up a Sparsenet dataset. Attributes: raw_base_url (str): where to find the source data raw_train_input_gz (str): URL of the full path to raw train inputs raw_train_target_gz (str): URL of the full path to raw train targets raw_test_input_gz (str): URL of the full path to raw test inputs raw_tes...
1,851
en
0.699542
wuher/devil
devil/util.py
1
3000
# -*- coding: utf-8 -*- # util.py --- # # Created: Fri Dec 30 23:27:52 2011 (+0200) # Author: Janne Kuuskeri # import re charset_pattern = re.compile('.*;\s*charset=(.*)') def camelcase_to_slash(name): """ Converts CamelCase to camel/case code ripped from http://stackoverflow.com/questions/1175208/does-...
mit
3,430,907,829,229,489,700
25.086957
144
0.581667
false
Converts CamelCase to camel/case code ripped from http://stackoverflow.com/questions/1175208/does-the-python-standard-library-have-function-to-convert-camelcase-to-camel-cas Compare accept items a and b Extract charset info from content type. E.g. application/json;charset=utf-8 -> utf-8 :param content_type: The ...
1,050
en
0.624516
ram8647/gcb-mobilecsp
modules/i18n_dashboard/i18n_dashboard_tests.py
1
160861
# coding: utf-8 # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
-880,724,496,572,794,800
40.319877
80
0.548985
false
Fetches a URL while counting a number of RPC calls. Args: url: URL to fetch hint: hint about this operation to put in the report quota: tuple of max counts of (memcache, db) RPC calls allowed during this request Ensure that all items added in setUp are present on dashboard. Do this so that we can trust in o...
5,504
en
0.86989
cclljj/AnySense_7688
pending/pm_hpm.py
1
3267
import mraa import time from multiprocessing import Queue,Process import move_avge NUM_INCOME_BYTE = 8 CHAR_PRELIM = 0x40 NUM_DATA_BYTE = 7 CHECK_BYTE = 7 PM1_BYTE = -1 PM25_BYTE = 3 PM10_BYTE = 5 class sensor(Process): def __init__(self, q): Process.__init__(self) self.q = q s...
gpl-3.0
4,554,266,414,521,395,700
23.380597
119
0.53015
false
cmd = bytearray([0x68,0x01,0x04,0x96])
38
en
0.377285
Larisa123/Kviz
main.py
1
12835
from tkinter import * from tkinter import ttk import random button_width = 17 number_of_characters_per_row = 56 diff_for_answers = 8 color = '#%02x%02x%02x' % (231, 231, 231) import subprocess # poskusile 5 razlicnih modulov: pyglet, mp3play, sound in se dva pa noben ni delal # pygame se nama zdi prevelika knjizni...
apache-2.0
391,766,898,711,221,760
39.05625
144
0.61359
false
Prikaze sporocilo glede na rezultat vrne primerno preurejen text z novimi vrsticami, ce je trenutno predolg prikaze vprasanje na label widgetu poskusile 5 razlicnih modulov: pyglet, mp3play, sound in se dva pa noben ni delal pygame se nama zdi prevelika knjiznica za dodati za samo nekaj zvokov dela samo na OS X! dela...
2,244
sl
0.473468
geometalab/OSMTagFinder
OSMTagFinder/thesaurus/mapsemnet.py
1
1602
# -*- coding: utf-8 -*- ''' Created on 08.11.2014 @author: Simon Gwerder ''' from rdflib.namespace import SKOS from semnet.osmsemanticnet import OSMSemanticNet from thesaurus.rdfgraph import RDFGraph from utilities.configloader import ConfigLoader class MapOSMSemanticNet: def __init__(self, tagFinderRDF, osnSem...
mit
-4,895,832,965,683,772,000
32.375
128
0.611735
false
Created on 08.11.2014 @author: Simon Gwerder -*- coding: utf-8 -*-print('Loading OSN graph') if osnSemNetRDF is None it will check the web graph check if some osn matches have been added alreadyprint(str(count) + ' : Added Matching Concept Mapping from: ' + subject + '\t\t\tto: ' + osnConcept)tagFinderRDF.serialize(...
342
en
0.576996
bellowsj/aiopogo
aiopogo/pogoprotos/settings/master/quest_settings_pb2.py
1
3401
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/settings/master/quest_settings.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.pr...
mit
2,925,874,700,893,986,300
40.987654
424
0.757424
false
Generated by the protocol buffer compiler. DO NOT EDIT! source: pogoprotos/settings/master/quest_settings.proto @@protoc_insertion_point(imports) @@protoc_insertion_point(class_scope:pogoprotos.settings.master.QuestSettings) @@protoc_insertion_point(module_scope)
264
en
0.499016
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.2/Lib/idlelib/macosxSupport.py
1
6327
""" A number of function that enhance IDLE on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys import tkinter from os import path _appbundle = None def runningAsOSXApp(): """ Returns True if Python is running from within an app on OSX. If so, assume that ...
mit
-5,375,528,088,494,449,000
34.745763
79
0.636637
false
This ensures that the application will respont to open AppleEvents, which makes is feaseable to use IDLE as the default application for python files. Returns True if IDLE is using a Carbon Aqua Tk (instead of the newer Cocoa Aqua Tk). Replace the Tk root menu by something that's more appropriate for IDLE. Returns True ...
2,168
en
0.899413
jspiros/python-ebml
ebml/tests/test_core.py
1
4698
import unittest try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import random import sys from ..core import * class ElementSizeTests(unittest.TestCase): def assert_roundtrip(self, value, length=None): encoded = encode_element_size(value, length=length) if length is not Non...
isc
-7,486,734,860,703,075,000
27.478788
111
0.711367
false
Note: I'm not sure if this is a good idea, due to the potential for loss of precision. It seems that, at least with my installation of Python, floats are 64-bit IEEE, and so, for now, this works.
195
en
0.969859
seung-lab/cloud-volume
cloudvolume/storage/storage_interfaces.py
1
15070
import six from collections import defaultdict import json import os.path import posixpath import re import boto3 import botocore from glob import glob import google.cloud.exceptions from google.cloud.storage import Batch, Client import requests import tenacity from cloudvolume.connectionpools import S3ConnectionPool...
bsd-3-clause
6,737,976,082,698,986,000
27.76145
118
0.633046
false
Most significant char radix sort There are many types of execptions which can get raised from this method. We want to make sure we only return None when the file doesn't exist. List the files in the layer with the given prefix. flat means only generate one level of a directory, while non-flat means generate all file ...
1,563
en
0.85859
jimmyho/thehobot
example/example.py
1
2968
from errbot import BotPlugin, botcmd, arg_botcmd, webhook class Example(BotPlugin): """ Just an example """ def activate(self): """ Triggers on plugin activation You should delete it if you're not using it to override any default behaviour """ super(Example, s...
mit
482,288,891,811,556,030
29.916667
85
0.61624
false
Just an example Triggers on plugin activation You should delete it if you're not using it to override any default behaviour Triggered for every message that comes from the bot itself You should delete it if you're not using it to override any default behaviour Triggers when bot is connected You should delete it if y...
1,306
en
0.88304
SCPR/kpcc_backroom_handshakes
measure_finance/models.py
1
7431
from django.conf import settings from django.db import models from django.utils.encoding import smart_str from django.utils import timezone from django.template.defaultfilters import slugify from django.shortcuts import get_object_or_404 from election_registrar import models as registrar import logging import time impo...
mit
9,157,139,782,778,764,000
59.909836
114
0.704885
false
official_background = models.TextField(" ", null=True, blank=True) official_background_author = models.CharField("", max_length=255, null=True, blank=True) official_arguments_yes = models.TextField(" ", null=True, blank=True) official_arguments_no = models.TextField(" ", null=True, blank=True) official_arguments_source...
1,634
en
0.225516
MiguelSR/djangosaml2
djangosaml2/views.py
1
17432
# Copyright (C) 2010-2013 Yaco Sistemas (http://www.yaco.es) # Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.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 # # ...
apache-2.0
4,200,962,372,265,607,000
40.308057
118
0.672155
false
SAML Authorization Response endpoint The IdP will send its response to this view, which will process it with pysaml2 help and log the user in using the custom Authorization backend djangosaml2.backends.Saml2Backend that should be enabled in the settings.py SAML Logout Response endpoint The IdP will send the logout re...
3,910
en
0.860404
ttroy50/cmake-examples
04-static-analysis/clang-format/cmake/scripts/clang-format-check-changed.py
1
5095
#!/usr/bin/env python import argparse import os import sys import subprocess def check_file(filename, excludes, extensions): """ Check if a file should be included in our check """ name, ext = os.path.splitext(filename) if len(ext) > 0 and ext in extensions: if len(excludes) == 0: ...
mit
-7,903,845,470,487,237,000
30.257669
120
0.575466
false
!/usr/bin/env python Not an exhaustive list of git status output but should be enough for this case check if this is a delete ignored file Covers renamed files arguments coming from cmake will be *.xx. We want to remove the * global params Run gcovr to get the .gcda files form .gcno
283
en
0.804858
datapythonista/pandas
pandas/tests/indexing/test_scalar.py
4
9940
""" test scalar indexing, including at and iat """ from datetime import ( datetime, timedelta, ) import numpy as np import pytest from pandas import ( DataFrame, Series, Timedelta, Timestamp, date_range, ) import pandas._testing as tm from pandas.tests.indexing.common import Base class T...
bsd-3-clause
5,832,607,505,893,796,000
30.356467
88
0.520523
false
test scalar indexing, including at and iat iat at iat at TODO: Better name, just separating things that dont need Base class as timestamp is not a tuple! GH 7729 make sure we are boxing the returns GH6493 iat/iloc with dups GH33041 setter gh-15822 GH 19860 GH 19860 GH 23236 GH24924 dataframe __getitem__ series __get...
872
en
0.734062
SahSih/ARStreaming360Display
RealTimeVideoStitch/motion_detector.py
1
2815
# USAGE # python motion_detector.py # python motion_detector.py --video videos/example_01.mp4 # import the necessary packages import argparse import datetime import imutils import time import cv2 # construct the argument parser and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", he...
mit
7,161,149,992,135,203,000
28.946809
84
0.705151
false
USAGE python motion_detector.py python motion_detector.py --video videos/example_01.mp4 import the necessary packages construct the argument parser and parse the arguments if the video argument is None, then we are reading from webcam otherwise, we are reading from a video file initialize the first frame in the video s...
1,092
en
0.755158
BronyTV/bronytv.net
btv_site/assets.py
1
2355
from flask_assets import Environment, Bundle assets = Environment() global_css = ["css/vendor/bootstrap.css", "css/global.css"] global_js = ["js/vendor/jquery.js", "js/vendor/angular.js", "js/angular/common.js", "js/header.js"] def make_css(name, assets): return Bundle(*assets, filters="cssmin", ou...
gpl-3.0
-5,187,518,734,788,820,000
32.642857
137
0.6
false
0
en
0.110449
device42/nix_bsd_mac_inventory
module_hpux.py
1
10053
import paramiko import math import json class GetHPUXData: def __init__(self, ip, ssh_port, timeout, usr, pwd, use_key_file, key_file, get_serial_info, get_hardware_info, get_os_details, get_cpu_info, get_memory_info, ignore_domain, upload_ipv6, debug): self.mach...
mit
6,703,414,946,404,267,000
39.721992
112
0.468915
false
not working currently, maybe in the future another disk
55
en
0.982421
rmcgibbo/openmoltools
openmoltools/amber.py
1
17246
import mdtraj as md import tempfile import logging import os import shutil from distutils.spawn import find_executable from mdtraj.utils.delay_import import import_ import mdtraj.utils try: from subprocess import getoutput # If python 3 except ImportError: from commands import getoutput # If python 2 logger...
gpl-2.0
6,290,256,106,830,964,000
38.555046
247
0.650586
false
Create a prmtop and inpcrd from a collection of mol2 and frcmod files as well as a single box PDB. We have used this for setting up simulations of neat liquids or binary mixtures. Parameters ---------- mol2_filenames : list(str) Filenames of GAFF flavored mol2 files. Each must contain exactly ONE ligand. ...
6,341
en
0.668916
nimbusproject/dashi
dashi/bootstrap/containers.py
1
5837
#!/usr/bin/env python __author__ = 'Adam R. Smith' __license__ = 'Apache 2.0' import collections class DotNotationGetItem(object): """ Drive the behavior for DotList and DotDict lookups by dot notation, JSON-style. """ def _convert(self, val): """ Convert the type if necessary and return if a conver...
apache-2.0
2,652,685,822,307,659,300
31.433333
108
0.588145
false
!/usr/bin/env pythondef DotListIterator(list.)it = super(DotList, self).__iter__()it_next = getattr(it, 'next')setattr(it, 'next', lambda: it_next(it))return it base should be a DotDict, raise TypeError exception if not Delegate to base Delegate to base dict_merge from: http://appdelegateinc.com/blog/2011/01/12/merge-d...
361
en
0.504528
BoPeng/SOS
src/sos/actions.py
1
58010
#!/usr/bin/env python3 # # Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. import copy import gzip import os import shlex import shutil import subprocess import sys import tarfile import time import tempfile import textwrap import u...
gpl-3.0
1,902,920,400,745,923,300
39.284722
140
0.483434
false
Assuming that output has already been generated and stop executing the rest of the substep Download files from specified URL, which should be space, tab or newline separated URLs. The files will be downloaded to specified destination. Option "dest_dir" specify the destination directory, and "dest_file" specify the outp...
7,720
en
0.708491
karmab/kcli
kvirt/klist.py
1
3492
#!/usr/bin/env python3 # coding=utf-8 from kvirt.config import Kconfig from kvirt.common import get_user import json import os import argparse def empty(): """ :return: """ return {'_meta': {'hostvars': {}}} class KcliInventory(object): """ """ def __init__(self): self.invento...
apache-2.0
5,411,395,601,268,033,000
27.859504
102
0.489977
false
:return: :return: :return: !/usr/bin/env python3 coding=utf-8 Called with `--list`. Called with `--host [hostname]`. If no groups or vars are present, return an empty inventory. Read the command line args passed to the script.
236
en
0.766331
nuagenetworks/vspk-python
vspk/v6/nusubnet.py
1
58844
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
-5,173,366,400,604,724,000
30.167903
358
0.585667
false
Represents a Subnet in the VSD Notes: This is the definition of a subnet associated with a Zone. Initializes a Subnet instance Notes: You can specify all parameters while calling this methods. A special argument named `data` will enable you to load the object from a Python dictionary Examples: >>...
21,656
en
0.767792
hemmerling/codingdojo
src/game_of_life/python_coderetreat_berlin_2014-09/python_legacycrberlin03/gol03_test.py
1
1436
#This file was originally generated by PyScripter's unitest wizard import unittest from gol03 import Gol03 def dummy(): """ Dummy function for comparison of the return values """ return class Gol03Test(unittest.TestCase): def setUp(self): pass def tearDown(self): pa...
apache-2.0
-5,112,050,620,155,597,000
19.757576
89
0.561978
false
Dummy function for comparison of the return values This file was originally generated by PyScripter's unitest wizard run all tests raised by sys.exit(True) when tests failed
175
en
0.89528
levelrf/level_basestation
level/examples/test_transmit.py
1
3457
#!/usr/bin/python # python ~/workspace/level_basestation/pre-cog/examples/simple_trx.py --port 12345 --radio-addr 85 --dest-addr 86 --args serial=E8R10Z2B1 # python ~/workspace/level_basestation/pre-cog/examples/simple_trx.py --port 12346 --radio-addr 86 --dest-addr 85 --args serial=E4R11Y0B1 from gnuradio import gr ...
gpl-3.0
-749,694,025,709,994,400
33.227723
137
0.558577
false
!/usr/bin/python python ~/workspace/level_basestation/pre-cog/examples/simple_trx.py --port 12345 --radio-addr 85 --dest-addr 86 --args serial=E8R10Z2B1 python ~/workspace/level_basestation/pre-cog/examples/simple_trx.py --port 12346 --radio-addr 86 --dest-addr 85 --args serial=E4R11Y0B1 5555 5555 2c6e fd00 0071 da0b e...
452
en
0.326936
dagar/Firmware
Tools/HIL/run_tests.py
1
3547
#! /usr/bin/python import serial, time import subprocess from subprocess import call, Popen from argparse import ArgumentParser import re def do_test(port, baudrate, test_name): databits = serial.EIGHTBITS stopbits = serial.STOPBITS_ONE parity = serial.PARITY_NONE ser = serial.Serial(port, baudrate, d...
bsd-3-clause
-5,418,919,410,731,338,000
31.245455
132
0.620242
false
! /usr/bin/python 10 seconds run test 5 minutes newline every 30 seconds if still runningdo_test(args.device, args.baudrate, "dataman")do_test(args.device, args.baudrate, "mixer")
179
en
0.296255
chrischambers/django-calendartools
calendartools/views/agenda.py
1
1141
from datetime import date from calendartools import defaults from calendartools.views.calendars import ( YearView, TriMonthView, MonthView, WeekView, DayView ) class YearAgenda(YearView): template_name = 'calendar/agenda/year.html' paginate_by = defaults.MAX_AGENDA_ITEMS_PER_PAGE class MonthAgenda(Month...
bsd-3-clause
3,052,311,570,141,808,600
30.694444
89
0.72305
false
0
en
0.110449
dzeban/batti-gtk
src/Notificator.py
1
2868
''' This file is part of batti, a battery monitor for the system tray. Copyright (C) 2010 Arthur Spitzer 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 ...
gpl-2.0
959,022,370,888,630,300
30.877778
126
0.589958
false
Set the duration on a notification with milSec milliseconds This file is part of batti, a battery monitor for the system tray. Copyright (C) 2010 Arthur Spitzer 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 ...
758
en
0.91
lfalvarez/votai
popular_proposal/tests/views_tests.py
1
21141
# coding=utf-8 from popular_proposal.tests import ProposingCycleTestCaseBase as TestCase from django.urls import reverse from django.forms import Form from popular_proposal.models import (PopularProposal, Commitment, ProposalTemporaryData) from p...
gpl-3.0
6,578,302,699,767,330,000
55.223404
115
0.563576
false
coding=utf-8 no need to be logged in no need to be logged in no need to be logged in Already commited Fiera has nothing to do with candidate2 Fiera cannot commit to a promise for another area no need to be logged in
215
en
0.94736
DrGFreeman/RasPiBot202
maze.py
1
7175
import networkx as nx import math class Maze: def __init__(self): self.g = nx.MultiGraph() self.newNodeUid = 0 self.startNode = None self.finishNode = None self.distTol = 75 # Distance tolerance to consider two nodes to be the same self.farAway = 10000 # A long dist...
mit
-6,924,944,892,534,273,000
35.794872
122
0.605714
false
Distance tolerance to consider two nodes to be the same A long distance... Create intersection node object If start, define object as maze start Create corresponding graph node Return new node Method to be called when exploring the maze. It will create a new node at position x, y if it does not already exists. It will ...
644
en
0.792426
naototty/vagrant-lxc-ironic
ironic/drivers/modules/ipmitool.py
1
42906
# coding=utf-8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright 2014 International Business Machines Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance ...
apache-2.0
-437,569,069,582,017,540
38.617729
79
0.600289
false
A ConsoleInterface that uses ipmitool and shellinabox. Checks if the specific ipmitool options are supported on host. This method updates the module-level variables indicating whether an option is supported so that it is accessible by any driver interface class in this module. It is intended to be called from the __in...
13,642
en
0.724065
Ictp/indico
indico/MaKaC/user.py
1
59857
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; eith...
gpl-3.0
-3,996,122,456,246,659,600
34.671633
123
0.549794
false
-*- coding: utf-8 -*- This file is part of Indico. Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). Indico 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 Licens...
3,705
en
0.890294
eomahony/Numberjack
examples/Tsccd.py
1
3117
from Numberjack import * def get_model(k, v, n): design = Matrix(v, n) pairs = Matrix(v * (v - 1) // 2, n) index = [[0 for i in range(v)] for j in range(v)] a = 0 for i in range(v - 1): for j in range(i + 1, v): index[i][j] = a index[j][i] = a a += 1 ...
lgpl-2.1
2,552,755,813,298,700,300
32.880435
145
0.494386
false
each block is a k-tuple exactly one change between each block each pair can occur between 1 and v-k times consecutive ones (convex rows) implied constraint (we know the number of pairs in in each column) symmetry breaking
221
en
0.910008
joswr1ght/gogomovietwit
movietwit.py
1
10583
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import time import termios import tty import socket import threading import tweepy import json import string import re import HTMLParser import tempfile from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListen...
mit
-3,674,604,013,726,025,700
30.780781
114
0.5506
false
!/usr/bin/env python -*- coding: utf-8 -*- TODO: This class has external dependenciesprint "\n" + "-"*80print data HTML parse ASCII only Remove hashtag, case insensitive (matching Tweepy stream) Remove URLs Remove newlines Skip RT's if configured to do so Split tweet into words (by anything but alphabetic characters) t...
993
en
0.568623
rsjohnco/rez
src/rez/package_resources_.py
1
12812
from rez.utils.resources import Resource from rez.utils.schema import Required, schema_keys from rez.utils.logging_ import print_warning from rez.utils.data_utils import cached_property, SourceCode, \ AttributeForwardMeta, LazyAttributeMeta from rez.utils.formatting import PackageRequest from rez.exceptions import ...
gpl-3.0
-2,584,266,316,096,890,000
31.600509
87
0.570559
false
A package family. A repository implementation's package family resource(s) must derive from this class. It must satisfy the schema `package_family_schema`. Base class for all package-related resources. Attributes: schema_error (`Exception`): Type of exception to throw on bad data. repository_type (str): Type ...
3,613
en
0.700903
Azure/azure-sdk-for-python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py
1
3182
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-3,418,886,602,235,532,300
46.492537
134
0.678504
false
Configuration for PolicyClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscriptio...
852
en
0.640113
pdear/verilib
pytools/vlparse/types/primary.py
1
5043
# # primary.py - Primary verilog syntax tree types # # Verilib - A Verilog HDL development framework # Copyright (c) 2014, Patrick Dear, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free ...
lgpl-3.0
-3,968,423,585,559,523,000
32.845638
77
0.611541
false
Represents any kind of idendifier Represents any kind of verilog number A generic syntactical node in our parse tree Parse a net type. Parse an immediate number Super easy Parse any sort of unary operator Parse a binary operator Transform back into a verilog string Convert back into verilog literal primary....
1,047
en
0.846699
felipet/fca3103_pytool
fca3103_tool.py
1
5035
#! /usr/bin/env python3 # -*- coding: utf-8 -* ''' Terminal tool to make Time Interval measures using the Tektronix FCA3103 @file @date Created on Sep. 16, 2015 @author Felipe Torres (torresfelipex1<AT>gmail.com) @copyright LGPL v2.1 ''' # --------------------------------------------------------------------------...
gpl-2.0
-1,453,097,992,371,775,000
44.772727
117
0.562066
false
Tool for automatize the control of Tektronix FCA3103 Timer/Counter Terminal tool to make Time Interval measures using the Tektronix FCA3103 @file @date Created on Sep. 16, 2015 @author Felipe Torres (torresfelipex1<AT>gmail.com) @copyright LGPL v2.1 ! /usr/bin/env python3 -*- coding: utf-8 -* --------------------...
1,687
en
0.673015
andyr0id/PyGFNN
pygfnn/structure/connections/gfnn.py
1
6302
__author__ = 'Andrew J. Lambert, andy@andyroid.co.uk' __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from scipy import reshape, dot, outer, eye from pybrain.structure.connections import FullConnection, FullNotSelfConnection from pybrain.structure.connections.connection import Connection from pybrain.structure....
gpl-2.0
4,527,439,174,360,566,300
32.349206
123
0.577594
false
1st inputs are for external connectionCHECKME: not setting derivatives -- this means the multiplicative weight is never updated! 2nd half for int connections Critical learning rule Don't learn self-connections This could be inverted guassian too ParameterContainer.__init__(self, self.indim*self.outdim) Full series of r...
664
en
0.753742
qunying/gps
share/support/core/gcov.py
1
7246
""" Provides the "Tools/Gcov/Compute coverage files" and "Remove coverage files" menus, which executes gcov automatically. This script will also perform checks along the way to guide through the procedure of obtaining gcov info. The output of the gcov process is displayed in a separate console. At the end of the proce...
gpl-3.0
-8,241,168,727,739,678,000
31.78733
86
0.569418
false
Cleanup the gcov coverage files Run gcov to generate the coverage files Provides the "Tools/Gcov/Compute coverage files" and "Remove coverage files" menus, which executes gcov automatically. This script will also perform checks along the way to guide through the procedure of obtaining gcov info. The output of the gcov...
1,523
en
0.891427
danpozmanter/jawaf
conftest.py
1
4037
""" Setup temporary projects for py.test, cleanup after tests are done.""" import pytest import os from pip._internal import main as pip_main import shutil from sqlalchemy import create_engine import sys import testing.postgresql from tests import templates sys.path.insert(0, os.path.abspath('jawaf')) @pytest.fixture...
bsd-3-clause
-4,507,208,642,298,035,700
32.090164
79
0.631905
false
Setup a test project, test app, and test app package. Load settings and create tables. Cleans up when test session ends. Create a Jawaf instance for test session. Setup temporary projects for py.test, cleanup after tests are done. Setup test package: Create a test project Create the code for the test project Setup te...
468
en
0.704206
inkasjasonk/rs
research/base/views.py
1
2923
from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponseRedirect from session_csrf import anonymous_csrf from django.db.models import get_app, get_models, get_model from models import * from ...
bsd-3-clause
6,649,872,892,987,389,000
49.396552
202
0.702703
false
If the form has been submitted... A form bound to the POST data If the form has been submitted... A form bound to the POST data An unbound form An unbound form
159
en
0.927624
cproctor/hex
server/hexserver/hexserver/models/spell.py
1
3379
from db import db_connection from user import _user_name_exists, _authenticate_user import json import time import logging log = logging.getLogger(__name__) def get_spells(request): conn = db_connection(request) cursor = conn.cursor() cursor.execute("SELECT * FROM spells;") result = cursor.fetchall() ...
mit
-1,238,376,574,511,584,300
29.441441
87
0.600474
false
We use spellTime as a primary key. So if we should happen to get two spells at the same second, pretend like the second came a second later.
140
en
0.910427
great-expectations/great_expectations
tests/datasource/test_sqlalchemy_datasource.py
1
10417
import os from unittest import mock import pandas as pd import pytest from ruamel.yaml import YAML import great_expectations.dataset.sqlalchemy_dataset from great_expectations.core.batch import Batch from great_expectations.core.expectation_suite import ExpectationSuite from great_expectations.dataset import SqlAlche...
apache-2.0
-650,419,896,327,268,100
37.724907
90
0.679274
false
We should now see updated configs We should be able to get a dataset of the correct type from the datasource. type_ = "sqlalchemy" Use sqlite so we don't require postgres for this test. It should be possible to create a sqlalchemy source using these params without saving substitution variables We should be able to get ...
762
en
0.863871
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/conf/locale/da/formats.py
1
1035
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:...
mit
4,936,223,680,368,423,000
33.689655
77
0.590338
false
-*- encoding: utf-8 -*- This file is distributed under the same license as the Django package. The *_FORMAT strings use the Django date format syntax, see http://docs.djangoproject.com/en/dev/ref/templates/builtins/date The *_INPUT_FORMATS strings use the Python strftime format syntax, see http://docs.python.org/librar...
444
en
0.498326
F5Networks/f5-common-python
f5/bigip/tm/asm/policies/response_pages.py
1
2162
# coding=utf-8 # # Copyright 2017 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-1,259,872,560,900,174,800
36.894737
109
0.674074
false
BIG-IP® ASM Response Page resource. BIG-IP® ASM Response Pages sub-collection. Create is not supported for Response Page resources :raises: UnsupportedOperation Delete is not supported for Response Page resources :raises: UnsupportedOperation coding=utf-8 Copyright 2017 F5 Networks Inc. Licensed under the Apache Li...
812
en
0.855682
Julian/home-assistant
homeassistant/components/notify/pushetta.py
1
1901
""" Pushetta platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.pushetta/ """ import logging from homeassistant.components.notify import ( ATTR_TITLE, DOMAIN, BaseNotificationService) from homeassistant.const import...
mit
5,321,828,693,776,001,000
33.563636
78
0.651236
false
Implement the notification service for Pushetta. Initialize the service. Get the Pushetta notification service. Send a message to a user. Pushetta platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.pushetta/ pylint: di...
348
en
0.762139
itsvismay/ElasticBodies
Pipeline/Optimizations/cobyla_beam_heightwidthlength_test.py
1
2030
from scipy.optimize import fmin_cobyla import sys, os, subprocess, numpy P, E = 1000.0, 69e9 # N, Pa, m, m fileName = 'optimizeTest.txt' resultName = '../TestsResults/opt.txt' def objective(x): height = x[0] width = x[1] length = x[2] volume = length * width * height return volume def g0(x): ...
mpl-2.0
-2,741,182,944,111,957,500
28.42029
206
0.575369
false
N, Pa, m, m fail-safes read results from file and return those height > 0.01 m (10 mm) height < 0.5 m (500 mm) 20 mm
116
en
0.74042
rr-/docstring_parser
docstring_parser/numpydoc.py
1
10211
"""Numpydoc-style docstring parsing. .. seealso:: https://numpydoc.readthedocs.io/en/latest/format.html """ import inspect import itertools import re import typing as T from .common import ( Docstring, DocstringDeprecated, DocstringMeta, DocstringParam, DocstringRaises, DocstringReturns, ...
mit
-4,061,001,772,794,959,000
29.756024
79
0.590442
false
Parser for numpydoc "deprecation warning" sections. Parser for numpydoc parameter sections. E.g. any section that looks like this: arg_name arg_description arg_2 : type, optional descriptions can also span... ... multiple lines Parser for numpydoc raises sections. E.g. any section that...
2,378
en
0.726012
ubyssey/dispatch
dispatch/theme/validators.py
1
1823
from uuid import UUID from django.core.validators import slug_re from dispatch.theme.exceptions import InvalidZone, InvalidWidget def is_valid_slug(slug): """Uses Django's slug regex to test if id is valid""" return slug_re.match(slug) def has_valid_id(o): return hasattr(o, 'id') and o.id and is_valid_s...
gpl-2.0
-6,203,565,886,182,744,000
29.915254
93
0.667581
false
Return True if id is a valid integer or UUID, False otherwise. Uses Django's slug regex to test if id is valid Return True if id is a valid UUID, False otherwise. Checks that the given widget contains the required fields Checks that the given zone contains the required fields
276
en
0.531221
low-sky/h2codumb
h2co_mm.py
1
6796
""" =========================== Formaldehyde mm-line fitter =========================== This is a formaldehyde 3_03-2_02 / 3_22-221 and 3_03-2_02/3_21-2_20 fitter. It is based entirely on RADEX models. This is the EWR fork of the fitter in pyspeckit. """ import numpy as np import pyspeckit.spectrum.models.hyperfi...
gpl-2.0
-8,952,912,852,867,932,000
31.208531
142
0.617716
false
,modelgrid for model grid reading http://adsabs.harvard.edu/abs/1971ApJ...169..429T has the most accurate freqs http://adsabs.harvard.edu/abs/1972ApJ...174..463T [twotwo] Convert X-units to frequency in GHz if this gets too far different from 1, we are gonna have a Bad Time. here there be physicsbecause it totally is ...
681
en
0.597188
vongola12324/Linking-Loader
main.py
1
3185
import os import sys # Open File filename = "" filename = input("Enter Input Filename: ") if filename == "": filename = "linkin.txt" fin = open(filename, "r") fout = open("out.txt", "w") # Variable Prepare PGBLOCKS = {} MODIFY = [] OBJCODE = [] # Method Prepare def splitline(line): word = line.strip().split...
gpl-3.0
8,571,556,472,533,741,000
28.229358
122
0.513344
false
Open File Variable Prepare Method Prepare Program Start
55
en
0.773741
terryjbates/test-driven-development-with-python
myflaskapp/tests/test_unit.py
1
1031
import unittest import requests class SmokeTest(unittest.TestCase): def test_maths(self): self.assertEquals(6, 2 + 4) def test_home_page_is_about_todo_lists(self): request = requests.get('http://localhost:5000') self.assertTrue( request.content.startswith(b'\n\n<!doctype h...
mit
-7,449,673,310,125,946,000
31.21875
72
0.586809
false
WebTest test for title Login successful. Goes to homepage def test_main_page_returns_expected_content(self, user, testapp): res = testapp.get('/')
152
en
0.452522
LUTAN/tensorflow
tensorflow/tools/docs/generate_lib.py
1
16276
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,404,556,434,261,722,000
32.489712
80
0.631052
false
Main entry point for generating docs. A simple struct for holding a doc's url and title. Turn guide files into an index from symbol name to a list of _GuideRefs. Extract the title from a .md file. Rewrites a Python guide so that each section has an explicit tag. Return dict: symbol name -> _GuideRef from the files in `...
3,274
en
0.792042
miyataken999/weblate
weblate/trans/admin.py
1
8516
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://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, eith...
gpl-3.0
8,613,016,902,550,696,000
32.124514
79
0.633267
false
Mass disabling of translations. Mass enabling of translations. Commits pending changes for selected components. Commits pending changes for selected components. Recalculates checks for selected components. Recalculates checks for selected components. Updates selected components from git. Updates selected components fro...
1,134
en
0.863886
adamcik/mopidy
mopidy/core/actor.py
1
9861
import collections import itertools import logging import pykka import mopidy from mopidy import audio, backend, mixer from mopidy.audio import PlaybackState from mopidy.core.history import HistoryController from mopidy.core.library import LibraryController from mopidy.core.listener import CoreListener from mopidy.co...
apache-2.0
-2,830,826,066,537,320,400
34.728261
82
0.594463
false
Restore state from disk. Load state from disk and restore it. Parameter ``coverage`` limits the amount of data to restore. Possible values for ``coverage`` (list of one or more of): - 'tracklist' fill the tracklist - 'mode' set tracklist properties (consume, random, repeat, single) - 'play-last' restore p...
1,637
en
0.874712
Gaha/intranet
ce/models.py
1
2664
#-*- coding:utf-8 -*- from datetime import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ class Agent(models.Model): LISTE_CONTRAT = ( ('CDI', 'CDI'), ('CDD', 'CDD'), ('PRE', 'Prestataire'), ('INT', 'Intérime'), ) nom = mode...
gpl-2.0
4,657,869,429,667,921,000
27.826087
82
0.597662
false
-*- coding:utf-8 -*- c'est ce qui s'affiche quand on print, notament dans admin
79
fr
0.961032
ccrouch/tuskar
tuskar/api/controllers/v1/types/__init__.py
1
1311
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicabl...
apache-2.0
4,752,457,954,367,442,000
49.423077
78
0.77193
false
vim: tabstop=4 shiftwidth=4 softtabstop=4 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...
591
en
0.83159
effigies/mne-python
examples/realtime/ftclient_rt_average.py
2
2816
""" ======================================================== Compute real-time evoked responses with FieldTrip client ======================================================== This example demonstrates how to connect the MNE real-time system to the Fieldtrip buffer using FieldTripClient class. This example was tested ...
bsd-3-clause
8,140,795,396,231,081,000
30.288889
77
0.638849
false
======================================================== Compute real-time evoked responses with FieldTrip client ======================================================== This example demonstrates how to connect the MNE real-time system to the Fieldtrip buffer using FieldTripClient class. This example was tested in s...
1,396
en
0.714663
shiquanwang/numba
numba/tests/test_struct.py
1
3074
import os from numba import * from numba import error import numpy as np #------------------------------------------------------------------------ # Structs as locals #------------------------------------------------------------------------ struct_type = struct(a=char.pointer(), b=int_) @autojit(backend='ast', loc...
bsd-2-clause
-5,321,238,675,857,827,000
25.5
73
0.503904
false
------------------------------------------------------------------------ Structs as locals------------------------------------------------------------------------ TODO: structs from objects@autojitdef struct_as_arg(arg): arg.a = "foo" return arg.a@autojit(backend='ast', locals=dict(value=struct_type))def call_str...
936
en
0.211932
bigmlcom/bigmler
bigmler/defaults.py
1
19989
# -*- coding: utf-8 -*- # # Copyright 2012-2021 BigML # # 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 ...
apache-2.0
968,097,636,733,711,100
46.032941
75
0.495473
false
Looks for a defaults file and returns its contents Reads default values from file Defaults parser for BigMLer -*- coding: utf-8 -*- Copyright 2012-2021 BigML 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 co...
693
en
0.847696
fastinetserver/portage-idfetch
pym/portage/tests/dep/test_match_from_list.py
1
1287
# test_match_from_list.py -- Portage Unit Testing Functionality # Copyright 2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.dep import match_from_list class AtomCmpEqualGlob(TestCase): """ A simple testcase for =* glob m...
gpl-2.0
-8,384,553,162,572,872,000
41.9
99
0.509713
false
A simple testcase for =* glob matching test_match_from_list.py -- Portage Unit Testing Functionality Copyright 2006 Gentoo Foundation Distributed under the terms of the GNU General Public License v2 I need to look up the cvs syntax ("=sys-fs/udev_cvs*","sys-fs/udev_cvs_pre4" ) ] failu...
333
en
0.630178
justmedude/librenms
services-wrapper.py
1
13762
#! /usr/bin/env python3 """ services-wrapper A small tool which wraps around check-services.php and tries to guide the services process with a more modern approach with a Queue and workers. Based on the original version of poller-wrapper.py by Job Snijders Author: Neil Lathwo...
gpl-3.0
-8,893,147,896,201,469,000
36.807692
229
0.58102
false
services-wrapper A small tool which wraps around check-services.php and tries to guide the services process with a more modern approach with a Queue and workers. Based on the original version of poller-wrapper.py by Job Snijders Author: Neil Lathwood <neil@librenms.org> ...
2,262
en
0.711517
mohou/Mohou_Box-master
boxPrint/print_service/__init__.py
1
10414
# coding=utf-8 #from threading import Thread import Queue import sys import time import logging import re import os import psutil class PrintService(object): def __init__(self, profile, serialInfo): # super(PrintService, self).__init__(name="PrintService") self.profile = profile ...
apache-2.0
6,482,249,820,652,363,000
35.194245
163
0.499516
false
coding=utf-8from threading import Thread super(PrintService, self).__init__(name="PrintService") self.stopFlag = False self.command_queue = Queue.PriorityQueue() def run(self): while True: if self.stopFlag: break (command, payload) = self.comma...
1,709
en
0.457676
IcyMint/Barchine
Barchine_gui.py
1
66916
import PySimpleGUI as sg from Ingredient_Library import restoreIngredientLibrary, storeIngredientLibrary, createIngredient from Ingredient_Library import listIngredients, getFamilyTypes, getBaseTypes, deleteIngredient from Ingredient_Library import restoreBases from Drink_Library import restoreDrinkLibrary, storeDrinkL...
mit
-2,645,147,178,557,540,400
41.298989
167
0.569505
false
Initialize display propertiesFullscreen selectorScreen ResolutionLoad library informationCheck for Home menu selectionwindow.hide()window.close()window.hide()window.close()window.hide()window.close()window.hide()window.close()window.hide()window.close()Check for Library menu selectionwindow.hide()window.close()window.h...
4,889
en
0.531277
jmuhlich/indra
indra/preassembler/hierarchy_manager.py
1
11321
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import os import rdflib import logging try: from functools import lru_cache except ImportError: from functools32 import lru_cache logger = logging.getLogger('hierarchy_manager') class HierarchyManager(objec...
bsd-2-clause
83,850,203,100,852,430
35.756494
78
0.536083
false
Store hierarchical relationships between different types of entities. Used to store, e.g., entity hierarchies (proteins and protein families) and modification hierarchies (serine phosphorylation vs. phosphorylation). Parameters ---------- rdf_file : string Path to the RDF file containing the hierarchy. Attribute...
2,891
en
0.797131
wisdomchuck/TestBot
utils/fun/lists.py
1
2804
# Image urls for the psat command psat_memes = [ "http://i.imgur.com/5eJ5DbU.jpg", "http://i.imgur.com/HBDnWVc.jpg", "http://i.imgur.com/RzZlq2j.jpg", "http://i.imgur.com/mVRNUIG.jpg", "http://i.imgur.com/OvOmC6g.jpg", "http://i.imgur.com/QqlSxaZ.png", "http://i.imgur.com/finNuzx.jpg", "...
gpl-3.0
-5,187,740,992,660,968,000
29.813187
103
0.634807
false
Image urls for the psat command Response for the 8ball command Insults for the insult command Drunk lines for the actdrunk command Image urls for the honk command
162
en
0.841064
vikingco/django-states
src/states/south_migrations/0006_group_action.py
1
4104
from south.db import db from django.db import models from states.models import * class Migration: def forwards(self, orm): # Deleting field 'StateReport.group_action' db.delete_column('states_statereport', 'group_action') def backwards(self, orm): ...
bsd-3-clause
8,244,591,785,139,202,000
58.478261
156
0.552144
false
Deleting field 'StateReport.group_action' Adding field 'StateReport.group_action'
81
en
0.435621
mseeger/apbsint
python/cython/setup.py
1
6137
#! /usr/bin/env python # Build ApBsInT extension modules (C++ code). Use '--workaround' option # in order to build workaround code (this needs private part not contained # in the public repo). from distutils.core import setup #from distutils.extension import Extension from Cython.Distutils import build_ext from Cytho...
bsd-3-clause
-873,107,301,675,034,800
32.906077
79
0.677856
false
! /usr/bin/env python Build ApBsInT extension modules (C++ code). Use '--workaround' option in order to build workaround code (this needs private part not contained in the public repo).from distutils.extension import Extension System profile (has to be edited) Basic information passed to compiler/linker NOTE: Do not ch...
886
en
0.711718