max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
airflow-materials/demo/mnt/dags/pipeline/process.py
reginold/airflow-handson
0
30200
def second_task(**context): print("This is ----------- task 2") return "hoge======" def third_task(**context): output = context["task_instance"].xcom_pull(task_ids="python_task_2") print("This is ----------- task 3") return "This is the result : " + output
2.078125
2
002-python-oop/code/021_oop_class_builtin_attributes.py
CHemaxi/python
0
30201
""" MARKDOWN --- YamlDesc: CONTENT-ARTICLE Title: python builtin class attributes MetaDescription: python object oriented programming class builtin attributes __doc__, __name__, __module__, __bases__ example code, tutorials MetaKeywords: python object oriented programming class builtin attributes __doc__, __name__, __m...
3.390625
3
Prototype_2/web/blueprints/index.py
amal66/Kawm
0
30202
<reponame>amal66/Kawm from flask import Blueprint, render_template,redirect,url_for,request,flash,make_response from flask import current_app as app from flask_login import ( LoginManager, current_user, login_required, login_user, logout_user, UserMixin, ) from ..models import User, db from ..se...
2.34375
2
sensor/GY521_MPU6050.py
Smart4L/embedded-server
0
30203
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time from math import atan2, degrees import board import busio import adafruit_mpu6050 class GY521_MPU6050(): def __init__(self, id=None, address=0x68) -> None: self.id_sensor = id self.i2c = busio.I2C(board.SCL, board.SDA) self.mpu = adafruit_mpu60...
3.046875
3
sumo/tools/projects/TaxiFCD_Krieg/src/taxiQuantity/TaxisPerEdge.py
iltempe/osmosi
0
30204
#!/usr/bin/env python # -*- coding: Latin-1 -*- """ @file TaxisPerEdge.py @author <NAME> @author <NAME> @author <NAME> @date 2008-04-08 @version $Id$ Counts for every edge in the given FCD-file the number of Taxis which used this edge. After that this information can be visualized with an script called mpl_du...
3.3125
3
Tree/maxDepth.py
konantian/LeetCode
2
30205
''' Source : https://leetcode.com/problems/maximum-depth-of-binary-tree/ Author : <NAME> Date : 2018-07-21 /********************************************************************************** *Given a binary tree, find its maximum depth. * *The maximum depth is the number of nodes along the longest path from the roo...
4
4
cli/mmt/mmtcli.py
Centaurioun/modernmt
154
30206
<reponame>Centaurioun/modernmt import os import re from cli.mmt import MMT_HOME_DIR, MMT_LIB_DIR, MMT_BIN_DIR, MMT_JAR, MMT_PLUGINS_JARS from cli.utils import osutils def __get_java_version(): try: stdout, stderr = osutils.shell_exec(['java', '-version']) java_output = stdout + '\n' + stderr ...
2.234375
2
DocumentClassicifation.py
ValentineNauli/My_MachineLearning
1
30207
<reponame>ValentineNauli/My_MachineLearning #AUTHOR : <NAME> """ You have been given a stack of documents that have already been processed and some that have not. Your task is to classify these documents into one of eight categories: [1,2,3,...8]. You look at the specifications on what a document must contain a...
3.71875
4
utils/make_temporal_subsets.py
davidhwyllie/findNeighbour4
0
30208
""" generates lists of SARS-CoV-2 samples which occurred before a particular date Also generates a dictionary of reference compressed sequences And a subset of these Together, these can be passed to a ram_persistence object which can be used instead of an fn3persistence object to test the performance of PCA, or for o...
2.4375
2
kiauhoku/dartmouth.py
zclaytor/kiauhoku
12
30209
import os import re import pickle import numpy as np import pandas as pd from tqdm import tqdm # Assign labels used in eep conversion eep_params = dict( age = 'Age (yrs)', hydrogen_lum = 'L_H', lum = 'Log L', logg = 'Log g', log_teff = 'Log T', core_hydrogen_frac = 'X_core', # must be added ...
2.203125
2
geoscript/geom/io/wkt.py
jericks/geoscript-py
0
30210
from com.vividsolutions.jts.io import WKTReader, WKTWriter from geoscript.util import deprecated def readWKT(wkt): """ Constructs a geometry from Well Known Text. *wkt* is the Well Known Text string representing the geometry as described by http://en.wikipedia.org/wiki/Well-known_text. >>> readWKT('POINT (1...
2.96875
3
config/settings/production.py
maxelite1520/multi-vendor-e-commerce
0
30211
import os import dj_database_url import dotenv from .base import BASE_DIR env = BASE_DIR / '.env' dotenv.read_dotenv(env) # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False ALLOWED_HOSTS = ["multiple-vendor-e-commerce.herokuapp.com"] # Database # https://docs.djangoproject.com/en/3....
1.648438
2
webapp/starter/tracker/views.py
jersobh/docker-covidoff
0
30212
<gh_stars>0 from django.views import View from django.http import JsonResponse from tracker.models import Match from tracker.forms import MatchForm import json class MatchView(View): def put(self, request): try: body = request.body.decode('utf-8') body = json.loads(body) except json.decoder.JSONDecodeErr...
2.21875
2
precise/covariance/ledoitwolf.py
iklasky/precise
0
30213
from precise.covariance.movingaverage import ema_scov from precise.covariance.matrixfunctions import grand_mean, grand_shrink from sklearn.covariance._shrunk_covariance import ledoit_wolf_shrinkage import numpy as np # Experimental estimator inspired by Ledoit-Wolf # Keeps a buffer of last n_buffer observations # Tra...
2.203125
2
setup.py
ProrokWielki/Text2CArray
0
30214
<gh_stars>0 from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() setup(name='Text2CArray', version='0.1.0', description='Script for generating C arrays from text.', long_description=long_description, long_description_content_type='text/markdown...
1.5
2
robotframework-ls/tests/robotframework_ls_tests/_resources/case_vars_file/robotvars.py
mardukbp/robotframework-lsp
92
30215
<filename>robotframework-ls/tests/robotframework_ls_tests/_resources/case_vars_file/robotvars.py VARIABLE_1 = 10 VARIABLE_2 = 20
1.289063
1
src/markovRecipe.py
schollz/parseingredient
1
30216
import json import os.path import operator import time from multiprocessing import Pool import markovify from tqdm import tqdm removeWords = ['c', 'tsp', 'qt', 'lb', 'pkg', 'oz', 'med', 'tbsp', 'sm'] removeWords2 = [" recipes "," recipe "," mashed "," fat ",' c. ',' c ','grams','gram','chopped','tbsps','tbsp','cups',...
2.578125
3
nanome/api/structure/complex.py
nanome-ai/nanome
1
30217
<reponame>nanome-ai/nanome from nanome._internal._structure._complex import _Complex from nanome._internal import _PluginInstance from nanome._internal._network import PluginNetwork from nanome._internal._network._commands._callbacks import _Messages from nanome.util import Matrix, Logs from .io import ComplexIO from ....
2.359375
2
neighbourhood/models.py
Mutembeijoe/hood_yetu
0
30218
from django.db import models from django.contrib.postgres.fields import ArrayField from django.urls import reverse # Create your models here. class Neighbourhood(models.Model): image = models.ImageField(upload_to='neighbourhood_avatars', default='dummy_neighbourhood.jpg') name = models.CharField(max_length=2...
2.375
2
WEEKS/CD_Sata-Structures/_MISC/misc-examples/text_buffer.py
webdevhub42/Lambda
0
30219
from doubly_linked_list import DoublyLinkedList class TextBuffer: def __init__(self): self.storage = DoublyLinkedList() # return a string to the print function def __str__(self): # build a string s = "" current_node = self.storage.head while current_node: ...
3.65625
4
TWLight/users/models.py
Chinmay-Gurjar/TWLight
0
30220
# -*- coding: utf-8 -*- """ This file holds user profile information. (The base User model is part of Django; profiles extend that with locally useful information.) TWLight has three user types: * editors * coordinators * site administrators. _Editors_ are Wikipedia editors who are applying for TWL resource acce...
2.1875
2
src/reddit_baselines.py
mengelhard/cft
2
30221
<reponame>mengelhard/cft import numpy as np import pandas as pd import tensorflow as tf import itertools import datetime import os from sklearn.metrics import roc_auc_score from model import mlp, lognormal_nlogpdf, lognormal_nlogsurvival from model_reddit import load_batch from train_reddit import get_files from trai...
2.265625
2
os_client_config/constructors.py
dtroyer/os-client-config
36
30222
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 appli...
2.09375
2
src/the_tale/the_tale/linguistics/migrations/0009_remove_quotes_from_diary.py
al-arz/the-tale
85
30223
<gh_stars>10-100 # -*- coding: utf-8 -*- import json from django.db import models, migrations DIARY_KEYS = (0, 3, 4, 17, 20001, 20002, 20003, 40000, 40001, 40002, 40003, ...
1.53125
2
scripts/supp_fig_C_calc.py
dhbrookes/FitnessSparsity
3
30224
<filename>scripts/supp_fig_C_calc.py import sys sys.path.append("../src") import numpy as np import matplotlib.pyplot as plt import seaborn as sns import C_calculation plt.style.use(['seaborn-deep', '../paper.mplstyle']) """ This script produces Figure S3, which displays a detailed summary of the calculations used ...
2.40625
2
Exercicios Python/exlista01.py
oswaldo-spadari/Python-Exec
0
30225
#Faça um Programa que leia um vetor de 5 números inteiros e mostre-os. lista=[] for i in range(1, 6): lista.append(int(input('Digite um número: '))) print(lista)
4.03125
4
seno/wallet/trading/trade_status.py
emilson0407/seno-blockchain
11,902
30226
from enum import Enum class TradeStatus(Enum): PENDING_ACCEPT = 0 PENDING_CONFIRM = 1 PENDING_CANCEL = 2 CANCELED = 3 CONFIRMED = 4 FAILED = 5
2.484375
2
sbpy/spectroscopy/vega/sources.py
mkelley/sbpy
3
30227
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ======================== SBPy Vega Sources Module ======================== Descriptions of source Vega spectra. """ # Parameters passed to Vega.from_file. 'filename' is a URL. After # adding spectra here update __init__.py docstring and # docs/sbpy...
1.4375
1
api_server.py
ChristianKreuzberger/computer.vision.101
0
30228
<reponame>ChristianKreuzberger/computer.vision.101 import os os.environ["KERAS_BACKEND"] = "tensorflow" import numpy as np import keras from keras.applications import imagenet_utils from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPoo...
2.953125
3
Lesson2_Functions/8-return.py
StyvenSoft/degree-python
0
30229
<filename>Lesson2_Functions/8-return.py def divide_by_four(input_number): return input_number/4 result = divide_by_four(16) # result now holds 4 print("16 divided by 4 is " + str(result) + "!") result2 = divide_by_four(result) print(str(result) + " divided by 4 is " + str(result2) + "!") def calculate_age(curren...
3.921875
4
adjutant-plugin/mfa_views/models.py
catalyst-cloud/adjutant-mfa
2
30230
from adjutant.api.v1.models import register_taskview_class from mfa_views import views register_taskview_class(r'^openstack/edit-mfa/?$', views.EditMFA) register_taskview_class(r'^openstack/users/?$', views.UserListMFA)
1.351563
1
src/toast/tod/applygain.py
ziotom78/toast
0
30231
# Copyright (c) 2015-2019 by the parties listed in the AUTHORS file. # All rights reserved. Use of this source code is governed by # a BSD-style license that can be found in the LICENSE file. import numpy as np from astropy.io import fits from ..op import Operator from ..timing import function_timer from .tod_mat...
2.421875
2
jans-linux-setup/jans_setup/static/extension/person_authentication/GoogleExternalAuthenticator.py
nikdavnik/jans
18
30232
<gh_stars>10-100 # Janssen Project software is available under the Apache 2.0 License (2004). See http://www.apache.org/licenses/ for full text. # Copyright (c) 2020, Janssen Project # # Author: <NAME> # from io.jans.service.cdi.util import CdiUtil from io.jans.as.server.security import Identity from io.jans.model.cus...
2.203125
2
app/abbr/models.py
Tjorriemorrie/abbr
0
30233
from django.db import models # classification value objects CHOICES_CLASSIFICATION = [ (0, 'unrelated'), (1, 'simple'), (2, 'complex'), (3, 'substring'), ] class Abbreviation(models.Model): long_form = models.TextField(blank=False) abbreviation = models.CharField(max_length=100, blank=False) classification =...
2.421875
2
example/sign up.py
Roblox-Thot/captchaCodeMakerV2
7
30234
# This code could be improved but its just a example on how to use the code from the site import requests, base64, random, string token = input("Put code here:\n") headers = { 'authority': 'auth.roblox.com', 'dnt': '1', 'x-csrf-token': requests.post("https://auth.roblox.com/v2/login").headers["x-csrf-tok...
3.03125
3
users/roles.py
Zimodra/yamdb_final
0
30235
from django.db import models class Roles(models.TextChoices): USER = 'user', 'User' MODERATOR = 'moderator', 'Moderator' ADMIN = 'admin', 'Admin'
1.953125
2
blyaml/validators.py
Brainlabs-Digital/Brainlabs-YAML-Generator
0
30236
import re from datetime import datetime from PyInquirer import Validator, ValidationError from prompt_toolkit.document import Document # This file contains functions used for validation and Validator classes that use them. # Validators are used by questions. def non_empty(document: Document) -> bool: if not doc...
3.515625
4
src/git_profile_command/__init__.py
NiklasRosenstein/git-profile
0
30237
<gh_stars>0 # The MIT License (MIT) # # Copyright (c) 2019 <NAME> # # 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...
1.875
2
src/test/rebaseline-p.py
visit-dav/vis
226
30238
import filecmp import os import sys import shutil import subprocess import time import unittest if (sys.version_info > (3, 0)): import urllib.request, urllib.parse, urllib.error else: import urllib from optparse import OptionParser from PyQt4 import QtCore,QtGui parser = OptionParser() parser.add_option("-r",...
2.40625
2
src/pigs/bot.py
rcobanov/Examination2
0
30239
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Here is the class that controls the bot. It also contains various value manipulation, and one function that lets the bot play one round, from first roll until hold. The intelligence is basically how many rolls the bot is going to do on one round. The easier level on t...
3.859375
4
enochecker3/logging.py
Sinitax/enochecker3
0
30240
import datetime import logging from typing import Optional from .types import CheckerTaskMessage, EnoLogMessage LOGGING_PREFIX = "##ENOLOGMESSAGE " class ELKFormatter(logging.Formatter): def format(self, record: logging.LogRecord) -> str: if type(record.args) is tuple and len(record.args) > 0: ...
2.484375
2
examples/experimental/scala-parallel-recommendation-entitymap/data/import_eventserver.py
pferrel/incubator-predictionio
2
30241
# # 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 us...
1.96875
2
lib/ReadCsv.py
cxd/wave_weather_data_python
0
30242
<filename>lib/ReadCsv.py import os as os from pandas import pandas as p from pandas.compat import StringIO, BytesIO class ReadCsv: def __init__(self, base_dir): self.base_dir = base_dir @staticmethod def all_files(base_path): all_files = [] for file in os.scandir(base_path): ...
3.234375
3
01.py
dataquanty/ArtWorkWaves
0
30243
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 30 15:28:09 2018 @author: dataquanty """ import numpy as np from math import sqrt, pi, acos,cos from matplotlib import pyplot as plt from scipy.misc import imsave from bisect import bisect_left h , w = 1000, 1000 img = np.ones((h,w)) center = (...
2.59375
3
docs/conf.py
jrosser/mitogen
0
30244
import os import sys sys.path.append('..') import mitogen VERSION = '%s.%s.%s' % mitogen.__version__ author = u'<NAME>' copyright = u'2018, <NAME>' exclude_patterns = ['_build'] extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinxcontrib.programoutput'] html_show_sourcelink = False html_show_sphinx =...
1.65625
2
src/pkg/caendr/caendr/models/sql/wormbase_gene_summary.py
AndersenLab/CAENDR
3
30245
<reponame>AndersenLab/CAENDR from caendr.services.cloud.postgresql import db from caendr.models.sql.dict_serializable import DictSerializable from sqlalchemy import func, or_ from sqlalchemy.ext.hybrid import hybrid_property class WormbaseGeneSummary(DictSerializable, db.Model): """ This is a condensed version...
2.4375
2
gunmel/models.py
zhenkai/xgunicorn
0
30246
from django.core.exceptions import ValidationError from django.db import models from django.forms.models import model_to_dict from decimal import Decimal # Create your models here. class ProductManager(models.Manager): def top_drops(self, n): return self.get_queryset().order_by('-price_drop')[:n] de...
2.28125
2
xos/api/utility/toscaapi.py
iecedge/xos
0
30247
# Copyright 2017-present Open Networking Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
1.804688
2
tests/test_plugins/test_wiki.py
follower46/ashaw-notes
4
30248
<filename>tests/test_plugins/test_wiki.py """ Testing Wiki Module """ import unittest from ddt import ddt, data, unpack from ashaw_notes.plugins.wiki import Plugin @ddt class PluginTests(unittest.TestCase): """Unit Testing Plugin""" @unpack @data( (1373500800, 'today: derp note', ...
2.765625
3
cppcheck_junit.py
PfannenHans/cppcheck-junit
8
30249
<reponame>PfannenHans/cppcheck-junit<filename>cppcheck_junit.py #!/usr/bin/env python3 """Converts Cppcheck XML version 2 output to JUnit XML format.""" import argparse import collections from datetime import datetime import os from socket import gethostname import sys from typing import Dict, List from xml.etree imp...
2.96875
3
apps/core/tests/conftest.py
techlib/czechelib-stats
1
30250
import pytest from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from core.models import Identity from organizations.models import Organization @pytest.fixture def valid_identity(): id_string = '<EMAIL>' user = get_user_model().objects...
2.015625
2
tests/test_descriptor.py
OlivierBeq/ProDEC
0
30251
<filename>tests/test_descriptor.py # -*- coding: utf-8 -*- """Tests for Descriptor.""" import unittest import numpy as np import orjson from prodec import Descriptor from prodec.utils import std_amino_acids from tests.constants import * class TestDescriptor(unittest.TestCase): """Tests for Descriptor.""" ...
2.765625
3
mmdet/apis/__init__.py
ar90n/ttfnet
36
30252
<filename>mmdet/apis/__init__.py from .env import get_root_logger, init_dist, set_random_seed from .inference import inference_detector, init_detector, show_result from .train import train_detector __all__ = [ 'init_dist', 'get_root_logger', 'set_random_seed', 'train_detector', 'init_detector', 'inference_dete...
1.414063
1
tree.py
joshedler/ct2ad
0
30253
#! /usr/bin/env python3 ''' Examine a CherryTree SQLite database and print out the tree in proper heirarchical form and sequence. ''' import argparse import colorama from colorama import Fore, Back, Style import sqlite3 from ct2ad import * def print_xc_node(xc_node, level): ''' Print the node information to...
3.125
3
sparse_entertainment.py
synergetics/nest_expermiments
0
30254
#!/usr/bin/env python import sys sys.path.append('/opt/lib/python2.7/site-packages/') import math import numpy as np import pylab import nest import nest.raster_plot import nest.voltage_trace import nest.topology as tp import ggplot t_sim = 500 populations = [1, 100] no_recurrent = True neuron_model = 'iaf_psc_e...
2.03125
2
management/views.py
EsraelDawit-a/Drims-Fse-Project
0
30255
from django.shortcuts import render,redirect,get_object_or_404 from .forms import * from django.contrib import messages from django.contrib.auth.decorators import login_required from .models import * from django.views.generic import DetailView,DeleteView from django.urls import reverse_lazy from test2.notification impo...
2.078125
2
dogpile/__init__.py
dhellmann/dogpile.cache
0
30256
__version__ = '0.9.3' from .lock import Lock # noqa from .lock import NeedRegenerationException # noqa
1.078125
1
pyssian/tests/test_chemistryutils.py
maserasgroup-repo/pyssian
15
30257
from pyssian.chemistryutils import is_basis,is_method import unittest class ChemistryUtilsTest(unittest.TestCase): def setUp(self): self.Valid_Basis = '6-311+g(d,p) 6-31g* cc-pVTZ D95V* LanL2DZ SDD28 Def2SVP UGBS2P2++'.split() self.Fake_Basis = '6-311g+(d,p) 6-31*g ccpVTZ D96V* LanL2TZ SDD Def2SP U...
2.84375
3
custom_components/life360/life360.py
nicholas-sly/life360
0
30258
<gh_stars>0 # This is what requests does. try: import simplejson as json except ImportError: import json import logging import requests from .exceptions import * _PROTOCOL = 'https://' _BASE_URL = '{}api.life360.com/v3/'.format(_PROTOCOL) _TOKEN_URL = _BASE_URL + 'oauth2/token.json' _CIRCLES_URL = _BASE_URL ...
2.765625
3
pandas_selectable/tests/conftest.py
jseabold/pandas-select
28
30259
<reponame>jseabold/pandas-select import numpy as np import pandas as pd import pytest @pytest.fixture def dta(): return pd.DataFrame.from_dict( { 'A': np.arange(1, 16), 'B': pd.date_range('2020-01-01', periods=15), 'C': ['A', 'B', 'C'] * 5, 'D': pd.Categoric...
2.390625
2
xsoccer/analysis/management/commands/analysis4.py
awyrough/xsoccer
0
30260
""" Objectives: - Which players pass together the most? - What types of position combintations are most frequent in pass-sequences? """ """ Sample Run Script: python manage.py analysis3 --team_uuid="t1326" --print_to_csv python manage.py analysis4 --team_uuid="t1326" --start_date="2016-07-01" python ...
2.6875
3
api/classes/portfolio.py
alexander-schilling/fintual_test
0
30261
from .stock import Stock class Portfolio: def __init__(self, assets): self.stocks = [] self.__populate_stocks(assets) def get_stock(self, stock_name): for stock in self.stocks: if stock.name == stock_name: return stock return None def get_prof...
3.125
3
examples/ConsumptionSaving/example_ConsMedModel.py
HsinYiHung/HARK_HY
0
30262
<gh_stars>0 # %% from HARK.utilities import CRRAutility_inv from time import time import matplotlib.pyplot as plt import numpy as np from HARK.ConsumptionSaving.ConsMedModel import MedShockConsumerType # %% mystr = lambda number: "{:.4f}".format(number) # %% do_simulation = True # %% [markdown] # This module defines...
2.640625
3
cogs/general.py
xthecoolboy/MizaBOT
0
30263
import discord from discord.ext import commands import asyncio import aiohttp import random from datetime import datetime, timedelta import math import json # ##################################################################################### # math parser used by $calc class MathParser: def __init_...
2.59375
3
2019-2020/MATH_1301_Python/Zork/barriers.py
TSoGiants/Foundations
0
30264
<reponame>TSoGiants/Foundations<gh_stars>0 ##################### ### Base classes. ### ##################### class barrier: synonyms = ["wall"] m_description = "There is a barrier in the way." def __init__(self, passable=False): self.passable = passable def __str__(self): ...
2.953125
3
etc/n_CR/Vmc_lo/load_Vsw.py
jimsrc/seatos
0
30265
#!/usr/bin/env ipython import numpy as np #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ class gral(): def __init__(self): self.name = '' sh, mc = gral(), gral() cr = gral() cr.sh, cr.mc = gral(), gral() vlo, vhi = 550.0, 3000.0 #550., 3000. #100.0, 450.0 #...
2.21875
2
tools/radar_img_per_sim.py
mgaggero/tdm-tools
0
30266
# Copyright 2018-2019 CRS4 # # 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, softwa...
2.046875
2
server/base/views.py
arubdesu/zentral
634
30267
import logging from django.apps import apps from django.contrib.auth.mixins import LoginRequiredMixin from django.http import Http404, HttpResponse, JsonResponse from django.views.generic import TemplateView, View from zentral.core.stores import frontend_store logger = logging.getLogger("server.base.views") class H...
1.914063
2
libqtile/widget/she.py
CharString/qtile
1
30268
from libqtile.widget import base from libqtile import bar, hook __all__ = ['She'] class She(base._TextBox): ''' Widget to display the Super Hybrid Engine status. can display either the mode or CPU speed on eeepc computers.''' defaults = [ ('device', '/sys/devices/platform/eeepc/cpufv', 'sys path...
2.5625
3
bench/bench_queue.py
coleifer/ukt
10
30269
<reponame>coleifer/ukt #!/usr/bin/env python from contextlib import contextmanager import os import sys import time srcdir = os.path.dirname(os.path.dirname(__file__)) sys.path.insert(0, srcdir) from ukt import * script = os.path.join(srcdir, 'scripts/kt.lua') server = EmbeddedServer(database='%', server_args=['-...
2.125
2
nicos_ess/labs/chop_embla/setups/skf_chopper.py
jkrueger1/nicos
12
30270
<gh_stars>10-100 description = 'Some kind of SKF chopper' pv_root = 'LabS-Embla:Chop-Drv-0601:' devices = dict( skf_drive_temp=device('nicos.devices.epics.pva.EpicsReadable', description='Drive temperature', readpv='{}DrvTmp_Stat'.format(pv_root), monitor=True, ), skf_motor_temp=de...
1.570313
2
autotf/selector/base_selector.py
zwt233/autotf
1
30271
class BaseSelector: def __init__(self): pass def select_model(self, X, y, total_time, learners=None, metric=None, save_directory=None): """ Find the best model with its hyperparameters from the autotf's...
3.015625
3
external/netdef_models/netdef_slim/evolutions/__init__.py
zhuhu00/MOTSFusion_modify
0
30272
nothing = None
1.359375
1
chapter_08/05_alphabetic_tel_number.py
SergeHall/Tony-Gaddis-Python-4th
2
30273
# # 5. Алфавитный переводчик номера телефона. Многие компании используют телефонные # # номера наподобие 555-GET-FOOD, чтобы клиентам было легче запоминать эти номера. # # На стандартном телефоне буквам алфавита поставлены в соответствие числа следующим # # образом: А,В и С=2 ; D,Е и F=З. phone_num = input('nnn-XXX-XXX...
4.34375
4
admin/urls.py
ttdys108/django-demo
0
30274
<filename>admin/urls.py from django.urls import path from .views import index, users, weather app_name = 'admin' urlpatterns = [ path('', index.index, name='index'), path('users/', users.index, name='users.index'), path('users/add', users.add, name='users.add'), path('users/update', users.update, name=...
1.867188
2
Disco.py
daniel-s-ingram/disco
0
30275
import sys import requests from statistics import mean, stdev from bs4 import BeautifulSoup import matplotlib.pyplot as plt class Disco(): def __init__(self, artist): self.website_url = "https://en.wikipedia.org" disco_soup = self.get_disco_soup(artist) album_urls = self.get_album_urls(dis...
3.09375
3
src/tools/dev/scripts/hooks/ciabot_svn.py
eddieTest/visit
0
30276
<reponame>eddieTest/visit #!/usr/bin/env python # # This is a CIA client script for Subversion repositories, written in python. # It generates commit messages using CIA's XML format, and can deliver them # using either XML-RPC or email. See below for usage and cuztomization # information. # # --------------------------...
1.992188
2
lists_04/insertion_at_a_specified_position_in_a_list.py
njoroge33/py_learn
0
30277
<gh_stars>0 # Given a list x of length n, a number to be inserted into the list and a position where to insert the number # return the new list # e.g given [2, 3, 6, 7], num=8 and position=2, return [2, 3, 8, 6, 7] # for more info on this quiz, go to this url: http://www.programmr.com/insertion-specified-position-array...
4.15625
4
carton/tests/urls.py
knyazz/py3-django-enriched-carton
0
30278
from django.conf.urls import url from .views import ( add, clear, remove, remove_single, set_quantity, show ) urlpatterns = [ url(r'^show/$', show, name='carton-tests-show'), url(r'^add/$', add, name='carton-tests-add'), url(r'^remove/$', remove, name='carton-tests-remove'), u...
1.59375
2
spectrumanalyzer.py
cwolfe007/LEDSoundResponsiveSuit
0
30279
# Spectrum Analyzer Code Author: <NAME> import time import Adafruit_GPIO.SPI as SPI import Adafruit_MCP3008 import numpy as np class SpectrumAnalyzer: def __init__(self,smprate=44100,senistivity=100.0,samplesize=1024): self.__samplerate =smprate self.__pea...
2.625
3
hs_core/discovery_form.py
tommac7/hydroshare
178
30280
from haystack.forms import FacetedSearchForm from haystack.query import SQ from django import forms from hs_core.discovery_parser import ParseSQ, MatchingBracketsNotFoundError, \ FieldNotRecognizedError, InequalityNotAllowedError, MalformedDateError FACETS_TO_SHOW = ['creator', 'contributor', 'owner', 'content_typ...
2.25
2
streamlit_prophet/lib/exposition/visualize.py
carolinedlu/darkpool-snowvation
36
30281
from typing import Any, Dict, List import datetime import pandas as pd import plotly.express as px import plotly.figure_factory as ff import plotly.graph_objects as go import streamlit as st from fbprophet import Prophet from fbprophet.plot import plot_plotly from plotly.subplots import make_subplots from streamlit_p...
2.609375
3
tracking/admin.py
mohdbakhrayba/it-assets
0
30282
<reponame>mohdbakhrayba/it-assets<gh_stars>0 from datetime import date, datetime, timedelta from django.conf import settings from django.conf.urls import url from django.contrib.admin import register, ModelAdmin from django.http import HttpResponse import pytz import xlsxwriter from .models import Computer, Mobile, EC...
1.867188
2
accounts/tests/test_views.py
jhonatanlteodoro/ecommerce-django
1
30283
from django.test import Client from django.test import TestCase from django.urls import reverse from django.contrib.auth import get_user_model from model_mommy import mommy from django.conf import settings User = get_user_model() class RegisterViewTestCase(TestCase): def setUp(self): self.client = Client(...
2.46875
2
modules/data_generator.py
radiradev/finetuned-cvn
1
30284
""" DUNE CVN generator module. """ __version__ = '1.0' __author__ = '<NAME>, <NAME>' __email__ = "<EMAIL>, <EMAIL>" import numpy as np import zlib class DataGenerator(object): ''' Generate data for tf.keras. ''' def __init__(self, cells=500, planes=500, views=3, batch_size=32, images_pat...
2.734375
3
car_classifier/utils.py
SaraLatif99/car-classification
2
30285
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf def show_batch(ds: tf.data.Dataset, classes: list, rescale: bool = False, size: tuple = (10, 10), title: str = None): """ Function to show a batch of images including labels f...
3.34375
3
mc_states/grains/makina_grains.py
makinacorpus/makina-states
18
30286
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Makina custom grains ===================== makina.upstart true if using upstart makina.lxc true if inside an lxc container makina.docker true if inside a docker container makina.devhost_num devhost num if any ''' import os import copy import subprocess...
2.078125
2
scripts/devops_tasks/trust_proxy_cert.py
vincenttran-msft/azure-sdk-for-python
2,728
30287
<filename>scripts/devops_tasks/trust_proxy_cert.py import requests import os EXISTING_ROOT_PEM = requests.certs.where() root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", "..")) LOCAL_DEV_CERT = os.path.abspath(os.path.join(root_dir, 'eng', 'common', 'testproxy', 'dotnet-devcert.crt')) COM...
2.453125
2
tests/onegov/wtfs/test_fields.py
politbuero-kampagnen/onegov-cloud
0
30288
from cgi import FieldStorage from datetime import date from io import BytesIO from onegov.core.utils import Bunch from onegov.form import Form from onegov.wtfs.fields import HintField from onegov.wtfs.fields import MunicipalityDataUploadField class PostData(dict): def getlist(self, key): v = self[key] ...
2.484375
2
lattice_gauge_theory/cluster.py
saforem2/lattice_gauge_theory
4
30289
<filename>lattice_gauge_theory/cluster.py<gh_stars>1-10 class Cluster(object): """ Object for grouping sets of sites. """ def __init__(self, sites): """ Initialize a cluster instance. Args: sites (list(Site)): The list of sites that make up the cluster. Returns: ...
3.25
3
airflow_server/dags/cbs.py
ephraimberkovitch/anyway-etl
0
30290
from airflow import DAG from airflow.utils.dates import days_ago from anyway_etl_airflow.operators.cli_bash_operator import CliBashOperator dag_kwargs = dict( default_args={ 'owner': 'airflow', }, schedule_interval='@weekly', catchup=False, start_date=days_ago(2), ) with DAG('cbs', **da...
2.3125
2
automation/devops_automation_infra/utils/s3.py
AnyVisionltd/devops-automation-infra
2
30291
<reponame>AnyVisionltd/devops-automation-infra import os import boto3 from automation_infra.utils import concurrently from functools import partial def clear_bucket(boto3_client, bucket_name): boto3_client.delete_bucket(Bucket=bucket_name) def clear_all_buckets(boto3_client): bucket_names = [bucket['Name'] ...
2.296875
2
part_1_read_test_dat.py
MOTWODAHS/cc_tools
0
30292
import cc_dat_utils #Part 1 input_dat_file = "data/pfgd_test.dat" #Use cc_dat_utils.make_cc_level_pack_from_dat() to load the file specified by input_dat_file #print the resulting data data = cc_dat_utils.make_cc_level_pack_from_dat(input_dat_file) print(data)
2.140625
2
src/gen_drum_kit/importer/importer_hydrogen.py
peter-zenk/genDrumkit
7
30293
''' Created on Jun 14, 2020 @author: peter ''' import sys import re import tarfile from os import path import xml.etree.ElementTree as ET import logging from gen_drum_kit.importer.importer_base import ImporterBase from gen_drum_kit.builder.builder_hydrogen import Builder_Hydrogen from gen_drum_kit.util ...
1.976563
2
icbd/type_analyzer/tests/parametric.py
kmod/icbd
7
30294
<filename>icbd/type_analyzer/tests/parametric.py import collections def unknown(): raise Exception() l = [1] # 0 [<int|str>] l.append(2) # 0 [<int|str>] # 2 (<int|str>) -> None l.append('') l[0] = 1 l[0] = "" l2 = list(l) # 0 [<int|str>] l2 = sorted(l) # 0 [<int|str>] x = collections.deque(l2).pop() # 0 <int|str...
2.84375
3
pylab/image/restoration/blind_deconv.py
N8Grant/Blind-Deconvolution-Python
0
30295
import matlab.engine import matlab import numpy as np import PIL import matplotlib.pyplot as plt import sys print(sys.version_info[0:2]) if sys.version_info[0:2] != (3, 8) and sys.version_info[0:2] != (3, 7) and sys.version_info[0:2] != (3, 6): raise Exception('Requires python 3.6, 3.7, or 3.8') eng = matlab.eng...
2.53125
3
chess-ai-master/game/rules.py
explodicus/intelliSah
0
30296
from collections import defaultdict import pieces class RulesEnforcer(object): """ Enforces the rules of the game Examines the move, and determines whether its a valid move or not. """ letter_dict = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7} pos_letters = letter_dict.keys() pos_nums...
3.984375
4
eyed/rpc/bacnetd/__init__.py
ThousandMileEye/Eye
0
30297
#!/usr/bin/env python # -*- coding: utf-8 -*- from bacnetd import SingleBACnetdService from bacnetd import BACnetdService __all__ = [ SingleBACnetdService, BACnetdService, ]
1.179688
1
gotham.py
amirothman/audio-visualization
0
30298
from skimage.util import img_as_float from skimage import io, filters # from skimage.viewer import ImageViewer import numpy as np def split_image_into_channels(image): """Look at each image separately""" red_channel = image[:, :, 0] green_channel = image[:, :, 1] blue_channel = image[:, :, 2] ret...
3.046875
3
backend/backend/integration_utils.py
kaipietila/CookOS
0
30299
from datetime import datetime from backend.backend.classes_main import Order, OrderItemStateUpdate, OrderUpdate, StatusHistory from backend.backend.exceptions import NoOrderFoundException from backend.backend.repository import get_order_by_id, update_items, update_order_status, get_orders, create_order from backend.ba...
2.46875
2