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 |
|---|---|---|---|---|---|---|
spacy/lang/th/__init__.py | snosrap/spaCy | 1 | 16700 | from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from ...language import Language, BaseDefaults
from ...tokens import Doc
from ...util import DummyTokenizer, registry, load_config_from_str
from ...vocab import Vocab
DEFAULT_CONFIG = """
[nlp]
[nlp.tokenizer]
@tokenizers = "spacy.th.ThaiTokenizer"
... | 2.46875 | 2 |
src/setup/__init__.py | ScottDay/DFN-Maintenance-GUI-Backend | 2 | 16701 | from .args import args
from .extensions import extensions
from .logger import logger
from .routes import routes
__all__ = ['args', 'extensions', 'logger', 'routes']
| 1.289063 | 1 |
cloudrunner_server/plugins/clouds/docker_host.py | ttrifonov/cloudrunner-server | 2 | 16702 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# /*******************************************************
# * Copyright (C) 2013-2014 CloudRunner.io <<EMAIL>>
# *
# * Proprietary and confidential
# * This file is part of CloudRunner Server.
# *
# * CloudRunner Server can no... | 1.859375 | 2 |
scope/client_util/job_runner_check.py | drew-sinha/rpc-scope | 1 | 16703 | # -*- coding: utf-8 -*-
# This code is licensed under the MIT License (see LICENSE file for details)
import platform
import datetime
import sys
import pathlib
import subprocess
import time
from .. import scope_job_runner
from ..config import scope_configuration
def main():
if len(sys.argv) == 2 and sys.argv[1] =... | 2.28125 | 2 |
toffy/json_utils.py | angelolab/toffy | 0 | 16704 | <filename>toffy/json_utils.py<gh_stars>0
import copy
import json
import os
from ark.utils import io_utils
def rename_missing_fovs(fov_data):
"""Identify FOVs that are missing the 'name' key and create one with value placeholder_{n}
Args:
fov_data (dict): the FOV run JSON data
Returns:
di... | 3.21875 | 3 |
app/plugins/task/upload.py | venturiscm/hcp | 1 | 16705 | from systems.plugins.index import BaseProvider
import os
class Provider(BaseProvider('task', 'upload')):
def execute(self, results, params):
file_path = self.get_path(self.field_file)
if not os.path.exists(file_path):
self.command.error("Upload task provider file {} does not exist".... | 2.3125 | 2 |
win_dein_deoplete/.vim/.cache/.vimrc/.dein/rplugin/python3/denite/source/outline.py | takkii/dotfile | 1 | 16706 | # ============================================================================
# FILE: outline.py
# AUTHOR: <NAME> (tamura.yasumasa _at_ gmail.com)
# License: MIT license
# ============================================================================
from .base import Base
from subprocess import check_output, CalledPro... | 2.203125 | 2 |
test.py | Tweetsched/tweetsched-publisher | 1 | 16707 | <reponame>Tweetsched/tweetsched-publisher<filename>test.py
from base64 import b64encode
from app import app
import unittest
from mock import patch
import os
import json
from twython import Twython
class TestApp(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
os.environ['SERVICE_K... | 2.5 | 2 |
Python/01. Fundamentals/01. Simple Calculators/08. Temperature Converter/tempCoverter.py | darioGerussi/exercises | 1 | 16708 | # Converts a given temperature from Celsius to Fahrenheit
# Prompt user for Celsius temperature
degreesCelsius = float(input('\nEnter the temperature in Celsius: '))
# Calculate and display the converted
# temperature in Fahrenheit
degreesFahrenheit = ((9.0 / 5.0) * degreesCelsius) + 32
print('Fahrenheit equivalent:... | 4.4375 | 4 |
website/models/post.py | LKKTGB/lkkpomia | 0 | 16709 | from bs4 import BeautifulSoup
from django.db import models
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
class Post(models.Model):
title = models.CharField(_('post_title'), max_length=100)
body = models.TextField(_('post_body'))
tags = TaggableManager(... | 2.328125 | 2 |
tests/sentry/api/serializers/test_alert_rule.py | kinghuang/sentry | 1 | 16710 | <reponame>kinghuang/sentry
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
from sentry.api.serializers import serialize
from sentry.api.serializers.models.alert_rule import DetailedAlertRuleSerializer
from sentry.incidents.logic import create_alert_rule, create_alert_rule_trigger
from sentr... | 1.960938 | 2 |
mys/cli/subparsers/test.py | nsauzede/mys | 0 | 16711 | import os
from ..utils import add_jobs_argument
from ..utils import add_no_ccache_argument
from ..utils import add_optimize_argument
from ..utils import add_verbose_argument
from ..utils import build_prepare
from ..utils import run
def do_test(_parser, args, _mys_config):
build_prepare(args.verbose, args.optimiz... | 2.15625 | 2 |
plugins/modules/nsxt_transport_node_collections.py | madhukark/ansible-for-nsxt | 0 | 16712 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES... | 1.265625 | 1 |
training/loss.py | drboog/Lafite | 45 | 16713 |
import numpy as np
import torch
from torch_utils import training_stats
from torch_utils import misc
from torch_utils.ops import conv2d_gradfix
import torch.nn.functional as F
import torchvision.transforms as T
import clip
import dnnlib
import random
#--------------------------------------------------------------------... | 2.53125 | 3 |
lib/oitool/fetchoi.py | stockalgo/oichart | 8 | 16714 | <reponame>stockalgo/oichart<filename>lib/oitool/fetchoi.py
import time
import logging
from bandl.nse_data import NseData
from influxdb import InfluxDBClient
class FetchOI:
def __init__(self,source=None,influxdb_client=None,database="oitool",log_path=None,logLevel='info'):
"""[summary]
:param sourc... | 2.359375 | 2 |
notebooks/HelperFunctions/RunModel.py | hh2110/continual-ml-stocks | 0 | 16715 | from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_auc_score
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def do_ml(merged_df, test_size, ml_model, **kwargs):
train_data = merged_df.d... | 2.84375 | 3 |
tools/build_defs/pkg/make_rpm.py | jpieper-tri/bazel | 1 | 16716 | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1.890625 | 2 |
data/datasets/gb_100.py | CharleyZhao123/graceful-few-shot | 1 | 16717 | <filename>data/datasets/gb_100.py
import os
import pickle
import random
from torch.utils.data import Dataset
from .datasets import dataset_register
default_split = {
'train': 0.7,
'val': 0.3,
}
@dataset_register('gb-100')
class GB100(Dataset):
def __init__(self, root_path, split='train', split_method='... | 2.578125 | 3 |
examples/analyze-outdated.py | duzvik/project-freta | 67 | 16718 | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# Re-analyze all images that don't have latest version of the analysis available
from freta.api import Freta
def main():
freta = Freta()
versions = freta.versions()
for image in freta.image.list():
... | 2.640625 | 3 |
utils/utils_fit.py | bubbliiiing/faster-rcnn-keras | 282 | 16719 | import numpy as np
import tensorflow as tf
from keras import backend as K
from tqdm import tqdm
def write_log(callback, names, logs, batch_no):
for name, value in zip(names, logs):
summary = tf.Summary()
summary_value = summary.value.add()
summary_value.simple_value = value
... | 2.296875 | 2 |
__init__.py | sbalen/TrafficSignsDataset | 1 | 16720 | """TrafficSignDataset dataset."""
from .TrafficSignsDataset import Trafficsignsdataset
| 1 | 1 |
exercicios-Python/ex042.py | pedrosimoes-programmer/exercicios-python | 0 | 16721 | <filename>exercicios-Python/ex042.py
#Refaça o DESAFIO 035 dos triângulos, acrescentando o recurso de mostrar que tipo de triângulo será formado:
#- EQUILÁTERO: todos os lados iguais
#- ISÓSCELES: dois lados iguais, um diferente
#- ESCALENO: todos os lados diferentes
print('-' * 20, 'Programa Analisador de Triângulos',... | 4.25 | 4 |
tests/test_extension.py | PeterWurmsdobler/mopidy-vfd | 0 | 16722 | from mopidy_vfd import Extension
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert "[vfd]" in config
assert "enabled = true" in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert "display" in schema
| 2.125 | 2 |
backend/venv/src/api/ordercampproduct/apps.py | AkashSDas/camps_for_champs | 0 | 16723 | <filename>backend/venv/src/api/ordercampproduct/apps.py
from django.apps import AppConfig
class OrdercampproductConfig(AppConfig):
name = 'api.ordercampproduct'
| 1.390625 | 1 |
onnx_tf/handlers/backend/identity.py | ZemingZhao/onnx-tensorflow | 0 | 16724 | <filename>onnx_tf/handlers/backend/identity.py
import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_func
@onnx_op("Identity")
@tf_func(tf.identity)
class Identity(BackendHandler):
@classmethod
def... | 2.109375 | 2 |
raiden/tests/integration/api/test_restapi.py | litexnetwork/raiden | 1 | 16725 | from http import HTTPStatus
import time
import logging
import pytest
import grequests
from flask import url_for
from eth_utils import (
to_checksum_address,
to_canonical_address,
is_checksum_address,
)
from raiden_contracts.constants import (
CONTRACT_HUMAN_STANDARD_TOKEN,
MAX_TOKENS_DEPLOY,
TE... | 2.0625 | 2 |
contents/MyExperiment/Exp3_test/cluster_env.py | Feng-XiaoYue/Reinforcement-learning-with-tensorflow-master | 0 | 16726 | <reponame>Feng-XiaoYue/Reinforcement-learning-with-tensorflow-master
import numpy as np
import pandas as pd
import random
import time
import sys
if sys.version_info.major == 2:
import Tkinter as tk
else:
import tkinter as tk
class Cluster(tk.Tk, object):
def __init__(self, state_init, server_attribute):
... | 2.828125 | 3 |
libensemble/tests/regression_tests/test_6-hump_camel_elapsed_time_abort.py | Kardyne/libensemble | 0 | 16727 | <filename>libensemble/tests/regression_tests/test_6-hump_camel_elapsed_time_abort.py<gh_stars>0
# """
# Runs libEnsemble on the 6-hump camel problem. Documented here:
# https://www.sfu.ca/~ssurjano/camel6.html
#
# Execute via the following command:
# mpiexec -np 4 python3 test_6-hump_camel_elapsed_time_abort.py
#... | 2.46875 | 2 |
do_like_javac/tools/graphtools.py | zcai1/do-like-javac | 1 | 16728 | import os
import argparse
from . import common
argparser = argparse.ArgumentParser(add_help=False)
graph_group = argparser.add_argument_group('graphtool arguments')
graph_group.add_argument('--graph-jar', metavar='<graphtool-jar>',
action='store',default=None, dest='graph_jar',
... | 2.6875 | 3 |
boss_grabbing/pipelines.py | shansb/boss_grabbing | 0 | 16729 | <reponame>shansb/boss_grabbing<filename>boss_grabbing/pipelines.py
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from boss_grabbing.sqlite import Sqlite
class BossGrabbin... | 2.375 | 2 |
core/jobs/urls.py | InKyrNet/inkyrnet | 0 | 16730 | from django.urls import path
from .views import *
from django_filters.views import FilterView
app_name = 'jobs'
urlpatterns = [
path('', FilterView.as_view(filterset_class=JobFilter,
template_name='jobs/job_list.html'), name='index'),
path('companies/', CompanyListView.as_view(... | 1.804688 | 2 |
src/compas/datastructures/mesh/transformations_numpy.py | arpastrana/compas | 2 | 16731 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import transform_points_numpy
__all__ = [
'mesh_transform_numpy',
'mesh_transformed_numpy',
]
def mesh_transform_numpy(mesh, transformation):
"""Transform a mesh.
Param... | 2.765625 | 3 |
selfdrive/car/gm/carcontroller.py | CTyrell/openpilot | 0 | 16732 | from cereal import car
from common.realtime import DT_CTRL
from common.numpy_fast import interp
from common.realtime import sec_since_boot
from selfdrive.config import Conversions as CV
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.gm import gmcan
from selfdrive.car.gm.values import DBC, Ac... | 2.15625 | 2 |
src/rprblender/__init__.py | ralic/RadeonProRenderBlenderAddon | 1 | 16733 | <filename>src/rprblender/__init__.py
#**********************************************************************
# Copyright 2020 Advanced Micro Devices, Inc
# 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 Li... | 1.546875 | 2 |
plot_metric_err_vs_dim.py | wchen459/design_embeddings_jmd_2016 | 9 | 16734 | """
Plots reconstruction error vs semantic space dimensionality
Usage: python metric_err_vs_dim.py
Author(s): <NAME> (<EMAIL>)
"""
import matplotlib.pyplot as plt
import numpy as np
plt.rc("font", size=18)
examples = ['glass', 'sf_linear', 'sf_s_nonlinear', 'sf_v_nonlinear']
titles = {'glass': 'Glass'... | 2.265625 | 2 |
tools/pot/openvino/tools/pot/graph/gpu_patterns.py | ryanloney/openvino-1 | 1,127 | 16735 | # Copyright (C) 2020-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from .pattern_utils import check_fused_scale_shift_patterns, get_fused_scale_shift_patterns, \
check_fused_op_const_patterns, get_fused_op_const_pattern, get_clamp_mult_const_pattern
def get_gpu_ignored_patterns():
return {
... | 1.679688 | 2 |
test/environments/instances/8x8/gen.py | Multi-Agent-Research-Group/hog2 | 5 | 16736 | <reponame>Multi-Agent-Research-Group/hog2<gh_stars>1-10
#!/usr/bin/python
import random
import os
import errno
for i in range(100):
s=set()
g=set()
while len(s) < 50:
s.add((random.randint(0,7),random.randint(0,7)))
while len(g) < 50:
g.add((random.randint(0,7),random.randint(0,7)))
start=list(s)
g... | 2.4375 | 2 |
pose_recognition_from_camera_demo.py | amazingchow/capture-dance-using-mediapipe | 0 | 16737 | <gh_stars>0
# -*- coding: utf-8 -*-
import argparse
import cv2 as cv
import mediapipe as mp
import sys
import time
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--video_device", type=int, default=0)
parser.add_argument("--video_file", type=str, default="")
args =... | 2.4375 | 2 |
reference/data_dict_export.py | TBody/atomic1D | 1 | 16738 | # Program name: atomic1D/reference/build_json.py
# Author: <NAME>
# Author email: <EMAIL>
# Date of creation: 14 July 2017
#
#
# Makes data_dict and copies it into a .json file 'sd1d-case-05.json'
filename = 'sd1d-case-05'
from boutdata.collect import collect
data_dict = {}
# Normalisation factor for temperature ... | 2.578125 | 3 |
wordDocComposite.py | flyonok/image2text | 0 | 16739 | <gh_stars>0
from docx import Document
def CompositeTwoDocs(srcDocFullName, dstDocFullName, compositeName):
'''
srcDocFullName:源文档,里面含有需要替换的内容
dstDocFullName:目标文档,执行后,相关模板内容被替换
compositeName:替换的对象名,比如正面或背面
return: 成功->True,失败->False
'''
try:
srcDoc = Document(srcDocFullName)
... | 2.6875 | 3 |
app/cover.py | mrwiwi/tydom2mqtt | 26 | 16740 | <filename>app/cover.py
import json
import time
from datetime import datetime
from sensors import sensor
cover_command_topic = "cover/tydom/{id}/set_positionCmd"
cover_config_topic = "homeassistant/cover/tydom/{id}/config"
cover_position_topic = "cover/tydom/{id}/current_position"
cover_set_postion_topic = "cover/tydom... | 2.625 | 3 |
edx/config/lms/docker_run.py | openfun/learning-analytics-playground | 1 | 16741 | """
This is the default template for our main set of servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from ba... | 1.867188 | 2 |
stashboard/handlers/site.py | kelnos/stashboard | 1 | 16742 | # The MIT License
#
# Copyright (c) 2008 <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, p... | 1.671875 | 2 |
bga/forms.py | KarmaPoliceT2/bga | 0 | 16743 | <reponame>KarmaPoliceT2/bga<gh_stars>0
from wtforms import Form, StringField, PasswordField, DecimalField, IntegerField, SelectField, validators
from wtforms.fields.html5 import DateField
def strip_filter(x): return x.strip() if x else None
class RegistrationForm(Form):
username = StringField('Username', [valid... | 2.359375 | 2 |
ejercicios_python/Clase05/practica5-9.py | hcgalvan/UNSAM-Python-programming | 0 | 16744 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 15 08:32:03 2021
@author: User
"""
import numpy as np
import matplotlib.pyplot as plt
a = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])
print(a)
print(a[0])
print(a.ndim) #te dice la cantidad de ejes (o dimensiones) del arreglo
print(a.shape) #Te va a dar una t... | 3.375 | 3 |
cluster_toolkit/xi.py | jhod0/cluster_toolkit | 0 | 16745 | <filename>cluster_toolkit/xi.py
"""Correlation functions for matter and halos.
"""
import cluster_toolkit
from cluster_toolkit import _ArrayWrapper, _handle_gsl_error
import numpy as np
def xi_nfw_at_r(r, M, c, Omega_m, delta=200):
"""NFW halo profile correlation function.
Args:
r (float or array lik... | 2.40625 | 2 |
Tools/scripts/rgrep.py | ystk/debian-python3.1 | 1 | 16746 | <reponame>ystk/debian-python3.1
#! /usr/bin/env python
"""Reverse grep.
Usage: rgrep [-i] pattern file
"""
import sys
import re
import getopt
def main():
bufsize = 64*1024
reflags = 0
opts, args = getopt.getopt(sys.argv[1:], "i")
for o, a in opts:
if o == '-i':
reflags = reflags ... | 2.953125 | 3 |
licel_format_parser/main.py | IFAEControl/lidar-cli | 0 | 16747 | <reponame>IFAEControl/lidar-cli
import struct
f = open("c0610400.102200", 'rb')
class DateTime:
def __init__(self):
line = f.readline().strip()
self._letter = chr(line[0])
self._year = line[1:3].decode("utf-8")
self._month = int(chr(line[3]), 16)
self._day = line[4:6].deco... | 2.5625 | 3 |
built-in/TensorFlow/Official/nlp/BertLarge_ID0634_for_TensorFlow2.X/bert/tf2_common/training/optimizer_v2modified.py | Ascend/modelzoo | 12 | 16748 | <reponame>Ascend/modelzoo
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 1.734375 | 2 |
src/data/utils.py | behavioral-data/multiverse | 0 | 16749 | <filename>src/data/utils.py
import os
import errno
import requests
import glob
import os
import json
from tqdm import tqdm
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
def make_sure_path_exists(path):
try:
os.makedirs(path)
except OSError as exception:
... | 2.609375 | 3 |
LeetCode/Product and Sum/Subtract_Product_And_Sum.py | GSri30/Competetive_programming | 22 | 16750 | class Solution:
def subtractProductAndSum(self, n: int) -> int:
x = n
add = 0
mul = 1
while x > 0 :
add += x%10
mul *= x%10
x = x//10
return mul - add
| 3.25 | 3 |
jocular/calibrator.py | MartinCooke/jocular | 6 | 16751 | ''' Handles calibration library and calibration of subs.
'''
import os.path
import numpy as np
from scipy.stats import trimboth
from kivy.app import App
from loguru import logger
from kivy.properties import BooleanProperty, DictProperty, NumericProperty
from kivy.core.window import Window
from jocular.table import T... | 2.09375 | 2 |
test/office_schema.py | chrismaille/marshmallow-pynamodb | 3 | 16752 | <filename>test/office_schema.py
from test.office_model import Headquarters, Office
from marshmallow import fields
from pynamodb.attributes import DiscriminatorAttribute
from marshmallow_pynamodb import ModelSchema
class OfficeSchema(ModelSchema):
"""Office Schema for PynamoDB Office Model.
We are overridin... | 2.546875 | 3 |
energy_demand/initalisations/initialisations.py | willu47/energy_demand | 0 | 16753 | """Helper initialising functions
"""
#pylint: disable=I0011, C0321, C0301, C0103, C0325, R0902, R0913, no-member, E0213
def init_fuel_tech_p_by(all_enduses_with_fuels, nr_of_fueltypes):
"""Helper function to define stocks for all enduse and fueltype
Parameters
----------
all_enduses_with_fuels : dict
... | 3.078125 | 3 |
npd_well_decoder/__init__.py | fmell/npd-well-name-decoder | 0 | 16754 | <reponame>fmell/npd-well-name-decoder
from .npd import parse_wellbore_name
| 0.867188 | 1 |
Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/util.py | jickieduan/python27 | 5 | 16755 | <reponame>jickieduan/python27
###############################################################################
# Name: util.py #
# Purpose: Misc utility functions used through out Editra #
# Author: <NAME> <<EMAIL>> ... | 2.234375 | 2 |
genrl/environments/vec_env/utils.py | matrig/genrl | 390 | 16756 | from typing import Tuple
import torch
class RunningMeanStd:
"""
Utility Function to compute a running mean and variance calculator
:param epsilon: Small number to prevent division by zero for calculations
:param shape: Shape of the RMS object
:type epsilon: float
:type shape: Tuple
"""
... | 3.0625 | 3 |
releases/pota-windows-1.3-ai5.0.2.0/ae/aiPotaTemplate.py | sumitneup/pota | 0 | 16757 | import mtoa.ui.ae.templates as templates
import pymel.core as pm
import maya.cmds as cmds
import mtoa.ui.ae.utils as aeUtils
class aiPotaTemplate(templates.AttributeTemplate):
"""
def filenameEditBokeh(self, mData) :
attr = self.nodeAttr('aiBokehEXRPath')
cmds.setAttr(attr,mData,type="string")
... | 2.21875 | 2 |
tests/test_user.py | munniomer/Send-IT-Api-v1 | 0 | 16758 | import unittest
from app import create_app
import json
from tests.basetest import BaseTest
class TestUSer(BaseTest):
"""User tests class"""
def test_user_registration(self):
"tests if new user can register"
respon = self.client.post("/api/v1/user/register", json=self.new_user)
self.as... | 3.421875 | 3 |
authors/apps/profiles/migrations/0023_auto_20190124_1222.py | andela/ah-django-unchained | 0 | 16759 | <reponame>andela/ah-django-unchained
# Generated by Django 2.1.4 on 2019-01-24 12:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0022_auto_20190123_1211'),
]
operations = [
migrations.AlterField(
model_name='... | 1.742188 | 2 |
Algorithm/ShellSort/pyShellSort.py | commanderHR1/algorithms | 1 | 16760 | # Implementation of Shell Sort algorithm in Python
def shellSort(arr):
interval = 1
# Initializes interval
while (interval < (len(arr) // 3)):
interval = (interval * 3) + 1
while (interval > 0):
for i in range(interval, len(arr)):
# Select val to be inserted
... | 4.34375 | 4 |
photos/models.py | benjaminbills/galleria | 0 | 16761 | <reponame>benjaminbills/galleria
from django.db import models
# Create your models here.
class Image(models.Model):
name = models.CharField(max_length=255)
posted_date = models.DateTimeField(auto_now_add=True)
image_description = models.CharField(max_length=500, default='DEFAULT VALUE')
image = models.ImageFie... | 2.375 | 2 |
main.py | kramrm/gcf-alerting-discord | 0 | 16762 | import base64
import json
from webhook import post_webhook
from datetime import datetime
def hello_pubsub(event, context):
"""Triggered from a message on a Cloud Pub/Sub topic.
Args:
event (dict): Event payload.
context (google.cloud.functions.Context): Metadata for the event.
"""
pubs... | 2.671875 | 3 |
libzyre.py | brettviren/wafit | 0 | 16763 | <reponame>brettviren/wafit
#!/usr/bin/env waf
'''
This is a wafit tool for using zyre
'''
import util
def options(opt):
opt.load("libczmq")
util.generic_options(opt, "libzyre", libs=False)
def configure(cfg):
cfg.load("libczmq")
util.generic_configure_incs(cfg, "libzyre", "zyre.h", "libczmq")
... | 1.398438 | 1 |
scripts/run-gmm.py | vr100/nfl-kaggle | 0 | 16764 | import argparse, os, fnmatch, json, joblib
import pandas as pd
from sklearn.mixture import GaussianMixture
from sklearn.metrics import adjusted_rand_score
# Reference paper - https://arxiv.org/abs/1906.11373
# "Unsupervised Methods for Identifying Pass Coverage Among Defensive Backs with NFL Player Tracking Data"
STA... | 2.359375 | 2 |
module01/classes/class06b.py | LauroHBrant/python-course | 2 | 16765 | from style import blue, none
n = input(f'Type {blue}something{none}: ')
print(f'{blue}{n.isnumeric()}')
| 3.09375 | 3 |
custom_components/panasonic_cc/__init__.py | shyne99/panasonic_cc | 0 | 16766 | <reponame>shyne99/panasonic_cc<filename>custom_components/panasonic_cc/__init__.py
"""Platform for the Panasonic Comfort Cloud."""
from datetime import timedelta
import logging
from typing import Any, Dict
import asyncio
from async_timeout import timeout
import voluptuous as vol
from homeassistant.core import HomeAs... | 2.21875 | 2 |
django/bossingest/test/test_ingest_manager.py | jhuapl-boss/boss | 20 | 16767 | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 1.867188 | 2 |
sanic_devtools/log.py | yunstanford/sanic-devtools | 12 | 16768 | <reponame>yunstanford/sanic-devtools
import json
import logging
import logging.config
import platform
import re
import traceback
from io import StringIO
import pygments
from devtools import pformat
from devtools.ansi import isatty, sformat
from pygments.formatters import Terminal256Formatter
from pygments.lexers impor... | 1.929688 | 2 |
rest_fhir/mixins/conditional_read.py | weynelucas/django-rest-fhir | 2 | 16769 | import calendar
from typing import Union
import dateutil.parser
from rest_framework import status
from rest_framework.response import Response
from django.utils.cache import get_conditional_response
from django.utils.http import http_date
from ..models import Resource, ResourceVersion
FhirResource = Union[Resource,... | 2.1875 | 2 |
code_week27_1026_111/sort_colors.py | dylanlee101/leetcode | 0 | 16770 | <filename>code_week27_1026_111/sort_colors.py
'''
给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。
注意:
不能使用代码库中的排序函数来解决这道题。
示例:
输入: [2,0,2,1,1,0]
输出: [0,0,1,1,2,2]
进阶:
一个直观的解决方案是使用计数排序的两趟扫描算法。
首先,迭代计算出0、1 和 2 元素的个数,然后按照0、1、2的排序,重写当前数组。
你能想出一个仅使用常数空间的一趟扫描算法吗?
来源:力... | 3.8125 | 4 |
solutions/lowest_common_ancestor_deepest_leaves/__main__.py | ansonmiu0214/dsa-worked-solutions | 0 | 16771 | <reponame>ansonmiu0214/dsa-worked-solutions<filename>solutions/lowest_common_ancestor_deepest_leaves/__main__.py
from .solution import lcaDeepestLeaves
from ..utils import TreeNode
print('Enter tree, e.g. [2,3,1,3,1,null,1]:', end=' ')
nodes = [int(node) if node != 'null' else None for node in input().strip().split(',... | 3.078125 | 3 |
code/python3/index_values_with_geo.py | jaylett/xapian-docsprint | 47 | 16772 | #!/usr/bin/env python
import json
from support import parse_states
import sys
import xapian
def index(datapath, dbpath):
# Create or open the database we're going to be writing to.
db = xapian.WritableDatabase(dbpath, xapian.DB_CREATE_OR_OPEN)
# Set up a TermGenerator that we'll use in indexing.
term... | 2.609375 | 3 |
logger.py | drewstone/dynamic-governanceq | 0 | 16773 | <filename>logger.py
import constants
def init(mode, gov, agents):
if mode == constants.DEBUG_LOGGING or mode == constants.LOG_INIT:
print("Agents = {}".format(
list(map(lambda agent: agent.capacity, agents))))
print("Starting param: {}".format(gov.param))
def round(mode, round, gov, ... | 2.78125 | 3 |
test/core/bad_ssl/gen_build_yaml.py | Akrog/grpc | 3 | 16774 | <filename>test/core/bad_ssl/gen_build_yaml.py
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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/LI... | 2.09375 | 2 |
tests/test_providers.py | thejoeejoee/django-allauth-cas | 0 | 16775 | <filename>tests/test_providers.py
# -*- coding: utf-8 -*-
from six.moves.urllib.parse import urlencode
from django.contrib import messages
from django.contrib.messages.api import get_messages
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.messages.storage.base import Message
from ... | 2.078125 | 2 |
infoblox_netmri/api/remote/models/device_password_log_remote.py | IngmarVG-IB/infoblox-netmri | 0 | 16776 | <reponame>IngmarVG-IB/infoblox-netmri
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class DevicePasswordLogRemote(RemoteModel):
"""
This table list out entries of DevicePasswordLog
| ``DevicePwLogID:`` The internal NetMRI identifier for the device p... | 2.09375 | 2 |
selenium_utils/element.py | defactto/selenium-utils | 7 | 16777 | import logging
import time
from selenium.common import exceptions
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.common import action_chains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium_utils i... | 2.734375 | 3 |
modules/iib_applications.py | satbel/ib-metrics-pyclient | 0 | 16778 | <filename>modules/iib_applications.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Various functions for ib applications."""
from modules.iib_api import get_status
def get_metric_name(metric_label):
"""Returns pushgateway formatted metric name."""
return 'ib_application_{0}'.format(metric_label)
def get_metric_ann... | 2.25 | 2 |
clock.py | hcjk/kitchen-bot | 0 | 16779 | import os
import requests
import psycopg2
import db_lib as db
from app import send_message, log
from apscheduler.schedulers.blocking import BlockingScheduler
DATABASE_URL = os.environ['DATABASE_URL']
conn = psycopg2.connect(DATABASE_URL, sslmode='require')
def kitchen_reminder():
# fetch current status
status = d... | 2.625 | 3 |
ucf_sub_catkin_ros/src/sub_states/src/qual/test.py | RoboticsClubatUCF/RoboSub | 0 | 16780 | #!/usr/bin/env python
import rospy
import smach
import gate
import pole
class SubStates:
def __init__(self):
rospy.loginfo("State Machine has started.")
self.gate = smach.StateMachine(outcomes=['preempted', 'POLE', 'GATE'])
self.pole = smach.StateMachine(outc... | 2.34375 | 2 |
networkapi/plugins/SDN/ODL/tests/test_send_flows_with_tcp_flags.py | vinicius-marinho/GloboNetworkAPI | 73 | 16781 | <reponame>vinicius-marinho/GloboNetworkAPI<filename>networkapi/plugins/SDN/ODL/tests/test_send_flows_with_tcp_flags.py
from networkapi.test.test_case import NetworkApiTestCase
from networkapi.plugins.SDN.ODL.flows.acl import AclFlowBuilder
class TestSendFlowsWithTCPFlags(NetworkApiTestCase):
""" Class to test fl... | 2.078125 | 2 |
Old/OpenCV Scripts/red_filtered_detector.py | multirotorsociety/SAFMC-19-D2-Autonomous-Drone | 6 | 16782 | <reponame>multirotorsociety/SAFMC-19-D2-Autonomous-Drone<filename>Old/OpenCV Scripts/red_filtered_detector.py
from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import numpy as np
import time
from fractions import Fraction
from PIL import Image
#cap = cv2.VideoCapture(0)
camera = PiCamer... | 2.390625 | 2 |
setup.py | Maven85/plugin.video.magenta-sport | 0 | 16783 | # -*- coding: utf-8 -*-
# Module: default
# Author: asciidisco
# Created on: 24.07.2017
# License: MIT https://goo.gl/WA1kby
"""Setup"""
from __future__ import unicode_literals
from os.path import abspath, dirname, join
from re import search
from sys import exit, version, version_info
from setuptools import find_pack... | 1.757813 | 2 |
franka_lcas_experiments/script/load_model_rtp.py | arsh09/franka_ros_lcas | 2 | 16784 | import numpy as np
import os, sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow.keras.models import Model
import tensorflow as tf
from PIL import Image
from utils_rtp import ProMP
class Predictor:
def __init__(self, encoder_model_path, predictor_model_path):
self.all_phi = self.promp_train(... | 2.078125 | 2 |
sdv/tabular/ctgan.py | joanvaquer/SDV | 0 | 16785 | <reponame>joanvaquer/SDV
"""Wrapper around CTGAN model."""
from sdv.tabular.base import BaseTabularModel
class CTGAN(BaseTabularModel):
"""Model wrapping ``CTGANSynthesizer`` model.
Args:
field_names (list[str]):
List of names of the fields that need to be modeled
and include... | 2.40625 | 2 |
cointrader/config.py | 3con/cointrader | 103 | 16786 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import logging
import logging.config
if (sys.version_info > (3, 0)):
# Python 3 code in this block
import configparser
else:
# Python 2 code in this block
import ConfigParser as configparser
DEFAULT_CONFIG = ".cointra... | 2.328125 | 2 |
src/snakeoil/descriptors.py | Arusekk/snakeoil | 0 | 16787 | """Classes implementing the descriptor protocol."""
__all__ = ("classproperty",)
class classproperty:
"""Like the builtin :py:func:`property` but takes a single classmethod.
Essentially, it allows you to use a property on a class itself- not
just on its instances.
Used like this:
>>> from sna... | 3.484375 | 3 |
playground/pets_dubins.py | pecey/mbrl-lib | 0 | 16788 | <gh_stars>0
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import torch
import omegaconf
import mbrl.env.continuous_dubins as dubins_env
import mbrl.env.reward_fns as reward_fns
import mbrl.env.termination_fns as termination_fns
import mbrl.models as models
import mbrl.planning as planning... | 2.046875 | 2 |
pixiv_spider/__init__.py | Uzukidd/Pixiv-spider | 1 | 16789 | <reponame>Uzukidd/Pixiv-spider<gh_stars>1-10
# from pixiv_web_crawler import Getters | 1.117188 | 1 |
parsers/parsers_base.py | xm4dn355x/async_test | 0 | 16790 | #
# Общие функции для всех парсеров
#
# Автор: <NAME>
# Лицензия: MIT License
#
from time import sleep
import requests
def get_htmls(urls):
"""
Получает список URL-адресов
Возвращает список из всех полученных HTML документов
:param urls: Список URL-адресов
:type urls: list
... | 3.046875 | 3 |
smbspider/smbspider.py | vonahi/pentesting_scripts | 13 | 16791 | #!/usr/bin/python
#
# This post-exploitation script can be used to spider numerous systems
# to identify sensitive and/or confidential data. A good scenario to
# use this script is when you have admin credentials to tons of
# Windows systems, and you want to look for files containing data such
# as PII, network pas... | 2.90625 | 3 |
api-inference-community/docker_images/spacy/app/pipelines/text_classification.py | mlonaws/huggingface_hub | 362 | 16792 | <filename>api-inference-community/docker_images/spacy/app/pipelines/text_classification.py<gh_stars>100-1000
import os
import subprocess
import sys
from typing import Dict, List
from app.pipelines import Pipeline
class TextClassificationPipeline(Pipeline):
def __init__(
self,
model_id: str,
)... | 2.625 | 3 |
aws/logs_monitoring/tests/test_cloudtrail_s3.py | rkitron/datadog-serverless-functions | 232 | 16793 | <filename>aws/logs_monitoring/tests/test_cloudtrail_s3.py
from unittest.mock import MagicMock, patch
import os
import sys
import unittest
import json
import copy
import io
import gzip
sys.modules["trace_forwarder.connection"] = MagicMock()
sys.modules["datadog_lambda.wrapper"] = MagicMock()
sys.modules["datadog_lambda... | 1.945313 | 2 |
ch_06/tests/test_lookup_mapping.py | real-slim-chadi/Python-Object-Oriented-Programming---4th-edition | 43 | 16794 | <reponame>real-slim-chadi/Python-Object-Oriented-Programming---4th-edition
"""
Python 3 Object-Oriented Programming
Chapter 6, Abstract Base Classes and Operator Overloading
"""
from lookup_mapping import Lookup
def test_lookup_mapping():
x = Lookup(
[
["z", "Zillah"],
["a", "Amy"]... | 3.234375 | 3 |
serempre_todo/utils/choices.py | pygabo/Serempre | 0 | 16795 | <gh_stars>0
TASK_STATUS = [
('TD', 'To Do'),
('IP', 'In Progress'),
('QA', 'Testing'),
('DO', 'Done'),
]
TASK_PRIORITY = [
('ME', 'Medium'),
('HI', 'Highest'),
('HG', 'High'),
('LO', 'Lowest'),
]
| 1.671875 | 2 |
symbols/block.py | zerofo/sdu-face-alignment | 192 | 16796 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mxnet as mx
import numpy as np
from config import config
def Conv(**kwargs):
body = mx.sym.Convolution(**kwargs)
return body
def Act(data, act_type, name):
if act_type=='prelu':
body... | 2.171875 | 2 |
train/metric.py | alexandrosstergiou/Squeeze-and-Recursion-Temporal-Gates | 54 | 16797 | '''
--- I M P O R T S T A T E M E N T S ---
'''
import coloredlogs, logging
coloredlogs.install()
import numpy as np
'''
=== S T A R T O F C L A S S E V A L M E T R I C ===
[About]
Object class for calculating average values.
[Init Args]
- name: String for the variable name to calc... | 2.90625 | 3 |
poly/repl.py | jdanford/poly | 0 | 16798 | import sys
from string import whitespace
from clint.textui import puts, indent, colored
from poly.common import *
from poly.node import *
def repl_main(args):
repl = Repl("repl")
repl.run()
class UndefinedCommandError(PolyError):
def __init__(self, command):
self.message = "Undefined command '{}... | 2.8125 | 3 |
resources/mgltools_x86_64Linux2_1.5.6/lib/python2.5/site-packages/Pmw/Pmw_1_3/demos/SelectionDialog.py | J-E-J-S/aaRS-Pipeline | 3 | 16799 | title = 'Pmw.SelectionDialog demonstration'
# Import Pmw from this directory tree.
import sys
sys.path[:0] = ['../../..']
import Tkinter
import Pmw
class Demo:
def __init__(self, parent):
# Create the dialog.
self.dialog = Pmw.SelectionDialog(parent,
title = 'My SelectionDialog',
buttons = ('OK', 'Ca... | 2.828125 | 3 |