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 |
|---|---|---|---|---|---|---|
dockwidhistory.py | kimoamer/Clinic-Manager | 3 | 15000 | from PyQt5.QtWidgets import QDialog
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt
from dockwina import Ui_Form as docka
class Dialog(QDialog, docka):
def __init__(self):
super(Dialog, self).__init__()
QDialog.__init__(self)
self.setupUi(self)
self.setWindowFlag... | 2.609375 | 3 |
forest_lite/server/lib/palette.py | uk-gov-mirror/MetOffice.forest-lite | 6 | 15001 | import bokeh.palettes
def all_palettes():
"""List of palette definitions"""
for name in bokeh.palettes.all_palettes:
for number in bokeh.palettes.all_palettes[name]:
yield {
"name": name,
"number": number,
"palette": bokeh.palettes.all_palett... | 2.484375 | 2 |
runtests.py | ombu/django-sortedm2m | 0 | 15002 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys, warnings
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
import django
from django.core.management import exe... | 2.046875 | 2 |
origin_check.py | mikispag/OriginCheck | 1 | 15003 | #!/usr/bin/env python3
import concurrent.futures
import logging
import requests
from sys import argv, exit
from urllib.parse import urlparse
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
HEADERS = {
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.... | 2.671875 | 3 |
orange3/Orange/preprocess/setup.py | rgschmitz1/BioDepot-workflow-builder | 54 | 15004 | <reponame>rgschmitz1/BioDepot-workflow-builder
# Author: <NAME> <<EMAIL>>
# License: BSD Style.
import os
import numpy
def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration
libraries = []
if os.name == "posix":
libraries.append("m")
config ... | 1.789063 | 2 |
ProjectEuler_plus/euler_042.py | byung-u/HackerRank | 0 | 15005 | <filename>ProjectEuler_plus/euler_042.py
#!/usr/bin/env python3
import sys
from math import sqrt
# (n * (n + 1)) / 2 -> n ** 2 + n - (2 * x)
# Solved with quadratic equation
# https://en.wikipedia.org/wiki/Quadratic_equation
for _ in range(int(input().strip())):
t = int(input().strip())
d = (sqrt(4 * 2 *... | 3.5 | 4 |
src/lpb.py | RobbinBouwmeester/LIT | 0 | 15006 | <reponame>RobbinBouwmeester/LIT
"""
Copyright (c) 2017 <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, modify... | 1.734375 | 2 |
floris/tools/optimization/scipy/__init__.py | eirikur16/flrs | 91 | 15007 | from . import (
yaw,
layout,
base_COE,
optimization,
layout_height,
power_density,
yaw_wind_rose,
power_density_1D,
yaw_wind_rose_parallel,
)
| 0.96875 | 1 |
src/gdata/spreadsheets/data.py | Cloudlock/gdata-python3 | 19 | 15008 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License 2.0;
# This module is used for version 2 of the Google Data APIs.
"""Provides classes and constants for the XML in the Google Spreadsheets API.
Documentation for the raw XML which these classes represent can be found he... | 2.234375 | 2 |
tests/test_issues/test_member_example.py | hsolbrig/pyjsg | 3 | 15009 | <reponame>hsolbrig/pyjsg<filename>tests/test_issues/test_member_example.py
import unittest
from pyjsg.validate_json import JSGPython
class MemberExampleTestCase(unittest.TestCase):
def test1(self):
x = JSGPython('''doc {
last_name : @string, # exactly one last name of type string
... | 2.8125 | 3 |
src/pte/filetools/filefinder_abc.py | richardkoehler/pynm-decode | 1 | 15010 | <reponame>richardkoehler/pynm-decode
"""Define abstract base classes to construct FileFinder classes."""
import os
import shutil
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from pathlib import Path
from typing import Optional, Sequence, Union
import mne_bids
@dataclass
class FileFin... | 2.71875 | 3 |
panel/routes/server.py | emilio2hd/pz-panel | 0 | 15011 | <reponame>emilio2hd/pz-panel
import glob
import time
from os import path
from flask import Blueprint, jsonify, current_app, request, Response, json
from flask_login import login_required
from .. import pz_server_state
from ..services.power_actions_service import is_valid_power_action, execute_action
from ..services.s... | 2.25 | 2 |
sub_models.py | tmartin2/EnsembleSplice-Inactive | 0 | 15012 | <filename>sub_models.py
# -----------------------------------------------------------------------------
# Copyright (c) 2021 <NAME>. All rights reserved.
# Distributed under the MIT License.
# -----------------------------------------------------------------------------
from Data import encode_data
# from utils import ... | 2.6875 | 3 |
tracportalopt/project/notification.py | isabella232/TracPortalPlugin | 2 | 15013 | <reponame>isabella232/TracPortalPlugin<filename>tracportalopt/project/notification.py
#! -*- coding: utf-8 -*-
#
# (C) 2013 Internet Initiative Japan Inc.
# All rights reserved.
#
# Created on 2013/05/15
# @author: <EMAIL>
"""Notify project owner with email when the project created successfully."""
from pkg_resources i... | 2.15625 | 2 |
misc/style/check-include-guard-convention.py | nitinkaveriappa/downward | 4 | 15014 | <reponame>nitinkaveriappa/downward
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os.path
import sys
DIR = os.path.dirname(os.path.abspath(__file__))
REPO = os.path.dirname(os.path.dirname(DIR))
SRC_DIR = os.path.join(REPO, "src")
def check_header_files(comp... | 2.703125 | 3 |
kyu_7/fun_with_lists_length/length.py | pedrocodacyorg2/codewars | 1 | 15015 | <filename>kyu_7/fun_with_lists_length/length.py
# Created by <NAME>.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
def length(head) -> int:
"""
The method length, which accepts a linked list
(head), and returns the length of the list.
:param head:
:re... | 4 | 4 |
test/functional/test_f_xcompat.py | farleyb-amazon/aws-encryption-sdk-python | 95 | 15016 | <reponame>farleyb-amazon/aws-encryption-sdk-python
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.... | 2.125 | 2 |
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py | opatua/cookiecutter-flask-api | 2 | 15017 | <filename>{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from {{cookiecutter.app_name}}.config import app_config
from {{cookiecutter.app_name}... | 2.296875 | 2 |
docs/examples/Moving_Platform_Simulation.py | Red-Portal/Stone-Soup-1 | 157 | 15018 | #!/usr/bin/env python
# coding: utf-8
"""
Multi-Sensor Moving Platform Simulation Example
===============================================
This example looks at how multiple sensors can be mounted on a single moving platform and exploiting a defined moving
platform as a sensor target.
"""
# %%
# Building a Simulated M... | 2.875 | 3 |
Glyph-Builders/lowercase_from_upper.py | m4rc1e/mf-glyphs-scripts | 27 | 15019 | <gh_stars>10-100
#MenuTitle: Generate lowercase from uppercase
"""
Generate lowercase a-z from uppercase A-Z
TODO (<NAME>) Generate all lowercase glyphs, not just a-z
"""
font = Glyphs.font
glyphs = list('abcdefghijklmnopqrstuvwxyz')
masters = font.masters
for glyph_name in glyphs:
glyph = GSGlyph(glyph_name)
... | 2.90625 | 3 |
src/gui/SubVision.py | bochkovoi/AHP | 0 | 15020 | <reponame>bochkovoi/AHP<filename>src/gui/SubVision.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets, QtGui, QtCore
import sys, os.path as op
path1 = op.join( op.abspath(op.dirname(__file__)), '..', 'Structure')
path2 = op.join( op.abspath(op.dirname(__file__)), '..')
sys.path.append(path1)... | 2.296875 | 2 |
examples/ndfd/ndfd.py | eLBati/pyxb | 123 | 15021 | from raw.ndfd import *
| 1.0625 | 1 |
pandoc_mustache/__init__.py | copart/pandoc-mustache | 43 | 15022 | from .version import __version__
import pandoc_mustache
| 0.988281 | 1 |
espnet2/gan_tts/espnet_model.py | actboy/espnet | 0 | 15023 | <gh_stars>0
# Copyright 2021 <NAME>
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""GAN-based TTS ESPnet model."""
from contextlib import contextmanager
from distutils.version import LooseVersion
from typing import Any
from typing import Dict
from typing import Optional
import torch
from typeguard im... | 1.757813 | 2 |
array/bot/others/P_ex07.py | timkphd/examples | 5 | 15024 | #!/usr/bin/env python
#
# This program shows how to use MPI_Alltoall. Each processor
# send/rec a different random number to/from other processors.
#
# numpy is required
import numpy
from numpy import *
# mpi4py module
from mpi4py import MPI
import sys
def myquit(mes):
MPI.Finalize()
print(mes)
... | 3.125 | 3 |
renderer/render_fmo.py | 12564985/DeFMO | 1 | 15025 | """ render_fmo.py renders obj file to rgb image with fmo model
Aviable function:
- clear_mash: delete all the mesh in the secene
- scene_setting_init: set scene configurations
- node_setting_init: set node configurations
- render: render rgb image for one obj file and one viewpoint
- render_obj: wrapper function for r... | 2.328125 | 2 |
main.py | VV123/NLIDB_gradient | 0 | 15026 | # coding=utf-8
import sys
import argparse
import os
from tensorflow.python.platform import gfile
import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
from utils.data_manager import load_data, load_data_one
from collections import defaultdict
from argparse import ArgumentParser
fro... | 2.28125 | 2 |
src/__init__.py | codespacedot/CodeSpaceAPI | 3 | 15027 | """FastAPI Project for CodeSpace.
https://csdot.ml
"""
| 1 | 1 |
gdsfactory/components/cdsem_straight.py | jorgepadilla19/gdsfactory | 42 | 15028 | """CD SEM structures."""
from functools import partial
from typing import Optional, Tuple
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.components.straight import straight as straight_function
from gdsfactory.components.text_rectangular import text_rectangular
from gdsfact... | 2.5 | 2 |
Examples/Tests/particle_fields_diags/analysis_particle_diags_impl.py | hklion/WarpX | 0 | 15029 | #!/usr/bin/env python3
# Copyright 2019-2022 <NAME>, <NAME>, <NAME>
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
# This script tests the reduced particle diagnostics.
# The setup is a uniform plasma with electrons, protons and photons.
# Various particle and field quantities are written to file usin... | 2 | 2 |
predict.py | stonebegin/Promise12-3DUNet | 2 | 15030 | <gh_stars>1-10
import importlib
import os
from datasets.hdf5 import get_test_loaders
from unet3d import utils
from unet3d.config import load_config
from unet3d.model import get_model
logger = utils.get_logger('UNet3DPredictor')
def _get_predictor(model, loader, output_file, config):
predictor_config =... | 2.140625 | 2 |
gitScrabber/scrabTasks/file/languageDetector.py | Eyenseo/gitScrabber | 0 | 15031 | """
The MIT License (MIT)
Copyright (c) 2017 <NAME>
Copyright (c) 2017 <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, ... | 1.609375 | 2 |
VAE/full_model/model_training.py | youngmg1995/NES-Music-Maker | 3 | 15032 | <reponame>youngmg1995/NES-Music-Maker
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 17:14:19 2020
@author: Mitchell
model_training.py
~~~~~~~~~~~~~~~~~
This file serves as a script for building and training our VAE model. To do
so we used the VAE and DataSequence classes defined in the file `VAE.py`, as
well as h... | 2.234375 | 2 |
tests/validation/test_is_subnational1.py | StuartMacKay/ebird-api | 9 | 15033 | <filename>tests/validation/test_is_subnational1.py
import unittest
from ebird.api.validation import is_subnational1
class IsSubnational1Tests(unittest.TestCase):
"""Tests for the is_subnational1 validation function."""
def test_is_subnational1(self):
self.assertTrue(is_subnational1("US-NV"))
de... | 2.953125 | 3 |
maths2.py | tavleensasan/Tav | 0 | 15034 | def multiple(first,second):
return first * second
def add(x,y):
return x+y
| 3.25 | 3 |
backend/kale/tests/assets/kfp_dsl/simple_data_passing.py | brness/kale | 502 | 15035 | import json
import kfp.dsl as _kfp_dsl
import kfp.components as _kfp_components
from collections import OrderedDict
from kubernetes import client as k8s_client
def step1():
from kale.common import mlmdutils as _kale_mlmdutils
_kale_mlmdutils.init_metadata()
from kale.marshal.decorator import marshal as... | 2.09375 | 2 |
note/urls.py | StevenYwch/CloudNote | 0 | 15036 | from django.urls import path
from . import views
urlpatterns = [
path('list', views.list_view),
path('add', views.add_view),
] | 1.523438 | 2 |
roombapy/discovery.py | Erelen-Laiquendi/roombapy | 17 | 15037 | import json
import logging
import socket
from roombapy.roomba_info import RoombaInfo
class RoombaDiscovery:
udp_bind_address = ""
udp_address = "<broadcast>"
udp_port = 5678
roomba_message = "irobotmcs"
amount_of_broadcasted_messages = 5
server_socket = None
log = None
def __init__(s... | 2.5625 | 3 |
nonbonded/cli/projects/__init__.py | SimonBoothroyd/nonbonded | 5 | 15038 | <reponame>SimonBoothroyd/nonbonded
# from nonbonded.cli.project.project import project
#
# __all__ = [project]
| 1.109375 | 1 |
pmaf/biome/essentials/_taxonomy.py | mmtechslv/PhyloMAF | 1 | 15039 | import warnings
warnings.simplefilter("ignore", category=FutureWarning)
from pmaf.biome.essentials._metakit import EssentialFeatureMetabase
from pmaf.biome.essentials._base import EssentialBackboneBase
from pmaf.internal._constants import (
AVAIL_TAXONOMY_NOTATIONS,
jRegexGG,
jRegexQIIME,
BIOM_TAXONOMY... | 1.90625 | 2 |
users_django/users/tests/test_views.py | r-o-main/users-exercise | 0 | 15040 | <gh_stars>0
from rest_framework.test import APIRequestFactory
from rest_framework import status
from django.test import TestCase
from django.urls import reverse
from ..models import User
from ..serializer import UserSerializer
from ..views import UserViewSet
import ipapi
class UsersApiRootTestCase(TestCase):
def... | 2.46875 | 2 |
jburt/mask.py | jbburt/jburt | 0 | 15041 | from typing import List
import numpy as np
def mask_nan(arrays: List[np.ndarray]) -> List[np.ndarray]:
"""
Drop indices from equal-sized arrays if the element at that index is NaN in
any of the input arrays.
Parameters
----------
arrays : List[np.ndarray]
list of ndarrays containing ... | 4.0625 | 4 |
ExpenseTracker/grocery/migrations/0004_auto_20200908_1918.py | lennyAiko/LifeExpenses | 0 | 15042 | # Generated by Django 3.1.1 on 2020-09-08 18:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('grocery', '0003_auto_202... | 1.515625 | 2 |
my_hello_world_app/web_api/router.py | gsjay980/data-science-IP | 5 | 15043 | from os import getenv
from typing import Optional, Dict
from flask import Flask
TestConfig = Optional[Dict[str, bool]]
def create_app(test_config: TestConfig = None) -> Flask:
""" App factory method to initialize the application with given configuration """
app: Flask = Flask(__name__)
if test_config ... | 2.8125 | 3 |
src/pythonModules/fourgp_rv/fourgp_rv/templates_resample.py | dcf21/4most-4gp | 0 | 15044 | <reponame>dcf21/4most-4gp
# -*- coding: utf-8 -*-
"""
Code to take template spectra, used for RV fitting, and pass them through 4FS to resample them to 4MOST's resolution.
It then further resamples each arm onto a fixed logarithmic stride.
"""
import argparse
import hashlib
import logging
import numpy as np
import os... | 2.578125 | 3 |
datahub/activity_feed/apps.py | Staberinde/data-hub-api | 6 | 15045 | from django.apps import AppConfig
class ActivityFeedConfig(AppConfig):
"""App config for activity_feed."""
name = 'datahub.activity_feed'
| 1.273438 | 1 |
ffmpeg_normalize/__init__.py | kostalski/ffmpeg-normalize | 3 | 15046 | <reponame>kostalski/ffmpeg-normalize
from ._ffmpeg_normalize import FFmpegNormalize
from ._media_file import MediaFile
from ._version import __version__
| 1.117188 | 1 |
__init__.py | nuxeo-cps/zope2--PortalTransforms | 0 | 15047 | __revision__ = '$Id$'
from utils import HAS_ZOPE
if HAS_ZOPE:
from Products.PortalTransforms.zope import *
| 1.101563 | 1 |
SpoTwillio/lib/python3.6/site-packages/twilio/rest/api/v2010/account/call/feedback.py | Natfan/funlittlethings | 3 | 15048 | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | 1.945313 | 2 |
app/donut.py | zaphodef/stockpile | 0 | 15049 | async def donut_handler(args):
print('This is where we would configure things to properly handle a .donut file request.')
return '', ''
| 1.78125 | 2 |
gtf2bed/__init__.py | jvfe/gtf2bed | 1 | 15050 | <filename>gtf2bed/__init__.py
"""Top-level package for gtf2bed."""
__author__ = """<NAME>"""
__email__ = "<EMAIL>"
__version__ = "0.1.0"
| 1.101563 | 1 |
fastapi_cloudauth/firebase.py | jleclanche/fastapi-cloudauth | 0 | 15051 | from calendar import timegm
from datetime import datetime
from typing import Any, Dict
from fastapi import HTTPException
from pydantic import BaseModel, Field
from starlette import status
from .base import UserInfoAuth
from .messages import NOT_VERIFIED
from .verification import JWKS, ExtraVerifier
class FirebaseCl... | 2.390625 | 2 |
tests/instrumentation/sqlite_tests.py | dsanders11/opbeat_python | 99 | 15052 | import sqlite3
import mock
import opbeat.instrumentation.control
from tests.helpers import get_tempstoreclient
from tests.utils.compat import TestCase
class InstrumentSQLiteTest(TestCase):
def setUp(self):
self.client = get_tempstoreclient()
opbeat.instrumentation.control.instrument()
@mock... | 2.53125 | 3 |
setup.py | samytessier/group_9_mlops | 1 | 15053 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='This MLOps project aims to use the Transformers framework from Hugging Face in order to tweak a pre-trained NLP model to accurately gauge the sentiment of an Amazon review (being able ... | 1.3125 | 1 |
gaphor/RAAML/stpa/connectors.py | Texopolis/gaphor | 867 | 15054 | <filename>gaphor/RAAML/stpa/connectors.py<gh_stars>100-1000
from gaphor.diagram.connectors import Connector
from gaphor.diagram.presentation import Classified
from gaphor.RAAML.raaml import RelevantTo
from gaphor.RAAML.stpa import RelevantToItem
from gaphor.SysML.requirements.connectors import DirectedRelationshipPrope... | 1.515625 | 2 |
voltagemetricspublisher/services/extractionService.py | SumudithaR/svc.voltage-metrics-publisher | 0 | 15055 | <reponame>SumudithaR/svc.voltage-metrics-publisher<gh_stars>0
from time import sleep
from gpiozero import MCP3008 # Installed in GAM 13/09/2019.
import time
import gpiozero
from ..models.rawMetricDto import RawMetricDto
class ExtractionService():
def __init__(self):
self.vref = 3.3
def getG... | 2.34375 | 2 |
data_browser/migrations/0002_auto_20200331_1842.py | me2d09/django-data-browser | 0 | 15056 | <gh_stars>0
# Generated by Django 2.0.13 on 2020-03-31 17:42
from django.db import migrations, models
import data_browser.models
class Migration(migrations.Migration):
dependencies = [
("data_browser", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="vie... | 1.734375 | 2 |
Community/get_audit_info/__init__.py | spenney-bc/gateway-workflows | 43 | 15057 | # Copyright 2020 BlueCat Networks. All rights reserved.
# -*- coding: utf-8 -*-
type = 'ui'
sub_pages = [
{
'name' : 'get_audit_info_page',
'title' : u'Get Audit Info',
'endpoint' : 'get_audit_info/get_audit_info_endpoint',
'description' : u'get_audit_info'
},
]
| 1.054688 | 1 |
ALDS/ALDS1_10_A.py | yu8ikmnbgt6y/MyAOJ | 1 | 15058 | import sys
import io
input_txt = """
44
"""
sys.stdin = io.StringIO(input_txt)
tmp = input()
# copy the below part and paste to the submission form.
# ---------function------------
def fibonacci(n):
if n <= 1:
return 1
fib_array = [1] * 45
for i in range(2, n+1):
fib_ar... | 3.75 | 4 |
armada/tests/unit/utils/test_lint.py | One-Fine-Day/armada | 0 | 15059 | <filename>armada/tests/unit/utils/test_lint.py
# Copyright 2017 The Armada Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 2.1875 | 2 |
mliv/dgps.py | microsoft/AdversarialGMM | 23 | 15060 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
# continuously differentiable
fn_dict_cdiff = {'2dpoly': 1, 'sigmoid': 2,
'sin': 3, 'frequent_sin': 4,
'3dpoly': 7, 'linear': 8}
# continuous but not differentiable
fn_dict_cont = {'abs': 0, '... | 2.078125 | 2 |
tests/test_definitions/test_expectations_cfe.py | OmriBromberg/great_expectations | 1 | 15061 | <gh_stars>1-10
import glob
import json
import os
import random
import string
import pandas as pd
import pytest
from great_expectations.execution_engine.pandas_batch_data import PandasBatchData
from great_expectations.execution_engine.sparkdf_batch_data import SparkDFBatchData
from great_expectations.execution_engine.... | 2.015625 | 2 |
corehq/apps/commtrack/resources/v0_1.py | johan--/commcare-hq | 0 | 15062 | <filename>corehq/apps/commtrack/resources/v0_1.py
from tastypie import fields
from corehq.apps.api.resources.v0_1 import CustomResourceMeta, DomainAdminAuthentication
from corehq.apps.products.models import Product
from corehq.apps.api.util import get_object_or_not_exist
from corehq.apps.api.resources import HqBaseReso... | 1.929688 | 2 |
spectrl/util/io.py | luigiberducci/dirl | 0 | 15063 | import argparse
import os
import pathlib
import cv2
import pickle
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
from numpy import genfromtxt
def parse_command_line_options(print_options=False):
parser = argparse.ArgumentParser()
parser.add_argument("-n", type=int, default=-1)... | 2.671875 | 3 |
pyqt_sql_demo/syntax_highlighter/sql.py | nshiell/pyqt-sql-demo | 18 | 15064 | from pygments import highlight as _highlight
from pygments.lexers import SqlLexer
from pygments.formatters import HtmlFormatter
def style():
style = HtmlFormatter().get_style_defs()
return style
def highlight(text):
# Generated HTML contains unnecessary newline at the end
# before </pre> closing tag... | 3.109375 | 3 |
raytracing.py | avigael/raytracing-example | 0 | 15065 | <reponame>avigael/raytracing-example<gh_stars>0
'''2D Raytracing Example using Pygame'''
import sys
from math import pi, cos, sin
import pygame
# Constants
SIZE = (600, 600)
BORDERS = [[0, 0, SIZE[0], 0], [0, 0, 0, SIZE[1]],
[0, SIZE[1], SIZE[0], SIZE[1]], [SIZE[0], 0, SIZE[0], SIZE[1]]]
WHITE = (255, 255, ... | 3.390625 | 3 |
preprocessed_data/UCM/Code/global_histogram_stretching.py | SaiKrishna1207/Underwater-Image-Segmentation | 0 | 15066 | import numpy as np
def histogram_r(r_array,height, width):
length = height * width
R_rray = []
for i in range(height):
for j in range(width):
R_rray.append(r_array[i][j])
R_rray.sort()
I_min = int(R_rray[int(length / 500)])
I_max = int(R_rray[-int(length / 500)])
array_G... | 2.953125 | 3 |
python/test/experimental/test_tb_graph_writer.py | daniel-falk/nnabla | 2,792 | 15067 | # Copyright 2021 Sony Corporation.
#
# 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 wri... | 2.140625 | 2 |
pokeman/coatings/resolver_attribute_methods/selective_consumer.py | wmarcuse/pokeman | 0 | 15068 | import json
import logging
LOGGER = logging.getLogger(__name__)
def start(self):
self.start_consuming()
def on_message(self, channel, method, properties, body):
"""
Invoked by pika when a message is delivered from the AMQP broker. The
channel is passed for convenience. The basic_deliver object tha... | 2.671875 | 3 |
mc-core/mc/data_gen/gnb_status_indication_pb2.py | copslock/o-ran_ric-app_mc | 0 | 15069 | <reponame>copslock/o-ran_ric-app_mc
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: gnb_status_indication.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf i... | 1.164063 | 1 |
test_tflite_model.py | jh88/fbnet | 6 | 15070 | import numpy as np
import tensorflow as tf
from time import perf_counter as timer
def main():
x = np.load('data/cifar_test_x.npy')
y = np.load('data/cifar_test_y.npy').flatten()
interpreter = tf.lite.Interpreter(model_path='data/fbnet.tflite')
interpreter.allocate_tensors()
input_details = inter... | 2.515625 | 3 |
src/pymor/vectorarrays/constructions.py | JuliaBru/pymor | 0 | 15071 | <gh_stars>0
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
def cat_arrays(vector_arrays):
"""Return a new |VectorArray| which a concatenatio... | 2.40625 | 2 |
swampytodo/urls.py | mrbaboon/swampytodo | 0 | 15072 | <reponame>mrbaboon/swampytodo<filename>swampytodo/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'swampytodo.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^monitor', 'monitor.vi... | 1.898438 | 2 |
src/pymor/playground/progressbar.py | JuliaBru/pymor | 0 | 15073 | <gh_stars>0
#!/usr/bin/env python
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import sys
####################################################... | 3.515625 | 4 |
toontown/minigame/TwoDBattleMgr.py | SuperM0use24/TT-CL-Edition | 1 | 15074 | from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
from toontown.toonbase.ToonBaseGlobal import *
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from toontown.battle.BattleProps import *
from toontown.battle import MovieUtil
import math
cla... | 2.125 | 2 |
lesson-12/ex1.py | alirsamar/intro-ml | 0 | 15075 | <reponame>alirsamar/intro-ml
# Explained Variance of Each PC
#### Boilerplate #################################################################
print __doc__
from time import time
import logging
import pylab as pl
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import ... | 3.265625 | 3 |
qt/__init__.py | popupcad/popupcad | 19 | 15076 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Written by <NAME> and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
"""
import sys
argv = [item.lower() for item in sys.argv]
if 'qt4' in argv:
loaded = 'PyQt4'
elif 'qt5' in argv:
loaded = 'PyQt5'
elif 'pyside' in argv:
loaded... | 1.929688 | 2 |
fast_carpenter/__main__.py | lgray/fast-carpenter | 0 | 15077 | <reponame>lgray/fast-carpenter<filename>fast_carpenter/__main__.py
"""
Chop up those trees into nice little tables and dataframes
"""
from __future__ import print_function
import sys
from .help import help_stages
import fast_flow.v1 as fast_flow
import fast_curator
import logging
import atuproot.atuproot_main as atup
f... | 2.421875 | 2 |
pictures/tests.py | FredAtei/Photo-app | 0 | 15078 | <filename>pictures/tests.py
from django.test import TestCase
from .models import Image,Location,Category
# Create your tests here.
class CategoryTestClass(TestCase):
def setUp(self):
self.travel = Category(name='travel')
def test_instance(self):
self.assertTrue(isinstance(self.travel,Category)... | 2.609375 | 3 |
{{ cookiecutter.project_name|replace(' ', '_')|replace('-', '_')|lower }}/project/apps/users/views.py | digitalashes/django2.0-template | 1 | 15079 | {%- if cookiecutter.use_allauth == "y" and cookiecutter.use_rest == "y" %}
from django.contrib.auth import logout as auth_logout
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _
from rest_auth.app_settings import create_token
from rest_auth.registration.views... | 2.09375 | 2 |
pyperform/tools.py | timgates42/pyperform | 250 | 15080 | <gh_stars>100-1000
__author__ = 'calvin'
import re
import sys
from math import log10
if sys.version[0] == '3':
pass
else:
range = xrange
classdef_regex = re.compile(r"\S*def .*#!|class .*#!")
tagged_line_regex = re.compile(r".*#!")
def convert_time_units(t):
""" Convert time in seconds into reasonable... | 2.84375 | 3 |
dictify.py | Dharma-Sagar/dictify | 0 | 15081 | from collections import defaultdict
from pathlib import Path
import re
import yaml
import json
from botok import Text
import pyewts
conv = pyewts.pyewts()
def dictify_text(string, is_split=False, selection_yaml='data/dictionaries/dict_cats.yaml', expandable=True, mode='en_bo'):
"""
takes segmented text and... | 2.921875 | 3 |
tests/test_validators.py | fakeezz/edipy | 1 | 15082 | # coding: utf-8
import pytest
from edipy import fields, validators, exceptions
@pytest.mark.parametrize('fixed_type, data', [
(fields.Integer(1, validators=[validators.Range(1, 5)]), '1'),
(fields.Integer(1, validators=[validators.MaxValue(3)]), '2'),
(fields.Integer(1, validators=[validators.MinValue(1... | 2.390625 | 2 |
archetypal/schedule.py | brunomarct/archetypal | 0 | 15083 | ################################################################################
# Module: schedule.py
# Description: Functions for handling conversion of EnergyPlus schedule objects
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archetypal
#####################################... | 2.6875 | 3 |
data/scripts/reverse.py | levindu/OpenCC | 43 | 15084 | <gh_stars>10-100
#!/usr/bin/env python
#coding: utf-8
import sys
from common import reverse_items
if len(sys.argv) != 3:
print("Reverse key and value of all pairs")
print(("Usage: ", sys.argv[0], "[input] [output]"))
exit(1)
reverse_items(sys.argv[1], sys.argv[2])
| 3.375 | 3 |
stock_predictions/web/template.py | abakhru/stock_prediction | 1 | 15085 | template = """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css">
<style>
.tradingvi... | 1.898438 | 2 |
script/app/agg.py | Intelligent-Systems-Lab/ISL-BCFL | 0 | 15086 | import os
# import torch
import argparse
import base64
import sys
import io
import torch
import torch.nn as nn
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
def fullmodel2base64(model):
buffer = io.BytesIO()
torch.save(mode... | 2.453125 | 2 |
examples/function_examples/bpod_info.py | ckarageorgkaneen/pybpod-api | 1 | 15087 | <reponame>ckarageorgkaneen/pybpod-api<filename>examples/function_examples/bpod_info.py
# !/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Get hardware info from Bpod
"""
from pybpodapi.protocol import Bpod
from confapp import conf
my_bpod = Bpod()
my_bpod.close()
print("Target Bpod firmware version: ", conf.TARGET_... | 2.171875 | 2 |
src/core/src/core_logic/PackageFilter.py | Azure/LinuxPatchExtension | 4 | 15088 | <filename>src/core/src/core_logic/PackageFilter.py
# Copyright 2020 Microsoft Corporation
#
# 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
#
... | 1.71875 | 2 |
pyesgf/util.py | ggarcias/esgf-pyclient-cmip6 | 17 | 15089 | <filename>pyesgf/util.py
"""
Utility functions using the pyesgf package.
"""
import sys
from urllib.parse import quote_plus
def ats_url(base_url):
"""
Return the URL for the ESGF SAML AttributeService
"""
# Strip '/' from url as necessary
base_url = base_url.rstrip('/')
return '/'.join([base... | 3.171875 | 3 |
tests/book/ch05/classify_name.py | TITC/pyhanlp | 0 | 15090 | <gh_stars>0
# -*- coding:utf-8 -*-
# Author:hankcs
# Date: 2018-06-21 19:46
# 《自然语言处理入门》5.3 基于感知机的人名性别分类
# 配套书籍:http://nlp.hankcs.com/book.php
# 讨论答疑:https://bbs.hankcs.com/
import sys,os# environment, adjust the priority
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(... | 2.828125 | 3 |
tests/test_content_download.py | easydo-cn/edo_client | 0 | 15091 | # coding: utf-8
import io
import os
import shutil
import tempfile
import unittest
from edo_client import WoClient
class ContentApi_DownloadTestCase(unittest.TestCase):
'''
- Basically this is to ensure
all the facilities related to HTTP range headers are working properly;
'''
@classmethod
... | 2.546875 | 3 |
src/train.py | Gordonbuck/ml-oov-we | 0 | 15092 | import higher
from leap import Leap
import numpy as np
import os
import torch
import torch.nn as nn
import gc
def train(model, source_corpus, char2idx, args, device):
model = model.to(device)
optimizer = torch.optim.Adam(model.parameters(), lr=args.lr_init)
lr_scheduler = torch.optim.lr_scheduler.ReduceLR... | 2.203125 | 2 |
number reverser.py | Jayapraveen34/crazy-lover | 0 | 15093 | a = str(input('Enter the number you want to reverse:'))
b = (a[::-1])
c = int(b)
print('the reversed number is',c)
| 4.0625 | 4 |
pyexcel_xls/xlsw.py | pyexcel/pyexcel-xls | 40 | 15094 | """
pyexcel_xlsw
~~~~~~~~~~~~~~~~~~~
The lower level xls file format handler using xlwt
:copyright: (c) 2016-2021 by Onni Software Ltd
:license: New BSD License
"""
import datetime
import xlrd
from xlwt import XFStyle, Workbook
from pyexcel_io import constants
from pyexcel_io.plugin_api import IW... | 2.75 | 3 |
venv/lib/python3.6/site-packages/gensim/__init__.py | bopopescu/wired_cli | 2 | 15095 | <filename>venv/lib/python3.6/site-packages/gensim/__init__.py
"""This package contains interfaces and functionality to compute pair-wise document similarities within a corpus
of documents.
"""
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
import logg... | 2.5 | 2 |
tests/test_ai.py | divanorama/katrain | 0 | 15096 | <reponame>divanorama/katrain
import pytest
from katrain.core.constants import AI_STRATEGIES_RECOMMENDED_ORDER, AI_STRATEGIES
class TestAI:
def test_order(self):
assert set(AI_STRATEGIES_RECOMMENDED_ORDER) == set(AI_STRATEGIES)
| 2.46875 | 2 |
game_client.py | wenlianglaw/Tetris-in-Python | 1 | 15097 | <reponame>wenlianglaw/Tetris-in-Python
# This file defines the back end of the Tetris game
#
# GameState is the base class of GameClient.
#
# GameClient.Run() will start two threads:
# - _ProcessActions: Process the action list every x seconds
# - _AutoDrop: Auto drops the current piece.
#
# GameClient:
# - curren... | 3.875 | 4 |
gateway/builders/authorization_builder.py | TarlanPayments/gw-python-client | 0 | 15098 | # The MIT License
#
# Copyright (c) 2017 <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, modify, merge, ... | 1.84375 | 2 |
cas9/score.py | cangtu/cot | 1 | 15099 | <reponame>cangtu/cot<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Copyright @ 0x6c78.
#
# 16-10-20 下午1:27 <EMAIL>
#
# Distributed under terms of the MIT License
from operator import mul
from itertools import combinations
class Score(object):
def __init__(self):
"""
张峰实验室通过实验获得的每个位置错配的特异性,具体参考网页:
... | 2.453125 | 2 |