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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bingopodcast/bingos | bingo_emulator/fun_spot_63/game.py | 1 | 47949 | #!/usr/bin/python
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
import procgame.game, sys, os
import procgame.config
import random
import procgame.sound
sys.path.insert(0,os.path.pardir)
import bingo_emulator.common.units as units
import bingo_em... | gpl-3.0 | 1,453,764,986,287,668,500 | 46.380435 | 222 | 0.550981 | false | Fun Spot '63 was an Ohio Dime Game without a replay button
!/usr/bin/python This is really nasty, but it is how we render graphics for each individual hole. numbers are added (or removed from) a list. In this way, I can re-use the same routine even for games where there are ball return functions like Surf Club. dis... | 3,848 | en | 0.932658 |
mrakgr/futhark | examples/life/quadlife_alt.py | 1 | 55476 | import sys
import numpy as np
import ctypes as ct
import pyopencl as cl
import pyopencl.array
import time
import argparse
FUT_BLOCK_DIM = "16"
cl_group_size = np.int32(512)
synchronous = False
fut_opencl_src = """typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long int64_t;
typede... | bsd-3-clause | 4,486,038,976,242,857,500 | 29.420159 | 150 | 0.537404 | false | Hacky parser/reader for values written in Futhark syntax. Used for reading stdin when compiling standalone programs with the Python code generator. May be line comment. Yes, line comment. Skip to end of line. Scalar functions. XXX: Assuming just a single device here. | 268 | en | 0.762386 |
bschollnick/downloader | downloader3.py | 1 | 7816 | """
Downloader, mass file downloader.
"""
import common
import logging, logging.handlers
import os
import os.path
import plistlib
import stat
import sys
import time
from optparse import OptionParser
from yapsy.PluginManager import PluginManager
SCRIPT_FILENAME = os.path.abspath(sys.argv[0])
SCRIPT_DIRECTORY = os.se... | mpl-2.0 | 2,206,838,923,007,199,500 | 30.643725 | 77 | 0.546827 | false | Loop round the plugins and print their names. plugin name contains pointer to module Make Root download folder Load the plugins from the plugin directory. | 156 | en | 0.834889 |
alfred82santa/tarrabmeCheckerGtk | src/tarrabme_checker_gtk/dialogs.py | 1 | 3341 | from gi.repository import Gtk, Gio
from .actuators import NeoPixelsActuator
__author__ = 'alfred'
class PreferencesDialog(Gtk.Dialog):
def __init__(self, settings):
Gtk.Dialog.__init__(self, "Preferences", None,
Gtk.DialogFlags.USE_HEADER_BAR | Gtk.DialogFlags.MODAL,
... | gpl-2.0 | 3,221,447,033,717,781,500 | 46.056338 | 102 | 0.677641 | false | 0 | en | 0.110449 | |
khosrow/metpx | sundew/unittests/unittest_senderAm.py | 1 | 1082 | # -*- coding: iso-8859-1 -*-
#############################################################################################
# Name: unittest_senderAm.py
# Author: Jun Hu
# Date: 2012-04-30
# Description: test cases for senderAm class
######################################################################################... | gpl-2.0 | 7,791,971,487,421,272,000 | 30.823529 | 93 | 0.575786 | false | -*- coding: iso-8859-1 -*- Name: unittest_senderAm.py Author: Jun Hu Date: 2012-04-30 Description: test cases for senderAm class | 129 | en | 0.442806 |
praekelt/django-ultracache | ultracache/tests/utils.py | 1 | 1072 | from collections import OrderedDict
class DummyProxy(dict):
def make_key(self, path, headers=None):
key = path
if headers is not None:
key += str(frozenset(sorted(headers.items())))
return key
def cache(self, request, value):
headers = {k[5:].replace("_", "-").low... | bsd-3-clause | 4,270,799,919,882,227,000 | 29.628571 | 75 | 0.602612 | false | The test framework sends an empty cookie with each request. Avoid copy pasta in the individual tests and just add that header here. | 131 | en | 0.856702 |
ContextLab/hypertools | hypertools/tools/format_data.py | 1 | 7323 | import warnings
import numpy as np
import six
from .._externals.ppca import PPCA
from .._shared.helpers import get_type
def format_data(x, vectorizer='CountVectorizer',
semantic='LatentDirichletAllocation', corpus='wiki', ppca=True, text_align='hyper'):
"""
Formats data into a list of numpy ... | mit | -6,226,596,756,234,407,000 | 38.583784 | 139 | 0.604534 | false | Formats data into a list of numpy arrays
This function is useful to identify rows of your array that contain missing
data or nans. The returned indices can be used to remove the rows with
missing data, or label the missing data points that are interpolated
using PPCA.
Parameters
----------
x : numpy array, datafram... | 3,363 | en | 0.649434 |
RetroMelon/PatchWords | patchwords_project/patchwords/queries.py | 1 | 3242 | # The queries.py file contains a bunch of relatively complex database
# queries that probably shouldn't take place inside the views.
from patchwords.models import Category, Story, Paragraph, User, Favourite
#gets a list of
def getTopStories(start=0, end=5, category=None):
#getting the stories and zipping them with... | mit | 3,769,124,615,543,503,400 | 30.784314 | 92 | 0.692474 | false | The queries.py file contains a bunch of relatively complex database queries that probably shouldn't take place inside the views.gets a list ofgetting the stories and zipping them with their favouritessorting the storiesunzipping the storiesgetting the categories and mapping them with their favourites.unzipping the cate... | 1,005 | en | 0.858123 |
Collisionc/sickbeard_mp4_automator | delugePostProcess.py | 1 | 5295 | #!/usr/bin/env python
import os
import sys
from autoprocess import autoProcessTV, autoProcessMovie, autoProcessTVSR, sonarr, radarr
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4
from deluge_client import DelugeRPCClient
import logging
from logging.config import fileConfig
logpath = '/var/log/sic... | mit | 6,938,189,214,140,944,000 | 34.066225 | 163 | 0.671388 | false | !/usr/bin/env python Check for custom Deluge output_dir Perform conversion. Send to Sickbeard Send to CouchPotato Send to Sonarr | 128 | en | 0.655986 |
jay-lau/magnum | magnum/tests/unit/common/test_clients.py | 1 | 15343 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | 3,733,136,881,680,137,000 | 42.962751 | 79 | 0.612527 | false | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is di... | 522 | en | 0.872906 |
FreeOpcUa/python-opcua | opcua/common/events.py | 1 | 8172 | import copy
from opcua import ua
import opcua
from opcua.ua.uaerrors import UaError
from opcua.common import ua_utils
class Event(object):
"""
OPC UA Event object.
This is class in inherited by the common event objects such as BaseEvent,
other auto standard events and custom events
Events are use... | lgpl-3.0 | -8,488,097,905,301,647,000 | 34.376623 | 150 | 0.618453 | false | OPC UA Event object.
This is class in inherited by the common event objects such as BaseEvent,
other auto standard events and custom events
Events are used to trigger events on server side and are
sent to clients for every events from server
Developper Warning:
On server side the data type of attributes should be know... | 1,264 | en | 0.848446 |
birdland/dlkit-doc | dlkit/services/grading.py | 1 | 224535 | # -*- coding: utf-8 -*-
"""Grading Open Service Interface Definitions
grading version 3.0.0
The Grading OSID defines a service to apply grades or ratings.
Grade Systems
The grade system sessions provide the means to retrievs and manage
``GradeSystem`` definitions. A ``GradeSystem`` is a fixed set of
``Grades`` . ``G... | mit | 3,892,039,066,676,046,000 | 38.593546 | 193 | 0.644349 | false | A gradebook defines a collection of grade entries.
Like all ``OsidLists,`` ``GradebookList`` provides a means for accessing ``Gradebook`` elements sequentially either one at a time or many at a time.
Examples: while (gl.hasNext()) { Gradebook gradebook =
gl.getNextGradebook(); }
or
while (gl.hasNext()) {
Gr... | 164,019 | en | 0.700771 |
eckardm/archivematica | src/MCPClient/lib/clientScripts/archivematicaCreateMETSMetadataCSV.py | 1 | 4618 | #!/usr/bin/env python2
#
# This file is part of Archivematica.
#
# Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation,... | agpl-3.0 | 1,642,396,789,617,826,600 | 37.165289 | 128 | 0.683629 | false | Parse all metadata.csv files in SIPPath.
Looking for metadata.csvs in metadata/ and
objects/metadata/transfers/<transfer name>/metadata/
See parseMetadataCSV for details on parsing.
:param SIPPath: Path to the SIP
:return: {<filename>: OrderedDict(key: [values]) }
Parses the metadata.csv into a dict with entries for... | 2,300 | en | 0.603104 |
cyphactor/lifecyclemanager | extra/plugins/userlog/userlog/userlog.py | 1 | 7748 | import posixpath
from trac.core import *
from trac.config import *
from trac.config import BoolOption
from trac.web.chrome import ITemplateProvider, \
add_stylesheet
from trac.web.main import IRequestHandler
from trac.wiki import wiki_to_html, wiki_to_oneliner
from trac.mimeview import Mimeview, is_binary
from trac... | gpl-3.0 | -8,103,132,112,731,082,000 | 43.786127 | 88 | 0.495225 | false | Return a list of directories containing the provided
ClearSilver templates.
IRequestHandler methods Have to sort by time because rev is a text field and sorts lexicographically rather than numerically support for 'A'dd changes will be a list of pairs: (start, end) if rev is more than two greater than last max or lis... | 421 | en | 0.843564 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/lo_fi_cache.py | 6 | 1090 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState
from telemetry.page import page as page_module
from telemetry import story
cla... | gpl-3.0 | 3,508,047,452,543,410,700 | 31.058824 | 79 | 0.721101 | false | Chrome proxy test sites
A test page for the chrome proxy Lo-Fi cache tests.
Checks that LoFi placeholder images are not loaded from cache on page reloads
when LoFi mode is disabled or data reduction proxy is disabled.
Copyright 2015 The Chromium Authors. All rights reserved. Use of this source code is governed by a ... | 376 | en | 0.859851 |
pcm17/tensorflow | tensorflow/contrib/distributions/python/ops/poisson.py | 1 | 5426 | # Copyright 2016 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 | 8,151,053,767,586,295,000 | 33.56051 | 80 | 0.679506 | false | Poisson distribution.
The Poisson distribution is parameterized by an event `rate` parameter.
#### Mathematical Details
The probability mass function (pmf) is,
```none
pmf(k; lambda, k >= 0) = (lambda^k / k!) / Z
Z = exp(lambda).
```
where `rate = lambda` and `Z` is the normalizing constant.
Initialize a batch of ... | 1,813 | en | 0.720075 |
harlequin/sickbeard | sickbeard/tv.py | 1 | 60124 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 | 129,994,857,721,770,370 | 39.379215 | 283 | 0.566795 | false | Author: Nic Wolfe <nic@wolfeden.ca> URL: http://code.google.com/p/sickbeard/ This file is part of Sick Beard. Sick Beard 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... | 5,179 | en | 0.931374 |
hufsm/tu_gen2_libsigrokdecode | decoders/usb_power_delivery/pd.py | 1 | 20599 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2015 Google, Inc
## Copyright (C) 2018 davidanger <davidanger@163.com>
## Copyright (C) 2018 Peter Hazenberg <sigrok@haas-en-berg.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Ge... | gpl-3.0 | -1,047,846,842,259,668,100 | 31.286834 | 96 | 0.468032 | false | This file is part of the libsigrokdecode project. Copyright (C) 2015 Google, Inc Copyright (C) 2018 davidanger <davidanger@163.com> Copyright (C) 2018 Peter Hazenberg <sigrok@haas-en-berg.nl> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub... | 2,576 | en | 0.757575 |
chromium/chromium | tools/grit/grit/format/rc.py | 7 | 18109 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Support for formatting an RC file for compilation.
'''
from __future__ import print_function
import os
import re
from functools import partial
impo... | bsd-3-clause | 2,850,999,913,179,659,000 | 36.727083 | 81 | 0.628859 | false | Formats an item that is included in an .rc file (e.g. an ICON).
Args:
item: an IncludeNode or StructureNode
lang, output_dir: standard formatter parameters
type: .rc file resource type, e.g. 'ICON' (ignored unless item is a
StructureNode)
process_html: False/True (ignored unless item is a StructureNode... | 3,507 | en | 0.673051 |
rainier-m/python-soccer | EPL-teamNews.py | 1 | 5001 | # -*- coding: utf-8 -*-
'''
Created on Jan 30, 2015
Modified on Jan 30, 2015
@author: rainier.madruga@gmail.com
A simple Python Program to scrape the ESPN FC website for content.
'''
'''
Version Number of Script
'''
version = '0.01.a'
# Import Libraries needed for Scraping the various web pages
from bs4 import Beautif... | gpl-2.0 | -1,380,015,014,240,211,200 | 34.721429 | 639 | 0.660868 | false | -*- coding: utf-8 -*- Import Libraries needed for Scraping the various web pages Establish the process Date & Time Stamp Updates the Time Stamp Download Image Program Version & System Variables Set Output Path for Windows or Mac environments recapPhotoItem = recapPhotoItem.find("img") print recapPhotoItem["src"] with o... | 741 | en | 0.521643 |
plq/spyne | spyne/protocol/_inbase.py | 1 | 24684 |
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | lgpl-2.1 | 6,236,613,823,759,580,000 | 33.37883 | 84 | 0.581672 | false | This is the abstract base class for all input protocol implementations.
Child classes can implement only the required subset of the public methods.
An output protocol must implement :func:`serialize` and
:func:`create_out_string`.
An input protocol must implement :func:`create_in_document`,
:func:`decompose_incoming_... | 2,812 | en | 0.786231 |
JerryYanWan/BigDL | spark/dl/src/test/resources/tf/models/vgg19.py | 1 | 1391 | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | 155,971,322,021,515,800 | 34.666667 | 97 | 0.686556 | false | You can also run these commands manually to generate the pb file
1. git clone https://github.com/tensorflow/models.git
2. export PYTHONPATH=Path_to_your_model_folder
3. python alexnet.py
Copyright 2016 The BigDL Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except ... | 744 | en | 0.840121 |
swarmer/autoscaler | autoscaler/server/scaling/algorithms/spline.py | 1 | 1065 | import math
import scipy.interpolate
from autoscaler.server.request_history import RequestHistory
from autoscaler.server.scaling.utils import parse_interval
class SplineScalingAlgorithm:
def __init__(self, algorithm_config):
self.interval_seconds = parse_interval(
algorithm_config['interval'... | mit | 2,385,278,985,483,348,000 | 32.28125 | 79 | 0.656338 | false | 0 | en | 0.110449 | |
SunyataZero/buddhist-well-being-prototype-4 | bwb/practice_details.py | 1 | 3624 | import sched
import threading
import time
from PyQt5 import QtCore
from PyQt5 import QtWidgets
import bwb.model
ID_NOT_SET = -1
BUTTON_WIDTH_IT = 28
class PracticeCompositeWidget(QtWidgets.QWidget):
time_of_day_state_changed_signal = QtCore.pyqtSignal()
def __init__(self):
super().__init__()
... | gpl-3.0 | 638,437,109,849,312,600 | 37.147368 | 132 | 0.651214 | false | ..for details self.details_ll = QtWidgets.QLabel("-----") self.details_ll.setWordWrap(True) Set a scheduled task -Several events can be scheduled, (the enterabs function adds an event rather than replacing) blocking=False storing the id locallytime_of_day_cb_was_blocked_bl = self.time_of_day_active_qcb.blockSignals(Tru... | 595 | en | 0.523119 |
uw-it-aca/canvas-sis-provisioner | sis_provisioner/builders/__init__.py | 1 | 4786 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from sis_provisioner.models.course import Course
from sis_provisioner.models.user import User
from sis_provisioner.csv.data import Collector
from sis_provisioner.csv.format import UserCSV, EnrollmentCSV
from sis_provisioner.dao.user... | apache-2.0 | 5,952,493,172,330,509,000 | 36.390625 | 79 | 0.614919 | false | Generates one enrollment for the passed group member.
Generates one student enrollment for the passed registration.
Generates one teacher enrollment for the passed section and person.
Creates a line of user data for the passed person. If force is not
true, the data will only be created if the person has not been
provi... | 531 | en | 0.769566 |
steveb/heat | heat/tests/openstack/heat/test_remote_stack.py | 1 | 27511 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 | -2,916,390,377,502,339,000 | 38.871014 | 79 | 0.601178 | false | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under th... | 1,193 | en | 0.879007 |
pytorch/fairseq | fairseq/model_parallel/models/pipeline_parallel_transformer/model.py | 1 | 33560 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import utils
from fairseq.model_parallel.model... | mit | -946,977,085,584,911,400 | 42.754889 | 151 | 0.57947 | false | Transformer decoder consisting of *args.decoder_layers* layers. Each layer
is a :class:`TransformerDecoderLayer`.
Args:
args (argparse.Namespace): parsed command-line arguments
dictionary (~fairseq.data.Dictionary): decoding dictionary
embed_tokens (torch.nn.Embedding): output embedding
no_encoder_attn... | 3,914 | en | 0.703911 |
6112/project-euler | problems/051.py | 1 | 2678 | #encoding=utf-8
## SOLVED 2014/04/18
## 121313
# By replacing the 1st digit of the 2-digit number *3, it turns out that six of
# the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
# By replacing the 3rd and 4th digits of 56**3 with the same digit, this
# 5-digit number is the first example having se... | mit | -6,838,346,259,325,526,000 | 42.901639 | 79 | 0.641897 | false | Replaces every 'base' in 'xs' with 'replacement'. Non destructive.
Args:
xs: Initial list of elements.
base: Element to be replaced in the new list.
replacement: Element to replace that value with.
Returns:
A new list with the replacement applied.
encoding=utf-8 SOLVED 2014/04/18 121313 By replacing t... | 1,482 | en | 0.874326 |
etkirsch/legends-of-erukar | erukar/content/skills/brutality/Cleave.py | 1 | 4561 | from erukar.system.engine import Attack, Damage, DamageScalar
from erukar.ext.math import Navigator
class Cleave(Attack):
Name = 'Cleave'
ShowInLists = True
Description = 'Cleave with {} at {}'
CurrentLevel = 'Swing wildly, inflicting {:0.1f}% damage per tile '\
'in three spaces at once. Cleav... | agpl-3.0 | -1,209,525,495,349,219,600 | 34.913386 | 74 | 0.585398 | false | X Tiles Y Tiles | 15 | es | 0.183769 |
RNAcentral/rnacentral-import-pipeline | tests/databases/ensembl/genomes/plants_test.py | 1 | 26982 | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | apache-2.0 | -8,262,563,082,367,672,000 | 40.767802 | 211 | 0.595879 | false | Copyright [2009-2018] EMBL-European Bioinformatics Institute
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 ... | 780 | en | 0.787208 |
sedden/django-basic-apps | basic/tools/shortcuts.py | 1 | 1190 | import os.path
import hashlib
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.http import HttpResponseRedirect
def get_image_path(instance, filename):
"""
Converts an image filename to a hash.
"""
name = hashlib.md5("%s" % instance.id).he... | bsd-3-clause | -5,613,188,190,341,763,000 | 28.775 | 114 | 0.67395 | false | Converts an image filename to a hash.
Simple wrapper for HttpResponseRedirect that checks the request for a
'next' GET parameter then falls back to a given object or url string.
Simple wrapper for render_to_response. | 216 | en | 0.458402 |
geo2tag-logistics/Geo2Logistics | logistics/Geo2TagService.py | 1 | 6073 | import json
import requests
from logistics.models import Fleet
SERVER_URL = "http://demo.geo2tag.org/instance/"
BASE_SERVICE_NAME = "testservice"
SERVICE_NAME = BASE_SERVICE_NAME
channel_dict = {}
points_dict = {}
def getSerivceUrl():
return SERVER_URL + "service/" + SERVICE_NAME
def one_time_startup():
... | apache-2.0 | -5,767,976,916,874,057,000 | 35.194969 | 159 | 0.596003 | false | m = hashlib.md5() m.update(socket.gethostbyname(socket.getfqdn()).encode('utf-8')) global SERVICE_NAME SERVICE_NAME = BASE_SERVICE_NAME + "_" + str(m.hexdigest()) print("SERVICE_NAME: "+SERVICE_NAME) url = SERVER_URL + 'service' data = {'name': SERVICE_NAME} request = requests.post(url, data=data) print(request.text) в... | 794 | ru | 0.922807 |
jimjing/smores_choose_behavior | src/smores_choose_behavior/visualizer.py | 1 | 1422 | #!/usr/bin/env python
import threading
import rospy
from visualization_msgs.msg import Marker, MarkerArray
class Visualizer(object):
def __init__(self):
self._current_pub_path = []
self.run = False
self.t = None
self.t = threading.Thread(target=self._startPathPub)
self.t.... | gpl-3.0 | -7,178,490,557,951,756,000 | 27.44 | 83 | 0.496484 | false | !/usr/bin/env python 10hz | 25 | es | 0.147001 |
ComputerNetworks-UFRGS/OpERA | python/device/radioDevice.py | 1 | 9121 | """
Copyright 2013 OpERA
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, softwar... | apache-2.0 | -5,384,129,354,236,725,000 | 25.591837 | 97 | 0.558162 | false | Class to handle a single path connection/disconnection
Function override.
Search for a parameter/function in all archs of this Radio.
So, a programer that doed radio.function, activates this __getattr__
function, which searches for 'function' in all architectures.
@param name Name of parameter/function.
A gereric... | 2,346 | en | 0.746406 |
tramin/frobo | frobo_nav/nodes/nav_calibrate_linear.py | 1 | 5813 | #!/usr/bin/env python
""" nav_square.py - Version 1.1 2013-12-20
A basic demo of the using odometry data to move the robot
along a square trajectory.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2012 Patrick Goebel. All rights reserved.
This program is free software; y... | mit | 3,346,981,609,078,906,400 | 39.089655 | 116 | 0.607088 | false | !/usr/bin/env python Give the node a name Set rospy to execute a shutdown function when terminating the script How fast will we check the odometry values? Set the equivalent ROS rate variable Set the parameters for the target square meters degrees converted to radians meters per second radians per second degrees to rad... | 1,129 | en | 0.752618 |
morgangiraud/openai-rl | main.py | 1 | 6781 | import gym, os, time, json, random, sys
import tensorflow as tf
import numpy as np
from agents import make_agent, get_agent_class
from hpsearch.hyperband import Hyperband, run_params
from hpsearch import fullsearch
from hpsearch import randomsearch
dir = os.path.dirname(os.path.realpath(__file__))
flags = tf.app.fla... | mit | 6,664,872,669,113,156,000 | 49.992481 | 233 | 0.679546 | false | HP search Hyperband Agent CM agents Policy Experience replay Environment if os.path.isfile(config['result_dir'] + '/config.json'): print("Overriding shell configuration with the one found in " + config['result_dir']) with open(config['result_dir'] + '/config.json', 'r') as f: config = json.loads(f.read(... | 322 | en | 0.417762 |
rjl09c/ysp2017 | katiehessian.py | 1 | 7324 | import yt
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import pylab
from yt.analysis_modules.halo_finding.api import HaloFinder
from pylab import*
from numpy import ma
from numpy import linalg as LA
#derives vel with respect to x
def derivx(vel,xcoords):
distance = xcoords[1][0] - xcoords[0][0]... | gpl-3.0 | -7,559,592,820,612,261,000 | 24.255172 | 106 | 0.58834 | false | derives vel with respect to xderives vel with respect to ysecond derivative of vel with respect to xsecond derivative of vel with respect to ysecond derivative of a mixed derivativetakes deriv of vel with respect to x and derives that in the y directionif on edges derives with respect to x firstcreate hessian matrix fo... | 859 | en | 0.865407 |
tehpug/Ares | leagues/models.py | 1 | 5319 | # -*- coding: utf-8 -*-
from celery.result import AsyncResult
from django.core.exceptions import ValidationError
from django.db import models, connection
from django.utils import timezone
def validate_even(value):
"""
Validate a number to be even
"""
if value % 2 != 0:
raise ValidationError('%... | gpl-3.0 | 6,876,304,096,557,620,000 | 34.225166 | 79 | 0.602369 | false | Leagues for robots
Validate the the values
Create a table of league
Check if the league schedule has changed or not
Match scheduler task
Validate a number to be even
-*- coding: utf-8 -*- Times to schedule matches within a day | 228 | en | 0.784311 |
Bajoo/client-pc | tests/unit_tests/filesync/task_consumer_test.py | 1 | 6616 | # -*- coding:utf-8 -*-
import threading
import pytest
from bajoo.filesync import task_consumer
from bajoo.promise import Promise
class TestTaskConsumer(object):
def _make_external_promise(self):
"""Helper used to make stub Promise.
Returns:
Promise, resolve, reject: the promise and... | gpl-3.0 | 6,029,750,878,475,561,000 | 29.348624 | 78 | 0.546705 | false | Helper used to make stub Promise.
Returns:
Promise, resolve, reject: the promise and its callbacks.
Add three tasks who are required to run at the same time.
The task A will wait the Task B, then B will wait A.
This test "force" the tasks to be executed in a non-linear order.
Add a task who is an almost empty ge... | 1,151 | en | 0.901209 |
visio2img/visio2img | setup.py | 1 | 1585 | import sys
from setuptools import setup
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Microsoft :: Windows'... | apache-2.0 | -7,219,872,094,020,648,000 | 31.346939 | 67 | 0.635962 | false | 0 | en | 0.110449 | |
azide0x37/tableFramer | tableFramer.py | 1 | 1267 | import requests
import json
from bs4 import BeautifulSoup
from collections import OrderedDict
class tableFramer:
def __init__(self, url):
self.url = url
self.response = requests.get(url, headers = {'User-Agent': 'Mozilla/5.0'})
def __call__(self):
souped = BeautifulSoup(self.response... | mit | 2,197,101,322,134,218,800 | 29.166667 | 88 | 0.535912 | false | , indent=4, separators=(',',':')) | 33 | fa | 0.112624 |
philipkershaw/ndg_security_server | ndg/security/server/wsgi/utils.py | 2 | 7507 | """NDG Security WSGI utilities
MashMyData Project
"""
__author__ = "P J Kershaw"
__date__ = "21/08/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = "$Id$"
import logging
log = ... | bsd-3-clause | 3,673,313,203,661,367,000 | 37.497436 | 83 | 0.520714 | false | Helper class creates iterable WSGI response based on a given block size
Raise for an invalid byte range requested
Raise for invalid range request syntax
Base exception type for exceptions raised from
FileObjResponseIterator class instances
Open a file and set the blocks for reading, any input range set and
the re... | 1,584 | en | 0.764587 |
zjkl19/AbaqusPython | SimpleSupportBeam/SimpleSupportBeam01.py | 1 | 7518 | # -*- coding: mbcs -*-
#auto generated by GUI operation.
#the template of the original example:ExpAbq00.py
#link:http://www.020fea.com/a/5/152/11521.html
#explanation:
#structure:simple supported beam
#load:ConcentratedForce in the midSpan
#post:none
#comment by lindinan in 20170829
#
from part import *
from mat... | mit | -4,320,695,320,007,110,000 | 51.573427 | 80 | 0.672918 | false | -*- coding: mbcs -*-auto generated by GUI operation.the template of the original example:ExpAbq00.pylink:http://www.020fea.com/a/5/152/11521.htmlexplanation:structure:simple supported beamload:ConcentratedForce in the midSpanpost:nonecomment by lindinan in 20170829 Save by bdl on 2017_08_05-12.10.39; build 6.13-1 2013... | 342 | en | 0.624011 |
selmanj/repel | datasets/recipe/synthetic/synth.py | 1 | 3044 | #!/usr/bin/python
#
# Generates synthetic recipe domains.
# RUNS ON PYTHON 3.x, not 2.7
# GENERAL DIRECTIONS
# 1. Plate items down
# * Cup, bowl, cakemix
# 2. Pour cakemix into bowl
# 3. Mix bowl
# 4. Place oil bottle
# 5. pour oil bottle into mixing bowl
# 6. MIX
# 7. Place 1-2 more bowls, pour and mix
#
# So we ma... | mit | -6,441,630,987,821,203,000 | 27.448598 | 95 | 0.68134 | false | Get an interval for a generic event (including delay) from offset
Get an interval for a place event (including delay) from offset
!/usr/bin/python Generates synthetic recipe domains. RUNS ON PYTHON 3.x, not 2.7 GENERAL DIRECTIONS 1. Plate items down * Cup, bowl, cakemix 2. Pour cakemix into bowl 3. Mix bowl 4. Place... | 744 | en | 0.83782 |
nugget/home-assistant | homeassistant/components/google_assistant/trait.py | 1 | 32913 | """Implement the Google Smart Home traits."""
import logging
from homeassistant.components import (
cover,
group,
fan,
input_boolean,
media_player,
light,
lock,
scene,
script,
switch,
vacuum,
)
from homeassistant.components.climate import const as climate
from homeassistant.... | apache-2.0 | -2,187,925,773,775,859,700 | 33.463874 | 79 | 0.57412 | false | Trait to control brightness of a device.
https://developers.google.com/actions/smarthome/traits/brightness
Trait to offer color spectrum functionality.
https://developers.google.com/actions/smarthome/traits/colorspectrum
Trait to offer color temperature functionality.
https://developers.google.com/actions/smarthome/... | 3,587 | en | 0.774523 |
leviroth/praw | tests/integration/models/test_redditors.py | 1 | 1453 | """Test praw.models.redditors."""
import mock
from praw.models import Redditor, Subreddit
from .. import IntegrationTest
class TestRedditors(IntegrationTest):
def test_new(self):
with self.recorder.use_cassette("TestRedditors.test_new"):
profiles = list(self.reddit.redditors.new(limit=300))
... | bsd-2-clause | -4,265,739,451,176,297,000 | 39.361111 | 74 | 0.653131 | false | Test praw.models.redditors. | 27 | en | 0.345639 |
RCOS-Grading-Server/HWserver | migration/tests/test_main.py | 2 | 1369 | from argparse import Namespace
import unittest
from migrator import main
class TestMain(unittest.TestCase):
def test_noop(self):
"""Test that noop function can take variable amount of parameters."""
test = []
for i in range(5):
main.noop(*test)
test.append(i)
... | bsd-3-clause | -4,302,171,282,327,793,000 | 26.938776 | 77 | 0.551497 | false | Test that noop function can take variable amount of parameters. | 63 | en | 0.699535 |
cltrudeau/django-awl | awl/tests/test_utils.py | 1 | 3111 | # awl.tests.test_utils.py
import sys
from io import StringIO
from django.test import TestCase
from awl.tests.models import Link
from awl.utils import (URLTree, refetch, refetch_for_update, render_page,
render_page_to_string, get_field_names, get_obj_attr)
from awl.waelsteng import FakeRequest
# =================... | mit | 4,314,477,777,599,757,000 | 30.11 | 80 | 0.58695 | false | awl.tests.test_utils.py ============================================================================ print_tree() exercises everything, so run it and capture stdout test defaults, ignore order test ignore_auto, ignore_relations and exclude --- data for testing --- tests | 270 | en | 0.468723 |
gaganjyot/EXIFGeoLocation | main.py | 1 | 1898 | from PIL import Image
from PIL.ExifTags import GPSTAGS, TAGS
def _get_if_exist(data, key):
if key in data:
return data[key]
return None
def _convert_to_degrees(value):
"""Helper function to convert the GPS coordinates stored in the EXIF to degress in float format"""
d0 = value[0][0]
d1 =... | gpl-3.0 | -757,813,787,278,791,300 | 27.772727 | 102 | 0.535827 | false | Helper function to convert the GPS coordinates stored in the EXIF to degress in float format
print "TAG", decoded, value | 121 | en | 0.456959 |
bheinzerling/bpemb | bpemb/available_vocab_sizes.py | 1 | 19854 | vocab_sizes = (
{
"ab": {
1000,
3000,
5000
},
"ace": {
1000,
3000,
5000
},
"ady": {
1000,
3000,
5000
},
"af": {
100000,
10000,
1000,
200000,
25000,
3000,
50000,
5000
},
"ak": {
1000,
3000,
5000
},
"als": {
100000,
... | mit | 6,636,670,103,671,172,000 | 8.666018 | 15 | 0.379722 | false | 0 | en | 0.110449 | |
kennethreitz/pipenv | tests/integration/test_project.py | 1 | 8289 | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import io
import os
import tarfile
import pytest
from pipenv.patched import pipfile
from pipenv.project import Project
from pipenv.utils import temp_environ
from pipenv.vendor.vistir.path import is_in_path, normalize_path
from pipenv.vendor... | mit | 8,963,331,359,839,735,000 | 32.695122 | 123 | 0.59392 | false | -*- coding=utf-8 -*- force source to be cached Initial pipfile + lockfile generation Rewrite each file with parameterized newlines message because of https://github.com/pytest-dev/pytest/issues/3443 Run pipenv install to programatically rewrite Make sure we kept the right newlines Consumes the content to detect newlin... | 392 | en | 0.769976 |
its-dirg/pefim-proxy | tests/test_ServerConfiguration.py | 1 | 2161 | import unittest
from argparse import Namespace
from pefimproxy.server import WsgiApplication
class ServerConfigurationTestCase(unittest.TestCase):
def setup_class(self):
pass
def test_server_config_files_ok(self):
valid, message = WsgiApplication.validate_server_config(
Namespace(... | gpl-3.0 | 2,929,277,978,590,305,000 | 35.033333 | 89 | 0.621472 | false | 0 | en | 0.110449 | |
ababino/networkb | networkb/algorithms/utils.py | 1 | 3266 | # -*- coding: utf-8 -*-
"""
Created on Wed May 15 20:11:59 2013
@author: andres
"""
import numpy
import networkx
from scipy import spatial
from scipy import stats
def find_peaks(th,gc):
peaks=[]
for i in range(1,len(th)-1):
if gc[1][i-1]<gc[1][i] and gc[1][i]>gc[1][i+1]:
peaks.append((th[i],gc[1][i]))
... | mit | 3,844,366,845,292,625,000 | 28.963303 | 105 | 0.609002 | false | -*- coding: utf-8 -*- | 21 | en | 0.767281 |
pytest-dev/pytest-bdd | pytest_bdd/utils.py | 1 | 1191 | """Various utility functions."""
from inspect import getframeinfo
from inspect import signature as _signature
from sys import _getframe
CONFIG_STACK = []
def get_args(func):
"""Get a list of argument names for a function.
:param func: The function to inspect.
:return: A list of argument names.
:rt... | mit | -1,642,162,315,754,404,600 | 27.357143 | 109 | 0.706129 | false | Get a list of argument names for a function.
:param func: The function to inspect.
:return: A list of argument names.
:rtype: list
Get the caller module locals dictionary.
We use sys._getframe instead of inspect.stack(0) because the latter is way slower, since it iterates over
all the frames in the stack.
Get the ca... | 500 | en | 0.709549 |
Xelaadryth/Xelabot | quest/quests/monster.py | 1 | 4536 | from random import getrandbits, randint
from ..quest import Quest
from ..quest_segment import QuestSegment
import settings
from utils.command_set import CommandSet
GOLD_SAFE_REWARD = 75
GOLD_VARIANCE_SAFE = 21
EXP_SAFE_REWARD = 2
GOLD_RISKY_PENALTY = 200
GOLD_RISKY_REWARD = 300
GOLD_RISKY_REWARD_BIG = 400
GOLD_VARIA... | mit | 256,312,372,235,626,660 | 40.614679 | 119 | 0.612434 | false | 0 | en | 0.110449 | |
epage/The-One-Ring | src/tp/_generated/Channel_Interface_DTMF.py | 1 | 2340 | # -*- coding: utf-8 -*-
# Generated from the Telepathy spec
"""Copyright (C) 2005, 2006 Collabora Limited
Copyright (C) 2005, 2006 Nokia Corporation
Copyright (C) 2006 INdT
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 ... | lgpl-2.1 | -6,948,686,769,589,709,000 | 38.677966 | 113 | 0.714103 | false | An interface that gives a Channel the ability to send DTMF events over
audio streams which have been established using the StreamedMedia channel
type. The event codes used are in common with those defined in RFC4733, and are
listed in the DTMF_Event enumeration.
Start sending a DTMF tone on this stream. Where possible,... | 1,595 | en | 0.904346 |
smallyear/linuxLearn | salt/salt/returners/mongo_future_return.py | 1 | 7113 | # -*- coding: utf-8 -*-
'''
Return data to a mongodb server
Required python modules: pymongo
This returner will send data from the minions to a MongoDB server. To
configure the settings for your MongoDB server, add the following lines
to the minion config files:
.. code-block:: yaml
mongo.db: <database name>
... | apache-2.0 | -3,668,263,459,001,041,000 | 24.959854 | 109 | 0.604246 | false | Return a mongodb connection object
Get the mongo options from salt.
Remove the dots from the given data structure
Return the most recent jobs that have executed the named function
Return the return information associated with a jid
Return a list of job ids
Return the load associated with a given job id
Return a list of... | 2,868 | en | 0.685061 |
SU-ECE-17-7/ibeis | ibeis/viz/viz_name.py | 1 | 15641 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import plottool.draw_func2 as df2
import numpy as np
from ibeis.other import ibsfuncs
from plottool import plot_helpers as ph
import plottool as pt
import utool as ut
from ibeis.viz import viz_chip
(print, print_,... | apache-2.0 | 8,261,119,530,049,679,000 | 40.378307 | 339 | 0.548239 | false | CommandLine:
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --no-inimage
python -m ibeis.viz.viz_name --test-show_multiple_chips --show --db NNP_Master3 --aids=6435,9861,137,6563,9167,12547,9332,12598,13285 --no-inimage --notitle
python -m ibeis.viz.viz_name --test-show_multiple_chips --show... | 6,698 | en | 0.126701 |
Pinyto/cloud | api_prototype/sandbox.py | 1 | 3475 | # coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2105 Johannes Merkert <jonny@pinyto.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... | gpl-3.0 | -6,002,983,267,726,479,000 | 38.488636 | 106 | 0.710216 | false | If you want to execute something in the sandbox, call this method.
It will setup a process and execute the code there with seccomp. The passed database connections
will used to access the users collection.
:param code: The python code which should be executed in the sandbox
:type code: str
:param request: Django's req... | 2,087 | en | 0.879645 |
jem-gh/STplayer | STplayer.py | 1 | 2502 | #!/usr/bin/python
# STplayer (aka STconverter 2) is under the MIT License
# Copyright (c) 2012 Jean-Etienne Morlighem <jem.nvnt@gmail.com>
# https://github.com/jem-gh/STplayer
###############################################################################
# STplayer (aka STconverter 2) allows you to execute Python sc... | mit | 9,001,916,947,905,313,000 | 38.09375 | 82 | 0.681855 | false | !/usr/bin/python STplayer (aka STconverter 2) is under the MIT License Copyright (c) 2012 Jean-Etienne Morlighem <jem.nvnt@gmail.com> https://github.com/jem-gh/STplayer STplayer (aka STconverter 2) allows you to execute Python scripts written for SimpleGUI on a machine configured with Tkinter GUI instead. STplayer i... | 1,744 | en | 0.857213 |
SUSE/kiwi | kiwi/bootloader/install/__init__.py | 1 | 2173 | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | gpl-3.0 | -4,317,752,855,747,303,000 | 31.432836 | 76 | 0.651173 | false | **BootLoaderInstall Factory**
:param string name: bootloader name
:param string root_dir: root directory path name
:param object device_provider: instance of :class:`DeviceProvider`
:param dict custom_args: custom arguments dictionary
Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. This file is part of kiw... | 924 | en | 0.814661 |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_configured_values_column_info1025.py | 1 | 10546 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit | -8,931,959,705,869,452,000 | 37.489051 | 138 | 0.611132 | false | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the a... | 3,500 | en | 0.669095 |
sigmunau/nav | python/nav/ipdevpoll/pool.py | 1 | 10770 | #
# Copyright (C) 2017 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope... | gpl-2.0 | -5,302,875,455,866,709,000 | 33.630225 | 80 | 0.589694 | false | Represent a cancel message for sending to workers
This is a dummy worker pool that executes all jobs in the current process
Represent a job for sending to a worker
Resolve actions for jobs received over AMP
Modify AMP protocol to allow running over process pipes
Represent a shutdown message for sending to workers
This ... | 1,318 | en | 0.925961 |
mazvv/travelcrm | travelcrm/forms/foodcats.py | 1 | 2079 | # -*-coding: utf-8 -*-
import colander
from . import(
ResourceSchema,
BaseForm,
BaseSearchForm,
BaseAssignForm,
)
from ..resources.foodcats import FoodcatsResource
from ..models.foodcat import Foodcat
from ..models.task import Task
from ..models.note import Note
from ..lib.qb.foodcats import Foodcats... | gpl-3.0 | -5,314,125,230,378,631,000 | 25.653846 | 64 | 0.601732 | false | -*-coding: utf-8 -*- | 20 | en | 0.686099 |
Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/settings.py | 1 | 7641 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | 2,743,992,611,349,540,400 | 31.653846 | 97 | 0.693888 | false | vim: tabstop=4 shiftwidth=4 softtabstop=4 Copyright 2012 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. Copyright 2012 Nebula, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file exc... | 1,629 | en | 0.825662 |
follownjmoney/campaign-server | campaignserver/campaignserver/settings_prod.py | 1 | 2523 | """
Django settings for campaignserver project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... | apache-2.0 | 5,052,721,809,511,146,000 | 25.010309 | 74 | 0.722553 | false | Django settings for campaignserver project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
Build paths inside the project like this: os.path.join(BASE_DIR, ...) Quic... | 820 | en | 0.732781 |
xesscorp/skidl | skidl/skidl.py | 1 | 7609 | # -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2016 by XESS Corp.
#
# 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... | mit | 5,613,484,846,963,720,000 | 32.372807 | 120 | 0.681036 | false | Class for holding SKiDL configuration.
Get the path to where the global fp-lib-table file is found.
Load SKiDL configuration from JSON files in given dirs.
Load a backup library that stores the parts used in the circuit.
Prevent creation of output files (netlists, ERC, logs) by this Circuit object.
Set the backup libra... | 2,889 | en | 0.85495 |
iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/x86_components.py | 1 | 69880 | # MODULE: x86-components
# CLASS: x86-system
# CLASS: x86-apic-system
# CLASS: x86-separate-mem-io-system
# CLASS: x86-apic-bus-system
# CLASS: x86-e7520-system
# CLASS: i386-cpu
# CLASS: i486sx-cpu
# CLASS: i486dx2-cpu
# CLASS: pentium-cpu
# CLASS: pentium-mmx-cpu
# CLASS: pentium-pro-cpu
# CLASS: pentium-ii-cpu
# CLA... | gpl-2.0 | -5,586,652,861,325,700,000 | 38.931429 | 101 | 0.557026 | false | MODULE: x86-components CLASS: x86-system CLASS: x86-apic-system CLASS: x86-separate-mem-io-system CLASS: x86-apic-bus-system CLASS: x86-e7520-system CLASS: i386-cpu CLASS: i486sx-cpu CLASS: i486dx2-cpu CLASS: pentium-cpu CLASS: pentium-mmx-cpu CLASS: pentium-pro-cpu CLASS: pentium-ii-cpu CLASS: pentium-iii-cpu CLASS: p... | 2,831 | en | 0.660807 |
bscottm/SublimeHaskell | internals/proc_helper.py | 1 | 9148 | # -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
# ProcHelper: Process execution helper class.
# -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
import errno
import subprocess
import os
import os.path
import SublimeHaskell.sublime_haskell_common as Common
i... | mit | 4,924,986,076,657,667,000 | 41.351852 | 117 | 0.591277 | false | Command and tool process execution helper.
Open a pipe to a command or tool.
Wrapper function for inserting the execution wrapper, e.g., 'cabal exec' or 'stack exec'
:returns: Process object from ProcHelper.
Get root of hs-source-dirs for filename in project.
Generate the augmented PATH for subprocesses: adds the... | 1,787 | en | 0.618715 |
Pytlicek/VOBS | app/controllers/supplier/profile.py | 1 | 1457 | # -*- coding: utf-8 -*-
from flask import render_template, session, redirect, url_for
from app import app
from app.models.Forms import PublicProfile
from app.models.Checks import login_required
from app.models.SQL_DB import User, Item_Profile
@app.route('/supplier/settings/public_profile', methods=['GET', 'POST'])
@... | mit | 9,213,925,581,094,542,000 | 46 | 117 | 0.720659 | false | -*- coding: utf-8 -*- | 21 | en | 0.767281 |
sanjaymandadi/mozu-python-sdk | test/functional_test/security_test/userauthenticator_test.py | 2 | 1389 | import unittest
from mozurestsdk import mozuclient;
from mozurestsdk.security.userauthenticator import UserAuthenticator;
from mozurestsdk import util;
class UserAuthenticator_Test(unittest.TestCase):
def setUp(self):
self.config = util.readConfigFile("c:\projects\mozuconfig.txt");
mozuclient.configure(config="c... | apache-2.0 | -2,910,828,063,572,994,600 | 36.540541 | 79 | 0.74586 | false | 0 | en | 0.110449 | |
tundish/turberfield-utils | turberfield/utils/db.py | 1 | 7983 | #!/usr/bin/env python3
# encoding: UTF-8
# This file is part of turberfield.
#
# Turberfield 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 ve... | gpl-3.0 | 8,149,039,837,599,711,000 | 29.469466 | 85 | 0.525742 | false | * Find target database files
* Load extensions
* Attach databases (readonly?)
* Attach in-memory database
* Execute pragmas
* Discover state tables
* Create state tables
Execute the SQL defined by this class.
Returns the cursor for data extraction.
!/usr/bin/env python3 encoding: UTF-8 This file is part of turberfiel... | 989 | en | 0.829274 |
fnl/pymonad | pymonad/Either.py | 1 | 3330 | # --------------------------------------------------------
# (c) Copyright 2014 by Jason DeLaat.
# Licensed under BSD 3-clause licence.
# --------------------------------------------------------
from pymonad.Monad import *
class Either(Monad):
"""
Represents a calculation that may either fail or succeed.
An altern... | bsd-3-clause | 8,568,344,353,019,406,000 | 28.732143 | 100 | 0.664264 | false | Represents a calculation that may either fail or succeed.
An alternative to using exceptions. `Either` is an abstract type and should not
be instantiated directly. Instead use `Right` (or its alias `Result`) and
`Left` (or its alias `Error`)
Represents a calculation which has failed and contains an error code or messag... | 1,745 | en | 0.861004 |
h-qub/wordeater-web | we-web/tests/unit/rest/users_test.py | 1 | 7620 | # coding=utf-8
from rest_test import *
import api.resources.users.users
__author__ = 'Glebov Boris'
class UserListTest(RestBaseTest):
"""
Test all case for GET: /api/v1/users/
"""
def test_users_list_success(self):
client_app = self.get_app_client()
r = client_app.get('/api/v1/users... | mit | 3,243,931,358,639,282,700 | 26.509025 | 120 | 0.555249 | false | Test all case for POST: /api/v1/users/check/
Test all case for GET: /api/v1/users/
Test all case for POST: /api/v1/users/signin/
Test all case for POST: /api/v1/users/signup/
Test case:
Email is exists
Test case:
Email is not exists
Test case:
Login and Email is not exists
Test case:
Login and Email did... | 752 | en | 0.73127 |
TraceContext/tracecontext-spec | test/tracecontext/tracestate.py | 1 | 2749 | from collections import OrderedDict
import re
class Tracestate(object):
_KEY_WITHOUT_VENDOR_FORMAT = r'[a-z][_0-9a-z\-\*\/]{0,255}'
_KEY_WITH_VENDOR_FORMAT = r'[0-9a-z][_0-9a-z\-\*\/]{0,240}@[a-z][_0-9a-z\-\*\/]{0,13}'
_KEY_FORMAT = _KEY_WITHOUT_VENDOR_FORMAT + '|' + _KEY_WITH_VENDOR_FORMAT
_VALUE_FORMAT = r'[\x20... | apache-2.0 | 5,575,316,123,618,295,000 | 32.52439 | 87 | 0.650782 | false | make this an optional choice instead of enforcement during put/update if the tracestate value size is bigger than 512 characters, the tracer CAN decide to forward the tracestate combined header length MUST be less than or equal to 512 bytes there can be a maximum of 32 list-members in a list | 292 | en | 0.844511 |
nick41496/Beatnik | beatnik/api_manager/api_manager.py | 1 | 3520 | import logging
import os
import spotipy
import sys
from beatnik.api_manager.clients import AppleMusicApi, SoundcloudApi
from beatnik.api_manager.link_converter import LinkConverter
from beatnik.api_manager.link_parser import LinkParser
from beatnik.api_manager.search_handler import SearchHandler
from gmusicapi import ... | gpl-3.0 | 1,703,179,569,399,725,300 | 34.2 | 95 | 0.598295 | false | 0 | en | 0.110449 | |
acshi/osf.io | framework/mongo/utils.py | 1 | 5732 | # -*- coding: utf-8 -*-
import functools
import httplib as http
from django.core.paginator import Paginator
from django.db.models import QuerySet
import markupsafe
import pymongo
from modularodm.query import QueryBase
from modularodm.exceptions import NoResultsFound, MultipleResultsFound
from framework.exceptions im... | apache-2.0 | -1,111,238,550,963,007,200 | 33.323353 | 114 | 0.643057 | false | Decorator to autoload a StoredObject instance by primary key and inject into kwargs. Raises
an appropriate HTTPError (see #get_or_http_error)
:param type Model: database collection model to query (should be a subclass of StoredObject)
:param basestring extract_key: named URL field containing the desired primary key to... | 2,273 | en | 0.667584 |
simphony/simphony-openfoam | foam_controlwrapper/tests/test_run_time.py | 1 | 4123 | import unittest
import os
import shutil
import tempfile
from foam_controlwrapper.blockmesh_utils import create_quad_mesh
from simphony.api import CUDS, Simulation
from simphony.core.cuba import CUBA
from simphony.cuds.meta import api
from simphony.engine import EngineInterface
class WrapperRunTestCase(unittest.Test... | gpl-2.0 | -8,620,174,854,293,740,000 | 35.8125 | 77 | 0.564152 | false | Test that field variable value is changed after
consecutive calls of run method
physics model | 95 | en | 0.944562 |
project-owner/Peppy | player/client/vlcclient.py | 1 | 10907 | # Copyright 2016-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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... | gpl-3.0 | -9,174,182,375,290,047,000 | 31.85241 | 106 | 0.539103 | false | This class extends base player and provides communication with VLC player
using Python binding for 'libvlc' library
Initializer. Starts separate threads for handling VLC events
Return the current song
Return current playlist
:return: current playlist
Return current track time
:return: current track time
Return cu... | 2,163 | en | 0.828943 |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/errors/types/user_data_error.py | 1 | 1227 | # -*- 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 or... | apache-2.0 | -305,280,532,206,740,100 | 30.461538 | 74 | 0.693562 | false | Enum describing possible request errors.
Container for enum describing possible user data errors.
-*- 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... | 686 | en | 0.814456 |
jasonleaster/LeetCode | Largest_Number/ln.py | 1 | 1325 | class number() :
key = 0
bit_list = []
cnt = 0
def num_init(array) :
if array is None :
return;
num_array = []
for i in range(0, len(array)) :
cls_num = number()
tmp = array[i]
cnt = 1
while tmp > 10 :
bit_list = bit_list + [tmp % 10]
... | gpl-2.0 | -8,309,436,790,888,531,000 | 19.075758 | 56 | 0.392453 | false | 0 | en | 0.110449 | |
Connexions/draft-transforms | drafttransform/cli.py | 1 | 3331 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
"""The command-line interface for transforming cnxml files directly in workspace."""
... | agpl-3.0 | 7,051,750,747,463,857,000 | 36.426966 | 100 | 0.567998 | false | !/usr/bin/env python -*- coding: utf-8 -*- Copyright (c) 2013, Rice University This software is subject to the provisions of the GNU Affero General Public License version 3 (AGPLv3). See LICENCE.txt for details. walk workgroup, look over and retrieve cnxmls, transform, then save and optionally publish. cmmd(**vars(ar... | 324 | en | 0.756195 |
mjenrungrot/competitive_programming | UVa Online Judge/12394.py | 1 | 1476 | # =============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 12394.py
# Description: UVa Online Judge - 12394
# =============================================================================
while True:... | mit | -6,404,102,092,147,442,000 | 27.941176 | 79 | 0.436314 | false | ============================================================================= Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/ FileName: 12394.py Description: UVa Online Judge - 12394 ============================================================================= Check number of review... | 357 | en | 0.522705 |
hellysmile/django-iron-sessions | tests/tests.py | 1 | 1986 | # tests stolen from https://github.com/martinrusev/django-redis-sessions
from django.utils.importlib import import_module
from django.conf import settings
import time
from nose.tools import eq_
session_engine = import_module(settings.SESSION_ENGINE).SessionStore()
def test_modify_and_keys():
eq_(session_engine.... | apache-2.0 | 1,653,861,135,497,624,000 | 29.553846 | 75 | 0.678751 | false | tests stolen from https://github.com/martinrusev/django-redis-sessions Python 3.* Test if the expiry age is set correctly def test_load(): session_engine.set_expiry(60) session_engine['item1'], session_engine['item2'] = 1,2 session_engine.save() session_data = session_engine.server.get(session_engine.se... | 391 | en | 0.256742 |
asicontech/software-for-equipment | bfgminer/usbtest.py | 2 | 3439 | #!/usr/bin/env python
# Copyright 2012-2013 Xiangfu
# Copyright 2012-2013 Andrew Smith
# Copyright 2013 Luke Dashjr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the Lice... | apache-2.0 | 6,122,057,605,471,330,000 | 37.640449 | 267 | 0.742658 | false | !/usr/bin/env python Copyright 2012-2013 Xiangfu Copyright 2012-2013 Andrew Smith Copyright 2013 Luke Dashjr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at you... | 1,216 | en | 0.80861 |
skoolkid/pyskool | pyskool/lesson.py | 1 | 21776 | # -*- coding: utf-8 -*-
# Copyright 2008, 2010, 2014, 2015 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool 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 ... | gpl-3.0 | 4,834,191,393,522,992,000 | 41.03861 | 135 | 0.618204 | false | Generates messages to be delivered by whoever is conducting assembly.
There is only one assembly message generator, shared by the whole skool.
Controls the interaction between the teacher, the swot and Eric during a
lesson. The various actions required by the teacher and the swot during a
lesson - such as grassing on E... | 9,490 | en | 0.885152 |
RoboPython/Pykemon | game.py | 1 | 12823 | # Copyright (c) 2010 Brian Gordon
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distri... | gpl-2.0 | 1,011,627,586,971,395,000 | 56.765766 | 188 | 0.613507 | false | Copyright (c) 2010 Brian Gordon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublic... | 5,537 | en | 0.923369 |
pwwang/bioprocs | bioprocs/scripts/imtherapy/pNetMHC.py | 1 | 5476 | from pathlib import Path
from diot import Diot
from bioprocs.utils import shell2 as shell, logger
from bioprocs.utils.parallel import Parallel, distributeList
{%from os import path%}
{%from pyppl.utils import always_list%}
infile = {{i.infile | quote}}
afile = {{i.afile | ?path.isfile | =readlines | !always_lis... | mit | -5,011,356,954,891,710,000 | 37.56338 | 107 | 0.60756 | false | support HLA-A*03:79 -> HLA-A0379 split infile common options merge results | 74 | en | 0.647226 |
minogame/bilinear_tensorflow | src/model.py | 1 | 14668 | import tensorflow as tf
import tensorflow.contrib.layers as cl
from gridconv_v3 import gridconv2d
from deformconv import deformconv2d
from utils import log_weights
# # # # # # # # # CIFAR # # # # # # # # #
# The network is built based on 'NCHW'.
def normal_cnn_cifar(name, reuse=False):
@log_weights
d... | gpl-3.0 | -2,439,001,560,730,617,300 | 45.469256 | 108 | 0.619239 | false | CIFAR The network is built based on 'NCHW'. The network is built based on 'NCHW'. x = gridconv2d(x, scope='Conv1_1', num_outputs=32, kernel_size=[3, 3], stride=1, activation_fn=tf.nn.relu, padding='SAME', data_format='NCHW', normalizer_fn=cl.batch_norm, normalizer_params=bn_params) x = gridconv2... | 2,373 | en | 0.454029 |
jandebleser/django-wiki | src/wiki/conf/settings.py | 1 | 10199 | from __future__ import absolute_import, unicode_literals
import bleach
from django.conf import settings as django_settings
from django.core.files.storage import default_storage
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
#: Should urls be case sensitive?
... | gpl-3.0 | 8,362,595,489,785,991,000 | 31.275316 | 92 | 0.702226 | false | : Should urls be case sensitive? Non-configurable (at the moment): The editor class to use -- maybe a 3rd party or your own...? You can always: extend the built-in editor and customize it!: Whether to use Bleach or not. It's not recommended to turn this off unless: you know what you're doing and you don't want to use t... | 4,321 | en | 0.838537 |
EricsonWillians/PyGameWidgets | examples/long_text_label.py | 1 | 1651 | import sys
sys.path.append("..")
import pygame
import core
import widgets
# Text label example.
WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 728
pygame.init()
pygame.font.init
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
clock = pygame.time.Clock()
FPS = 60
running = True
if __name__ == "__main__":
p... | gpl-3.0 | -231,955,241,589,300,640 | 29.018182 | 112 | 0.625681 | false | Text label example. This is the color of the widget, not to be confused with the color of its text. Altering the margin because of the border. | 142 | en | 0.870149 |
hchauvet/beampy | beampy/statics/default_theme.py | 1 | 4858 | # -*- coding: utf-8 -*-
# Default theme of Beampy
# Main keys of the dict should be the name of the beampy modules or class
# Each modules default options need to be defined here!
THEME = {}
THEME['document'] = {
'format': 'html5', #could be svg // pdf // html5
'width': 800,
'height': 600,
'optimize'... | gpl-3.0 | -2,950,168,247,424,549,000 | 21.490741 | 176 | 0.527995 | false | -*- coding: utf-8 -*- Default theme of Beampy Main keys of the dict should be the name of the beampy modules or class Each modules default options need to be defined here!could be svg // pdf // html5Could be changed to a function that will decorate the current slide with elementsthis can be used to create a specific la... | 604 | en | 0.736128 |
bolkedebruin/airflow | airflow/providers/google/cloud/operators/local_to_gcs.py | 1 | 3617 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 | -7,390,544,169,797,167,000 | 36.28866 | 104 | 0.646945 | false | Uploads a file to Google Cloud Storage.
Optionally can compress the file for upload.
:param src: Path to the local file. (templated)
:type src: str
:param dst: Destination path within the specified bucket, it must be the full file path
to destination object on GCS, including GCS object (ex. `path/to/file.txt`) (te... | 1,871 | en | 0.818686 |
robertz23/code-samples | python scripts and tools/list_intersection.py | 1 | 1200 | """
List intersection: Finds intersections between various lists
"""
def check_intersection(first_list, second_list):
#We use set builtin function to find the intersection between lists
return set(first_list).intersection(second_list)
def create_lists(line):
#receive a line from the file containing asc... | mit | 7,565,693,730,159,266,000 | 32.333333 | 86 | 0.645 | false | We use set builtin function to find the intersection between lists receive a line from the file containing ascending numberseach line is of the form 'n,n,n;n,n,n' where n is a numberand the semi-colon separates the listsMake sure that we have a list of numbers and not numbers and commaslook for the intersectionreturn 0... | 376 | en | 0.861081 |
emanuil-tolev/yugi-sync | yugisync.py | 1 | 1574 | """
Usage: python yugisync.py pull|push
Backs up everything needed to restore your current game options,
deck and card list to a git repository. If the repository is uploaded
to a service like GitHub.com, this will also upload the changes there.
Example: python yugisync.py push on your own laptop and then python... | mit | 7,542,078,908,345,114,000 | 27.735849 | 70 | 0.69568 | false | Usage: python yugisync.py pull|push
Backs up everything needed to restore your current game options,
deck and card list to a git repository. If the repository is uploaded
to a service like GitHub.com, this will also upload the changes there.
Example: python yugisync.py push on your own laptop and then python
yugisync.... | 1,069 | en | 0.900582 |
hjoliver/cylc | cylc/flow/xtriggers/echo.py | 1 | 1143 | # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | gpl-3.0 | -1,211,451,900,558,556,000 | 37.1 | 79 | 0.72091 | false | An xtrigger function that prints its arguments and never succeeds.
This may be a useful aid to understanding how xtriggers work. Try returning
True (success) and some results dict to pass on to dependent tasks.
Returns
tuple: (False, {})
THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. Copyright (C) NIWA & Britis... | 966 | en | 0.904153 |
joseguerrero/sembrando | src/presentacion/librerias/popups.py | 1 | 13668 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from .texto import texto
from .textoci import texto2
from .imgfondo import fondo
TEXT_COLOR2 = (0,0,0)
COLOR_RED = (213, 0, 0)
BAR_COLOR = (151, 0, 172)
TEXT_COLOR = (255, 255, 255)
class Button(pygame.sprite.Sprite):
def __init__(self, identificador, par... | gpl-3.0 | -4,537,053,745,970,449,400 | 47.508897 | 166 | 0.548823 | false | Método inicializador de la clase.
@param identificador: Variable usada para identificar al botón.
@type identificador: str
@param parent: Instancia del gestor de pantallas.
@type parent: Manejador
@param text: Variable que indica el texto que tendrá el botón.
@type text: str
@param fondo: Indica si el fondo del botón... | 2,994 | es | 0.938685 |
SDAquaponics/Software | Arduino/PythonDriver/NotifyAQPServer.py | 1 | 2261 | #! /usr/bin/python
# Import dependencies
import serial, sys, sendmail, decimal
import socket
HOST = "raspberrypi"
PORT = 1981
DEBUG = False;
# Serial port settings
AT_PORT = "/dev/ttyATH0"
AT_BAUD = 115200
# Serial packet structure
MAGIC_1 = 0xA9
MAGIC_2 = 0xBD
MSG_TYPE_REQUEST = 0x00
MSFG_TYPE_RESPONSE = 0x01
MS... | gpl-2.0 | 8,152,229,391,004,637,000 | 20.130841 | 82 | 0.655462 | false | ! /usr/bin/python Import dependencies Serial port settings Serial packet structure Sensor type definitions Check for response Send the network packet to the AQPServer running on the RasPIprint ord(nw_packet[0]), ord(nw_packet[1]), ord(nw_packet[2]), ord(nw_packet[3]) | 267 | en | 0.465162 |
pave/pylint_flask_ext | flask_ext_clean.py | 1 | 5123 | """
Plugin for pylint that tells it about flask's extension classes.
"""
from pylint.utils import PyLintASTWalker
from logilab.astng import MANAGER
from logilab.astng import node_classes
def copy_node_info(src, dest):
"""Copy information from src to dest
Every node in the AST has to have line number information.... | mit | 5,791,808,267,114,807,000 | 36.669118 | 75 | 0.608823 | false | AST Visitor that looks for flask.ext imports and rewrites them
This is something like the Visitor Pattern. For every Foo node in
the AST, PyLintASTWalker will call visit_foo.
Copy information from src to dest
Every node in the AST has to have line number information. Get
the information from the old stmt.
Pylint call... | 1,838 | en | 0.872183 |
VRaviTheja/SDN-policy | flowgenerator/random_ports.py | 1 | 1532 | import random
import socket
import struct
from random import randint
def port_generator():
lim=1000
port_src_start = []
port_src_end = []
port_dst_start = []
port_dst_end = []
for i in range (0,lim):
m = random.randint(1, 200)
n = random.randint(1, 200)
i... | apache-2.0 | 9,052,464,247,601,924,000 | 28.64 | 71 | 0.498695 | false | 0 | en | 0.110449 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.