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 |
|---|---|---|---|---|---|---|
OpenAttack/exceptions/classifier.py | zangy17/OpenAttack | 10 | 12773451 | from ..exception import AttackException
class ClassifierNotSupportException(AttackException):
pass
| 1.234375 | 1 |
Project_Codev0.1/Class-diagram_Classes/class Reccomendation.py | cyberseihis/Wallsource | 0 | 12773452 | class Reccomandation:
def __init__(self, input_text):
self.text = input_text
def __get__(self, name ):
return self.name
| 2.546875 | 3 |
scripts/linux/merge_gamelists.py | LatorreDev/recalbox | 0 | 12773453 | import argparse
import glob
import os
import xml.etree.ElementTree as ET
from xml.dom import minidom
class Merger:
def __init__(self):
self._filelist = []
pass
def prettify(self, elem):
xmlstr = ET.tostring(elem, 'utf-8').replace('\n', '')
while "> " in xmlstr:
xmlst... | 2.953125 | 3 |
tests.py | wrapp/pymetricslog | 0 | 12773454 | <filename>tests.py<gh_stars>0
import json
from mock import ANY
from cStringIO import StringIO
from metricslog import Logger
class TestMetricLogObserver(object):
def setup(self):
self.out = StringIO()
self.service = 'myservice'
self.hostname = 'host-01'
self.log = Logger(self.out, s... | 2.5 | 2 |
src/docconvert/cli.py | cbillingham/docconvert | 8 | 12773455 | """Commandline script for docconvert."""
import argparse
import logging
import os
import subprocess
import sys
from six.moves import input
from . import configuration
from . import core
from . import parser
from . import writer
_LOGGER = logging.getLogger(__name__)
def setup_logger(verbose=False):
"""Setup b... | 2.734375 | 3 |
solutions/python/2018/deceptiveTransmission.py | lucifer1198/Codesignal | 2 | 12773456 | """
Due to recent advances in our cryptographic technology (i.e. the invention of the state-of-the-art Ceasar Cipher decoder),
the opposition has been on the losing side. As their attack plans were leaked and used against them, they suffered heavy losses.
Many soldiers from the enemy side defected and the war seemed li... | 3.3125 | 3 |
donate/donate/web_form/donation_form/donation_form.py | smriti-ps/Donation-portal | 0 | 12773457 | from __future__ import unicode_literals
import frappe
def get_context(context):
# do your magic here
context.title="Donation Form"
context.Introduction="Kindly fill the form"
| 1.5 | 2 |
plugins/polio/migrations/0020_fix_statuses.py | BLSQ/iaso-copy | 29 | 12773458 | <reponame>BLSQ/iaso-copy<filename>plugins/polio/migrations/0020_fix_statuses.py
from django.db import migrations
OLD_STATUS_TO_NEW = {"PENDING": "TO_SUBMIT", "ONGOING": "SUBMITTED", "FINISHED": "APPROVED", None: None}
VALID_STATUSES = ["APPROVED", "TO_SUBMIT", "SUBMITTED", "REVIEWED", None]
def convert(old):
re... | 1.945313 | 2 |
tunacell/filters/cells.py | LeBarbouze/tunacell | 0 | 12773459 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module defines filters for Cell instances
"""
from __future__ import print_function
import copy
import numpy as np
from tunacell.filters.main import FilterGeneral, bounded, included, FilterAND
from tunacell.base.datatools import multiplicative_increments
from tu... | 2.890625 | 3 |
sprezz/views/oauth2.py | oohlaf/sprezz | 1 | 12773460 | import json
import logging
from aiohttp import web
log = logging.getLogger(__name__)
class AuthorizeView(web.View):
async def get(self):
log.info('Requested URL: %s', self.request.path_qs)
log.info('Requested Remote: %s', self.request.remote)
if self.request.can_read_body:
d... | 2.546875 | 3 |
tests/unit/test_dist.py | olegklimov/DeepSpeed | 6,728 | 12773461 | import torch
import torch.distributed as dist
from common import distributed_test
import pytest
@distributed_test(world_size=3)
def test_init():
assert dist.is_initialized()
assert dist.get_world_size() == 3
assert dist.get_rank() < 3
# Demonstration of pytest's parameterization
@pytest.mark.parametri... | 2.796875 | 3 |
SWIM-Executables/Unix/pyinstaller-2.0/swim3/render.py | alexsigaras/SWIM | 3 | 12773462 | # -*- coding: utf-8 -*-
#############################################
## (C)opyright by <NAME> ##
## All rights reserved ##
#############################################
__version__ = "$Revision: 176 $"
__author__ = "$Author: kgrodzicki $"
__date__ = "$Date: 2011-01-15 10:11:47 +0100 (Fr... | 2.765625 | 3 |
30 Days of Code/Day 10 Binary Numbers.py | MasterZesty/HackerRank-Solutions | 2 | 12773463 | #!/bin/python3
import math
import os
import random
import re
import sys
def dec_to_base(num,base): #Maximum base - 36
base_num = ""
while num>0:
dig = int(num%base)
if dig<10:
base_num += str(dig)
else:
base_num += chr(ord('A')+dig-10) #Using uppercase letter... | 3.484375 | 3 |
util/config.py | benvenutto/wrangle-and-analyze-data | 0 | 12773464 | import yaml
def read_creds(conf_path):
with open(conf_path, 'r') as cf:
config = yaml.load(cf, Loader=yaml.FullLoader)
return config
| 2.015625 | 2 |
helper/parameter_generator.py | mrikitoku/LightGBM | 0 | 12773465 | <filename>helper/parameter_generator.py<gh_stars>0
import os
def GetParameterInfos(config_hpp):
is_inparameter = False
parameter_group = None
cur_key = None
cur_info = {}
keys = []
member_infos = []
with open(config_hpp) as config_hpp_file:
for line in config_hpp_file:
... | 2.703125 | 3 |
mysql_communicator/__init__.py | alexisljn/bluetooth-ipssi | 0 | 12773466 | <filename>mysql_communicator/__init__.py
import mysql.connector
class connector:
def __init__(self):
self.db = mysql.connector.connect(
host="localhost",
user="scannr",
password="<PASSWORD>",
database="scannr",
)
self.cursor = self.db.cursor(... | 3.109375 | 3 |
tests/conftest.py | Informasjonsforvaltning/organization-page-bffe | 0 | 12773467 | <gh_stars>0
"""Conftest module."""
from asyncio import AbstractEventLoop
import datetime
import os
import time
from typing import Any
from unittest.mock import Mock
from dotenv import load_dotenv
import pytest
from pytest_mock import MockFixture
import requests
from requests.exceptions import ConnectionError
from fdk... | 2.125 | 2 |
setup.py | kartik-hegde/fate | 0 | 12773468 | from setuptools import setup, find_packages
setup(name='fate', version='1.0', packages=find_packages()) | 1.140625 | 1 |
reporting/data.py | pranavrajpal/mypyc-benchmarks | 0 | 12773469 | <filename>reporting/data.py
from typing import NamedTuple, List, Dict, Set, Tuple
from datetime import datetime
import os
import re
import sys
import glob
import subprocess
from reporting.common import (
get_hardware_id, get_os_version, get_c_compiler_version, CC, DATA_DIR, SOURCE_DIRS
)
def write_csv_header(fna... | 2.390625 | 2 |
count-primes.py | mengzhuo/my-leetcode-solution | 0 | 12773470 | <gh_stars>0
"""
https://leetcode.com/problems/count-primes/
"""
class Solution:
# @param {integer} n
# @return {integer}
def countPrimes(self, n):
if n <=2:
return 0
if n == 3:
return 1
count = n-2
d = [True for i in xrange(n)]
... | 3.46875 | 3 |
app/apply/views.py | spbso/so_rest | 0 | 12773471 | import logging
from core.authentication import VKAuthentication
from core.models import Boec, UserApply
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers, status, viewsets
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
fr... | 2.125 | 2 |
tests/unit/test_app.py | davidjsherman/repo2docker | 1,047 | 12773472 | import errno
import pytest
from tempfile import TemporaryDirectory
from unittest.mock import patch
import docker
import escapism
from repo2docker.app import Repo2Docker
from repo2docker.__main__ import make_r2d
from repo2docker.utils import chdir
def test_find_image():
images = [{"RepoTags": ["some-org/some-rep... | 2.25 | 2 |
ocrapi/common.py | pengyang486868/PY-read-Document | 0 | 12773473 | <reponame>pengyang486868/PY-read-Document
from aip import AipOcr
config = {
'appId': '16804814',
'apiKey': 'mVCRu8AmAcTdFSGaDtoRki53',
'secretKey': '<KEY>'
}
client = AipOcr(**config)
def get_file_content(file):
with open(file, 'rb') as fp:
return fp.read()
| 2.46875 | 2 |
tests/html_generation_tests.py | JoshBarr/python-mammoth | 1 | 12773474 | from nose.tools import istest, assert_equal
from mammoth.html_generation import HtmlGenerator, satisfy_html_path
from mammoth import html_paths
@istest
def generates_empty_string_when_newly_created():
generator = HtmlGenerator()
assert_equal("", generator.html_string())
@istest
def html_escapes_text():
... | 2.59375 | 3 |
admin/getActiveDirectory.py | KleeGroup-BaseCamp/klee-office | 0 | 12773475 | <gh_stars>0
#!/home/dev/anaconda2/bin/python
# -*- coding: utf-8 -*-
import json # jsonfy search result
import sys # sys.exit()
import ldap3 as ldap # ldap connection request
from ldap3 import Server, Connection, NTLM, ALL, MODIFY_ADD, MODIFY_REPLACE
######################################################
with open... | 2.296875 | 2 |
backend-chat/app.py | bayuajinurmnsh/chat_apps | 0 | 12773476 | <filename>backend-chat/app.py<gh_stars>0
from flask import Flask, request, jsonify, make_response
from datetime import datetime
import operations as ops
app = Flask(__name__)
@app.route('/users', methods=['GET'])
def get_all_user():
data = ops.get_users()
return jsonify({'users': data}), 200
@app.route('/r... | 2.84375 | 3 |
Jasper/__init__.py | Rhodolite/Gem.py.Other | 0 | 12773477 | #
# Copyright (c) 2018 <NAME>. All rights reserved.
#
| 0.769531 | 1 |
codegen/subexpr_elim.py | gballard/fast-matmul | 23 | 12773478 | # Copyright (c) 2014-2015, Sandia Corporation
# All rights reserved.
#
# This file is part of fast-matmul and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause.
import convert
import sys
import gen
def all... | 2.96875 | 3 |
scripts/csv_to_paper_plots/4wayROC/preprocess.py | iqbal-lab-org/paper_pandora2020_analyses | 0 | 12773479 | <reponame>iqbal-lab-org/paper_pandora2020_analyses
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import os
# In[2]:
# read df
import sys
four_way_df = pd.read_csv("../pandora1_paper_analysis_output_4_way/ROC_data_old_and_new_basecall.tsv", sep="\t")
# In[3]:
# add new columns
four_way_df... | 2.21875 | 2 |
networkapi/api_pools/tests/pool_v3_test.py | brunodevel/GloboNetworkAPI | 0 | 12773480 | # -*- coding: utf-8 -*-
import json
import logging
from django.test.client import Client
from networkapi.test.test_case import NetworkApiTestCase
log = logging.getLogger(__name__)
class PoolTestV3Case(NetworkApiTestCase):
maxDiff = None
def setUp(self):
self.client = Client()
def tearDown(se... | 2.265625 | 2 |
ethereum/experimental/__init__.py | IIIIllllIIIIllllIIIIllllIIIIllllIIIIll/pyethereum | 11 | 12773481 | <gh_stars>10-100
from ethereum.experimental import pruning_trie, refcount_db
| 1.171875 | 1 |
parser.py | DanielOjalvo/execview | 0 | 12773482 | #!/usr/bin/env python3
'''
designed for cronjobs where /build and /sources are mount on the system.
They need to be mounted under the same parent directory.
e.g. /mnt/seadev/build for /build
/mnt/seadev/sources for /sources
'''
import psycopg2
import argparse
import re
import os
import sys
import inspect
import t... | 2.046875 | 2 |
pi/emo_reco/helpers/utils/captchahelper.py | danielbrenners/buzz-lightyear | 17 | 12773483 | <reponame>danielbrenners/buzz-lightyear
# import the necessary packages
import imutils
import cv2
def preprocess(image, width, height):
# grab the dimensions of the image, then initialize
# the padding values
(h, w) = image.shape[:2]
# if the width is greater than the height then resize along
# the width
if w >... | 3 | 3 |
dnnv/properties/transformers/remove_ifthenelse.py | samysweb/dnnv | 5 | 12773484 | <filename>dnnv/properties/transformers/remove_ifthenelse.py<gh_stars>1-10
from __future__ import annotations
from ..expressions import And, IfThenElse, Implies, Not, Or
from .base import GenericExpressionTransformer
class RemoveIfThenElse(GenericExpressionTransformer):
def __init__(self, form="dnf"):
sup... | 2.328125 | 2 |
models/student.py | EugeneJoe/Peri_Planner | 0 | 12773485 | <reponame>EugeneJoe/Peri_Planner
#!/usr/bin/python3
"""This module defines a Student Class"""
import sqlalchemy
from sqlalchemy import Column, String, ForeignKey
from sqlalchemy.orm import relationship, backref
from os import getenv
import models
from models.base_model import BaseModel, Base
from models.log import Les... | 3.203125 | 3 |
isobmff/sinf.py | kentoku24/isobmff | 6 | 12773486 | <filename>isobmff/sinf.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from .box import Box
from .box import FullBox
from .box import Quantity
from .box import read_int
from .box import read_string
class ProtectionSchemeInfoBox(Box):
box_type = 'sinf'
is_mandatory = False
quantity = Quantity.ONE_OR_MO... | 2.421875 | 2 |
oi/Contest/self/2017-1/network/gen.py | Riteme/test | 3 | 12773487 | <gh_stars>1-10
#!/usr/bin/env pypy
import sys
from random import *
if len(sys.argv) < 3:
print("Usage: %s [N] [Q]" % sys.argv[0])
exit(-1)
N = int(sys.argv[1])
Q = int(sys.argv[2])
print("%s %s" % (N, Q))
for i in range(0, Q):
u = randint(1, N)
v = randint(1, N)
t = randint(1, Q - i)
print(... | 2.90625 | 3 |
marketplaces/apps/market_community/urls.py | diassor/CollectorCity-Market-Place | 135 | 12773488 | <gh_stars>100-1000
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url('^$', 'market_community.views.overview', name='market_community'),
url(r'^overview/$', 'market_community.views.overview', name='community_overview'),
url(r'^forums/$', 'market_community.views.forums', name='community... | 1.53125 | 2 |
src/main/resources/templates/c/gcc/test/testUtils/Utils.py | TheZoker/Artemis | 58 | 12773489 | import os
import select
import signal
from datetime import datetime
from io import TextIOWrapper
from pty import openpty
from pwd import getpwnam, struct_passwd
from subprocess import Popen
from termios import ONLCR, tcgetattr, TCSANOW, tcsetattr
from threading import Thread
from time import sleep
from typing import An... | 2.28125 | 2 |
2.Insertion Sort, Merge Sort/sort.py | zuhaalfaraj/Introduction-to-Algorithms | 1 | 12773490 | <gh_stars>1-10
def insertionSort(lst):
lst = [-np.inf]+ lst
for i in range(2,len(lst)):
t = lst[i]
k= i-1
while t<lst[k]:
print(k)
lst[k+1]= lst[k]
k-=1
lst[k+1]=t
lst = lst[1:]
return lst
def mergeSort(arr):
def merege(L,R)... | 3.375 | 3 |
nicos/devices/datasinks/file.py | ebadkamil/nicos | 12 | 12773491 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 1.640625 | 2 |
Model Codes/RetrieveEdit/github_eval.py | lvyiwei1/StylePTB | 36 | 12773492 | # -*- coding: utf-8 -*-
import paths
import os
#os.environ['COPY_EDIT_DATA'] = paths.data_dir
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import sys
def set_output_encoding(encoding='utf-8'):
import sys
import codecs
'''When piping to the terminal, python knows the encoding needed, and
sets it autom... | 2.3125 | 2 |
Plan 001/Variables/ejercicio_2_antes.py | LookThisCode/Python-Basic-001 | 0 | 12773493 | __author__ = 'nickbortolotti'
"""
Parte 1
1.utilizar un arreglo que almacene 2 cadenas y 2 valores enteros
2.mostrar en pantalla el la ubicacion 1
mostrar desde el 0-2
mostrar del 2 en adelante
mostrar del 1 en reversa
mostrar el ultimo elemento del arreglo en reversa
"""
| 2.484375 | 2 |
ndj_pipeline/data_checks.py | ndjenkins85/ndj_cookie | 1 | 12773494 | # -*- coding: utf-8 -*-
# Copyright © 2021 by <NAME>. All rights reserved
#
# 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 u... | 1.765625 | 2 |
tests/datasets/test_gcc_data.py | fishmingyu/cogdl | 6 | 12773495 | <reponame>fishmingyu/cogdl
from cogdl.datasets import build_dataset
from cogdl.utils import build_args_from_dict
def test_gcc_kdd_icdm():
args = build_args_from_dict({"dataset": "kdd_icdm"})
assert args.dataset == "kdd_icdm"
dataset = build_dataset(args)
data = dataset.data
assert data[0].edge_ind... | 2.078125 | 2 |
src/quiche/pal/pal_lift_37.py | riswords/quiche | 0 | 12773496 | from ast import (
Module,
Suite,
FunctionDef,
AsyncFunctionDef,
Assign,
AnnAssign,
For,
AsyncFor,
With,
AsyncWith,
Num,
Str,
Bytes,
NameConstant,
ExtSlice,
arguments,
arg,
)
from quiche.pal.pal_block import (
PALIdentifier,
PALLeaf,
PALPri... | 2.265625 | 2 |
error_output.py | mertyigit/INEEDopt | 15 | 12773497 |
def error_output(number_of_parameters):
"""Write the optimized error values into the params file near the corresponding parameter identicator"""
try:
file2 = open("parameters", "r+")
file2.seek(0)
position2 = file2.tell()
file = open("fort.13","r") ... | 3.34375 | 3 |
Trading arbitrage strategy/strategies/arbitrage.py | iCoder333/Trading-arbitrage-strategy | 4 | 12773498 | <reponame>iCoder333/Trading-arbitrage-strategy
"""Provides the concrete arbitrage trading class"""
| 1.46875 | 1 |
magmap/io/yaml_io.py | clifduhn/magellanmapper | 0 | 12773499 | <reponame>clifduhn/magellanmapper
# YAML Input/Output
# Author: <NAME>, 2020
"""YAML file format input/output."""
import yaml
from magmap.io import libmag
def load_yaml(path, enums=None):
"""Load a YAML file with support for multiple documents and Enums.
Args:
path (str): Path to YAML file.
... | 2.953125 | 3 |
paper/tested_configs/solov2_light_448_r50_fpn_coco.py | anion0278/SOLO | 0 | 12773500 | num_classes = 81
# model settings
model = dict(
type='SOLOv2',
#pretrained='torchvision://resnet50', # The backbone weights will be overwritten when using load_from or resume_from.
# https://github.com/open-mmlab/mmdetection/issues/7817#issuecomment-1108503826
backbone=dict(
type='ResNet',
... | 1.867188 | 2 |
hetsage/data.py | vakker/HetSAGE | 0 | 12773501 | <filename>hetsage/data.py
from typing import List, NamedTuple, Optional, Tuple
import networkx as nx
import numpy as np
import torch
from sklearn.model_selection import train_test_split
from torch_sparse import SparseTensor
from tqdm import tqdm
tensor = torch.FloatTensor
def get_props(g):
return {
data... | 2.234375 | 2 |
models/train_classifier.py | MoustafaaAshraf/Disaster-Response-Message-Classification | 0 | 12773502 | <filename>models/train_classifier.py
# importing needed libraries
import sys
import pandas as pd
import re
from sqlalchemy import create_engine
import pickle
import nltk
from nltk import word_tokenize
from nltk.corpus import stopwords
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('stopwords')
from skl... | 3.078125 | 3 |
src/apps/configs/api/serializers.py | MatsuiLin101/aprp | 2 | 12773503 | from rest_framework.serializers import (
ModelSerializer,
)
from apps.configs.models import (
Config,
AbstractProduct,
Chart,
Type,
Source,
Unit,
)
class ChartSerializer(ModelSerializer):
class Meta:
model = Chart
fields = '__all__'
class TypeSerializer(ModelSerialize... | 2.09375 | 2 |
src/multi2convai/pipelines/base.py | inovex/multi2convai | 7 | 12773504 | from abc import ABC, abstractmethod
from typing import Any
class BasePipelineConfig:
"""Base config."""
def __init__(self, *args, **kwargs):
pass
class BasePipeline(ABC):
"""Abstract base class for end-to-end pipelines.
Args:
config (:class:`~BasePipelineConfig`): pipeline configur... | 3.421875 | 3 |
maml/compressed_sensing/compressed_sensing.py | epyzerknapp/maml-bsd | 2 | 12773505 | <reponame>epyzerknapp/maml-bsd
__author__ = 'epyzerknapp'
import numpy as np
import cPickle as pkl
from maml.compressed_sensing import twist_solver as twist
from copy import deepcopy
from maml.distances.tanimoto import tanimoto_similarity
"""
With compressed sensing we are looking to locate the maximum compression whi... | 2.28125 | 2 |
5200_flask_app/app/forms.py | F-Zainab/SWArch | 0 | 12773506 | #Form classes can be declared here and imported into the routes view
#More to come soon
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired
class TestForm(FlaskForm):
username = StringField('Username', validators=[Dat... | 2.515625 | 3 |
tempdir/login-app.py | Kennethvalerio212/design-app | 0 | 12773507 | <reponame>Kennethvalerio212/design-app
# Add to this file for the sample app lab
from flask import Flask
from flask import request
from flask import render_template
login = Flask(__name__)
@login.route("/")
def main():
return render_template("login.html")
if __name__ == "__main__":
login.run(host="0.0.0.0",... | 2.46875 | 2 |
analysis_vis/scripts/EpistasisCanSeqs.py | arubenstein/deep_seq | 0 | 12773508 | #!/usr/bin/env python
"""Create edges and nodes from a list of sequences that are a given hamming distance apart"""
import itertools
import sys
import operator
import numpy
from numpy import linalg as LA
import argparse
from general_seq import conv
from general_seq import seq_IO
def find_intermediates(starting_seq, e... | 2.765625 | 3 |
sync.py | vadniks/MultiDandyBot_Client | 0 | 12773509 | """
MIT License
Copyright (c) 2022 <NAME> (https://github.com/vadniks)
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, m... | 2.359375 | 2 |
5-capstone/src/spark/core/builder.py | natanascimento/data-engineer-udacity | 1 | 12773510 | from pyspark.sql import SparkSession
class SparkSessionBuilder:
@staticmethod
def build():
spark = SparkSession \
.builder \
.config("spark.jars.packages", "org.apache.hadoop:hadoop-aws:2.7.0,") \
.master("local[*]") \
.getOrCreate()
re... | 2.328125 | 2 |
hydra/example0.py | futabato/mlops_demo | 0 | 12773511 | import hydra
from omegaconf import DictConfig
@hydra.main(config_path="conf", config_name="config.yaml")
def main(cfg: DictConfig) -> None:
print(cfg)
if __name__ == "__main__":
main()
| 1.773438 | 2 |
catalog/testing/logged_unittest.py | eoss-cloud/madxxx_catalog_api | 0 | 12773512 | <gh_stars>0
import logging
import sys
import unittest
class LogMyTestCase(type):
def __new__(cls, name, bases, dct):
# if the TestCase already provides setUp, wrap it
if 'setUp' in dct:
setUp = dct['setUp']
else:
setUp = lambda self: None
def wrappedSetUp(s... | 2.625 | 3 |
PIDS_parse/Logic2plot.py | charlieromano/FIUBA_PIDS2020 | 0 | 12773513 | <filename>PIDS_parse/Logic2plot.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Path='/home/charlieromano/Documents/Academico/CESE/Proyecto2020/TallerCastelar/Mediciones/traza/dataOut'
dt = pd.read_csv(Path+'/Wave_bin.txt', header=34, sep='\t', index_col=0)
dt.head()
dt.columns
dt.dtypes
#... | 2.84375 | 3 |
local-lighttpd/uci.py | vaginessa/OpenWireless | 1 | 12773514 | <gh_stars>1-10
"""
Override implementation for routerapi/uci.py when running local-lighttpd.
Instead of calling out to /sbin/uci, which probably doesn't exist, store
name-value pairs in a JSON file in OVERRIDE_ETC.
"""
import json
import os
import common
uci_path = os.path.join(common.get_etc(), 'uci.json')
try:
wi... | 2.46875 | 2 |
String/Easy/firstUniqueString.py | pavi-ninjaac/leetcode | 0 | 12773515 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 10 22:57:42 2020
@author: ninjaac
"""
"""
Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1.
Examples:
s = "leetcode"
return 0.
s = "loveleetcode"
return 2.
"""
from collections import C... | 3.84375 | 4 |
apps/mh2/mh2mhx.py | teddydragoone/makehuman1.0.0alpha7 | 2 | 12773516 | <gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehuman.org/
**Code Home Page:** http://code.google.com/p/makehuman/
**Authors:** <NAME>
**Copyright(c):** MakeHuman Team 2001-2009
**Licensing:** ... | 1.914063 | 2 |
src/main.py | jk96491/C-COMA | 10 | 12773517 | <reponame>jk96491/C-COMA
import numpy as np
import torch as th
from utils.logging import get_logger
import random
from run import run
import config_util as cu
'''
algorithm 설정 가이드(config/algs 경로의 파일이름 그대로)
만일 QMIX 를 실행하고 싶다면 -> 'QMIX'
만일 C-COMA 를 실행하고 싶다면 -> 'C-COMA'
'''
if __name__ == '__main__':
logger = get_lo... | 2.03125 | 2 |
decrypt.py | cjntifo/pentest-tools | 0 | 12773518 | #!/usr/bin/python
#
# Gpprefdecrypt - Decrypt the password of local users added via Windows 2008 Group Policy Preferences.
#
# This tool decrypts the cpassword attribute value embedded in the Groups.xml file stored in the domain controller's Sysvol share.
#
# Updated by <NAME>
# Edited to run with Python 3.x... | 2.6875 | 3 |
test/basic/conf.py | fpoirotte/sphinxcontrib-paradoxy | 1 | 12773519 | <gh_stars>1-10
from os import path
extensions = ['sphinxcontrib.paradoxy']
exclude_patterns = ['_build']
version = '1.2.3'
paradoxy = {
'example': (
'http://example.com/doc/',
path.join(path.dirname(path.abspath('.')), 'doxygen', 'Example.xml')
),
}
| 1.359375 | 1 |
app/movie/tests/test_tags_api.py | evanmcpheron/Django-starter | 0 | 12773520 | <gh_stars>0
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag
from movie.serializers import TagSerializer
TAGS_URL = reverse('movie:tag-list')
class... | 2.5 | 2 |
civil/models.py | AeroYoung/PyCSE | 0 | 12773521 | <reponame>AeroYoung/PyCSE
from math import floor
from django.db.models import Sum
from django.db import models
from users.models import User
class Category(models.Model):
category_name = models.CharField(
primary_key=True,
unique=True,
max_length=200,
verbose_name='题型大类'
)
... | 2.3125 | 2 |
scripts/mk_symbols_file.py | DavidLegg/StockSim | 1 | 12773522 | from glob import glob
import os, sys, re
USAGE = """Usage: mk_symbols_file [PATTERN]...
Make resources/symbols.txt, using the files matching given PATTERN(s).
Each PATTERN must contain exactly one "*" wildcard,
for the location in the path of the symbol.
Earlier patterns have precedence over later ones.
Exampl... | 3.609375 | 4 |
students/k3342/practical_works/Zangieva Veronika/project/auto/auto/apps/owners/migrations/0003_delete_ownersmodel.py | TonikX/ITMO_ICT_-WebProgramming_2020 | 10 | 12773523 | # Generated by Django 3.0.4 on 2020-05-30 01:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('owners', '0002_ownersmodel'),
]
operations = [
migrations.DeleteModel(
name='OwnersModel',
),
]
| 1.53125 | 2 |
2020/Day-22/Crab_Combat/example.py | sreekesari-vangeepuram/aoc-2020 | 1 | 12773524 | #!/usr/bin/env python
from typing import List, Tuple
def play_space_cards(p1: List[int], p2: List[int]) -> Tuple[str, List[int]]:
b1, b2 = 0, 0 # buffer spaces for both players to space their cards
while len(p1) !=0 and len(p2)!= 0:
b1, b2 = p1.pop(0), p2.pop(0)
if b1 > b2:
p1.exte... | 3.765625 | 4 |
contextaware.py | yogeshagrawal50/Movie-Recommendation-System | 2 | 12773525 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 16 18:04:26 2020
@author: hp
"""
import pandas as pd
import numpy as np
ratings= pd.read_csv('ratings.csv')
movies= pd.read_csv(r'movies.csv' )
ts = ratings['timestamp']
ts = pd.to_datetime(ts, unit = 's').dt.hour
movies['hours'] = ts
merged = ratin... | 2.546875 | 3 |
CS3/0600_neural networks_handwriting_recognition/numpy_nnet/erikdelange/linear.py | nealholt/python_programming_curricula | 7 | 12773526 | # A neural network which approximates linear function y = 2x + 3.
# The network has 1 layer with 1 node, which has 1 input (and a bias).
# As there is no activation effectively this node is a linear function.
# After +/- 10.000 iterations W should be close to 2 and B should be close to 3.
import matplotlib.pyplot as p... | 3.921875 | 4 |
app/repositories/register.py | JulienBalestra/enjoliver | 33 | 12773527 | <reponame>JulienBalestra/enjoliver
from repositories.machine_discovery_repo import DiscoveryRepository
from repositories.machine_schedule_repo import ScheduleRepository
from repositories.machine_state_repo import MachineStateRepository
from repositories.user_interface_repo import UserInterfaceRepository
from smartdb im... | 2.140625 | 2 |
tools/check-license-header.py | Just-maple/go2sky | 1 | 12773528 | # Licensed to SkyAPM org under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. SkyAPM org licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in co... | 1.84375 | 2 |
vc_scripts/parallel_build.py | TimSVector/azure | 0 | 12773529 | #
# The MIT License
#
# Copyright 2020 Vector Informatik, GmbH.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | 1.765625 | 2 |
gameresources/config.py | RoW171/GameResources | 0 | 12773530 | __author__ = "Robin 'r0w' Weiland"
__date__ = "2019-05-07"
__version__ = "0.0.0"
from configparser import ConfigParser
from io import StringIO, TextIOWrapper
from warnings import warn
class Section:
_config = None
_name = str()
def __getattribute__(self, item): return super(Section, self).__getattribute... | 2.265625 | 2 |
examples/input.py | cloudagon/prey | 0 | 12773531 | #!/usr/bin/env prey
async def main():
word = input("Give me a word: ")
await x(f"echo {word}")
| 2.609375 | 3 |
mods/Commands.py | waffle620/fagyhal | 494 | 12773532 | import asyncio
import discord
import sys
from discord.ext import commands
from utils import checks
from mods.cog import Cog
class Commands(Cog):
def __init__(self, bot):
super().__init__(bot)
self.cursor = bot.mysql.cursor
self.escape = bot.escape
@commands.group(pass_context=True, aliases=['setprefix', 'chan... | 2.484375 | 2 |
year2017/day03/test_solver.py | Sebaestschjin/advent-of-code | 0 | 12773533 | <reponame>Sebaestschjin/advent-of-code
import pytest
from assertpy import assert_that
import year2017.day03.reader as reader
import year2017.day03.solver as solver
@pytest.mark.parametrize('puzzle, expected',
[(1, 0),
(12, 3),
(23, 2),
... | 2.484375 | 2 |
codemon/CodemonFetch.py | Enigmage/codemon | 0 | 12773534 | import requests
import re
import os
import itertools
from bs4 import BeautifulSoup as beSo
from clint.textui import colored
def check_structure(name, basedir):
# Check if the question folder exists for the name passed.
status = True
if not os.path.exists(os.path.join(basedir, f'{name}')) or not \
os.pat... | 3.015625 | 3 |
pyactiviti/pyactiviti.py | matrixise/pyactiviti | 3 | 12773535 | # -*- coding: utf-8 -*-
import requests
import json
from requests.status_codes import codes
from .exceptions import (
UserAlreadyExists,
NotFound,
UserNotFound,
GroupNotFound,
GroupMissingID,
UserMissingID,
GroupUpdatedSimultaneous,
UserAlreadyMember,
UserUpdatedSimultaneous,
De... | 2.265625 | 2 |
txweb/tests/test_static_file_resource.py | devdave/txWeb | 0 | 12773536 | <filename>txweb/tests/test_static_file_resource.py
from txweb.web_site import WebSite
from twisted.web.server import NOT_DONE_YET
from twisted.web.static import File
from twisted.web.resource import getChildForRequest
from .helper import MockRequest
from pathlib import Path
"""
Reference tests for how I can hack ... | 2.25 | 2 |
tools/demo.py | YuxinZou/vedacls | 1 | 12773537 | import os
import sys
import argparse
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../'))
from vedacls.runner import InferenceRunner
from vedacls.utils import Config
def parse_args():
parser = argparse.ArgumentParser(description='Demo')
parser.add_argument('config', type=str, help='config file ... | 2.453125 | 2 |
pubg_python/__init__.py | adamgeraldy/pubg-python | 0 | 12773538 | <reponame>adamgeraldy/pubg-python
from .base import PUBG # noqa
from .domain.base import ( # noqa
Filter,
Shard,
)
__all__ = [
'PUBG',
'Filter',
'Shard',
]
| 1.453125 | 1 |
code/server/odis/tests/entities/test_base.py | michalporeba/odis | 5 | 12773539 | import pytest
from odis.entities import *
from django.db import models
class Sut():
class States(models.TextChoices):
FIRST = ('one', 'the first state')
SECOND = ('two', 'the second state')
THIRD = ('three', 'the third state')
SHORTER = ('s', 'two part tuple')
ANY = ('any'... | 2.296875 | 2 |
enthought/pyface/i_about_dialog.py | enthought/etsproxy | 3 | 12773540 | # proxy module
from pyface.i_about_dialog import *
| 1.085938 | 1 |
version/utils.py | Kramoule/happypanda | 9 | 12773541 | #"""
#This file is part of Happypanda.
#Happypanda is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 2 of the License, or
#any later version.
#Happypanda is distributed in the hope that it will be u... | 1.992188 | 2 |
pyramid_swagger/__init__.py | hiromu/pyramid_swagger | 61 | 12773542 | <filename>pyramid_swagger/__init__.py
# -*- coding: utf-8 -*-
"""
Import this module to add the validation tween to your pyramid app.
"""
from __future__ import absolute_import
import pyramid
from pyramid_swagger.api import build_swagger_20_swagger_schema_views
from pyramid_swagger.api import register_api_doc_endpoin... | 2.171875 | 2 |
supervisoragent/eventlistener.py | silverfernsys/supervisoragent | 0 | 12773543 | #!/usr/bin/env python
import sys
import socket
import logging
import json
class EventListener():
def __init__(self):
self.logger = logging.getLogger('Event Listener')
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
def write_stdout(self, s):
# only eventlistener proto... | 2.8125 | 3 |
convert.py | HitkoDev/siamesenetwork-tensorflow | 0 | 12773544 | import tensorflow as tf
from model2 import model
flags = tf.compat.v1.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_string('model', '', 'Model to restore')
model.load_weights(FLAGS.model, by_name=True, skip_mismatch=True)
model.save('converted.h5')
| 2.1875 | 2 |
metric_plot.py | GravYong/scalarized_ns | 0 | 12773545 | import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from numpy import log10 as lg
from numpy import pi as pi
from scipy.interpolate import interp1d as sp_interp1d
from scipy.integrate import odeint
from scipy.integrate import ode
import warnings
import timeit
import sci... | 1.851563 | 2 |
labTwo/config/__init__.py | kotskon/patrec19 | 0 | 12773546 | class ToolConfig ():
def __init__ (self):
self.one = './data/onetwothree1.wav'
self.two = './data/onetwothree8.wav'
self.digits_path = './data/digits'
| 2.390625 | 2 |
conv_split_miniImagenet.py | arslan-chaudhry/orthog_subspace | 17 | 12773547 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Training script for split miniImageNET 100 experiment.
"""
from __future__ import print_function
import argparse
import o... | 1.875 | 2 |
app/api/v2/models/party_model.py | mogoria/Project-politico | 0 | 12773548 | <filename>app/api/v2/models/party_model.py
from app.utils.database.model import Model
class Party(Model):
table_name = "parties"
columns = ('name', 'logourl', 'hqaddress')
def __init__(self, name, logourl, hqaddress):
super().__init__()
self.name = name
self.logourl = logourl
... | 2.703125 | 3 |
athena/edu/views.py | antonyryan/athena-backend-Django- | 5 | 12773549 | <reponame>antonyryan/athena-backend-Django-<filename>athena/edu/views.py<gh_stars>1-10
from rest_framework import viewsets
from athena.authentication.permissions import (
IsAdmin,
IsStudentAndReadOnly,
IsTeacher,
IsTutor,
)
from .serializers import (
Speciality,
SpecialitySerializer,
Stude... | 2.046875 | 2 |
scripts/bandpasses/LFI_bandpass_check.py | ACTCollaboration/tilec | 1 | 12773550 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from tilec.fg import dBnudT,get_mix
"""
compute various conversion factors for LFI bandpasses
"""
TCMB = 2.726 # Kelvin
TCMB_uK = 2.726e6 # micro-Kelvin
hplanck = 6.626068e-34 # MKS
kboltz = 1.3806503e-23 # MKS
clight = 2997924... | 2.21875 | 2 |