content
stringlengths
7
928k
avg_line_length
float64
3.5
33.8k
max_line_length
int64
6
139k
alphanum_fraction
float64
0.08
0.96
licenses
list
repository_name
stringlengths
7
104
path
stringlengths
4
230
size
int64
7
928k
lang
stringclasses
1 value
# Script that uses meshgrid to get map coordinates and then plots # the DEM in 3d. import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from osgeo import gdal ds = gdal.Open(r'D:\osgeopy-data\Washington\dem\sthelens_utm.tif') band = ds.GetRasterBand(1) ov_band = band.GetOverview...
27.4
66
0.713869
[ "MIT" ]
ClaudeCoulombe/osgeopy-code
Chapter13/listing13_7.py
1,370
Python
# -*- coding: utf-8 -*- """ :mod:`plots` -- Tests data plots ================================ .. module:: plots :platform: Unix, Windows :synopsis: Tests of the raster plots and processed data plots. .. moduleauthor:: Andre Rocha <rocha.matcomp@gmail.com> """ import matplotlib.pyplot as plt from matplotlib.te...
31.977778
86
0.599027
[ "MIT" ]
rochamatcomp/python-rocha
tests/test_plots.py
1,439
Python
from models.flowpp_cifar import CifarFlowPP from models.rvae import RVAE from models.modules import init_mode model_registry = { # MNIST 'rvae_mnist': lambda **kwargs: RVAE(z_size=16, h_size=40, kl_min=0.1, x_channels=1, **kwargs), # CIFAR 'tiny_rvae': lambda *...
48.173913
125
0.611011
[ "MIT" ]
tom-bird/binary-gen-models
models/__init__.py
1,108
Python
""" A python script to run a parameter sweep """ # Python tools import numpy as np import yaml import os # WISDEM tools from wisdem.aeroelasticse import runFAST_pywrapper, CaseGen_General from wisdem.aeroelasticse.Util import FileTools # ROSCO tools from ROSCO_toolbox import controller as ROSCO_controller from ROSCO_to...
34.280423
124
0.722334
[ "Apache-2.0" ]
NREL/pCrunch
runBatch/run_FlapGainSweep_BAR.py
6,479
Python
import requests import time from bs4 import BeautifulSoup class crawl: """Keep track of time between scrape requests. args: wait: time between requests retry_max: number of times to retry """ def __init__(self, wait, retry_max): self.wait = wait self.retry_max = retry_...
29.226415
80
0.550032
[ "Unlicense" ]
seanbreckenridge/MALUserVsAverage
manual_crawler.py
1,549
Python
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
38.686441
87
0.62782
[ "Apache-2.0" ]
HCYXAS/horovod
horovod/spark/keras/tensorflow.py
4,565
Python
# ----------------------------------------------------------------------------- # Copyright (c) 2021 Trevor P. Martin. All rights reserved. # Distributed under the MIT License. # ----------------------------------------------------------------------------- from Data import encode_data # from utils import cross_validati...
34.781627
126
0.525352
[ "MIT" ]
tmartin2/EnsembleSplice-Inactive
sub_models.py
23,095
Python
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import enum from builtins import _test_sink, _test_source from typing import Annotated, Any, Dict, List class Test1_C: x: int = 0 ...
17.741758
65
0.635491
[ "MIT" ]
0xgpapad/pyre-check
source/interprocedural_analyses/taint/test/integration/via_type_of.py
3,229
Python
import os import anyconfig PARSABLES = { 'pickle':['p','pickle'], 'toml':['toml'], 'xml':['xml'], 'yaml':['yml','yaml'], 'json':['json'], 'ini':['ini'], 'properties':['props','properties'], 'shellvars':['env']} class Source(object): def __init__(self, uri, root_path=None, cont...
25.9
122
0.543436
[ "MIT" ]
flashashen/flange
flange/source.py
2,072
Python
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'picscope.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
23
53
0.652174
[ "MIT" ]
yeaske/picscope
picscope/urls.py
299
Python
"""Data Helpers Data helpers leverage the abstraction layer of ArchivesSnake to provide additional functionality for retrieving, inferring and concatenating data elements. They can also extend (or invert) relationships between different objects. """ from datetime import datetime import re from rapidfuzz import fuzz f...
31.73384
85
0.648454
[ "MIT" ]
RockefellerArchiveCenter/rac_aspace
rac_aspace/data_helpers.py
8,346
Python
# Copyright (c) 2009-2017 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
41.76078
103
0.654309
[ "BSD-3-Clause" ]
gem5-graphics/gem5-graphics
gem5/src/dev/arm/RealView.py
40,675
Python
#!/usr/bin/env python # File: plot_icd_vs_colorgrad.py # Created on: Tue 08 May 2012 11:03:26 AM CDT # Last Change: Sun 21 Oct 2012 02:43:33 PM CDT # Purpose of script: <+INSERT+> # Author: Steven Boada import pylab as pyl from mk_galaxy_struc import mk_galaxy_struc galaxies = mk_galaxy_struc() f1 = pyl.figure(1,fig...
29.537313
79
0.624558
[ "MIT" ]
boada/ICD
sandbox/legacy_plot_code/plot_icd_vs_colorgrad_vs_sersic.py
1,979
Python
# -*- coding: utf-8 -*- """ babel.messages.mofile ~~~~~~~~~~~~~~~~~~~~~ Writing of files in the ``gettext`` MO (machine object) format. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import array import struct from babel.messages.catalog import Catalog, ...
34.084112
89
0.541815
[ "Apache-2.0" ]
10088/hue
desktop/core/ext-py/Babel-2.5.1/babel/messages/mofile.py
7,294
Python
import pyaf.Bench.web_traffic.Forecaster as fo PROJECTS = ['de.wikipedia.org'] data_dir = 'data/web-traffic-time-series-forecasting' lForecaster = fo.cProjectForecaster() lForecaster.mDataDirectory = data_dir lForecaster.mBackendName = 'pyaf_default_clean' lForecaster.mKeysFileName = 'key_1.csv.zip' last_date = '20...
27.4375
53
0.794989
[ "BSD-3-Clause" ]
antoinecarme/pyaf
tests/bench/web_traffic_jobs/de.wikipedia.org/test_web_traffic_de.wikipedia.org_pyaf_default_clean.py
439
Python
import sys import logging import urlparse import urllib import redis from flask import Flask, current_app from flask_sslify import SSLify from werkzeug.contrib.fixers import ProxyFix from werkzeug.routing import BaseConverter from statsd import StatsClient from flask_mail import Mail from flask_limiter import Limiter ...
31.258993
118
0.729574
[ "BSD-2-Clause" ]
CodeGerm/redash
redash/__init__.py
4,345
Python
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 5 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class SnapshotScheduleExtended(o...
28.498525
159
0.589898
[ "Unlicense" ]
Isilon/isilon_sdk_python
isi_sdk_8_1_0/isi_sdk_8_1_0/models/snapshot_schedule_extended.py
9,661
Python
from decimal import Decimal as D from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class, get_classes, get_model from oscar.templatetags.currency_filters import currency Benefit = get_model('offer', 'Benefit') BasketDiscount, SHIPPING_DISCOUNT, ZERO_DISCOUNT = get_classes('of...
33.862857
108
0.626645
[ "BSD-3-Clause" ]
AMuratTuran/mkn
src/oscar/apps/offer/benefits.py
11,852
Python
import os import shutil import tempfile import time class TemporaryDirectory(): def __init__(self, remove: bool=True, prefix: str='tmp'): self._remove = remove self._prefix = prefix def __enter__(self) -> str: if 'KACHERY_STORAGE_DIR' in os.environ: storage_dir = os.getenv...
33.307692
109
0.586028
[ "Apache-2.0" ]
flatironinstitute/kachery
kachery/_temporarydirectory.py
1,732
Python
from pypy.objspace.std.multimethod import * from rpython.annotator.annrpython import RPythonAnnotator class W_Root(object): pass class W_Int(W_Root): pass class W_Str(W_Root): pass str_w = MultiMethodTable(1, root_class=W_Root, argnames_before=['space']) int_w = MultiMethodTable(1, root_class=W_Root, a...
22.877193
73
0.669479
[ "MIT" ]
kantai/passe-pypy-taint-tracking
pypy/objspace/std/test/test_annmm.py
1,304
Python
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Haozhi Qi, from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn) # ----------------------------------...
42.781182
119
0.591428
[ "MIT" ]
alphadadajuju/Deep-Feature-Flow-mod
lib/dataset/pascal_voc.py
19,551
Python
from typing import List from yandex_market_language import models, exceptions from yandex_market_language.models import fields from yandex_market_language.models.abstract import XMLElement, XMLSubElement from yandex_market_language.exceptions import ValidationError class Shop( fields.EnableAutoDiscountField, ...
34.172996
79
0.540684
[ "MIT" ]
stefanitsky/yandex_market_language
yandex_market_language/models/shop.py
8,099
Python
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-10-02 09:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hkm', '0025_userprofile_printer_presets'), ] operations = [ migrations.AddF...
28.807692
107
0.636849
[ "MIT" ]
City-of-Helsinki/kuvaselaamo
hkm/migrations/0026_hkm_museum_printer_credentials.py
749
Python
# ============================================================================= # IMPORTS # ============================================================================= import torch from espaloma.nn.readout.base_readout import BaseReadout # ===========================================================================...
32.48
79
0.383005
[ "MIT" ]
choderalab/espaloma
espaloma/nn/readout/node_typing.py
812
Python
from __future__ import print_function, division import json import torch from torch.utils.data import Dataset import numpy as np import os import sys import collections import torch.utils.data as data import shutil from PIL import Image from torchvision.datasets.utils import download_url, check_integrity class ADE20KD...
36.411765
92
0.5937
[ "MIT" ]
hsfzxjy/ESSNet
datasets/ade.py
2,476
Python
# coding: utf-8 # # Copyright 2018 Moriyoshi Koizumi # # 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, me...
33.796875
118
0.589112
[ "MIT" ]
moriyoshi/dummydf
dummydf/sql/dataframe.py
8,652
Python
from kivy.uix.screenmanager import Screen # Declara o Menu do Jogo class TelaMenu(Screen): pass # Declara a Tela do Pong class TelaJogo(Screen): pass # Declara a Tela do Vencedor 3 class TelaVencedor1(Screen): pass # Declara a Tela do Vencedor 2 class TelaVencedor2(Screen): pass
13.818182
41
0.723684
[ "MIT" ]
LivioAlvarenga/Tutoriais_Kivy_KivyMD
Jogo_pong/telas/Telas.py
304
Python
def printBigHeadline(text): print("") print("#######################################################################") print(text) print("#######################################################################") print("") def printSmallHeadline(text): print("") print("--------------------...
30.5625
84
0.216769
[ "MIT" ]
recursinging/daisyHat
python/daisyHat/Tools.py
489
Python
import re from social_core.backends.oauth import OAuthAuth NAME_RE = re.compile(r'([^O])Auth') LEGACY_NAMES = ['username', 'email'] def backend_name(backend): name = backend.__name__ name = name.replace('OAuth', ' OAuth') name = name.replace('OpenId', ' OpenId') name = name.replace('Sandbox', '') ...
23.157143
72
0.624923
[ "MIT" ]
776166/yggdrasil-django
site/social_auth/filters.py
1,621
Python
""" Get a list of Packages in CI, Deployed, or all Images """ from __future__ import print_function from pc_lib import pc_api, pc_utility # --Configuration-- # parser = pc_utility.get_arg_parser() parser.add_argument( '--mode', type=str, choices=['ci', 'deployed', 'all'], default='all', help='(Op...
37.351485
129
0.605302
[ "MIT" ]
moonman81/pc-toolbox
pcs_images_packages_read.py
7,545
Python
import numpy as np import theano def intX(X): return np.asarray(X, dtype=np.int32) def floatX(X): return np.asarray(X, dtype=theano.config.floatX) def sharedX(X, dtype=theano.config.floatX, name=None): return theano.shared(np.asarray(X, dtype=dtype), name=name) def shared0s(shape, dtype=theano.config.fl...
28.095238
63
0.727119
[ "MIT" ]
IndicoDataSolutions/Passage
passage/theano_utils.py
590
Python
import sys from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMainWindow, QAction, QMessageBox, QStatusBar from PyMailConfigWindow import ConfigWindow from PyMailReceiverModel import ReceiverModel from PyMailReceiverView import ReceiverView from PyMailSenderModel import SenderModel from PyMailSenderWindow impo...
33.663551
85
0.68573
[ "MIT" ]
LolsonX/PyMail
PyMailMainWindow.py
3,602
Python
from abc import ABC from types import NoneType import logictest import http_connector from log import log class TestHttp(logictest.SuiteRunner, ABC): def __init__(self, kind, pattern): super().__init__(kind, pattern) self._http = None def get_connection(self): if self._http is None:...
39.192308
93
0.499836
[ "Apache-2.0" ]
LiuYuHui/databend
tests/logictest/http_runner.py
3,057
Python
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-14 18:05 from __future__ import unicode_literals import common.blocks.columns import common.blocks.tabs from django.db import migrations, models import wagtail.wagtailcore.blocks import wagtail.wagtailcore.fields import wagtail.wagtailembeds.blocks import...
136.59375
3,522
0.732098
[ "Apache-2.0" ]
baylee-d/cos.io
common/migrations/0018_auto_20161014_1805.py
4,371
Python
# Copyright 2013 IBM Corp # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
35.257143
79
0.603998
[ "Apache-2.0" ]
kkltcjk/kklt
yardstick/dispatcher/http.py
3,702
Python
#created by Angus Clark on 8/01/2017 # toDo incoperate the saving program into this_dir import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '130.56.253.43' print host # remove when done debugging port = 5201 # edit when port for comm is decided s.bind((host,port)) f = open('temp.json','wb') s...
19.956522
53
0.651416
[ "BSD-2-Clause" ]
wmizzi/tn2capstone
ServerScript/recievejson(legacy).py
459
Python
import json import requests HUE_NUPNP_URL = "https://www.meethue.com/api/nupnp" class APIException(Exception): pass class HueAPI(object): def __init__(self, username): self.username = username self.ip = self.discover_hub_ip() @property def base_url(self): return "http://{}...
23.910448
74
0.576779
[ "MIT" ]
BenDoan/playground
hue/hue_api.py
1,602
Python
# Generated by Django 2.2.1 on 2019-05-21 10:29 from django.db import migrations, models import uni_ticket.models class Migration(migrations.Migration): dependencies = [ ('uni_ticket', '0030_auto_20190520_1532'), ] operations = [ migrations.AlterField( model_name='ticketcate...
60.72
895
0.690382
[ "Apache-2.0" ]
mspasiano/uniTicket
uni_ticket/migrations/0031_auto_20190521_1229.py
1,518
Python
from typing import List, Literal, Union, Callable, Tuple from dataclasses import dataclass, replace from .config_types import ( TWInterface, TWSettingStorage, TWSettingBool, TWSetting, WrapType, Fields, AnkiModel, LabelText, WhichField, Tags, Falsifiable, ) ScriptKeys = Literal[ 'enabled', 'name'...
26.854545
112
0.654705
[ "MIT" ]
hgiesel/anki_text_wrapper
src/lib/interface.py
1,477
Python
import pymysql.cursors import ldap def get_domain_name(): """ Returns the domain name of the current configuration from a config file Returns ------- string the domain name """ with open("/var/www/logic_webapp/webapp_config") as file: line = file.readline() dom...
25.608108
87
0.626385
[ "MIT" ]
Quoding/petricore
webapp/external_access.py
1,895
Python
"""Form definitions, allow easy validation of input and rendering of forms """ # future imports from __future__ import absolute_import # local imports from app.forms.pages.base import PageForm class AboutPageForm(PageForm): pass
18.230769
74
0.780591
[ "Apache-2.0" ]
mjmcconnell/sra
src-server/app/forms/pages/about.py
237
Python
from typing import Union, Iterator, Tuple from ...symbols import NOUN, PROPN, PRON from ...errors import Errors from ...tokens import Doc, Span def noun_chunks(doclike: Union[Doc, Span]) -> Iterator[Tuple[int, int, int]]: """ Detect base noun phrases from a dependency parse. Works on both Doc and Span. "...
30.784314
81
0.56879
[ "Apache-2.0", "MIT" ]
Alan-love/spaCy
spacy/lang/en/syntax_iterators.py
1,570
Python
"""Permissions for the client app""" from rest_framework import permissions class ClientPermissions(permissions.BasePermission): """Handles authorization of requests to the client app.""" def has_permission(self, request, view): if view.action == 'create' \ and request.user.has_perm('c...
34.315789
66
0.628834
[ "MIT" ]
My-Garage/resourceideaapi
client/permissions.py
652
Python
import os import discord import youtube_dl as ytdl class MusicPlayer: ''' This module is responsible for connecting and disconnecting the bot from a voice channel, downloading songs from youtube and add them in the queue . Basic music functions like pause, resume, stop and play, in order to give ...
43.117647
120
0.621949
[ "MIT" ]
mavroudo/jarvis-discord
modules/youtube_music.py
6,597
Python
from typing import Any, Dict, Iterable, Optional, Tuple from datastore.shared.util import DeletedModelsBehaviour from ....models.checker import Checker, CheckException from ....models.models import Organization from ....shared.exceptions import ActionException from ....shared.filters import FilterOperator from ....sh...
36.978495
88
0.655714
[ "MIT" ]
JLkp/openslides-backend
openslides_backend/action/actions/organization/initial_import.py
3,439
Python
# 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 u...
36.918919
87
0.786603
[ "Apache-2.0" ]
hetw/aliyun-openapi-python-sdk
aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyLaunchTemplateDefaultVersionRequest.py
2,732
Python
""" @brief test log(time=20s) """ import sys import os import unittest from pyquickhelper.loghelper import fLOG, run_cmd from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv, skipif_appveyor, skipif_travis from pyquickhelper.pycode import add_missing_development_version class TestPyDa...
34.816
111
0.535156
[ "MIT" ]
sdpython/jupytalk
_unittests/ut_talk_examples/test_pydata2016_animation.py
4,352
Python
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.login_root, name='login_root'), url(r'^success/$', views.login_success, name='login_success'), url(r'^fail/$', views.login_fail, name='login_fail'), ]
25.1
66
0.673307
[ "MIT" ]
omiguelperez/DjangoLoginBDD
bdd_example/login/urls.py
251
Python
#!/usr/bin/python # -*- coding: utf-8 -*- # # Scaleway IP management module # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: scaleway_ip short_descriptio...
27.178707
131
0.615837
[ "MIT" ]
elixir-no-nels/usegalaxy
venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/cloud/scaleway/scaleway_ip.py
7,148
Python
""" # Interaction Tracker # @license http://www.apache.org/licenses/LICENSE-2.0 # Author @ Jamil Hussain, Zaki """ from django.conf import settings from django.contrib.auth.models import ( BaseUserManager, AbstractBaseUser ) from django.core.validators import RegexValidator from django.db import models from dj...
29.099379
110
0.646105
[ "Apache-2.0" ]
Ahmar123/Lean-UX-Platform
InteractionTracker/accounts/models.py
4,685
Python
from __future__ import unicode_literals import os import inspect from webob import Request, Response from parse import parse from jinja2 import FileSystemLoader, Environment from requests import session as RequestsSession from wsgiadapter import WSGIAdapter as RequestWSGIAdapter class API: """ this is just ...
25.218274
79
0.633655
[ "BSD-3-Clause" ]
sodrooome/diy
diy/api.py
4,968
Python
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
38.138889
78
0.633649
[ "MIT" ]
acured/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/connection_monitor_query_result.py
1,373
Python
#!/usr/bin/env python import unittest from tests.base import PyangBindTestCase class EnumerationTests(PyangBindTestCase): yang_files = ["enumeration.yang"] def setUp(self): self.enum_obj = self.bindings.enumeration() def test_container_has_all_leafs(self): for leaf in ["e", "f"]: ...
30.070175
115
0.608518
[ "Apache-2.0" ]
JoseIgnacioTamayo/pyangbind
tests/enumeration/run.py
1,714
Python
import os from flask_script import Manager from flask_migrate import MigrateCommand from App import create_app env = os.environ.get("flask_env", "develop") app = create_app(env) manager = Manager(app) manager.add_command("db", MigrateCommand) if __name__ == '__main__': manager.run()
16.388889
44
0.755932
[ "MIT" ]
jonathan-hxj/FlaskTpp
manager.py
295
Python
# Copyright (c) 2021 PaddlePaddle 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 app...
29.376068
74
0.635438
[ "Apache-2.0" ]
Abraham-Xu/Paddle
python/paddle/fluid/tests/unittests/ipu/op_test_ipu.py
3,437
Python
# Copyright 2021 Canonical Ltd. # # 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 writin...
43.203191
79
0.641698
[ "ECL-2.0", "Apache-2.0" ]
Basdbruijne/zaza
unit_tests/events/plugins/test_zaza_events_plugins_conncheck.py
40,611
Python
stages = [''' +---+ | | O | /|\ | / \ | | ========= ''', ''' +---+ | | O | /|\ | / | | ========= ''', ''' +---+ | | O | /|\ | | | ========= ''', ''' +---+ | | O | /| | | | ========= ''', ''' +---+ | | O | | | ...
12.911765
47
0.083144
[ "MIT" ]
iliescua/Hangman
hangman_art.py
878
Python
import argparse import numpy as np from sklearn.metrics import accuracy_score, jaccard_score, balanced_accuracy_score import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import dataloader import track from classifiers import ObservationsConditionsClassifier from classifiers import ClassifierComp...
40.949438
189
0.664563
[ "MIT" ]
petersvenningsson/radar-Bayesian-human-motion
train.py
7,289
Python
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the pruning code. WARNING: This test uses 4GB of disk space. This test takes 30 mins or more (up ...
44.866944
138
0.613781
[ "MIT" ]
umkoin/umkoin
test/functional/feature_pruning.py
21,581
Python
import time from Classes.Packets.PiranhaMessage import PiranhaMessage class OwnHomeDataMessage(PiranhaMessage): def __init__(self, messageData): super().__init__(messageData) self.messageVersion = 0 def encode(self, fields, player): ownedBrawlersCount = len(player.OwnedBrawlers) ...
31.844538
152
0.599419
[ "Apache-2.0" ]
ServerBSvvv/BSDS-V41
Classes/Packets/Server/Home/OwnHomeDataMessage.py
15,158
Python
from sympy.logic.boolalg import to_cnf, eliminate_implications, distribute_and_over_or, \ compile_rule, conjuncts, disjuncts, to_int_repr, fuzzy_not, Boolean, is_cnf from sympy import symbols, And, Or, Xor, Not, Nand, Nor, Implies, Equivalent, ITE from sympy.utilities.pytest import raises, XFAIL def test_overloadi...
32.097015
89
0.562892
[ "BSD-3-Clause" ]
cielavenir/sympy
py3k-sympy/sympy/logic/tests/test_boolalg.py
8,602
Python
import argparse from pathlib import Path import tempfile from typing import List from gensim.models import KeyedVectors from gensim.scripts.glove2word2vec import glove2word2vec from target_extraction.data_types import TargetTextCollection from target_extraction.tokenizers import spacy_tokenizer def parse_path(path_st...
42.863014
169
0.660914
[ "Apache-2.0" ]
apmoore1/tdsa_augmentation
tdsa_augmentation/data_creation/shrink_glove_to_targets.py
3,129
Python
import platform import random import shutil import subprocess import textwrap from pathlib import Path, PurePath import pytest from cibuildwheel.docker_container import DockerContainer from cibuildwheel.environment import EnvironmentAssignment # for these tests we use manylinux2014 images, because they're available ...
33.385
98
0.634417
[ "BSD-2-Clause" ]
YannickJadoul/cibuildwheel
unit_test/docker_container_test.py
6,677
Python
import numpy as np from envs.babyai.oracle.teacher import Teacher class LandmarkCorrection(Teacher): def empty_feedback(self): """ Return a tensor corresponding to no feedback. """ return np.array([-1, -1]) def random_feedback(self): """ Return a tensor corresp...
39.660714
120
0.638001
[ "MIT" ]
AliengirlLiv/babyai
envs/babyai/oracle/landmark_correction.py
2,221
Python
from inits import * import tensorflow as tf flags = tf.app.flags FLAGS = flags.FLAGS # global unique layer ID dictionary for layer name assignment _LAYER_UIDS = {} def get_layer_uid(layer_name=''): """Helper function, assigns unique layer IDs.""" if layer_name not in _LAYER_UIDS: _LAYER_UIDS[layer_n...
31.297297
175
0.576733
[ "MIT" ]
krohak/TAGCN
layers.py
8,106
Python
import numpy import mysql.connector from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder from sklearn import tree ##--------------------------Catch Data from data base-------------------------------- cnx = mysql.connector.connect(user = [type your user] , password = ...
29.450704
148
0.66045
[ "MIT" ]
AlirezaMojtabavi/Predict-Price-of-an-Apartment-in-Tehran
PredictPrice.py
2,108
Python
# Given a statement, find the parse tree that led to it. from tree_parser import * import pickle #pickle.dump(database.proof_datas, open(output_file,'wb')) from copy import deepcopy from tree import * #output_file = 'tree_parse_data' # class InitialStringSearcher: # def __init__(self): # self.nodes = ...
57.671958
2,466
0.503761
[ "MIT" ]
dwhalen/holophrasm
statement_to_tree.py
10,900
Python
""" const $ = new Env("京东饭粒"); 京东饭粒任务 活动入口:https://u.jd.com/ytWx4w0 每天60豆小毛,爱要不要 cron: 46 9 * * * jd_fanli.py """ import os import time import re import requests import random proxies = {"http": None, "https": None} def randomstr(num): randomstr = "" for i in range(num): randomstr = randomstr + ra...
33.453704
331
0.599779
[ "Apache-2.0" ]
w123113/loon
jd_fanli.py
3,715
Python
""" test all other .agg behavior """ from collections import OrderedDict import datetime as dt from functools import partial import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, PeriodIndex, Series, date_range, period_range, ) from pandas...
30.695222
96
0.537784
[ "BSD-3-Clause" ]
ajspera/pandas
pandas/tests/groupby/aggregate/test_other.py
18,632
Python
#!/usr/bin/python # encoding: utf-8 ''' codegen_checker.codegen -- shortdesc codegen_checker.codegen is a description It defines classes_and_methods @author: user_name @copyright: 2013 organization_name. All rights reserved. @license: license @contact: user_email @deffield updated: U...
33.636364
218
0.56248
[ "Apache-2.0" ]
MarouenMechtri/accords-platform-1
tools/codegen/codegen_checker.py
6,290
Python
# asot: Localhost tunneling # Copyright 2021, Luna and asot contributors # SPDX-License-Identifier: BSD-3-Clause from .main import main if __name__ == "__main__": main()
19.555556
44
0.732955
[ "BSD-3-Clause" ]
lun-4/asot
server/asot/manage/__main__.py
176
Python
from datetime import datetime import numpy as np import exetera.core.session as sess from exetera.core import dataframe ADATA = '/home/jd21/data/processed_May17_processed.hdf5' VDATA = '/home/jd21/data/vacc.0603.h5' DSTDATA = '/home/jd21/data/full_merge.h5' def asmt_merge_vacc(): """ Merge assessment df wi...
45.945055
153
0.643387
[ "Apache-2.0" ]
KCL-BMEIS/ExeTeraCovid
scripts/asmt_merge_vacc_exetera.py
4,181
Python
def can_build(plat): return plat=="android" def configure(env): if (env['platform'] == 'android'): env.android_add_dependency("compile 'com.google.android.gms:play-services-ads:8.3.0'") env.android_add_java_dir("android") env.android_add_to_manifest("android/AndroidManifestChunk.xml") env.disable_module()
29
88
0.752351
[ "MIT" ]
Mavhod/GodotAdmob
admob/config.py
319
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """Public Title. Doc str for module users .. moduleauthor:: Max Wu <http://maxwu.me> .. References:: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject .. Test Samples in doctest format >>> None """ from setupt...
29.87
79
0.634416
[ "MIT" ]
maxwu/ci-stat
setup.py
2,987
Python
import os from databases import Database from sqlalchemy import MetaData, create_engine SQLALCHEMY_DATABASE_URL = ( os.environ.get("DATABASE_URL") or '{}://{}:{}@{}:{}/{}'.format( os.environ.get("DATABASE"), os.environ.get("DB_USERNAME"), os.environ.get("DB_PASSWORD"), os.envir...
19.774194
46
0.631321
[ "MIT" ]
lupinthe14th/ptodo
backend/app/database.py
613
Python
from clvm_tools import binutils from chinilla.types.blockchain_format.program import Program, INFINITE_COST from chinilla.types.announcement import Announcement from chinilla.types.blockchain_format.sized_bytes import bytes32 from chinilla.util.condition_tools import parse_sexp_to_conditions from chinilla.wallet.puzzl...
39.433071
115
0.720447
[ "Apache-2.0" ]
Chinilla/chinilla-blockchain
tests/wallet/test_singleton.py
5,008
Python
from __future__ import annotations import numpy as np import tcod import g import game.constants import game.engine import game.game_map import game.render_functions from game.tiles import tile_graphics def render_map(console: tcod.Console, gamemap: game.game_map.GameMap) -> None: # The default graphics are of ...
34.620253
105
0.652285
[ "CC0-1.0" ]
HexDecimal/7drl-2022
game/rendering.py
2,735
Python
from sys import argv, stdin def cut(input_file, *args): options = process_options(*args) delimiter = d_option(options["-d"]) lines = input_file.readlines() columns = [item.split(delimiter) for item in lines] scope = f_option(options["-f"], len(columns[0])) out_scope = [] for x in scope: ...
26.927273
67
0.576637
[ "MIT" ]
MichalKyjovsky/NPRG065_Programing_in_Python
SandBox/Practicals_05_Cut.py
1,481
Python
import os import platform from datetime import datetime # TODO test counter # def test_count(): # return 0 # f"Count: {test_count()}\n"\ def serve_info(): return f"Stats\n" \ f"UTC: {datetime.utcnow().isoformat()}\n" \ f"\nMachine\n" \ f"Architecture: {platform.machine()}\n" \...
33.275862
68
0.550259
[ "MIT" ]
pwentrys/SubstanceHelpers
utils/logger.py
965
Python
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
52.080645
266
0.698235
[ "MIT" ]
Vibaswan/ixnetwork_restpy
ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/spbnetworkrange_525415b0593fd4072368412490b137fa.py
16,145
Python
import time, datetime from app import db class ServerInfo(db.Model): __tablename__ = 'servers' __table_args__ = (db.PrimaryKeyConstraint('ip', 'port', name='_ip_port_pk'),) ip = db.Column(db.String(128), nullable=False) port = db.Column(db.Integer, nullable=False) ...
35.090909
82
0.58601
[ "MIT" ]
sappykun/scpsl-masterserver
app/modules/serverinfo/models.py
1,930
Python
''' TRIES Trie support search, insert, and deletion in O(L) time where L is length of the key why Trie? * With Trie, we can insert and find strings in O(L) time where L represent the length of a single word. This is obviously faster than BST. This is also faster than Hashing because of the ways it is im...
28.925
147
0.703544
[ "MIT" ]
Wmeng98/Leetcode
CTCI/Data Structures/Trees/tries.py
1,157
Python
import argparse import multiprocessing import random import shutil from datetime import datetime from functools import partial from pathlib import Path import chainer import chainer.functions as F import chainer.links as L import cupy import numpy as np from chainer import iterators, optimizers, serializers from chain...
43.589404
112
0.648891
[ "MIT" ]
diceroll/metric_learning
train_cifar.py
6,582
Python
import lvgl as lv import styles def lv_arc(screen): # Create the arc object on lv screen, ie a lv.scr() object arc = lv.arc(screen) # Set arc size arc.set_size(150, 150) # Set arc background style color blue arc.add_style(arc.PART.BG, styles.gstyle_bg1) # Set arc indicator (i.e. line) st...
29.5
98
0.653846
[ "MIT" ]
ndrogness/lvgl_micropython_examples
widgets/lv_arc/lv_arc.py
1,534
Python
#!/usr/bin/env python from __future__ import print_function import argparse import calendar import codecs import datetime import io import os.path import re import subprocess import sys from pycoinzpub.convention import tx_fee, satoshi_to_mbtc from pycoinzpub.encoding import hash160 from pycoinzpub.key import Key fr...
37.086207
120
0.620999
[ "MIT" ]
mewald55/pycoin_ypub-zpub
pycoin/cmds/tx.py
27,963
Python
from __future__ import absolute_import __version__ = '0.3.3' from .core.composition import * from .core.transforms_interface import * from .core.serialization import * from .augmentations.transforms import * from .augmentations.bbox_utils import * from .imgaug.transforms import *
25.727273
40
0.80212
[ "MIT" ]
BelBES/albumentations
albumentations/__init__.py
283
Python
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebPersonal.settings") application = get_wsgi_application() #application = DjangoWhiteNoise(application)
30.714286
71
0.84186
[ "Apache-2.0" ]
CristianAAT/web-personal
WebPersonal/WebPersonal/wsgi.py
215
Python
import sys import win32gui import sys import re import os import delete_mark import keyboard import win32com.client import pythoncom from PyQt5.QtWidgets import QApplication from PyQt5.QtGui import QImage import map_insert import pic_locate import delete_mark base_dir = os.path.dirname(os.path.abspath(__file__)) app =...
37.733333
121
0.658127
[ "MIT" ]
ChengYang1998/GenshinMapAutoMarkTools
main.py
2,280
Python
from bottle import route, Route, request, default_app, view, HTTPError, response from redis import StrictRedis from redis.utils import pipeline import json import uwsgi import os import logging import requests from config import get_config from worker import get_cache_key, get_wait_key, get_queue_key from worker im...
24.670886
108
0.611339
[ "MIT" ]
ikreymer/archivethiswebsite
web/app.py
3,898
Python
""" Some common functions for interfacing with the NodeMeister REST API. """ import requests import anyjson import re import logging MISSING_ITEM = '-' DIFF_MARKER = ">" try: logger.debug("importing nodemeisterlib") except NameError: FORMAT = "[%(levelname)s %(filename)s:%(lineno)s - %(funcName)20s() ] %(mes...
35.338411
168
0.634253
[ "Apache-2.0" ]
coxmediagroup/nodemeister
contrib/cli_scripts/nodemeisterlib.py
32,476
Python
from __future__ import absolute_import from datetime import datetime from django.utils import timezone from sentry.api.serializers import Serializer, register from sentry.models import Event, EventError @register(Event) class EventSerializer(Serializer): _reserved_keys = frozenset(['sentry.interfaces.User', 'sd...
32.868056
81
0.530319
[ "BSD-3-Clause" ]
E-LLP/sentry
src/sentry/api/serializers/models/event.py
4,733
Python
import os import sys from envyaml import EnvYAML # Adding the repository root to the sys path so exports work properly sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", ".."))) from examples.common.processes import GUIProcess, ImageCapture, YoloImageProcessor # noqa: E402 from rembrain_robot_framew...
31.387097
96
0.727646
[ "MIT" ]
francisso/rembrain_robotframework
examples/local/main.py
973
Python
# Purpose: API utilities # # Notes: API credentials must be enabled on Veracode account and placed in ~/.veracode/credentials like # # [default] # veracode_api_key_id = <YOUR_API_KEY_ID> # veracode_api_key_secret = <YOUR_API_KEY_SECRET> # # and file permission set appropriate...
39.184584
180
0.747904
[ "MIT" ]
DaYuM/veracode-api-py
veracode_api_py/api.py
19,318
Python
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2021 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
53.936102
199
0.603838
[ "Apache-2.0" ]
rdkcmf/rdkb-tools-tdkb
testscripts/RDKB/component/WAN_MANAGER/TS_WANMANAGER_DSLWANoE_FixedMode_ActLink_P_1-1_WAN_Pri-Sec.py
16,882
Python
from django.shortcuts import render,redirect from .models import Image,Location,Category # Create your views here. def intro(request): images = Image.objects.all() return render(request, 'intro.html',{'images':images}) def search_results(request): if 'image' in request.GET and request.GET["image"]: ...
38.928571
89
0.713761
[ "MIT" ]
IsaacMurage-dev/Art-Gallery
snaps/views.py
545
Python
class Solution: def removeDuplicates(self, S: str) -> str: i = 1 while i < len(S): if i <= 0: i += 1 continue if S[i] == S[i - 1]: S = S[:i - 1] + S[i + 1:] i = i - 1 else: i = i + 1 ...
21.833333
46
0.358779
[ "Apache-2.0" ]
kefirzhang/algorithms
leetcode/python/easy/p1047_removeDuplicates.py
393
Python
"""Assorted utilities shared between parts of apitools.""" import collections import httplib import os import types import urllib2 from apitools.base.py import exceptions __all__ = [ 'DetectGae', 'DetectGce', ] def DetectGae(): """Determine whether or not we're running on GAE. This is based on: ht...
25.477612
74
0.68717
[ "Apache-2.0" ]
Technology-Hatchery/google-cloud-sdk
.install/.backup/lib/apitools/base/py/util.py
1,707
Python
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved r""" Batch acquisition functions using the reparameterization trick in combination with (quasi) Monte-Carlo sampling. See [Rezende2014reparam]_ and [Wilson2017reparam]_ .. [Rezende2014reparam] D. J. Rezende, S. Mohamed,...
39.197561
86
0.62759
[ "MIT" ]
BradyBromley/botorch
botorch/acquisition/monte_carlo.py
16,071
Python
from .fhirbase import fhirbase class Annotation(fhirbase): """ A text note which also contains information about who made the statement and when. Args: authorReference: The individual responsible for making the annotation. authorString: The individual responsible for making the anno...
25.2
78
0.614638
[ "MIT" ]
D3-AI/Cardea
cardea/fhir/Annotation.py
1,134
Python
import abc import json import logging import os from typing import Any, Tuple, Union import numpy as np import tifffile import tiledb import zarr from slaid.commons import Mask, BasicSlide from slaid.commons.base import Polygon from slaid.commons.ecvl import BasicSlide as EcvlSlide logger = logging.getLogger(__file_...
28.062893
79
0.575751
[ "MIT" ]
mdrio/slaid
slaid/renderers.py
4,462
Python