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
openff/bespokefit/executor/services/qcgenerator/cache.py
openforcefield/bespoke-f
12
600
import hashlib from typing import TypeVar, Union import redis from openff.toolkit.topology import Molecule from openff.bespokefit.executor.services.qcgenerator import worker from openff.bespokefit.schema.tasks import HessianTask, OptimizationTask, Torsion1DTask from openff.bespokefit.utilities.molecule import canonic...
2.09375
2
advanced-workflows/task-graphs-lab/exercise/plugins/lab/plugin/workflows.py
jrzeszutek/cloudify-training-labs
6
601
'''Copyright Gigaspaces, 2017, All Rights Reserved''' from cloudify.plugins import lifecycle OP_START = 'hacker.interfaces.lifecycle.start' OP_STOP = 'hacker.interfaces.lifecycle.stop' OP_SS_C = 'hacker.interfaces.lifecycle.create_snapshots' OP_SS_D = 'hacker.interfaces.lifecycle.delete_snapshots' REQUIRED_OPS = set([...
2.390625
2
File Transfer/Flyter/flyter.py
CryptoNyxz/Miscellaneous-Tools
0
602
<gh_stars>0 """ Flyter Tool for transferring files on the same network using raw sockets. Doesn't use encryption. """ __version__ = (0, 0, 0) __author__ = "CryptoNyxz" __license__ = """ MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa...
1.953125
2
tests/test_modeling_tf_led.py
patelrajnath/transformers
0
603
# coding=utf-8 # Copyright <NAME>, <NAME>, <NAME> and The HuggingFace Inc. team. 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/LI...
1.796875
2
src/wann_genetic/individual/numpy/ffnn.py
plonerma/wann-genetic
0
604
<filename>src/wann_genetic/individual/numpy/ffnn.py import numpy as np import sklearn import logging from wann_genetic.individual.network_base import BaseFFNN def softmax(x, axis=-1): """Compute softmax values for each sets of scores in x. Returns: softmax - softmax normalized in dim axis """ ...
2.984375
3
common/tests/util.py
uktrade/tamato
14
605
import contextlib from datetime import date from datetime import datetime from datetime import timezone from functools import wraps from io import BytesIO from itertools import count from typing import Any from typing import Dict from typing import Sequence import pytest from dateutil.parser import parse as parse_date...
1.828125
2
src/com/python/email/send_mail.py
Leeo1124/pythonDemo
0
606
<gh_stars>0 ''' Created on 2016年8月10日 @author: Administrator ''' from email import encoders from email.header import Header from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEBase from email.utils import parseaddr, formataddr import smtplib def _fo...
3.078125
3
studies/mixture_feasibility/parsley_benchmark/alcohol_ester/run.py
openforcefield/nistdataselection
3
607
<filename>studies/mixture_feasibility/parsley_benchmark/alcohol_ester/run.py<gh_stars>1-10 from evaluator import unit from evaluator.backends import QueueWorkerResources from evaluator.backends.dask import DaskLSFBackend from evaluator.client import ConnectionOptions, EvaluatorClient from evaluator.datasets import Phys...
2.09375
2
nuplan/planning/simulation/observation/idm/test/test_profile_idm_observation.py
motional/nuplan-devkit
128
608
import logging import unittest from pyinstrument import Profiler from nuplan.planning.scenario_builder.nuplan_db.test.nuplan_scenario_test_utils import get_test_nuplan_scenario from nuplan.planning.simulation.history.simulation_history_buffer import SimulationHistoryBuffer from nuplan.planning.simulation.observation....
2.34375
2
baselines/ddpg/ddpg.py
RDaneelOlivav/baselines
11
609
<filename>baselines/ddpg/ddpg.py import os import os.path as osp import time from collections import deque import pickle from baselines.ddpg.ddpg_learner import DDPG from baselines.ddpg.models import Actor, Critic from baselines.ddpg.memory import Memory from baselines.ddpg.noise import AdaptiveParamNoiseSpec, NormalA...
1.835938
2
footprints/transaction_details.py
enwawerueli/footprints
1
610
<filename>footprints/transaction_details.py import os from datetime import datetime from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * from PySide2.QtPrintSupport import QPrinter, QPrintDialog from jinja2 import TemplateNotFound from .ui.ui_transaction_details import Ui_Transacti...
1.96875
2
yt/units/yt_array.py
FeiLi5/git-github.com-yt-project-yt
0
611
""" YTArray class. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this so...
1.78125
2
src/posts/api/serializers.py
MahmoudMagdi20/django_rest_blog_api
0
612
<gh_stars>0 from rest_framework import serializers from posts.models import Post class PostCreateUpdateSerializer(serializers.ModelSerializer): class Meta: model = Post fields = [ #'id', 'title', #'slug', 'content', 'publish', ] ...
2.203125
2
Protheus_WebApp/Modules/SIGAGTP/GTPA036ETestCase.py
98llm/tir-script-samples
17
613
<reponame>98llm/tir-script-samples from tir import Webapp import unittest class GTPA036E(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup("SIGAGTP", "05/08/2020", "T1", "D MG 01 ") inst.oHelper.Program('GTPA036') def test_GTPA036E_CT001(self): ...
2.421875
2
code_tmpl/views.py
lovebirdegg/nnms-server
0
614
<filename>code_tmpl/views.py<gh_stars>0 # @Time : {time} # @Author : code_generator from rest_framework.viewsets import ModelViewSet from rest_framework.generics import ListAPIView from rest_framework.filters import SearchFilter, OrderingFilter from rest_framework.response import Response from rest_framework.decor...
1.8125
2
src/collectors/heartbeat/heartbeat.py
art19/netuitive-diamond
2
615
<reponame>art19/netuitive-diamond<filename>src/collectors/heartbeat/heartbeat.py # coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbe...
2.140625
2
process_script/stat.py
vitorebatista/AVEMH
2
616
<reponame>vitorebatista/AVEMH import numpy as np import pandas as pd import sys markets = ["hangseng", "dax", "ftse", "sp", "nikkei"] market = markets[int(sys.argv[1])-1] # read GD data file dat = pd.read_csv("./num_res/{}.GD.csv".format(market)) # split into two experiments exp1_GD = dat[dat.columns[:5]]...
3.0625
3
Scripts/calc_Utilities.py
zmlabe/ThicknessSensitivity
1
617
<gh_stars>1-10 """ Functions are useful untilities for SITperturb experiments Notes ----- Author : <NAME> Date : 13 August 2017 Usage ----- [1] calcDecJan(varx,vary,lat,lon,level,levsq) [2] calcDecJanFeb(varx,vary,lat,lon,level,levsq) [3] calc_indttest(varx,vary) [4] calc_weightedAve(va...
2.734375
3
tests/python/unittest/test_tir_schedule_compute_inline.py
xiebaiyuan/tvm
0
618
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
1.820313
2
cwl_flask.py
Sage-Bionetworks/workflow-service
1
619
from flask import Flask, Response, request, redirect import subprocess import tempfile import json import yaml import signal import threading import time import copy app = Flask(__name__) jobs_lock = threading.Lock() jobs = [] class Job(threading.Thread): def __init__(self, jobid, path, inputobj): super...
2.09375
2
cs15211/ReverseBits.py
JulyKikuAkita/PythonPrac
1
620
<reponame>JulyKikuAkita/PythonPrac __source__ = 'https://leetcode.com/problems/reverse-bits/description/' # https://github.com/kamyu104/LeetCode/blob/master/Python/reverse-bits.py # Time : O(n) # Space: O(1) # Bit Manipulation # # Description: Leetcode # 190. Reverse Bits # # Reverse bits of a given 32 bits unsigned in...
3.765625
4
tibanna/_version.py
freezecoder/tibanna
0
621
<gh_stars>0 """Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.16.1"
1.09375
1
selective_merge_pdf.py
vs-slavchev/selective_merge_pdf
0
622
from sys import argv from PyPDF2 import PdfFileReader, PdfFileWriter import re range_pattern = re.compile(r'(\d+)(\.\.|-)(\d+)') comma_pattern = re.compile('\d+(,\d+)*') def pages_args_to_array(pages_str): groups = range_pattern.search(pages_str) if groups: start = int(groups.group(1)) end = int(groups.group(3)...
3.265625
3
vp/scoring.py
romack77/vp-toolbox
10
623
import math from vp import geom_tools def horizon_error(ground_truth_horizon, detected_horizon, image_dims): """Calculates error in a detected horizon. This measures the max distance between the detected horizon line and the ground truth horizon line, within the image's x-axis, and normalized by ima...
3.0625
3
compositional-rl-benchmark/composition/spinningup_training/train_mtl_ppo.py
collassubmission91/CompoSuite-Code
0
624
import numpy as np import argparse import composition import os import json import torch from spinup.algos.pytorch.ppo.core import MLPActorCritic from spinup.algos.pytorch.ppo.ppo import ppo from spinup.utils.run_utils import setup_logger_kwargs from spinup.utils.mpi_tools import proc_id, num_procs def parse_args()...
1.882813
2
pypy/interpreter/test/test_generator.py
m4sterchain/mesapy
381
625
<filename>pypy/interpreter/test/test_generator.py class AppTestGenerator: def test_generator(self): def f(): yield 1 assert f().next() == 1 def test_generator2(self): def f(): yield 1 g = f() assert g.next() == 1 raises(StopIteration, g.n...
2.484375
2
igvm/cli.py
innogames/igvm
14
626
"""igvm - The command line interface Copyright (c) 2017 InnoGames GmbH """ from __future__ import print_function from argparse import ArgumentParser, _SubParsersAction from logging import StreamHandler, root as root_logger import time from fabric.network import disconnect_all from igvm.commands import ( change_...
2.421875
2
test/test_data_processor/test_condition_generation_dataset.py
puraminy/OpenPrompt
979
627
<reponame>puraminy/OpenPrompt import os, sys from os.path import dirname as d from os.path import abspath, join root_dir = d(d(d(abspath(__file__)))) sys.path.append(root_dir) from openprompt.data_utils.conditional_generation_dataset import PROCESSORS base_path = os.path.join(root_dir, "datasets/CondGen") def test_We...
2.25
2
BaseTools/Source/Python/Common/BuildToolError.py
JayLeeCompal/EDKII_Git
1
628
## @file # Standardized Error Hanlding infrastructures. # # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text...
1.203125
1
datasets/SUN397EncodbleDataset.py
allenai/ViRB
26
629
import torch import torchvision.transforms as transforms from torch.utils.data import Dataset import glob from PIL import Image import random class SUN397EncodableDataset(Dataset): """SUN397 encodable dataset class""" def __init__(self, train=True): super().__init__() path = 'data/SUN397/trai...
2.53125
3
cybox/common/location.py
tirkarthi/python-cybox
40
630
<reponame>tirkarthi/python-cybox<filename>cybox/common/location.py # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities, fields import cybox import cybox.bindings.cybox_common as common_binding class LocationFactory(entities.EntityFactor...
2.328125
2
scripts/bam-stats.py
varlociraptor/prosic-evaluation
2
631
<gh_stars>1-10 #!/usr/bin/env python import sys import numpy as np import pandas as pd import pysam import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns from functools import partial tumor = pysam.AlignmentFile(snakemake.input[0], "rb") normal = pysam.AlignmentFile(snakemake.i...
1.9375
2
app/rss_feeder_api/migrations/0003_auto_20200813_1623.py
RSaab/rss-scraper
0
632
<reponame>RSaab/rss-scraper<gh_stars>0 # Generated by Django 3.1 on 2020-08-13 16:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('rss_feeder_api', '0002_feed_subtitle'), ] operations = [ migrations.AlterM...
1.789063
2
AdversarialSampleGeneratorV11/AdversarialSampleGeneratorV11/ResNetConstructor.py
MetaMain/BewareAdvML
1
633
import tensorflow from tensorflow import keras Model = keras.models.Model Dense = keras.layers.Dense Activation = keras.layers.Activation Flatten = keras.layers.Flatten BatchNormalization= keras.layers.BatchNormalization Conv2D = tensorflow.keras.layers.Conv2D AveragePooling2D = keras.layers.AveragePooling2D I...
3.109375
3
ttl2json.py
the-norman-sicily-project/genealogical-trees
1
634
#!/usr/bin/env python3 import sys import json import rdflib import rdflib.plugins.sparql as sparql RELS_TO_DRAW = ['isWifeOf', 'isMotherOf', 'isFatherOf', 'isHusbandOf', 'isSpouseOf'] RELS_TO_INFER = ['hasGrandParent', 'isGrandParentOf', 'hasGreatGrandParent', 'isGreatGrandParentOf', 'isUncleOf', 'ha...
2.34375
2
tests/rest/client/test_login.py
BearerPipelineTest/synapse-1
0
635
# Copyright 2019-2021 The Matrix.org Foundation C.I.C. # # 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...
1.664063
2
rmf_demo_tasks/rmf_demo_tasks/request_delivery.py
Kevinskwk/rmf_demos
0
636
<gh_stars>0 import argparse import sys from time import sleep import uuid import rclpy from rmf_task_msgs.msg import Delivery def main(argv = sys.argv): rclpy.init(args=argv) args_without_ros = rclpy.utilities.remove_ros_args(argv) ''' # Example request: task_id: randomid_001 items: [itemA,...
2.375
2
dis_snek/api/http/http_client.py
BoredManCodes/Dis-Snek
0
637
<filename>dis_snek/api/http/http_client.py """This file handles the interaction with discords http endpoints.""" import asyncio import logging from typing import Any, Dict, Optional, Union from urllib.parse import quote as _uriquote from weakref import WeakValueDictionary import aiohttp from aiohttp import BaseConnect...
2.125
2
config.py
conradsuuna/uac-computer-competency
0
638
from os import environ import psycopg2 from datetime import timedelta from dotenv import load_dotenv load_dotenv() class Config(object): """ app configuration class """ TESTING = False CSRF_ENABLED = True SECRET_KEY = environ.get('SECRET_KEY') USER = environ.get('DB_USER') PASSWORD = environ.g...
2.234375
2
electrum/version.py
c4pt000/electrum-radiocoin
0
639
<filename>electrum/version.py ELECTRUM_VERSION = '4.1.5-radc' # version of the client package APK_VERSION = '4.1.5.0' # read by buildozer.spec PROTOCOL_VERSION = '1.4' # protocol version requested # The hash of the mnemonic seed must begin with this SEED_PREFIX = '01' # Standard wallet SEED...
1.882813
2
lib/layers/functions/prior_box.py
arleyzhang/object-detection-pytorch
4
640
from __future__ import division from math import sqrt as sqrt from itertools import product as product import torch import numpy as np import cv2 from lib.utils.visualize_utils import TBWriter def vis(func): """tensorboard visualization if has writer as input""" def wrapper(*args, **kw): return func...
2.140625
2
python/Gaffer/SequencePath.py
cwmartin/gaffer
0
641
########################################################################## # # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
1.210938
1
reo/migrations/0121_merge_20211001_1841.py
NREL/REopt_API
7
642
# Generated by Django 3.1.13 on 2021-10-01 18:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reo', '0117_financialmodel_generator_fuel_escalation_pct'), ('reo', '0120_auto_20210927_2046'), ('reo', '0121_auto_20211012_0305') ] operat...
1.375
1
PhysicsTools/Heppy/python/analyzers/objects/TauAnalyzer.py
ckamtsikis/cmssw
852
643
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle from PhysicsTools.Heppy.physicsobjects.Tau import Tau from PhysicsTools.HeppyCore.utils.deltar import deltaR, matchObjectCollection3 import PhysicsTools.HeppyCore.framework.config as cfg...
2.109375
2
vize/170401038.py
omuryorulmaz/kriptografi
8
644
# <NAME> 170401038 import math import random r = 3271 def egcd(a,b): if(a == 0): return(b,0,1) else: c,d,e = egcd(b % a, a) return(c, e - (b // a) * d, d) def modInvert(a,b): c,d,e = egcd(a,b) if c != 1: raise Exception('moduler ters bulunamadi') ...
3.125
3
seqenv/ontology.py
xapple/seqenv
7
645
# Built-in modules # # Internal modules # from seqenv import module_dir from seqenv.common.cache import property_cached # Third party modules # import sh, networkx import matplotlib.colors # A list of envos to help test this module # test_envos = [ "ENVO:00000033", "ENVO:00000043", "ENVO:00000067", "...
2.34375
2
sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models.py
adewaleo/azure-sdk-for-python
1
646
<reponame>adewaleo/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R)...
2.125
2
tests/unit/controllers/v1/test_rbac_for_supported_st2api_endpoints.py
cognifloyd/st2-open-rbac
0
647
<reponame>cognifloyd/st2-open-rbac<gh_stars>0 # Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Ver...
1.632813
2
testing/scripts/test_ksonnet_single_namespace.py
dtrawins/seldon-core
0
648
import pytest import time import subprocess from subprocess import run,Popen from seldon_utils import * from k8s_utils import * def wait_for_shutdown(deploymentName): ret = run("kubectl get deploy/"+deploymentName, shell=True) while ret.returncode == 0: time.sleep(1) ret = run("kubectl get depl...
2.015625
2
enthought/envisage/safeweakref.py
enthought/etsproxy
3
649
<reponame>enthought/etsproxy # proxy module from __future__ import absolute_import from envisage.safeweakref import *
0.941406
1
test_app/models.py
alissonmuller/django-group-by
25
650
from django.db import models from .query import BookQuerySet class Book(models.Model): objects = BookQuerySet.as_manager() title = models.CharField(max_length=50) publication_date = models.DateTimeField() author = models.ForeignKey('Author') genres = models.ManyToManyField('Genre') class Autho...
2.40625
2
ResNet/dropblock.py
whj363636/CamDrop
0
651
<reponame>whj363636/CamDrop # -*- coding: utf-8 -*- # File: dropblock.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import six # from tensorpack.tfutils.compat import tfv1 as tf # this should be avoided first in model code from tensorpack.tfu...
2.796875
3
tutorial/deprecated/tutorial_recurrent_policy/main_a2c.py
Purple-PI/rlstructures
281
652
<gh_stars>100-1000 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from rlstructures import logging from rlstructures.env_wrappers import GymEnv, GymEnvInf from rlstructures.tools impor...
2.296875
2
dashboard/gnd-app.py
buchmuseum/GND_Dashboard
5
653
from matplotlib.pyplot import title import streamlit as st import pandas as pd import altair as alt import pydeck as pdk import os import glob from wordcloud import WordCloud import streamlit_analytics path = os.path.dirname(__file__) streamlit_analytics.start_tracking() @st.cache def load_gnd_top_daten(typ): gn...
2.9375
3
seamo/support/seamo_exceptions.py
amandalynne/Seattle-Mobility-Index
3
654
<filename>seamo/support/seamo_exceptions.py """ Class for all excpetions used in following scripts - geocoder.py - geocoder_input.py """ class OverlappingGeographyError(Exception): def __init__(self, message): self.message = message # msg: geodataframe has overlapping polygons representing geographic ...
2.546875
3
vize/150401052/sunucu.py
hasan-se/blm304
1
655
#<NAME> 150401052 import os import sys import time from socket import * from os import system, name ip = '127.0.0.1' port = 42 s_soket = socket(AF_INET, SOCK_DGRAM) s_soket.bind((ip, port)) print("\nSunucu Hazir\n") kontrol, istemciAdres = s_soket.recv...
2.46875
2
httprunner/compat.py
panyuan209/httprunner
0
656
<filename>httprunner/compat.py<gh_stars>0 """ This module handles compatibility issues between testcase format v2 and v3. 解决httprunner2 和 3 之间测试用例兼容性问题 """ import os import sys from typing import List, Dict, Text, Union, Any from loguru import logger from httprunner import exceptions from httprunner.loader import loa...
2.296875
2
examples/demo/basic/scatter.py
ContinuumIO/chaco
3
657
""" Scatter plot with panning and zooming Shows a scatter plot of a set of random points, with basic Chaco panning and zooming. Interacting with the plot: - Left-mouse-drag pans the plot. - Mouse wheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a recta...
4.21875
4
webstr/core/config.py
fbalak/webstr
3
658
""" Central configuration module of webstr selenium tests. This module provides configuration options along with default values and function to redefine values. """ # Copyright 2016 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
2.515625
3
operations/mutations/mutation.py
PiotrBosowski/feat-genes
0
659
<filename>operations/mutations/mutation.py import random class Mutation: def __init__(self, chrom_mut_chance, gen_mut_chance): self.chrom_mut_chance = chrom_mut_chance self.gen_mut_chance = gen_mut_chance def __call__(self, population): chroms_to_mutate = random.sample( po...
3.125
3
examples/CountLettersInList.py
Ellis0817/Introduction-to-Programming-Using-Python
0
660
<filename>examples/CountLettersInList.py import RandomCharacter # Defined in Listing 6.9 def main(): """Main.""" # Create a list of characters chars = createList() # Display the list print("The lowercase letters are:") displayList(chars) # Count the occurrences of each letter counts...
4.28125
4
ddtrace/contrib/vertica/__init__.py
lightstep/dd-trace-py
5
661
""" The Vertica integration will trace queries made using the vertica-python library. Vertica will be automatically instrumented with ``patch_all``, or when using the ``ls-trace-run`` command. Vertica is instrumented on import. To instrument Vertica manually use the ``patch`` function. Note the ordering of the follow...
2.265625
2
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_htmldiscover.py
kokosing/hue
5,079
662
<filename>desktop/core/ext-py/python-openid-2.2.5/openid/test/test_htmldiscover.py from openid.consumer.discover import OpenIDServiceEndpoint import datadriven class BadLinksTestCase(datadriven.DataDrivenTestCase): cases = [ '', "http://not.in.a.link.tag/", '<link rel="openid.server" href="...
2.421875
2
project/settings/production.py
chiehtu/kissaten
0
663
<reponame>chiehtu/kissaten<gh_stars>0 from .base import * SECRET_KEY = get_env_var('SECRET_KEY') CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_dire...
1.609375
2
modelflow/graph_viz_from_outputs.py
ModelFlow/modelflow
6
664
import pandas as pd import argparse import json try: from graphviz import Digraph except: print("Note: Optional graphviz not installed") def generate_graph(df, graph_format='pdf'): g = Digraph('ModelFlow', filename='modelflow.gv', engine='neato', format=graph_format) g.attr(overlap='false') g.attr...
2.796875
3
src/command/voice_log/chart.py
link1345/Vol-GameClanTools-DiscordBot
0
665
import discord import os import json import datetime import pandas as pd from dateutil.relativedelta import relativedelta from pprint import pprint import base.ColorPrint as CPrint import command.voice_log.Config_Main as CSetting def most_old_Month() : old_month = 1 labels = [] fileNameList = [] while True : ...
2.65625
3
5kyu/(5 kyu) Count IP Addresses/(5 kyu) Count IP Addresses.py
e1r0nd/codewars
49
666
def ips_between(start, end): calc = lambda n, m: (int(end.split(".")[n]) - int(start.split(".")[n])) * m return calc(0, 256 * 256 * 256) + calc(1, 256 * 256) + calc(2, 256) + calc(3, 1)
2.96875
3
python/src/vmaf/core/feature_extractor.py
jayholman/vmaf
40
667
from abc import ABCMeta, abstractmethod import os from vmaf.tools.misc import make_absolute_path, run_process from vmaf.tools.stats import ListStats __copyright__ = "Copyright 2016-2018, Netflix, Inc." __license__ = "Apache, Version 2.0" import re import numpy as np import ast from vmaf import ExternalProgramCaller,...
2.1875
2
notebooks/_solutions/pandas_02_basic_operations28.py
rprops/Python_DS-WS
65
668
<gh_stars>10-100 df['Age'].hist() #bins=30, log=True
1.921875
2
controller/base_service.py
oopsteams/pansite
0
669
# -*- coding: utf-8 -*- """ Created by susy at 2019/11/8 """ from dao.dao import DataDao import pytz from dao.models import PanAccounts from cfg import PAN_SERVICE, MASTER_ACCOUNT_ID class BaseService: def __init__(self): self.default_tz = pytz.timezone('Asia/Chongqing') # self.pan_acc: PanAccoun...
2.125
2
transformerquant/modules/attention/multi_head.py
StateOfTheArt-quant/transformerquant
22
670
<reponame>StateOfTheArt-quant/transformerquant #!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch.nn as nn from .single import attention class MultiHeadedAttention(nn.Module): def __init__(self, d_model, nhead, dropout=0.1): super().__init__() assert d_model % nhead ==0 ...
2.421875
2
avatar/generalization.py
Julian-Theis/AVATAR
7
671
import os, time, argparse from datetime import datetime from pm4py.objects.log.importer.csv import factory as csv_importer from pm4py.objects.log.exporter.xes import factory as xes_exporter from pm4py.objects.log.importer.xes import factory as xes_importer from pm4py.objects.petri.importer import pnml as pnml_importer...
2.21875
2
Introductions/The Rust Programming Language/embed/bindings/embed.py
uqtimes/Rust-SampleCodes
0
672
# $ python embed.py from ctypes import cdll lib = cdll.LoadLibrary("../target/release/libembed.dylib") #=> for Mac #lib = cdll.LoadLibrary("../target/release/libembed.so") #=> for Linux lib.process() print("done!")
1.734375
2
huaweicloud-sdk-image/huaweicloudsdkimage/v1/image_client.py
handsome-baby/huaweicloud-sdk-python-v3
1
673
<gh_stars>1-10 # coding: utf-8 from __future__ import absolute_import import datetime import re import importlib import six from huaweicloudsdkcore.client import Client, ClientBuilder from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcore.utils import http_utils from huaweicloudsdkcore.sdk_str...
2.3125
2
frank_wolfe.py
ebezzam/PolyatomicFW_SPL
0
674
<gh_stars>0 import numpy as np from typing import Optional, Any from pandas import DataFrame from copy import deepcopy from abc import abstractmethod from utils import TimedGenericIterativeAlgorithm import pycsou.core as pcore import pycsou.linop as pl from pycsou.func.penalty import L1Norm from pycsou.func.loss impo...
1.984375
2
lib/rdflib-3.1.0/test/test_trix_serialize.py
suzuken/xbrlparser
3
675
#!/usr/bin/env python import unittest from rdflib.graph import ConjunctiveGraph from rdflib.term import URIRef, Literal from rdflib.graph import Graph class TestTrixSerialize(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testSerialize(self): s1 = URIRef...
2.421875
2
dbschema/revertDBinstall.py
leschzinerlab/myami-3.2-freeHand
0
676
#!/usr/bin/env python from sinedon import dbupgrade, dbconfig import updatelib project_dbupgrade = dbupgrade.DBUpgradeTools('projectdata', drop=True) if __name__ == "__main__": updatelib_inst = updatelib.UpdateLib(project_dbupgrade) checkout_version = raw_input('Revert to checkout version, for example, 2.1 -->') i...
2.484375
2
fightchurn/listings/chap9/listing_9_4_regression_cparam.py
guy4261/fight-churn
151
677
from sklearn.linear_model import LogisticRegression from fightchurn.listings.chap8.listing_8_2_logistic_regression import prepare_data, save_regression_model from fightchurn.listings.chap8.listing_8_2_logistic_regression import save_regression_summary, save_dataset_predictions def regression_cparam(data_set_path, C_pa...
2.140625
2
notebooks/classical_clustering.py
prise6/smart-iss-posts
0
678
#%% [markdown] # # Clustering classique #%% [markdown] # ## import classique import os #%% %load_ext autoreload %autoreload 2 os.chdir('/home/jovyan/work') #%% [markdown] # ## Import iss #%% from iss.tools import Config from iss.tools import Tools from iss.models import SimpleConvAutoEncoder from iss.clustering imp...
2.03125
2
SM_28BYJ48/logger/logger.py
kaulketh/stepper-motor-stuff
0
679
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------- # created 02.02.2021, tkaulke # <NAME>, <EMAIL> # https://github.com/kaulketh # ----------------------------------------------------------- __author__ = "<NAME>" __email__ = "<EMAIL>" import errno import logging ...
2.515625
3
tests/test_mr_uplift.py
Ibotta/mr_uplift
48
680
<gh_stars>10-100 import numpy as np import pytest from mr_uplift.dataset.data_simulation import get_no_noise_data, get_simple_uplift_data, get_observational_uplift_data_1 from mr_uplift.mr_uplift import MRUplift, get_t_data from mr_uplift.keras_model_functionality import prepare_data_optimized_loss import sys import p...
2.140625
2
lambdataalchemani/lambda_test.py
Full-Data-Alchemist/lambdata-Mani-alch
0
681
""" """ import unittest from example_module import COLORS, increment class ExampleTest(unittest.TestCase): """ #TODO """ def test_increment(self): x0 = 0 y0 = increment(x0) #y0 == 1 self.assertEqual(y0, 1) x1 = 100 y1 = increment(x1) #y1 == 101 se...
3.5
4
desktop/core/src/desktop/auth/views.py
bopopescu/hue-5
1
682
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
1.695313
2
models/node.py
AlonsoReyes/t-intersection-graph
0
683
class Node(object): def __init__(self, name, follow_list, intention, lane): self.name = name self.follow_list = follow_list self.intention = intention self.lane = lane def __eq__(self, other): if isinstance(other, Node): if self.name == other.get...
3.515625
4
gsheetsdb/url.py
tim-werner/gsheets-db-api
3
684
<reponame>tim-werner/gsheets-db-api<filename>gsheetsdb/url.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from moz_sql_parser import parse as parse_sql import pyparsing import r...
2.328125
2
detr/datasets/construction_panoptic.py
joyjeni/detr-fine
0
685
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import json from pathlib import Path import numpy as np import torch from PIL import Image from panopticapi.utils import rgb2id # from util.box_ops import masks_to_boxes from .construction import make_construction_transforms import logging def...
2.265625
2
Code/all-starter-code/search.py
diyarkudrat/CS-1.3-Core-Data-Structures
0
686
#!python """ ANNOTATE FUNCTIONS WITH TIME AND SPACE COMPLEXITY!!!!! """ def linear_search(array, item): """return the first index of item in array or None if item is not found""" return linear_search_iterative(array, item) # return linear_search_recursive(array, item) def linear_search_iterative(ar...
4.4375
4
max_ai/src/max_ai/mem_db.py
mat-heim/max_ros
0
687
#!/usr/bin/python ''' memory class stored in sqlite data base holds raw input and memories in parse taged columns ''' import sys import re import sqlite3 import os from datetime import date, datetime from pattern.en import parse from pattern.en import pprint from pattern.en import parsetree from pattern.en import ...
3.421875
3
examples/pylab_examples/image_masked.py
pierre-haessig/matplotlib
16
688
<filename>examples/pylab_examples/image_masked.py #!/usr/bin/env python '''imshow with masked array input and out-of-range colors. The second subplot illustrates the use of BoundaryNorm to get a filled contour effect. ''' from pylab import * from numpy import ma import matplotlib.colors as colors delta = 0.0...
2.84375
3
app/schemas/socket.py
d3vzer0/reternal-backend
6
689
from pydantic import BaseModel, validator, Field from typing import List, Dict from datetime import datetime class Authenticate(BaseModel): access_token: str
2.28125
2
meme/meme.py
aniket091/modmail-plugins-1
8
690
<reponame>aniket091/modmail-plugins-1 import discord from discord.ext import commands import requests import random from box import Box class WildMemes(commands.Cog): """ Randomly spawns memes. """ subreddits = [ "dankmemes", "wholesomememes", "memes", "terriblefacebookmemes", "hist...
2.625
3
pcat2py/class/20bdcef0-5cc5-11e4-af55-00155d01fe08.py
phnomcobra/PCAT2PY
0
691
#!/usr/bin/python ################################################################################ # 20bdcef0-5cc5-11e4-af55-00155d01fe08 # # <NAME> # <EMAIL> # <EMAIL> # # 10/24/2014 Original Construction ################################################################################ class Finding: def __init__(...
2.15625
2
mikan/exceptions.py
dzzhvks94vd2/mikan
1
692
<reponame>dzzhvks94vd2/mikan class MikanException(Exception): """Generic Mikan exception""" class ConversionError(MikanException, ValueError): """Cannot convert a string"""
1.976563
2
cv_recommender/account/urls.py
hhhameem/CV-Recommender
1
693
<reponame>hhhameem/CV-Recommender<gh_stars>1-10 from django.urls import path from django.contrib.auth import views as auth_views from . import views urlpatterns = [ path('register/', views.register, name='register'), path('login/', views.userlogin, name='login'), path('logout/', views.userlogout, name='log...
1.945313
2
Moodle/scripts/edit_conf.py
nii-gakunin-cloud/ocs-templates
4
694
from datetime import datetime from difflib import unified_diff from logging import basicConfig, getLogger, INFO import os from pathlib import Path import shutil import subprocess import sys import yaml from urllib.parse import urlparse from notebook import notebookapp from IPython.core.display import HTML WORKDIR = ...
2
2
other/minimum_edit_distance.py
newvicklee/nlp_algorithms
0
695
""" Minimum edit distance computes the cost it takes to get from one string to another string. This implementation uses the Levenshtein distance with a cost of 1 for insertions or deletions and a cost of 2 for substitutions. Resource: https://en.wikipedia.org/wiki/Edit_distance For example, getting from "intention" ...
3.890625
4
varifier/dnadiff.py
iqbal-lab-org/varifier
11
696
from operator import attrgetter import logging import os import shutil import subprocess import pyfastaq import pymummer from cluster_vcf_records import vcf_record from varifier import utils # We only want the .snps file from the dnadiff script from MUMmer. From reading # the docs inspecting that script, we need to ...
2.4375
2
modules/models.py
sbj-ss/github-watcher
0
697
<gh_stars>0 from dataclasses import asdict, dataclass from typing import Any, Dict, List, Type @dataclass(frozen=True) class StatsBaseModel: """Base model for various reports""" @classmethod def key(cls: Type) -> str: name = cls.__name__ return name[0].lower() + name[1:] def to_table(...
2.609375
3
queryfilter/datetimefilter.py
iCHEF/queryfilter
4
698
from __future__ import absolute_import import datetime from dateutil import parser import pytz from .base import FieldFilter, DictFilterMixin, DjangoQueryFilterMixin from .queryfilter import QueryFilter WHOLE_DAY = datetime.timedelta(days=1) ONE_SECOND = datetime.timedelta(seconds=1) @QueryFilter.register_type_c...
2.3125
2
built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/operator/rpn.py
Huawei-Ascend/modelzoo
12
699
<reponame>Huawei-Ascend/modelzoo<filename>built-in/TensorFlow/Research/cv/image_classification/Cars_for_TensorFlow/automl/vega/search_space/networks/pytorch/operator/rpn.py # -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistri...
1.820313
2