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 |
|---|---|---|---|---|---|---|
django_gotolong/bhav/apps.py | ParikhKadam/gotolong | 15 | 19200 | <reponame>ParikhKadam/gotolong
from django.apps import AppConfig
from django_gotolong.bhav.views import start
class BhavConfig(AppConfig):
name = 'bhav'
def ready(self):
start()
| 1.796875 | 2 |
tethysext/atcore/services/paginate.py | Aquaveo/tethysext-atcore | 3 | 19201 | """
********************************************************************************
* Name: pagintate.py
* Author: nswain
* Created On: April 17, 2018
* Copyright: (c) Aquaveo 2018
********************************************************************************
"""
def paginate(objects, results_per_page, page, resul... | 3.078125 | 3 |
geotweet/tests/integration/twitter/__init__.py | meyersj/geotweet | 6 | 19202 | <gh_stars>1-10
import os
from os.path import dirname
import sys
ROOT = dirname(dirname(dirname(os.path.abspath(__file__))))
sys.path.append(ROOT)
| 1.960938 | 2 |
main.py | nerdmanPc/arvore-b | 0 | 19203 | <reponame>nerdmanPc/arvore-b<gh_stars>0
# Primeiro Trabalho Pratico de EDAII (UFBA)
# Desenvolvido em dupla:
# <NAME> e <NAME>
# Versão Python 3.8.10
#
# OBSERVACAO IMPORTANTE:
# A CONSTANTE GRAUMINIMO ESTA NO ARQUIVO node.py
import os
from struct import Struct
from typing import Optional, Tuple
from enum import Enum
... | 3.015625 | 3 |
hcat/backends/spatial_embedding.py | buswinka/hcat | 4 | 19204 | import torch
import hcat.lib.functional
from hcat.lib.functional import IntensityCellReject
from hcat.backends.backend import Backend
from hcat.models.r_unet import embed_model as RUnet
from hcat.train.transforms import median_filter, erosion
import hcat.lib.utils
from hcat.lib.utils import graceful_exit
import os.pat... | 1.960938 | 2 |
mortar_rdb/tests/test_utility.py | Mortar/mortar_rdb | 1 | 19205 | from mortar_rdb import register_session, get_session
from mortar_rdb.interfaces import ISession
from testfixtures.components import TestComponents
from sqlalchemy.exc import OperationalError
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import Session
from sqlalchemy.schema import ... | 2.25 | 2 |
magic_driver_control/scripts/driver_controller.py | flamma7/adv_robotics | 0 | 19206 | <filename>magic_driver_control/scripts/driver_controller.py
#!/usr/bin/env python
"""
This node talks directly to the pololu driver
It takes in PID control effort and maps it to commands for the pololu driver
"""
from __future__ import division
import rospy
from std_msgs.msg import Float64, Int8MultiArray
DRIVE_PUB... | 2.578125 | 3 |
GageRnR/application.py | tobyndax/GageRnR | 0 | 19207 | """GageRnR.
The input data should be structured
in a 3d array n[i,j,k] where
i = operator, j = part, k = measurement
Stored to file this data would look:
m1 m2 m3
3.29; 3.41; 3.64 # p1 | o1
2.44; 2.32; 2.42 # p2
3.08; 3.25; 3.07 # p1 | o2
2.53; 1.78; 2.32 # p2
3.04; 2.89; 2.85 # p1 | o3
1.62; 1.87; 2.04 # ... | 2.90625 | 3 |
final/options.py | annahung31/Advance_MM_homeworks | 0 | 19208 | <filename>final/options.py
import numpy as np
import os
import glob
import torch
import argparse
def parse_args(script):
parser = argparse.ArgumentParser(description= 'few-shot script %s' %(script))
parser.add_argument('--task', default='fsl', help='fsl/cdfsl-single/cdfsl-multi')
parser.add_argument('--dataset',... | 2.3125 | 2 |
tests/test_pt.py | atti84it/ebook-reader-dict | 83 | 19209 | import pytest
from wikidict.render import parse_word
from wikidict.utils import process_templates
@pytest.mark.parametrize(
"word, pronunciations, gender, etymology, definitions",
[
("ababalhar", [], "", ["De baba."], ["<i>(popular)</i> babar; conspurcar"]),
(
"alguém",
... | 2.640625 | 3 |
rebalancer.py | papercheck/lndg | 0 | 19210 | <filename>rebalancer.py
import django, json, datetime
from django.conf import settings
from django.db.models import Sum
from pathlib import Path
from datetime import datetime, timedelta
from gui.lnd_deps import lightning_pb2 as ln
from gui.lnd_deps import lightning_pb2_grpc as lnrpc
from gui.lnd_deps import router_pb2 ... | 2.015625 | 2 |
pale/fields/base.py | Loudr/pale | 13 | 19211 | <gh_stars>10-100
# -*- coding: utf-8 -*-
import logging
import types
from collections import Iterable
class BaseField(object):
"""The base class for all Fields and Arguments.
Field objects are used by Resources to define the data they return.
They include a name, a type, a short description, and a long
... | 3.140625 | 3 |
DublinBusTest/forms.py | Eimg851/DublinBusApp_ResearchPracticum | 0 | 19212 | from django import forms
from .models import *
class routeForm(forms.ModelForm):
class Meta:
model = Routes
fields = ('route_short_name',)
| 1.789063 | 2 |
tests/automated/test_aws_automated.py | hrichardlee/meadowrun | 0 | 19213 | """
These tests require an AWS account to be set up, but don't require any manual
intervention beyond some initial setup. Also, these tests create instances (which cost
money!). Either `meadowrun-manage install` needs to be set up, or `meadowrun-manage
clean` needs to be run periodically
"""
import asyncio
import date... | 1.953125 | 2 |
aficionado/defaults.py | SamuelHornsey/aficionado | 1 | 19214 | def not_found_handler():
return '404. Path not found'
def internal_error_handler():
return '500. Internal error' | 1.609375 | 2 |
apps/hosts/views.py | kaustubh-s1/EvalAI | 1,470 | 19215 | <gh_stars>1000+
from django.contrib.auth.models import User
from rest_framework import permissions, status
from rest_framework.decorators import (
api_view,
authentication_classes,
permission_classes,
throttle_classes,
)
from rest_framework.response import Response
from rest_framework_expiring_authtoke... | 1.96875 | 2 |
trace_for_guess/rescale.py | wtraylor/trace21ka_for_lpjguess | 0 | 19216 | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import os
import shutil
import subprocess
from termcolor import cprint
from trace_for_guess.skip import skip
def rescale_file(in_file, out_file, template_file, alg):
"""Regrid a NetCDF file using NCO (i.e. the ncremap command).
... | 2.4375 | 2 |
loldib/getratings/models/NA/na_khazix/na_khazix_top.py | koliupy/loldib | 0 | 19217 | from getratings.models.ratings import Ratings
class NA_Khazix_Top_Aatrox(Ratings):
pass
class NA_Khazix_Top_Ahri(Ratings):
pass
class NA_Khazix_Top_Akali(Ratings):
pass
class NA_Khazix_Top_Alistar(Ratings):
pass
class NA_Khazix_Top_Amumu(Ratings):
pass
class NA_Khazix_Top_Anivia(Ratings):
... | 1.34375 | 1 |
setup.py | KloudTrader/libkloudtrader | 11 | 19218 | <reponame>KloudTrader/libkloudtrader<filename>setup.py
from distutils.core import setup
setup(
name='libkloudtrader',
version='1.0.0',
author='KloudTrader',
author_email='<EMAIL>',
packages=['libkloudtrader'],
url='https://github.com/KloudTrader/kloudtrader',
license='LICENSE',
descript... | 1.3125 | 1 |
sdk/python/opencannabis/media/__init__.py | CookiesCo/OpenCannabis | 2 | 19219 | # ~*~ coding: utf-8 ~*~
__doc__ = """
`opencannabis.media`
---------------------------
Records and definitions that structure digital media and related assets.
"""
# `opencannabis.media`
| 1.054688 | 1 |
mlutils/losses.py | DSciLab/mlutils | 0 | 19220 | <reponame>DSciLab/mlutils
from typing import Callable, Optional, Union, Tuple, List
import torch
from torch import nn
from cfg import Opts
from torch import Tensor
from torch.nn import functional as F
from mlutils import LogitToPreds
EPS = 1.0e-8
__all__ = ['IOULoss', 'GDiceLoss', 'SoftDiceLoss',
'CrossE... | 2.296875 | 2 |
libary/yml_wrapper.py | NekoFanatic/kaiji | 0 | 19221 | from typing import Union
import yaml
class ConfigReader:
def __init__(self):
with open("config.yml", "r") as f:
data = yaml.safe_load(f)
self.data = data
def __getattr__(self, __name: str):
s = __name.split("_")
data = self.data
try:
for i in s... | 3.03125 | 3 |
smoothfdr/easy.py | tansey/smoothfdr | 6 | 19222 | <reponame>tansey/smoothfdr
# import itertools
# from functools import partial
# from scipy.stats import norm
# from scipy.sparse import csc_matrix, linalg as sla
# from scipy import sparse
# from scipy.optimize import minimize, minimize_scalar
# from collections import deque, namedtuple
import numpy as np
from networkx... | 2.171875 | 2 |
code/2cams.py | ctm1098/umucv | 12 | 19223 | <filename>code/2cams.py
#!/usr/bin/env python
import numpy as np
import cv2 as cv
cap1 = cv.VideoCapture(0)
cap2 = cv.VideoCapture(1)
while(cv.waitKey(1) & 0xFF != 27):
ret, frame1 = cap1.read()
ret, frame2 = cap2.read()
cv.imshow('c1',frame1)
cv.imshow('c2',frame2)
gray1 = cv.cvtColor(frame1... | 2.84375 | 3 |
Summary pie chart/Sum_Indonesia.py | pdeesawat/PSIT58_test_01 | 0 | 19224 | import plotly.plotly as py
"""Get data from csv and split it"""
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for ix in alldata:
listdata.append(ix.strip().split(','))
"""Seperate data in each type of disaster."""
all_disaster = {'Drought':0, 'Flood':0, 'Storm':0, 'Epidemic':0... | 3.546875 | 4 |
python/draw_dog.py | event-driven-robotics/study-air-hockey | 0 | 19225 | import numpy as np
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import cm
from scipy import signal
import matplotlib.image as mpimg
# matplotlib.use('Agg')
# define normalized 2D gaussian
def gaus2d(x, y, mx, my, sx, sy):
return 1. / (2. * np.pi * sx *... | 2.59375 | 3 |
PycharmProjects/PythonValidacao/consome_api.py | FeFSRibeiro/learning-python | 0 | 19226 | import requests
class BuscaEndereco:
def __init__(self,cep):
if self.valida_cep(str(cep)):
self.cep = str(cep)
else:
raise ValueError("CEP Inválido !!!")
def __str__(self):
return self.formata_cep()
def valida_cep(self,cep):
if len(self.cep ==... | 2.984375 | 3 |
tools/convert_lightning2venot.py | ucl-exoplanets/TauREx_public | 18 | 19227 | <reponame>ucl-exoplanets/TauREx_public
#! /usr/bin/python
#small script that shits out the venot file format equivalent for the lightening project
import numpy as np
import pylab as pl
import pyfits as pf
import glob, os, sys
AMU = 1.660538921e-27
KBOLTZ = 1.380648813e-23
G = 6.67384e-11
RSOL = 6.955e8
RJUP = 6.9... | 2.5 | 2 |
setup.py | NWeis97/ML_Ops_Project | 0 | 19228 | <filename>setup.py
from setuptools import find_packages, setup
setup(
name="src",
packages=find_packages(),
version="0.1.0",
description="This project contains the final exercise of S1, "
+ "in which we will continue to build upon",
author="<NAME>",
license="MIT",
)
| 1.164063 | 1 |
webapi.py | rhalkyard/gmdrec | 0 | 19229 | <reponame>rhalkyard/gmdrec
# Talking to the music player and sanitizing data.
import datetime
import requests
from requests.exceptions import Timeout
from unihandecode import Unihandecoder
from settings import server_url
def asciify(script, args):
if args.lang_code is None:
return Unihandecoder().decode... | 2.8125 | 3 |
puresnmp/aio/api/pythonic.py | badboybeyer/puresnmp | 0 | 19230 | <filename>puresnmp/aio/api/pythonic.py
"""
This module contains the high-level functions to access the library with
asyncio. Care is taken to make this as pythonic as possible and hide as many
of the gory implementations as possible.
This module provides "syntactic sugar" around the lower-level, but almost
identical, ... | 2.015625 | 2 |
dataset_models/normalization/aroundZeroNormalizer.py | Zvezdin/blockchain-predictor | 35 | 19231 | <filename>dataset_models/normalization/aroundZeroNormalizer.py
import numpy as np
from .normalizer import Normalizer
class AroundZeroNormalizer(Normalizer):
def __init__(self, data):
self.minVal = np.min(data)
self.maxVal = np.max(data)
self.maxVal = max(abs(self.maxVal), abs(self.minVal))
def transform(sel... | 2.859375 | 3 |
viz/scripts/closest_over_time_with_shading.py | zhicongchen/histwords | 2 | 19232 | import helpers
import sys
from representations.sequentialembedding import SequentialEmbedding
"""
Let's examine the closest neighbors for a word over time
"""
import collections
from sklearn.manifold import TSNE
import numpy as np
import matplotlib.pyplot as plt
WORDS = helpers.get_words()
if __name__ == "__main__"... | 3.140625 | 3 |
Products/LDAPUserFolder/interfaces.py | phgv/Products.LDAPUserFolder | 0 | 19233 | <filename>Products/LDAPUserFolder/interfaces.py
##############################################################################
#
# Copyright (c) 2000-2009 <NAME> and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL shou... | 2.0625 | 2 |
arequests/exceptions.py | fhag/telegram2 | 0 | 19234 | # -*- coding: utf-8 -*-
"""
Exceptions for Arequests
Created on Tue Nov 13 08:34:14 2018
@author: gfi
"""
class ArequestsError(Exception):
"""Basic exception for errors raised by Arequests"""
pass
class AuthorizationError(ArequestsError):
'''401 error new authentification required'''
pass
class Some... | 2.4375 | 2 |
NASA/Python_codes/drivers/02_remove_outliers_n_jumps/01_intersect_remove_jumps_JFD/01_remove_jumps_JFD_intersect.py | HNoorazar/Kirti | 0 | 19235 | <reponame>HNoorazar/Kirti
####
#### Nov 16, 2021
####
"""
Regularize the EVI and NDVI of fields in individual years for training set creation.
"""
import csv
import numpy as np
import pandas as pd
from math import factorial
import scipy
import scipy.signal
import os, os.path
from datetime import date
import datetim... | 2.03125 | 2 |
pyquante2/ints/one.py | Konjkov/pyquante2 | 0 | 19236 | <reponame>Konjkov/pyquante2<gh_stars>0
"""
One electron integrals.
"""
from numpy import pi,exp,floor,array,isclose
from math import factorial
from pyquante2.utils import binomial, fact2, Fgamma, norm2
# Notes:
# The versions S,T,V include the normalization constants
# The version overlap,kinetic,nuclear_attraction d... | 2.25 | 2 |
tests/test_pyhive_runBCFTools_VC.py | elowy01/igsr_analysis | 3 | 19237 | <reponame>elowy01/igsr_analysis
import os
import subprocess
import glob
import pytest
# test_pyhive_runBCFTools_VC.py
def test_runBCFTools_VC(bcftools_folder, hive_dir, datadir, clean_tmp):
"""
Test function to run BCFTools mpileup|call on a BAM file
"""
bam_file = "{0}/exampleBAM.bam".format(datadir... | 1.867188 | 2 |
src/sentry/api/endpoints/organization_projects.py | seukjung/sentry-custom | 1 | 19238 | from __future__ import absolute_import
import six
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
from sentry.utils.apidocs import sc... | 2.03125 | 2 |
account/models.py | Vicynet/kwiktalk | 0 | 19239 | from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.shortcuts import render
from cloudinary.models import CloudinaryField
from .utils import get_random_code
from django.template.defaultfilters import slugify
from django.contrib.auth import get_user_model... | 2.140625 | 2 |
senta/data/field_reader/generate_label_field_reader.py | zgzwelldone/Senta | 0 | 19240 | # -*- coding: utf-8 -*
"""
:py:class:`GenerateLabelFieldReader`
"""
import numpy as np
from senta.common.register import RegisterSet
from senta.common.rule import DataShape, FieldLength, InstanceName
from senta.data.field_reader.base_field_reader import BaseFieldReader
from senta.data.util_helper import generate_pad_... | 1.976563 | 2 |
algorithm/python/alphabet_board_path.py | cocoa-maemae/leetcode | 1 | 19241 | class Solution:
def alphabetBoardPath(self, target):
"""
Time Complexity: O(N)
Space Complexity: O(N)
"""
m = {c: [i // 5, i % 5] for i, c in enumerate("abcdefghijklmnopqrstuvwxyz")}
x0, y0 = 0, 0
res = []
for c in target:
x, y = m[c]
... | 3.46875 | 3 |
src/virtual-wan/azext_vwan/custom.py | michimune/azure-cli-extensions | 1 | 19242 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 1.8125 | 2 |
aiogram/contrib/middlewares/environment.py | muhammedfurkan/aiogram | 0 | 19243 | import asyncio
from aiogram.dispatcher.middlewares import BaseMiddleware
class EnvironmentMiddleware(BaseMiddleware):
def __init__(self, context=None):
super(EnvironmentMiddleware, self).__init__()
if context is None:
context = {}
self.context = context
def update_data(s... | 2.4375 | 2 |
custom_components/ztm/__init__.py | peetereczek/ztm | 4 | 19244 | """
module init
""" | 1.148438 | 1 |
Aula37/Controller/squad_controller.py | PabloSchumacher/TrabalhosPython | 0 | 19245 | from Dao.squad_dao import SquadDao
from Model.squad import *
from Controller.backend_controller import BackendController
from Controller.frontend_controller import FrontendController
from Controller.sgbd_controller import SgbdController
class SquadController:
dao = SquadDao()
be = BackendController()
fro =... | 2.15625 | 2 |
airbyte-integrations/connectors/source-square/source_square/utils.py | OTRI-Unipd/OTRI-airbyte | 6,215 | 19246 | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from typing import Union
def separate_by_count(total_length: int, part_count: int) -> (int, int):
"""
Calculates parts needed to separate count by part_count value
For example: separate_by_count(total_length=196582, part_count=10000) returns (1... | 4 | 4 |
packages/awrams/utils/templates.py | kaamilah/awra_cms | 20 | 19247 | <reponame>kaamilah/awra_cms<gh_stars>10-100
def transform_file(infile,outfile,templates):
with open(infile,'r') as fh:
indata = fh.read()
lines = indata.split('\n')
outlines = []
for line in lines:
if '//ATL_BEGIN' in line:
start = line.find('//ATL_BEGIN')
... | 2.9375 | 3 |
hypermapper/plot_pareto.py | adelejjeh/hypermapper | 0 | 19248 | <reponame>adelejjeh/hypermapper<gh_stars>0
"""
Plots design space exploration results.
"""
import json
from collections import OrderedDict, defaultdict
import matplotlib
from jsonschema import Draft4Validator
from pkg_resources import resource_stream
matplotlib.use("agg") # noqa
import matplotlib.pyplot as plt
from ... | 1.96875 | 2 |
foodshering/authapp/forms.py | malfin/silvehanger | 0 | 19249 | from django import forms
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm, PasswordChangeForm, UserChangeForm
from authapp.models import UserProfile, Status
class LoginForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for na... | 2.46875 | 2 |
devices/parser/serializers.py | City-of-Helsinki/hel-data-pipe | 1 | 19250 | <reponame>City-of-Helsinki/hel-data-pipe
from rest_framework import serializers
from .models import Device, SensorType
class SensorTypeSerializer(serializers.ModelSerializer):
class Meta:
model = SensorType
fields = "__all__"
class DeviceSerializer(serializers.HyperlinkedModelSerializer):
c... | 2.21875 | 2 |
technews/__init__.py | WisChang005/technews_watcher | 1 | 19251 | from .technews_helper import TechNews
from .mail_helper import EmailContentHelper
| 1.09375 | 1 |
core/migrations/0002_auto_20191102_1734.py | manulangat1/djcommerce | 1 | 19252 | # Generated by Django 2.2.6 on 2019-11-02 17:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='item',
name='category',
field=... | 1.828125 | 2 |
aoc_tools/__init__.py | dannyboywoop/AOC_Tools | 0 | 19253 | from ._advent_timer import * | 1.140625 | 1 |
stamper/migrations/0004_auto_20161208_1658.py | uploadcare/stump | 0 | 19254 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-12-08 16:58
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('stamper', '0003_auto_20161122_1253'),
... | 1.789063 | 2 |
lemon.py | lab-sigma/learning-to-rationalize | 0 | 19255 | import argparse,time,os,pickle
import matplotlib.pyplot as plt
import numpy as np
from player import *
plt.switch_backend('agg')
np.set_printoptions(precision=2)
class lemon:
def __init__(self, std, num_sellers, num_actions, unit, minx):
self.std = std
self.unit = unit
self.num_sellers = num_sellers
self.nu... | 2.984375 | 3 |
src/osaction.py | ivan-georgiev/urlmonitor | 0 | 19256 | # pylint: disable=too-many-arguments
"""
Observer implemtation doing OS command
"""
from base.iobserver import IObserver
import subprocess
import logging
import os
import sys
logging.basicConfig(
format='%(asctime)s %(levelname)s:%(name)s: %(message)s',
level=os.environ.get('LOGLEVEL', 'INFO').upper(),
d... | 2.21875 | 2 |
CellProfiler/tests/modules/test_opening.py | aidotse/Team-rahma.ai | 0 | 19257 | <reponame>aidotse/Team-rahma.ai
import numpy
import numpy.testing
import skimage.morphology
import cellprofiler.modules.opening
instance = cellprofiler.modules.opening.Opening()
def test_run(image, module, image_set, workspace):
module.x_name.value = "example"
module.y_name.value = "opening"
if image.... | 2.4375 | 2 |
pug-bot/apitoken.py | stevenktruong/pug-bot | 17 | 19258 | <filename>pug-bot/apitoken.py
TOKEN = "YOUR_TOKEN_HERE"
| 1.007813 | 1 |
proxy/web/app_web.py | 5GCity/5GCity-infrastructure-abstraction | 0 | 19259 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017-2022 Univertity of Bristol - High Performance Networks Group
# 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.a... | 1.664063 | 2 |
openstates/importers/tests/test_base_importer.py | washabstract/openstates-core | 0 | 19260 | <filename>openstates/importers/tests/test_base_importer.py<gh_stars>0
import os
import json
import shutil
import tempfile
import datetime
import pytest
from unittest import mock
from openstates.data.models import (
Bill,
Jurisdiction,
Division,
LegislativeSession,
Organization,
Person,
)
from op... | 2.296875 | 2 |
cloudml-template/template/trainer/metadata.py | VanessaDo/cloudml-samples | 3 | 19261 | #!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 2.171875 | 2 |
tests/models/test_models_base.py | harmsm/epistasis | 0 | 19262 |
import pytest
import gpmap
from epistasis import models
import numpy as np
import pandas as pd
import os
def test__genotypes_to_X(test_data):
# Make sure function catches bad genotype passes
d = test_data[0]
gpm = gpmap.GenotypePhenotypeMap(genotype=d["genotype"],
p... | 2.546875 | 3 |
examples/write_spyview_meta.py | sourav-majumder/qtlab | 0 | 19263 | # File name: spyview.py
#
# This example should be run with "execfile('spyview.py')"
from numpy import pi, linspace, sinc, sqrt
from lib.file_support.spyview import SpyView
x_vec = linspace(-2 * pi, 2 * pi, 100)
y_vec = linspace(-2 * pi, 2 * pi, 100)
qt.mstart()
data = qt.Data(name='testmeasurement')
# to make the... | 2.703125 | 3 |
arcpyext/mapping/_cim/__init__.py | PeterReyne/arcpyext | 11 | 19264 | <reponame>PeterReyne/arcpyext<filename>arcpyext/mapping/_cim/__init__.py
from .pro_project import ProProject | 1.03125 | 1 |
o3/operators/filter_logs_to_percentage_operator.py | carlba/o3 | 0 | 19265 | <filename>o3/operators/filter_logs_to_percentage_operator.py
# -*- coding: utf-8 -*-
"""Custom operator for filtering out a percentage of input log files."""
import os
import glob
from airflow.exceptions import AirflowException, AirflowSkipException
from airflow.models import BaseOperator
from airflow.utils.decorator... | 2.65625 | 3 |
alibExp.py | wicknec/WalArt | 2 | 19266 | #! /usr/bin/env python3
"""
alibExp
=======================
Qt4 interface for alib explorer
To browse alib in a more user-friendly way than simple text
Item.data(1,-1) stores its data, i.e. a str or another alib
"""
# NOTE: the actual command documentation is collected from docstrings of the
# commands and is appen... | 2.25 | 2 |
test/test_batch.py | ASemakov/ob-pipelines | 11 | 19267 | """
Integration test for the Luigi wrapper of AWS Batch
Requires:
- boto3 package
- Amazon AWS credentials discoverable by boto3 (e.g., by using ``aws configure``
from awscli_)
- An enabled AWS Batch job queue configured to run on a compute environment.
Written and maintained by <NAME> (@jfeala) for Outlier Bio (@ou... | 2.15625 | 2 |
reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/tests/conftest.py | jpmarques19/tensorflwo-test | 5 | 19268 | import pytest
from markov.tests import test_constant
@pytest.fixture
def aws_region():
return test_constant.AWS_REGION
@pytest.fixture
def model_metadata_s3_key():
return test_constant.MODEL_METADATA_S3_KEY
@pytest.fixture
def reward_function_s3_source():
return test_constant.REWARD_FUNCTION_S3_SOURCE
@... | 1.734375 | 2 |
ROS/my_initials.py | Vishwajeetiitb/Autumn-of-Automation | 0 | 19269 | <gh_stars>0
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
import math
import os
from turtlesim.msg import Pose
import time
os.system("rosrun")
def callback(msg):
global current_angle
current_angle = msg.theta
# print(msg)
def move():
# Starts a new node
rospy.init_node('ro... | 2.71875 | 3 |
Assignment-04/Question-03/mpi_ping_pong.py | gnu-user/mcsc-6030-assignments | 0 | 19270 | #!/usr/bin/env python2
###############################################################################
#
# Assignment 4, Question 3 solution for MPI ping-pong timings to calcualate
# alpha and beta, implemented in Python using MPI.
#
# Copyright (C) 2015, <NAME> (100437638)
# All rights reserved.
#
####################... | 3.4375 | 3 |
app/monitoring/logging_config.py | robmarkcole/python-fastapi-aws-lambda-container | 15 | 19271 | import os
import uuid
import logging
import json
from json import JSONEncoder
from pythonjsonlogger import jsonlogger
from datetime import datetime
from logging.config import dictConfig
# Custom JSON encoder which enforce standard ISO 8601 format, UUID format
class ModelJsonEncoder(JSONEncoder):
def default(self,... | 2.734375 | 3 |
FPAIT/lib/logger/utils.py | D-X-Y/MSPLD-2018 | 63 | 19272 | <reponame>D-X-Y/MSPLD-2018
import time, sys
import numpy as np
def time_for_file():
ISOTIMEFORMAT='%d-%h-at-%H-%M-%S'
return '{}'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(time.time()) ))
def time_string():
ISOTIMEFORMAT='%Y-%m-%d %X'
string = '[{}]'.format(time.strftime( ISOTIMEFORMAT, time.gmtime(tim... | 2.84375 | 3 |
hoomd/hpmc/test-py/test_ghost_layer.py | PetersResearchGroup/PCND | 0 | 19273 | <filename>hoomd/hpmc/test-py/test_ghost_layer.py
from __future__ import print_function
from __future__ import division
from hoomd import *
from hoomd import hpmc
import math
import unittest
context.initialize()
class test_ghost_layer(unittest.TestCase):
def test_implicit(self):
# setup the MC integration
... | 2.109375 | 2 |
performanceplatform/collector/ga/plugins/load_plugin.py | alphagov/performanceplatform-collector | 3 | 19274 | <filename>performanceplatform/collector/ga/plugins/load_plugin.py
"""
load_plugin.py
--------------
Responsible for taking plugin strings and returning plugin callables.
"""
# For the linter
import __builtin__
import performanceplatform.collector.ga.plugins
def load_plugins(plugin_names):
return [load_plugin(... | 2 | 2 |
src/Python/Visualization/FrogReconstruction.py | ajpmaclean/vtk-examples | 81 | 19275 | #!/usr/bin/env python
import collections
from pathlib import Path
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import vtkLookupT... | 1.648438 | 2 |
mfr/extensions/tabular/libs/stdlib_tools.py | yacchin1205/RDM-modular-file-renderer | 36 | 19276 | <reponame>yacchin1205/RDM-modular-file-renderer
import re
import csv
from mfr.extensions.tabular.exceptions import EmptyTableError, TabularRendererError
from mfr.extensions.tabular import utilities
def csv_stdlib(fp):
"""Read and convert a csv file to JSON format using the python standard library
:param fp: ... | 2.9375 | 3 |
code/master_web/app/template_support.py | glenn-edgar/lacima_ranch_cloud | 0 | 19277 | <gh_stars>0
#
#
# This is Support for Drawing Bullet Charts
#
#
#
#
#
#
#
'''
This is the return json value to the javascript front end
{ "canvasName":"canvas1","featuredColor":"Green", "featuredMeasure":14.5,
"qualScale1":14.5, "qualScale1Color":"Black","titleText":"... | 2.21875 | 2 |
zucchini/graders/exceptions.py | dbecker1/zucchini | 3 | 19278 | class InvalidGraderConfigError(Exception):
pass
| 1.296875 | 1 |
datapack/data/scripts/custom/8871_gve/__init__.py | DigitalCoin1/L2SPERO | 0 | 19279 | # Author ProGramMoS, <NAME>
# Version 0.2b
import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gam... | 2.421875 | 2 |
src/hypergol/base_data.py | hypergol/hypergol | 49 | 19280 | <filename>src/hypergol/base_data.py
import json
import base64
import pickle
from hypergol.repr import Repr
class NoIdException(Exception):
pass
class BaseData(Repr):
"""
Base class for all domain objects.
Extends the Repr convenience base class that provides printing facilities.
Provides to_d... | 2.90625 | 3 |
examples/spark-function.py | Hedingber/mlrun | 1 | 19281 | # Pyspark example called by mlrun_spark_k8s.ipynb
from pyspark.sql import SparkSession
from mlrun import get_or_create_ctx
# Acquire MLRun context
mlctx = get_or_create_ctx("spark-function")
# Get MLRun parameters
mlctx.logger.info("!@!@!@!@!@ Getting env variables")
READ_OPTIONS = mlctx.get_param("data_sources")
... | 2.828125 | 3 |
scripts/create_dataset.py | maxrousseau/dl-anesthesia | 0 | 19282 | <filename>scripts/create_dataset.py
#!/usr/bin/python3
import os, glob
import datetime
import xmltodict as xd
import numpy as np
import pandas as pd
import h5py
import matplotlib
import matplotlib.pyplot as plt
from sklearn import preprocessing
# lets make a little data set for fun...
mh_dir = os.path.abspath('./d... | 2.65625 | 3 |
ossdbtoolsservice/admin/contracts/__init__.py | DaeunYim/pgtoolsservice | 33 | 19283 | <filename>ossdbtoolsservice/admin/contracts/__init__.py
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ------------... | 1.507813 | 2 |
whacc/image_tools.py | hireslab/whacc | 1 | 19284 | import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import numpy as np
import h5py
import copy
import time
import os
from whacc import utils
def isnotebook():
try:
c = str(get_ipython().__class__)
shell = get_ipython().__class__.__name__
if 'colab' in c:
... | 2.296875 | 2 |
tests/texts/declerations.py | Intsights/flake8-intsights | 12 | 19285 | <filename>tests/texts/declerations.py<gh_stars>10-100
declerations_test_text_001 = '''
list1 = [
1,
]
'''
declerations_test_text_002 = '''
list1 = [
1,
2,
]
'''
declerations_test_text_003 = '''
tuple1 = (
1,
)
'''
declerations_test_text_004 = '''
tuple1 = (
1,
2,
)
'''
declerations_test_text_005... | 2.28125 | 2 |
data/preprocess_original.py | Nstats/pytorch_senti_analysis_ch | 1 | 19286 | import pandas as pd
import os
import random
train_df = pd.read_csv("./data/Train_DataSet.csv")
train_label_df = pd.read_csv("./data/Train_DataSet_Label.csv")
test_df = pd.read_csv("./data/Test_DataSet.csv")
train_df = train_df.merge(train_label_df, on='id', how='left')
train_df['label'] = train_df['label'].fillna(-1)
... | 2.515625 | 3 |
tools/load_save.py | zs-liu/Pytorch-AS | 0 | 19287 | <reponame>zs-liu/Pytorch-AS<filename>tools/load_save.py<gh_stars>0
import torch
def save_checkpoint(save_dir, model, optimizer):
torch.save({'model_state_dict': model.state_dict(),
'optimizer_state_dict': optimizer.state_dict()}, save_dir)
return True
def load_checkpoint(load_dir):
check... | 2.203125 | 2 |
support/send_broadcast_message.py | ICT4H/dcs-web | 1 | 19288 | from xlrd import open_workbook
from scheduler.smsclient import SMSClient
filename = "/Users/twer/Downloads/SchoolsSMSGhana.xlsx"
workbook = open_workbook(filename)
organization_number = "1902"
area_code = "233"
sheets_ = workbook.sheets()[0]
sms_client = SMSClient()
print 'Start'
for row_num in range(1, sheets_.nrow... | 2.828125 | 3 |
typhon/oem/error.py | jmollard/typhon | 0 | 19289 | <reponame>jmollard/typhon<gh_stars>0
# -*- coding: utf-8 -*-
"""Functions to estimate the different sources of retrieval error.
"""
from typhon.oem import common
__all__ = [
'smoothing_error',
'retrieval_noise',
]
def smoothing_error(x, x_a, A):
"""Return the smoothing error through the averaging kerne... | 2.421875 | 2 |
nicos/core/spm.py | ebadkamil/nicos | 12 | 19290 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 1.851563 | 2 |
2_Regression/ARX_Regression/empirical_id.py | abe-mart/arduino | 1 | 19291 | import numpy as np
import apm_id as arx
######################################################
# Configuration
######################################################
# number of terms
ny = 2 # output coefficients
nu = 1 # input coefficients
# number of inputs
ni = 1
# number of outputs
no = 1
# load data ... | 2.53125 | 3 |
setup.py | Alexhuszagh/toolchains | 22 | 19292 | #!/usr/bin/env python
'''
setup
=====
This is a relatively complicated setup script, since
it does a few things to simplify version control
and configuration files.
There's a simple script that overrides the `build_py`
command to ensure there's proper version control set
for the librar... | 1.90625 | 2 |
src/sgfsdriver/plugins/ftp/ftp_client.py | syndicate-storage/syndicate-fs-driver-plugins | 0 | 19293 | <filename>src/sgfsdriver/plugins/ftp/ftp_client.py
#!/usr/bin/env python
"""
Copyright 2016 The Trustees of University of Arizona
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
... | 2.125 | 2 |
py/ops/ops/mob/keys.py | clchiou/garage | 3 | 19294 | <filename>py/ops/ops/mob/keys.py
__all__ = [
'keys',
]
from pathlib import Path
import logging
from garage import apps
from garage import scripts
LOG = logging.getLogger(__name__)
HOST_KEYS = [
('dsa', 1024),
('ecdsa', 521),
('ed25519', None),
('rsa', 4096),
]
# ECDSA requires less bits than... | 2.421875 | 2 |
reconcile/test/test_saasherder.py | bhushanthakur93/qontract-reconcile | 0 | 19295 | from typing import Any
from unittest import TestCase
from unittest.mock import patch, MagicMock
import yaml
from github import GithubException
from reconcile.utils.openshift_resource import ResourceInventory
from reconcile.utils.saasherder import SaasHerder
from reconcile.utils.jjb_client import JJB
from reconcile.ut... | 2.015625 | 2 |
configs/example/garnet_synth_traffic.py | georgia-tech-synergy-lab/gem5_astra | 5 | 19296 | <gh_stars>1-10
# Copyright (c) 2016 Georgia Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | 1.601563 | 2 |
tests/unit/service/test_messaging.py | davetobin/ignition | 1 | 19297 | import unittest
import time
import copy
from unittest.mock import patch, MagicMock, call
from ignition.service.messaging import PostalService, KafkaDeliveryService, KafkaInboxService, Envelope, Message, MessagingProperties
from kafka import KafkaProducer
class TestPostalService(unittest.TestCase):
def setUp(self... | 2.4375 | 2 |
app/core/management/commands/wait_for_db.py | denis240997/recipe-app-api | 0 | 19298 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
# This is bullshit! Problem was not solved!
# The first connection is successful, but after that postgres closes the connection and
# reconnects. At the moment, this script h... | 2.3125 | 2 |
clusters/actions.py | bhaugen/localecon | 10 | 19299 | <filename>clusters/actions.py
import csv
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
def export_as_csv(modeladmin, request, queryset):
"""
Generic csv export admin action.
"""
if not request.user.is_staff:
raise PermissionDenied
opts = modeladmin... | 2.484375 | 2 |