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
rep/hpfeeds
tests/test_client_integration_py2.py
1
1398
import logging import threading import unittest from hpfeeds import client from hpfeeds.protocol import readpublish from .fakebroker import FakeBroker, setup_default_reactor class TestClientIntegration(unittest.TestCase): log = logging.getLogger('hpfeeds.testserver') def _server_thread(self): self...
gpl-3.0
5,969,301,653,231,483,000
25.377358
76
0.633763
false
0
en
0.110449
geosim/QAD
qad_joindisjoin_cmd.py
1
25015
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin comando JOIN e DISJOIN per aggregare e disgregare le geometrie (multipoint, multilinestring, poligon e multipoligon) ------------------- be...
gpl-3.0
-2,137,112,879,578,955,000
39.693811
139
0.577587
false
Aggiunge il set di entità al punto da modificare Aggiunge il set di entità al poligono da modificare Aggiunge il set di entità alla polilinea da modificare Sconnette la sotto-geometria corrente del poligono da modificare creando una nuova entità istanzia un nuovo comando dello stesso tipo istanzia un nuovo comando del...
5,816
it
0.871975
pointhi/kicad-footprint-generator
scripts/Packages/Package_Gullwing__QFP_SOIC_SO/ipc_gullwing_generator.py
1
30745
#!/usr/bin/env python3 import sys import os import argparse import yaml import math sys.path.append(os.path.join(sys.path[0], "..", "..", "..")) # load parent path of KicadModTree from KicadModTree import * # NOQA from KicadModTree.nodes.base.Pad import Pad # NOQA sys.path.append(os.path.join(sys.path[0], "..", "...
gpl-3.0
-423,376,989,085,531,260
46.574303
199
0.557056
false
!/usr/bin/env python3 load parent path of KicadModTree NOQA NOQA load parent path of toolsToDo: find a settings file that can contain these. Zmax = Lmin + 2JT + √(CL^2 + F^2 + P^2) Gmin = Smax − 2JH − √(CS^2 + F^2 + P^2) Xmax = Wmin + 2JS + √(CW^2 + F^2 + P^2) Some manufacturers do not list the terminal spacing (S) in ...
742
en
0.488213
drwahl/pimometer
bin/mongo_config.py
1
5605
#!/usr/bin/env python # vim: set expandtab: """ ********************************************************************** GPL License *********************************************************************** This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Lic...
gpl-2.0
-256,066,831,566,277,950
29.966851
90
0.603211
false
!/usr/bin/env python vim: set expandtab: sometimes, we get a string instead of a NoneType
89
en
0.340232
SUSE/kiwi
kiwi/utils/sysconfig.py
1
2856
# 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
-2,067,535,882,005,381,400
33
70
0.572129
false
**Read and Write sysconfig style files** :param str source_file: source file path Read file into a list and a key/value dictionary Only lines which are not considered a comment and containing the structure key=value are parsed into the key/value dictionary. In order to keep the order of lines a list is stored too. Th...
1,148
en
0.920233
lucadealfaro/crowdranker
controllers/feedback.py
1
10966
# -*- coding: utf-8 -*- import access import util @auth.requires_login() def index(): """Produces a list of the feedback obtained for a given venue, or for all venues.""" venue_id = request.args(0) if venue_id == 'all': q = (db.submission.user == get_user_email()) else: q = ((db.su...
bsd-3-clause
-9,091,172,184,251,331,000
45.66383
138
0.621922
false
Produces a list of the feedback obtained for a given venue, or for all venues. Shows detailed feedback for a user in a venue. This controller accepts various types of arguments: * 's', submission_id * 'u', venue_id, username * 'v', venue_id (in which case, shows own submission to that venue) This controller displays ...
824
en
0.857404
gabrielmagno/nano-dlna
nanodlna/dlna.py
1
1582
#!/usr/bin/env python3 # encoding: UTF-8 import os import pkgutil import sys from xml.sax.saxutils import escape as xmlescape if sys.version_info.major == 3: import urllib.request as urllibreq else: import urllib2 as urllibreq def send_dlna_action(device, data, action): action_data = pkgutil.get_data( ...
mit
4,625,877,574,989,528,000
27.763636
78
0.616941
false
!/usr/bin/env python3 encoding: UTF-8
37
en
0.289315
morevnaproject/RenderChan
renderchan/contrib/pencil2d.py
1
5111
__author__ = 'Konstantin Dmitriev' from renderchan.module import RenderChanModule from renderchan.utils import is_true_string from distutils.version import StrictVersion import subprocess import tempfile import os from xml.etree import ElementTree class RenderChanPencil2dModule(RenderChanModule): def __init__(s...
bsd-3-clause
-8,211,885,996,274,041,000
43.443478
285
0.576208
false
Extra paramsdefault value The CLI features depend on the version The exporting of a fake file is a workaround for older versions which just start the program when passed only -v Get the version from stdout. An example of the output: "Pencil2D 0.6.0\n" We don't actually have to do anything here because there are no depe...
472
en
0.871764
eggplantbren/NSwMCMC
python/straightline2.py
1
2303
import copy import numpy as np import numpy.random as rng import scipy.special from utils import randh from numba import jit # How many parameters are there? num_params = 4 # Some data data = np.loadtxt("road.txt") N = data.shape[0] # Number of data points # Plot the data import matplotlib.pyplot as plt plt.plot(dat...
gpl-2.0
5,760,810,357,822,276,000
22.989583
87
0.6231
false
A function to generate parameter values from the prior. Returns a numpy array of parameter values. Evaluate the (log of the) likelihood function Evaluate the (log of the) prior distribution Generate new values for the parameters, for the Metropolis algorithm. How many parameters are there? Some data Number of data po...
725
en
0.556984
kennedyshead/home-assistant
tests/helpers/test_entity_registry.py
1
32162
"""Tests for the Entity Registry.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.const import EVENT_HOMEASSISTANT_START, STATE_UNAVAILABLE from homeassistant.core import CoreState, callback, valid_entity_id from homeassistant.exceptions import MaxLengthExc...
apache-2.0
2,473,947,555,476,688,400
32.819138
88
0.631864
false
Return an empty, loaded, registry. Test that entity_id is returned. Test that registering entry triggers a save. Test that we don't create entity id that currently exists. Test that we don't create entity id that are already registered. Test that suggested_object_id works. Test that we don't generate an entity id that ...
860
en
0.930769
ActiveState/code
recipes/Python/286240_Python_portscanners/recipe-286240.py
1
3523
# a simple portscanner with multithreading import socket as sk import sys import threading MAX_THREADS = 50 def usage(): print "\npyScan 0.1" print "usage: pyScan <host> [start port] [end port]" class Scanner(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) ...
mit
749,350,839,647,121,400
26.523438
74
0.518024
false
a simple portscanner with multithreading host and port build up the socket obj connect to the given host:port arguments vector start port and end port host name check the arguments a simple portscanner with multithreading QUEUE BASED VERSION queues for (host, port) connect to the given host:port set the CLOSED flag
316
en
0.761233
bacaldwell/ironic
ironic/tests/unit/common/test_image_service.py
1
16700
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
4,742,086,651,356,532,000
47.688047
78
0.627365
false
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under th...
546
en
0.872906
CommonsCloud/Core-API
CommonsCloudAPI/models/user.py
1
8946
""" For CommonsCloud copyright information please see the LICENSE document (the "License") included with this software package. This file may not be used in any manner except in compliance with the License Unless required by applicable law or agreed to in writing, software distributed under the License is distributed ...
agpl-3.0
2,422,971,609,378,438,700
28.331148
145
0.705455
false
Before updating any information we first have to load the User object for the user we wish to act upon. To make extra sure that one user doesn't update another by sending an alertnative 'id' through with the post request. We only act on the `current_user` as defined by the security module. For CommonsCloud copyright in...
1,002
en
0.857424
mjschultz/redlock
tests/test_lock.py
1
1801
from redlock import RedLock import time def test_default_connection_details_value(): """ Test that RedLock instance could be created with default value of `connection_details` argument. """ lock = RedLock("test_simple_lock") def test_simple_lock(): """ Test a RedLock can be acquired. ...
mit
3,412,506,755,901,172,000
26.707692
84
0.62965
false
Test a RedLock can be released by the context manager automically. Test that RedLock instance could be created with default value of `connection_details` argument. Test a RedLock can be acquired. Now lock1 has expired, we can accquire a lock
243
en
0.909404
chme/plugin.audio.mpdclient2
mpdclient/Navigation.py
1
19566
# # Copyright (c) chme # # This file is part of the mpdclient kodi plugin # # This plugin is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of # the License, or (at your option) any later ...
gpl-3.0
-9,181,020,625,052,426,000
39.342268
163
0.525759
false
Copyright (c) chme This file is part of the mpdclient kodi plugin This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This plug...
2,203
en
0.615772
Psycojoker/hackeragenda
hackeragenda/settings.py
1
5897
# Django settings for hackeragenda project. import os from collections import OrderedDict PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0]) SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0] BASE_DIR = PROJECT_PATH # to avoid stupid warning from django 1.6 DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ...
gpl-3.0
-9,104,221,644,388,092,000
21.76834
72
0.575886
false
Django settings for hackeragenda project. to avoid stupid warning from django 1.6 ('Your Name', 'your_email@example.com'), http://en.wikipedia.org/wiki/List_of_tz_zones_by_name http://www.i18nguy.com/unicode/language-identifiers.html 'APP_DIRS': True, Needed for the admin interface Python dotted path to the WSGI applic...
353
en
0.559308
mbr/flatland0
tests/schema/test_dicts.py
1
17601
from flatland import ( Dict, Integer, String, SparseDict, Unset, ) from flatland.util import Unspecified, keyslice_pairs from tests._util import ( asciistr, udict, unicode_coercion_available, ) import six import pytest def test_dict(): with pytest.raises(TypeError): Dict()...
mit
-5,521,041,941,222,855,000
25.075556
77
0.546276
false
the values are unhashable Elements, so this is a little painful a mini test, this policy thing may get whacked stub
115
en
0.54311
wooga/airflow
tests/providers/microsoft/azure/operators/test_file_to_wasb.py
1
2779
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-3,118,337,514,945,456,000
33.308642
87
0.635121
false
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file...
752
en
0.883564
lizardsystem/lizard-map
lizard_map/daterange.py
1
2259
"""Handle the date range setting and remembering """ import datetime import logging from django.conf import settings import pytz # NOTE: this module is obsolete as date ranges are entirely handled in # javascript and should be passed as request parameter logger = logging.getLogger(__name__) # Session data postfix...
lgpl-3.0
-1,085,294,113,683,170,700
29.527027
78
0.698539
false
Return the current period, either default or from session. TODO: mix together with current_start_end_dates (but is has a lot of impact) Return the current start datetime and end datetime. If for_form is True, this function returns the datetime's as a dictionary so the client can pass that directly into a form class. ...
930
en
0.782232
mlperf/training_results_v0.5
v0.5.0/nvidia/submission/code/object_detection/pytorch/maskrcnn_benchmark/config/defaults.py
1
11814
# # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # Copyright (c) 2017-2018, NVIDIA CORPORATION. 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 a...
apache-2.0
-2,606,254,840,766,577,000
38.777778
83
0.604706
false
Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. Copyright (c) 2017-2018, NVIDIA CORPORATION. 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....
7,537
en
0.670215
ajaygarg84/sugar
src/jarabe/frame/activitiestray.py
1
30803
# Copyright (C) 2006-2007 Red Hat, Inc. # Copyright (C) 2008 One Laptop Per Child # Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> # # 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 Foundati...
gpl-2.0
-8,059,462,500,647,446,000
36.610501
79
0.610103
false
Button with a notification attached Base palette class for frame or notification icon for file transfers UI element representing an ongoing incoming file transfer Palette for frame or notification icon for incoming file transfers Invite to shared activity Palette for frame or notification icon for i...
1,773
en
0.864094
explora26/zephyr
doc/conf.py
1
14566
# -*- coding: utf-8 -*- # # Zephyr documentation build configuration file, created by # sphinx-quickstart on Fri May 8 11:43:01 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
apache-2.0
-3,894,528,861,728,211,000
32.405963
84
0.682595
false
-*- coding: utf-8 -*- Zephyr documentation build configuration file, created by sphinx-quickstart on Fri May 8 11:43:01 2015. This file is execfile()d with the current directory set to its containing dir. Note that not all possible configuration values are present in this autogenerated file. All configuration values h...
8,429
en
0.678557
0xbc/pyvex
setup.py
1
5029
# pylint: disable=no-name-in-module,import-error import os import urllib2 import subprocess import sys import shutil import glob import tarfile import multiprocessing import platform try: from setuptools import setup from setuptools import find_packages packages = find_packages() except ImportError: fr...
bsd-2-clause
5,826,168,124,604,355,000
32.751678
140
0.616624
false
pylint: disable=no-name-in-module,import-error can also be vex-amd64-linux linux_* platform tags are disallowed because the python ecosystem is fubar linux builds should be built in the centos 5 vm for maximum compatibility https://www.python.org/dev/peps/pep-0425/
265
en
0.693586
eonpatapon/contrail-controller
src/config/fabric-ansible/job_manager/job_messages.py
1
9479
class MsgBundle(object): JOB_TEMPLATE_MISSING = 1, JOB_EXECUTION_ID_MISSING = 2, JOB_SUMMARY_MESSAGE_HDR = 3, JOB_RESULT_STATUS_NONE = 4, JOB_MULTI_DEVICE_FAILED_MESSAGE_HDR = 5, JOB_SINGLE_DEVICE_FAILED_MESSAGE_HDR = 6, PLAYBOOK_RESULTS_MESSAGE = 7, PLAYBOOK_EXIT_WITH_ERROR = 8, PL...
apache-2.0
-8,469,327,516,854,512,000
51.661111
78
0.450364
false
0
en
0.110449
vitchyr/rlkit
rlkit/torch/sac/sac.py
1
8191
from collections import OrderedDict, namedtuple from typing import Tuple import numpy as np import torch import torch.optim as optim from rlkit.core.loss import LossFunction, LossStatistics from torch import nn as nn import rlkit.torch.pytorch_util as ptu from rlkit.core.eval_util import create_stats_ordered_dict fro...
mit
-7,586,187,944,391,447,000
30.026515
99
0.553534
false
Use heuristic value from SAC paper Compute statistics using only one batch per epoch
84
en
0.619501
pythondude325/flaskr
flaskr.py
1
3871
from postmarkup import render_bbcode from sqlite3 import connect from contextlib import closing from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash # config DATABASE = 'flaskr.db' DEBUG = True SECRET_KEY = 'devkey' USERNAME = 'admin' PASSWORD = 'default' # create app app = F...
mit
-5,481,024,899,938,952,000
29.007752
113
0.612245
false
config create app app.config.from_envvar('FLASKR_CONF') database functions request functions routes this should never happen boiler plate
137
en
0.558209
medularis/py-star
py_star/astemu.py
1
4712
from __future__ import absolute_import, print_function, unicode_literals from os import fork, kill, waitpid from signal import SIGTERM import socket from time import sleep from . import compat_six as six class Event(dict): """ Events are encoded as dicts with a header fieldname to content-list map. Norm...
bsd-3-clause
8,920,116,669,416,906,000
32.41844
73
0.493633
false
Emulator for asterisk management interface. Used for unittests of :mod:`py_star.manager`. Now factored into a standalone module for others to use in unittests of programs that build on :mod:`py_star.manager`. By default let the operating system decide the port number to bind to, resulting port is stored in self.port. E...
1,004
en
0.883002
cherokee/pyscgi
CTK/ProgressBar.py
1
1975
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010-2011 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation....
bsd-3-clause
-5,721,624,957,532,368,000
28.924242
90
0.620759
false
CTK: Cherokee Toolkit Authors: Alvaro Lopez Ortega <alvaro@alobbs.com> Copyright (C) 2010-2011 Alvaro Lopez Ortega This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is dis...
739
en
0.868478
jabaier/iic1103.20152.s5
strings_listas_ej0.py
1
1320
# defina una función que dado una lista de numeros # retorne la suma de ellos def sumalista(l): # calcula l[0] + l[1] + l[2] + ... + l[??] # el largo de la lista l se obtiene con len(l) suma = 0 i = 0 while i < len(l): suma = suma + l[i] i = i + 1 return suma def sumalista_cool(l): ...
unlicense
-7,947,223,740,876,585,000
19.292308
62
0.541319
false
defina una función que dado una lista de numeros retorne la suma de ellos calcula l[0] + l[1] + l[2] + ... + l[??] el largo de la lista l se obtiene con len(l)
159
es
0.846939
jalavik/plotextractor
plotextractor/converter.py
1
7853
# -*- coding: utf-8 -*- # # This file is part of plotextractor. # Copyright (C) 2010, 2011, 2015 CERN. # # plotextractor 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 (a...
gpl-2.0
7,425,665,071,529,268,000
36.754808
84
0.605246
false
Was that tarball also gzipped? Let's find out! @param: file (string): the name of the object (so we can gunzip, if that's necessary) @output: a gunzipped file in the directory of choice, if that's necessary @return new_file (string): The name of the file after gunzipping or the original name of the file if ...
3,327
en
0.915722
jminuscula/dixit-online
server/src/dixit/api/game/views/player.py
1
2333
from django.db import IntegrityError from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.exceptions import NotFound from rest_framework.response import Response from rest_framework import generics, status from dixit.game.models import Player from ...
mit
-6,770,100,734,929,883,000
32.811594
100
0.675954
false
Implements Player list actions - GET list of players for a game - POST a new player t oa game from a player name Implements Player retrieve action - GET player for game
180
en
0.962741
kasra-hosseini/obspyDMT
obspyDMT/tests/test_input_handler.py
1
6739
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Filename: test_input_handler.py # Purpose: testing input_handler # Author: Kasra Hosseini # Email: kasra.hosseinizad@earth.ox.ac.uk # License: GPLv3 # ----------------------------...
gpl-3.0
-1,119,200,854,747,404,200
39.113095
79
0.599644
false
!/usr/bin/env python -*- coding: utf-8 -*- ------------------------------------------------------------------- Filename: test_input_handler.py Purpose: testing input_handler Author: Kasra Hosseini Email: kasra.hosseinizad@earth.ox.ac.uk License: GPLv3 ----------------------------------------------...
702
en
0.206879
ixaxaar/sdcc
support/regression/compact-results.py
1
1999
import sys, re import string """Simple script that scans all of the test suite results text fed in through stdin and summarises the total number of failures, test points, and test cases.""" # Read in everything lines = sys.stdin.readlines() # Init the running totals failures = 0 cases = 0 tests = 0 bytes = 0 ticks =...
gpl-2.0
9,146,120,504,725,573,000
29.287879
99
0.568284
false
Read in everything Init the running totals hack for valdiag --- Running: gen/ucz80/longor/longor in case the test program crashes before the "--- Running" message '--- Summary: f/t/c: ...', where f = failures, t = test points, c = test cases. '--- Simulator: b/t: ...', where b = bytes, t = ticks Stop at 0x000228: ...
352
en
0.664222
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/celery/backends/database/session.py
1
1896
# -*- coding: utf-8 -*- """SQLAlchemy session.""" from __future__ import absolute_import, unicode_literals from kombu.utils.compat import register_after_fork from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.pool import ...
apache-2.0
277,522,112,381,838,560
30.6
78
0.634494
false
Manage SQLAlchemy sessions. SQLAlchemy session. -*- coding: utf-8 -*-
71
en
0.485331
tensorflow/compression
tensorflow_compression/python/util/packed_tensors.py
1
3070
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-766,657,654,993,320,700
30.979167
80
0.657003
false
Packed representation of compressed tensors. This class can pack and unpack several tensor values into a single string. It can also optionally store a model identifier. The tensors currently must be rank 1 (vectors) and either have integer or string type. A model identifier. Packs `Tensor` values into this object. Th...
1,137
en
0.859527
wzin/interactivespaces-python-api
tests/test_master.py
1
13234
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from mock import MagicMock import json import urllib import urllib2 import sys import os sys.path.append(os.getcwd()) import interactivespaces TEST_ACTIVITY_DATA = { "id":"53", "bundleContentHash":"hjkl", ...
apache-2.0
-5,224,145,098,743,237,000
36.174157
102
0.504458
false
Test a valid call to Master._api_get_html(). Test a valid call to Master._api_get_json(). Test a valid call to Master._api_post_html(). Test a valid call to Master._api_post_json(). Test construction with valid arguments. Test Master.get_activities() with no pattern. Helper for testing collection getters. Test Master.g...
644
en
0.418096
yollamttam/WordPrediction
EntropyBenchmarkUnigram.py
1
1302
import nltk import glob import pickle import numpy as np from fann2 import libfann ### Unigram perplexity # obvious alpha = 0.5 nExamples = 0 fileToEntropy = {} # load pickle wordsInOrder = pickle.load( open( "wordsInOrder.p", "rb" ) ) wordProb = pickle.load( open( "wordProbability.p", "rb" ) ) # load neural netwo...
apache-2.0
2,327,401,023,340,730,000
21.448276
62
0.659754
false
Unigram perplexity obvious load pickle load neural network loop through tokens
80
en
0.856541
luiscape/hdxscraper-violation-documentation-center-syria
app/__main__.py
1
1039
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0] dir = os.path.join(dir, 'scripts') sys.path.append(dir) from setup.load import LoadConfig from utilities.prompt_format import item from utilities.database import CleanTable, StoreRecord...
mit
3,159,288,300,322,429,400
21.106383
68
0.668912
false
!/usr/bin/python -*- coding: utf-8 -*- Clean table and store new records. Loading configuration and running program.
116
en
0.821407
sfjuocekr/PokeIV
setup.py
1
1764
#!/usr/bin/env python #-- Setup file for py2exe from distutils.core import setup import py2exe import sys, os import Cryptodome import requests #find POGOProtos sys.path.append("pgoapi\protos") mydata = list() path = Cryptodome.__path__[0] root_end = path.find('Cryptodome') for folder,folder_name,files in os.walk(p...
mit
1,747,010,191,501,326,800
29.413793
78
0.560091
false
!/usr/bin/env python-- Setup file for py2exefind POGOProtos
59
en
0.141693
Matla/Python_Logging
logging/logging.py
1
6683
__author__ = "Mats Larsen" __copyright__ = "Mats Larsen2014" __credits__ = ["Morten Lind"] __license__ = "GPL" __maintainer__ = "Mats Larsen" __email__ = "matsla@{ntnu.no}" __status__ = "Development" #-------------------------------------------------------------------- #File: logging.py #Module Description """ This mod...
gpl-3.0
-5,752,381,826,589,844,000
38.081871
102
0.540326
false
Exception class. This class create an instance to logging in a custom mode. This mode will lock the data from the ft-sensor This mode will log the joint angels. Returning the name of the instance. Print a message, and track, where the log is invoked Input: -msg: message to be printed, '' -log_level: informationlevel ...
1,677
en
0.613588
emedvedev/st2
st2actions/st2actions/runners/windows_command_runner.py
1
4081
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
-9,076,009,354,234,646,000
38.621359
92
0.627542
false
Runner which executes commands on a remote Windows machine. :param timeout: Action execution timeout in seconds. :type timeout: ``int`` Licensed to the StackStorm, Inc ('StackStorm') under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding ...
1,249
en
0.8673
psathyrella/partis
bin/add-seqs-to-outputs.py
1
5004
#!/usr/bin/env python import csv import os import sys csv.field_size_limit(sys.maxsize) # make sure we can write very large csv fields import argparse import operator import colored_traceback.always import collections # if you move this script, you'll need to change this method of getting the imports partis_dir = os....
gpl-3.0
3,960,263,518,355,998,000
63.153846
391
0.733613
false
!/usr/bin/env python make sure we can write very large csv fields if you move this script, you'll need to change this method of getting the imports why tf isn't this printing the defaults? raise Exception('too many clusters %d in the partition overlaps with sequences from the fasta file' % len(clusters_with_overlap)) t...
381
en
0.967614
adityahase/frappe
frappe/core/doctype/navbar_settings/navbar_settings.py
1
1160
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class NavbarSettings(Document): def validate(self): self.validat...
mit
5,117,916,987,784,409,000
28
89
0.735345
false
-*- coding: utf-8 -*- Copyright (c) 2020, Frappe Technologies and contributors For license information, please see license.txt
126
en
0.746347
Julian/home-assistant
homeassistant/components/notify/pushbullet.py
1
4409
""" PushBullet platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.pushbullet/ """ import logging from homeassistant.components.notify import ( ATTR_TARGET, ATTR_TITLE, BaseNotificationService) from homeassistant.con...
mit
-4,096,327,190,134,021,000
33.992063
78
0.604445
false
Implement the notification service for Pushbullet. Initialize the service. Get the PushBullet notification service. Refresh devices, contacts, etc. pbtargets stores all targets available from this pushbullet instance into a dict. These are PB objects!. It sacrifices a bit of memory for faster processing at send_messag...
1,354
en
0.868697
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/contrib/gis/db/models/functions.py
1
16962
from decimal import Decimal from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField from django.contrib.gis.db.models.sql import AreaField, DistanceField from django.contrib.gis.geos import GEOSGeometry from django.core.exceptions import FieldError from django.db.models import ( BooleanFiel...
apache-2.0
7,931,150,428,917,694,000
35.24359
117
0.635538
false
By default, Decimal values are converted to str by the SQLite backend, which is not acceptable by the GIS functions expecting numeric values. Ensure that value expressions are geometric. Ensure that expressions are geometric. Automatic SRID conversion so objects are comparable. No version parameter Geometry fields wi...
799
en
0.740059
himaaaatti/qtile
libqtile/widget/backlight.py
1
3044
# Copyright (c) 2012 Tim Neumann # Copyright (c) 2012, 2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig # # 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 wit...
mit
7,803,237,369,298,870,000
32.822222
79
0.638962
false
A simple widget to show the current brightness of a monitor. Copyright (c) 2012 Tim Neumann Copyright (c) 2012, 2014 Tycho Andersen Copyright (c) 2013 Tao Sauvage Copyright (c) 2014 Sean Vig Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation file...
1,213
en
0.853432
raphaelrubino/nid
nn/mono/run.py
1
1143
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np np.random.seed( 1337 ) import data_utils from nid import Neural_information_density import sys if __name__ == '__main__': if len( sys.argv ) != 9: print( "\nUsage: ", sys.argv[ 0 ], "<context> <target> <voc...
mit
8,807,348,404,547,177,000
26.878049
138
0.677165
false
!/usr/bin/env python3 -*- coding: utf-8 -*-, max_features )
59
en
0.286224
komuW/sewer
sewer/catalog.py
1
2472
import codecs, importlib, json, os from typing import Dict, List, Sequence from .auth import ProviderBase class ProviderDescriptor: def __init__( self, *, name: str, desc: str, chals: Sequence[str], args: Sequence[Dict[str, str]], deps: Sequence[str], ...
mit
-5,405,137,072,739,433,000
30.692308
91
0.59021
false
initialize a driver descriptor from one item in the catalog intialize a catalog from either the default catalog.json or one named by filepath return the ProviderDescriptor that matches name return the list of items in the catalog, sorted by name return the class that implements this driver return the class that impleme...
378
en
0.685087
wienerschnitzel/schnitzelserver
schnitzelserver/session/session.py
1
4940
import logging import enum from sqlalchemy import or_ from sqlalchemy import inspect from schnitzelserver.moduleindex import ModuleIndex from schnitzelserver.session.grant_access import SessionGrant from schnitzelserver.pool import ModelPool, ViewPool logger = logging.getLogger(__name__) class AccessTypes(enum.Enum...
lgpl-3.0
7,753,447,680,131,350,000
38.846774
114
0.591498
false
A Schnitzel Session Check user rights on a given model :param model_name: :param field_name: :param model_id: :return: set of access_rights at maximum: {'read', 'write', 'create', 'delete'} Query local Query database cache for rule in rules: grants.add( (rule.model_id, rule.field_name, rule.access_type)) ...
402
en
0.571325
cprakashagr/PythonClass
src/maths/Haversine.py
1
1450
from math import radians, cos, sin, asin, sqrt import time current_milli_time = lambda: int(round(time.time() * 1000)) def haversine(point1, point2, miles = False): AVG_EARTH_RADIUS = 6371 lat1, lng1 = point1 lat2, lng2 = point2 # convert all latitudes/longitudes from decimal degrees to radians ...
mit
-8,202,962,493,890,972,000
22.015873
73
0.570345
false
convert all latitudes/longitudes from decimal degrees to radians calculate haversine in miles lyon = (45.7597, 4.8422) paris = (48.8567, 2.3508) Saroj Snapwiz print i time.sleep(5) start = time.time() print (haversine(lyon, paris, miles=True)) end = time.time() print "%.20f" % start-end
287
en
0.412912
dedupeio/dedupe-examples
pgsql_big_dedupe_example/pgsql_big_dedupe_example_init_db.py
1
10090
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a setup script for mysql_example. It downloads a zip file of Illinois campaign contributions and loads them in t aMySQL database named 'contributions'. __Note:__ You will need to run this script first before execuing [mysql_example.py](http://datamade.github.c...
mit
-596,923,599,316,805,100
39.522088
87
0.615461
false
This is a setup script for mysql_example. It downloads a zip file of Illinois campaign contributions and loads them in t aMySQL database named 'contributions'. __Note:__ You will need to run this script first before execuing [mysql_example.py](http://datamade.github.com/dedupe-examples/docs/mysql_example.html). Tabl...
735
en
0.790896
yunli2004/OpenClos
jnpr/openclos/util.py
2
8115
''' Created on Aug 21, 2014 @author: moloyc ''' import re import os import yaml import platform import datetime import shutil from netaddr import IPNetwork import netifaces from propLoader import propertyFileLocation TWO_STAGE_CONFIGURATOR_DEFAULT_ATTEMPT=5 TWO_STAGE_CONFIGURATOR_DEFAULT_INTERVAL=30 # in seconds TWO...
apache-2.0
3,603,975,910,876,883,000
29.855513
107
0.616266
false
in seconds in secondsreturn 'ubuntu' in platform.platform().lower()return 'centos' in platform.platform().lower()
113
en
0.347873
xncbf/authome
log/views.py
1
3426
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.staticfiles.templatetags.staticfiles import static from django.urls import reverse from django.db import connection from django.shortcuts import render, HttpResponse from django.utils import timezon...
mit
8,670,323,591,795,827,000
43.763158
118
0.496179
false
0
en
0.110449
LabD/wagtail-personalisation
tests/factories/rule.py
1
1032
from __future__ import absolute_import, unicode_literals import datetime import factory from wagtail_personalisation import rules class DayRuleFactory(factory.DjangoModelFactory): class Meta: model = rules.DayRule class DeviceRuleFactory(factory.DjangoModelFactory): class Meta: model = ...
mit
6,287,791,869,828,322,000
18.471698
59
0.719961
false
0
en
0.110449
jfrfonseca/IndexadorDidaticoPython
fileIO.py
1
11925
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' José F. R. Fonseca See Attached License file Controls the access to the disk. Defines the class DIskAccessControl, an object to control the disk files. Multithread-writes the files ''' import ast import os import time from linecache import getline from threading impor...
gpl-2.0
-3,419,447,673,354,494,500
49.312236
126
0.617243
false
!/usr/bin/env python -*- coding: utf-8 -*- @IgnorePep8 loads the name of the index file if there is a parameter fileLen, uses it. if not, counts the number of lines in the indexFile print "GETTING THE FILE OF LINES!" reads every line, and counts the number of lines in the index file @IgnorePep8 if there is a parameter...
3,560
en
0.87835
uberVU/elasticboard
data_processor/api.py
1
7727
from functools import partial, wraps import datetime import queries from utils import crossdomain from flask import Flask, jsonify, request from werkzeug.contrib.cache import MemcachedCache cache = MemcachedCache(['127.0.0.1:11211']) CACHE_TIMEOUT = 5 * 60 app = Flask(__name__) # app.debug = True CHART_INTERVALS = 6...
mit
-6,479,771,487,385,263,000
31.330544
116
0.671541
false
app.debug = True http://flask.pocoo.org/docs/patterns/viewdecorators/caching-decorator using full path for get params api endpoints that call the queries
153
en
0.676709
elhe/bread_diary_web
application/views.py
1
1189
from application import application, utils from application.urls import DIARY_ADD_URL, DIARY_ALL_URL from dateutil.parser import parser from flask import render_template, request, url_for from werkzeug.utils import redirect __author__ = 'elhe' @application.route('/', methods=['GET', ]) def index(): response = ...
gpl-2.0
5,933,237,861,314,215,000
35.030303
71
0.637511
false
0
en
0.110449
jaseg/python-mpv
setup.py
1
1155
#!/usr/bin/env python3 from setuptools import setup setup( name = 'python-mpv', version = '0.5.1', py_modules = ['mpv'], description = 'A python interface to the mpv media player', url = 'https://github.com/jaseg/python-mpv', author = 'jaseg', author_email = 'github@jaseg.net', license ...
agpl-3.0
5,502,061,537,492,389,000
34
93
0.575758
false
!/usr/bin/env python3
21
fr
0.448822
cstrong/ProjectCost
app/__init__.py
1
1110
######################################### # # Project Cost project # # pyapp/__init__.py # ######################################### from flask import Flask from flask.ext.bootstrap import Bootstrap # Monkey patch to make flask-triangle work, since it is not yet compatible with python3 import builtins builtins.unicod...
mit
2,145,066,538,203,652,400
23.130435
87
0.672973
false
Project Cost project pyapp/__init__.py Monkey patch to make flask-triangle work, since it is not yet compatible with python3 register resources
143
en
0.84137
mahabuber/erpnext
erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2
26538
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, flt from frappe import _, msgprint, throw from erpnext.accounts.party import get_par...
agpl-3.0
6,422,347,278,987,420,000
35.204638
153
0.685771
false
Set against account for debit to account Set indicator for portal Set retail related fields from POS Profiles check in manage account if sales order / delivery note required or not. Links invoice and advance voucher: 1. cancel advance voucher 2. split into multiple rows if partially adjusted, assign aga...
1,458
en
0.69915
ahwillia/PyNeuron-Toolbox
PyNeuronToolbox/neuromorpho.py
1
5790
""" Scraper for querying NeuroMorpho.Org from Python. For more on NeuroMorpho.Org, see: Ascoli GA, Donohue DE, Halavi M. (2007) NeuroMorpho.Org: a central resource for neuronal morphologies.J Neurosci., 27(35):9247-51 Run this file as a stand-alone script for a demo. The demo queries NeuroMorpho.Org in gener...
mit
-963,203,165,447,386,800
35.19375
137
0.647323
false
figure out if category is a cell type, species, or region check the cached sets first no luck: try all three options remove non-breaking spaces remove units locate the path to the downloads
189
en
0.720031
cloudify-cosmo/cloudify-cli
cloudify_cli/tests/commands/test_deployments.py
1
48285
######## # Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-2,392,071,210,047,672,000
40.339897
79
0.589334
false
Copyright (c) 2018 Cloudify Platform Ltd. 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 ag...
1,236
en
0.905241
Scille/parsec-cloud
parsec/backend/vlob.py
1
13190
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS from typing import List, Tuple, Dict, Optional from uuid import UUID import pendulum from parsec.utils import timestamps_in_the_ballpark from parsec.api.protocol import ( DeviceID, OrganizationID, vlob_create_serializer, v...
agpl-3.0
-1,780,366,703,321,259,500
31.407862
100
0.605762
false
Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS TODO: raise error if too many events since offset ?
129
en
0.498657
nakagami/reportlab
src/reportlab/pdfbase/ttfonts.py
1
45587
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__ = '$Id: ttfonts.py 3959 2012-09-27 14:39:39Z robin $' __doc__="""TrueType font support This defines classes to represent TrueType fonts. They know how to calculate their own width and how to write themselves into PDF files. T...
bsd-3-clause
468,004,839,853,736,800
38.67537
179
0.566653
false
Encoding for TrueType fonts (always UTF-8). TTEncoding does not directly participate in PDF object creation, since we need a number of different 8-bit encodings for every generated font subset. TTFont itself cares about that. TrueType font exception Represents a TrueType font. Its encoding is always UTF-8. Note: yo...
8,299
en
0.74969
lightalchemist/ML-algorithms
dim_reduction/spectral_embedding.py
1
1410
# -*- coding: utf-8 -*- import numpy as np def compute_pairwise_distance_matrix(X, k): """Compute pairwise distances between each point in X and its k-nearest neighbors.""" from scipy.spatial import KDTree kdtree = KDTree(X) A = np.zeros((X.shape[0], X.shape[0]), dtype=np.float) for i, x in...
mit
6,210,406,793,321,975,000
33.390244
82
0.614184
false
Compute pairwise distances between each point in X and its k-nearest neighbors. Perform dimension reduction using the eigenvectors of the graph laplacian computed from a given set of data. Project data X from original dimension n to k, where X is a numpy array of dimension [m x n] and k <= n. -*- coding: utf-8 -*- k+...
564
en
0.868724
mick-d/nipype
nipype/interfaces/nipy/model.py
7
13161
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals, absolute_import from builtins import range, str, bytes import os import nibabel as nb import numpy as np from ...utils.misc import package_check from ...utils import NUMPY_MMAP from ..base import (BaseInterface, TraitedSpec, ...
bsd-3-clause
6,562,482,735,676,853,000
39.74613
112
0.52458
false
Estimate contrast of a fitted model. Fit GLM model based on the specified design. Supports only single or concatenated runs. -*- coding: utf-8 -*-
148
en
0.864174
X-dark/Flexget
flexget/__init__.py
1
1135
#!/usr/bin/python from __future__ import unicode_literals, division, absolute_import import os import logging from flexget import logger from flexget.options import get_parser from flexget import plugin from flexget.manager import Manager __version__ = '{git}' log = logging.getLogger('main') def main(args=None): ...
mit
-4,021,792,851,769,180,700
26.682927
74
0.672247
false
Main entry point for Command Line Interface !/usr/bin/python If an absolute path is not specified, use the config directory.
125
en
0.637724
spcui/virt-test
virttest/libvirt_xml/vol_xml.py
1
3408
""" Module simplifying manipulation of XML described at http://libvirt.org/ """ from virttest.libvirt_xml import base, accessors class VolXMLBase(base.LibvirtXMLBase): """ Accessor methods for VolXML class. Properties: name: string, operates on XML name tag uuid: string, operates on uui...
gpl-2.0
-8,600,053,957,075,828,000
35.645161
80
0.569542
false
Manipulators of a Virtual Vol through it's XML definition. Accessor methods for VolXML class. Properties: name: string, operates on XML name tag uuid: string, operates on uuid tag type: string, operates on type tag capacity: integer, operates on capacity attribute of capacity tag allocation: intege...
850
en
0.73917
switowski/invenio
invenio/modules/submit/models.py
1
19892
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2015 CERN. # # Invenio 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 optio...
gpl-2.0
2,390,014,930,960,900,600
36.674242
78
0.61477
false
Represent a SbmACTION record. Represent a SbmALLFUNCDESCR record. Represent a SbmAPPROVAL record. Represent a SbmCATEGORIES record. Represent a SbmCHECKS record. Represents a SbmCOLLECTION record. Represents a SbmCOLLECTIONSbmCOLLECTION record. Represents a SbmCOLLECTIONSbmDOCTYPE record. Represents a SbmCOOKIES record...
1,785
en
0.826146
rhiever/sklearn-benchmarks
model_code/grid_search/SGDClassifier.py
1
1597
import sys import pandas as pd import numpy as np import itertools from sklearn.preprocessing import RobustScaler from sklearn.linear_model import SGDClassifier from evaluate_model import evaluate_model dataset = sys.argv[1] pipeline_components = [RobustScaler, SGDClassifier] pipeline_parameters = {} loss_values = [...
mit
2,270,912,534,851,505,000
52.233333
204
0.705698
false
0
en
0.110449
sitexa/foobnix
foobnix/gui/top.py
1
2239
#-*- coding: utf-8 -*- ''' Created on 22 сент. 2010 @author: ivan ''' from gi.repository import Gtk from foobnix.gui.model.signal import FControl from foobnix.gui.state import LoadSave from foobnix.gui.menu import MenuBarWidget from foobnix.helpers.my_widgets import ImageButton from foobnix.helpers.menu import Popup...
gpl-3.0
2,132,427,195,450,941,200
30.928571
94
0.640268
false
Created on 22 сент. 2010 @author: ivan -*- coding: utf-8 -*-
62
en
0.71304
inkhey/Transvoyage.py
transvoyage.py
1
13138
#!/usr/bin/python # -*- coding: utf-8 -*- # transvoyage.py # Version 0.3 # # Copyright 2014 Guénaël Muller <contact@inkey-art.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eit...
gpl-3.0
-8,850,327,259,524,849,000
35.261838
229
0.639038
false
!/usr/bin/python -*- coding: utf-8 -*- transvoyage.py Version 0.3 Copyright 2014 Guénaël Muller <contact@inkey-art.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of th...
2,721
fr
0.747642
MultiNet-80211/Hostapd
wpa_supplicant/examples/wpas-dbus-new-signals.py
1
6275
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1...
gpl-2.0
1,071,992,416,003,939,100
28.91133
124
0.69259
false
!/usr/bin/python Convert the byte-array for SSID and BSSID to printable strings
79
en
0.35706
itsCoder/itscoder.github.io
generate_post.py
1
1594
# coding=utf-8 import os import re FUCK_STR = ' ' PATTERN_PHASE_FILE = re.compile('\S+-weeklyblog-phase-(\d+)\.md') PATTERN_POST = re.compile('-\s*\[(.+)\]\((https?://\S+)\)\s*\(\[@(.+)\]\((.+)\)\)') PATTERN_CATEGORY = re.compile('#{5}\s*(.*?)\n') BLOG_DIR = '_posts/' def get_post(f, phase): phase_summary = '...
mit
-2,145,483,734,492,894,700
32.869565
83
0.466924
false
coding=utf-8 | 这是文章标题 | Android | 作者链接 |
40
zh
0.887836
sdrogers/ms2ldaviz
ms2ldaviz/setup_feat_col.py
1
2204
import os import sys os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings_simon") import django django.setup() from basicviz.models import * if __name__ == '__main__': other_experiment_name = sys.argv[1] fs,status = BVFeatureSet.objects.get_or_create(name = 'binned_005') if status: print("Crea...
mit
8,517,246,142,656,428,000
25.890244
125
0.685118
false
Now get the features as tied to the feature set get another experiment Find all the instances
93
en
0.941924
blue-yonder/pyscaffold
tests/test_update.py
1
7140
# -*- coding: utf-8 -*- import logging import os import re from os.path import join as path_join from pathlib import Path from pkg_resources import parse_version, working_set import pytest from pyscaffold import __version__, structure, update from pyscaffold.utils import chdir from .helpers import uniqstr EDITABLE...
mit
422,592,667,080,846,660
36.578947
84
0.621429
false
-*- coding: utf-8 -*- When update is False (no project exists yet) always update When content is string always update When force is True always update When file exist, update is True, rule is NO_OVERWRITE, do nothing When file does not exist, update is True, but rule is NO_CREATE, do nothing convert Path to str Normall...
822
en
0.907315
uni-peter-zheng/tp-qemu
openvswitch/tests/ovs_basic.py
4
10440
import logging import time import os from virttest import utils_misc, aexpect, utils_net, openvswitch, ovs_utils from virttest import versionable_class, data_dir from autotest.client.shared import error def allow_iperf_firewall(machine): machine.cmd("iptables -I INPUT -p tcp --dport 5001 --j ACCEPT") machine....
gpl-2.0
-4,935,766,518,107,801,000
39.153846
79
0.484962
false
Run basic test of OpenVSwitch driver. ForAllP(self.mvms).cmd("dhclinet") Test TCP bandwidth test udp bandwidth limited to 1Gb
127
en
0.544209
beyoungwoo/C_glibc_Sample
_Algorithm/ProjectEuler_python/euler_4.py
1
1587
#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Largest palindrome product</h2><div id="problem_info" class="info"><h3>Problem 4</h3><span>Published on Frid...
gpl-3.0
-6,911,959,164,782,817,000
28.388889
198
0.555766
false
!/usr/bin/python -Wall -*- coding: utf-8 -*- 999 * 999 = 998001 998 comp 100
76
en
0.375328
michal-ruzicka/archivematica
src/MCPClient/lib/clientScripts/restructureForComplianceMaildir.py
1
1919
#!/usr/bin/python -OO # This file is part of Archivematica. # # Copyright 2010-2013 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, ei...
agpl-3.0
8,630,748,113,008,248,000
36.627451
125
0.705576
false
!/usr/bin/python -OO This file is part of Archivematica. Copyright 2010-2013 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, either version 3 ...
853
en
0.794901
gopaycommunity/gopay-python-api
tests/unit/utils.py
1
1531
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency, Language class Utils: GO_ID = '8712700986' CLIENT_ID = '1689337452' CLIENT_SECRET = 'CKr7FyEE' CLIENT_ID_EET = "1365575992" CLIENT_SECRET_EET = "NUVsrv4W" GO_ID_EET = '8289213768' @staticmethod def create_base_payme...
mit
-2,250,619,758,455,118,600
35.452381
112
0.536251
false
'default_swift': BankSwiftCode.CESKA_SPORITELNA,'default_payment_instrument': PaymentInstrument.BANK_ACCOUNT, if lang is not specified, then default lang is used
161
en
0.259199
ludwiktrammer/odoo
addons/sale/sale.py
1
42630
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from openerp import SUPERUSER_ID from openerp import api, fields, models, _ import openerp.addons.decimal_precision as dp from openerp.exceptions import UserError from openerp.too...
agpl-3.0
-3,618,811,220,402,187,000
46.314095
276
0.607718
false
Create procurements based on quantity ordered. If the quantity is increased, new procurements are created. If the quantity is decreased, no automated action is taken. Compute the total amounts of the SO. Compute the amounts of the SO line. Compute the invoice status of a SO line. Possible statuses: - no: if the SO is n...
4,268
en
0.924808
sk413025/tilitools
ocsvm.py
1
3767
from cvxopt import matrix,spmatrix,sparse from cvxopt.blas import dot,dotu from cvxopt.solvers import qp import numpy as np from kernel import Kernel class OCSVM: """One-class support vector machine 'Estimating the support of a high-dimensional distribution.', Sch\"{o}lkopf, B and Platt, J C and Shawe-Taylor, ...
mit
-5,839,695,781,475,350,000
24.452703
89
0.663127
false
One-class support vector machine 'Estimating the support of a high-dimensional distribution.', Sch"{o}lkopf, B and Platt, J C and Shawe-Taylor, J and Smola, a J and Williamson, R C, Microsoft, 1999 Application of a dual trained oc-svm. Trains an one-class svm in dual with kernel. (scalar) something went wrong (scala...
1,374
en
0.765373
jianrongdeng/LAMOST
ana/scripts/filesIO.py
1
9324
""" ============================ script: filesIO.py ============================ date: 20170615 by Jianrong Deng purpose: handle input / output files various data I/O functions Input: input dir, date, time """ import const import pickle import os #========================== def getDir (path=const.test_path_ou...
gpl-3.0
-551,796,630,725,550,400
28.506329
191
0.525097
false
purpose: filename class for rawdata purpose: initialization purpose: save pixel Lists to output file input : filename and pixellist purpose: save stat info (mean and sstd ) to output file input : file_stat and data stat(mean and sstd) purpose: name scheme for 3sigma-mask file purpose: name scheme for net data (= raw...
3,287
en
0.500768
fbzhong/sublime-closure-linter
gjslint.py
1
4010
import os import re import shutil import sublime import sublime_plugin from const import * from listener import * from statusprocess import * from asyncprocess import * class ShowClosureLinterResultCommand(sublime_plugin.WindowCommand): """show closure linter result""" def run(self): self.window.run_command("s...
bsd-3-clause
6,959,701,586,400,418,000
31.33871
134
0.625436
false
not found full line. ignore error. if selection_was_at_end: self.output_view.show(self.output_view.size()) if end: self.output_view.run_command("goto_line", {"line": 1})
173
en
0.314609
qedsoftware/commcare-hq
corehq/apps/userreports/sql/data_source.py
1
5578
import numbers from django.utils.decorators import method_decorator from django.utils.translation import ugettext from dimagi.utils.decorators.memoized import memoized from sqlagg.columns import SimpleColumn from sqlagg.sorting import OrderBy from corehq.apps.reports.sqlreport import SqlData, DatabaseColumn from co...
bsd-3-clause
1,145,583,826,430,436,100
37.736111
114
0.6436
false
ask each column for its group_by contribution and combine to a single list allow throwing exception if the report explicitly sorts on an unsortable column type This explicitly only includes columns that resolve to database queries. The name is a bit confusing but is hard to change due to its dependency in SqlData TODO ...
579
en
0.912357
andrejbauer/jurij
jurij/graph.py
1
4649
# -*- encoding: utf-8 -*- # A very simple implementation of graphs in python, including graphs # embedded in the plane. class Graph(): """A graph stored as an adjacency dictionary.""" def __init__(self, data=None, vertices=None, edges=None, vertex_labels=None, edge_labels=None): """C...
bsd-2-clause
-6,448,450,689,787,050,000
35.03876
88
0.52678
false
A graph stored as an adjacency dictionary. Construct a graph to from the given data. The object must define methods vertices() and edges() which return iterators on vertices and edges, respectively. Vertices are required to be hashable objects while edges are pairs of vertices. The cone over g. The edges of the graph a...
756
en
0.929386
twitterdev/twitter-python-ads-sdk
examples/audience_summary.py
1
1125
from twitter_ads.client import Client from twitter_ads.targeting import AudienceSummary CONSUMER_KEY = 'your consumer key' CONSUMER_SECRET = 'your consumer secret' ACCESS_TOKEN = 'access token' ACCESS_TOKEN_SECRET = 'access token secret' ACCOUNT_ID = 'account id' # initialize the client client = Client(CONSUMER_KEY, ...
mit
1,429,144,818,825,178,400
27.125
81
0.625778
false
initialize the client load the advertiser account instance targeting criteria params
84
en
0.6864
pxzhang94/GAN
GAN/wasserstein_gan/wgan_tensorflow.py
1
3148
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os mb_size = 32 X_dim = 784 z_dim = 10 h_dim = 128 mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True) def plot(samples...
apache-2.0
-6,329,197,380,667,734,000
24.184
76
0.589263
false
0
en
0.110449
retorquere/zotero-better-bibtex
setup/item.py
1
24607
#!/usr/bin/env python3 from networkx.readwrite import json_graph from collections import OrderedDict import hashlib import operator import shlex from functools import reduce from http.client import RemoteDisconnected from lxml import etree from mako import exceptions from mako.template import Template from munch impo...
mit
-3,831,744,764,635,071,500
40.011667
161
0.61897
false
!/usr/bin/env python3print(schema.keys())'version', 'itemTypes', 'meta', 'csl', 'locales', 'release', 'hash' field/type order doesn't matter for BBT assures primary is first add nodes & edges juris-m has a list here, zotero strings add labels how is this possible? remove multi-line text fields remove two or more incomi...
1,921
en
0.618799
hasadna/OpenTrain
webserver/opentrain/timetable/utils.py
1
3883
from models import TtStop,TtStopTime,TtTrip import gtfs.models from timetable.models import TtShape import json from common import ot_utils import datetime def build_from_gtfs(start_date,days=30): build_stops() end_date = start_date + datetime.timedelta(days=days-1) print '=' * 50 print 'Start day = %s...
bsd-3-clause
-7,730,519,627,983,113,000
40.308511
99
0.60443
false
0
en
0.110449
aaronj1335/cs388-final-project
bin/plot.py
1
6512
#!/usr/bin/env python import os from os.path import join from itertools import chain from math import log from pylab import plot, show, legend, close, figure, title, xlabel, ylabel, barh, savefig import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter N = 0 ...
bsd-2-clause
-7,641,680,713,887,290,000
27.814159
94
0.578163
false
!/usr/bin/env python problem size num of level 1 threads num of level 2 threads running time we still store all figures here make the output directory if necessary update a few params about the select the fastest numbers select the fastest numbers special case just to wash out dups put one tick at the end ensure we sta...
450
en
0.798739
CommunityHoneyNetwork/CHN-Server
mhn/auth/views.py
2
5341
import hashlib import random from flask import Blueprint, request, jsonify from flask_mail import Message from sqlalchemy.exc import IntegrityError from flask_security.utils import ( login_user as login, verify_and_update_password, encrypt_password, logout_user as logout) from mhn import db, mail from...
lgpl-2.1
2,775,682,520,948,707,000
33.458065
88
0.644823
false
email and password are in the posted data. Deactivate all other password resets for this user. Send password reset email to user. Request body is not complete. Password do not match. No need to check password hash object or email. Request body is not complete for not authenticated request, ie, uses password reset hash.
320
en
0.810755
tlksio/tlksio
env/lib/python3.4/site-packages/pylint/checkers/base.py
1
37578
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # Copyright (c) 2009-2010 Arista Networks, Inc. # http://www.logilab.fr/ -- mailto:contact@logilab.fr # 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 # ...
mit
1,372,308,262,561,143,800
41.033557
94
0.551599
false
checks for : * doc strings * modules / classes / functions / methods / arguments / variables name * number of arguments, local variables, branches, returns and statements in functions, methods * required module attributes * dangerous default values as arguments * redefinition of function / metho...
6,114
en
0.821316
ideamonk/apt-offline
apt_offline_gui/Ui_AptOfflineQtAbout.py
1
8800
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'AptOfflineQtAbout.ui' # # Created: Sun Nov 7 20:54:52 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_AboutAptOffline(object): def setupUi...
gpl-3.0
6,399,191,816,789,832,000
65.165414
201
0.716364
false
-*- coding: utf-8 -*- Form implementation generated from reading ui file 'AptOfflineQtAbout.ui' Created: Sun Nov 7 20:54:52 2010 by: PyQt4 UI code generator 4.7.3 WARNING! All changes made in this file will be lost!
221
en
0.814486
zhoulan/google-python-exercises
basic/string1.py
1
4177
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
343,722,256,654,909,760
29.268116
78
0.651903
false
!/usr/bin/python -tt Copyright 2010 Google Inc. Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 Google's Python Class http://code.google.com/edu/languages/google-python-class/ Basic string exercises Fill in the code for the functions below. main() is already set up to call the ...
2,203
en
0.785011
gangadharkadam/tailorerp
erpnext/support/doctype/support_ticket/support_ticket.py
1
8287
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import now, extract_email_id import json import reque...
agpl-3.0
-8,289,523,798,107,514,000
34.26383
237
0.68879
false
Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors License: GNU General Public License v3. See license.txt self.login()test['communications'] = []self.call_del_keys(support_ticket.get('communications'), test) def on_update(self): self.send_email() mail_titles = frappe.get_hooks().get("login_mail_tit...
725
en
0.328398
afriestad/WikiLinks
kokekunster/settings_dev.py
1
1482
import os from kokekunster.settings import BASE_DIR # Settings for development environment DEBUG = True ALLOWED_HOSTS = ['*'] # "Secret" cryptographic key, only used during local development SECRET_KEY = 'fc4_hb-wi32l^c&qpx6!m)o*xd(4ga$13(ese#pfj#pjxnmt0p' # Database # https://docs.djangoproject.com/en/1.8/ref...
mit
8,427,073,580,051,762,000
22.15625
78
0.687584
false
Settings for development environment "Secret" cryptographic key, only used during local development Database https://docs.djangoproject.com/en/1.8/ref/settings/databases The development database requires postgresql to be installed on the machine. The following settings correspond to the default settings used by Postgre...
564
en
0.843052
pFernbach/hpp-rbprm-corba
script/tools/parse_bench_contactGen.py
1
1861
import sys totalSuccess = 0. totalTime = 0. totalMuscodConverg = 0. totalMuscodWarmStartConverg = 0. totalCrocConverg = 0. totalConf = 0. totalIt = 0. f = open("/local/fernbac/bench_iros18/bench_contactGeneration/walk_noCroc.log","r") line = f.readline() while line.startswith("new"): totalIt += 1. line = f.r...
lgpl-3.0
5,070,445,143,479,115,000
32.232143
97
0.602902
false
0
en
0.110449
LordDarkula/chess_py
chess_py/core/board.py
1
13656
# -*- coding: utf-8 -*- """ Constructs board object which stores the get_location of all the pieces. Default Array | [[0th row 0th item, 0th row 1st item, 0th row 2nd item], | [1st row 0th item, 1st row 1st item, 1st row 2nd item], | [2nd row 0th item, 2nd row 1st item, 2nd row 2nd item]] | Default board | 8...
mit
-1,198,334,598,218,724,400
30.571429
106
0.550108
false
Standard starting position in a chess game. Initialized upon startup and is used when init_default constructor is used Copies the board faster than deepcopy :rtype: Board Creates a ``Board`` given an array of ``Piece`` and ``None`` objects to represent the given position of the board. :type: position: list Returns li...
2,917
en
0.741892
nke001/attention-lvcsr
lvsr/extensions.py
1
3223
"""Nice small extensions that maybe will it make to Blocks at some point.""" from __future__ import print_function import subprocess import pkgutil import math from theano.scan_module.scan_op import Scan from blocks.extensions import TrainingExtension, SimpleExtension class CGStatistics(SimpleExtension): def __...
mit
-8,607,135,214,068,613,000
39.2875
88
0.603785
false
Nice small extensions that maybe will it make to Blocks at some point.
70
en
0.9847