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 |
|---|---|---|---|---|---|---|
src/krylov/lsqr.py | nschloe/krylov | 36 | 38700 | <reponame>nschloe/krylov
"""
<NAME>, <NAME>,
LSQR: An Algorithm for Sparse Linear Equations and Sparse Least Squares,
ACM Transactions on Mathematical Software,
Volume 8, Issue 1, March 1982, pp 43-71,
<https://doi.org/10.1145/355984.355989>.
<https://web.stanford.edu/group/SOL/software/lsqr/>
<https://petsc.org/relea... | 2.21875 | 2 |
2020/Day 24/main.py | edgorman/advent-of-code | 0 | 38701 | <reponame>edgorman/advent-of-code<filename>2020/Day 24/main.py
import os
import copy
def part_one(flip_tiles):
flipped_tiles = []
# For each tile
for tile in flip_tiles:
position = (0, 0, 0)
# For each direction
for direction in tile:
# Switch on direction
... | 3.40625 | 3 |
zabbix_alarm_script/all.py | ansemz/zabbix-wechat | 81 | 38702 | <reponame>ansemz/zabbix-wechat<gh_stars>10-100
#!/usr/bin/python3.4
# coding: utf-8
import urllib.request
import cgi
import cgitb
import sys
import json
import time
import os
import shutil
import logging
import os
import codecs
import re
import logging
import json
import base64
import http.cookiejar
import urllib.reque... | 2.1875 | 2 |
greenrocket/aio.py | kr41/GreenRocket | 0 | 38703 | <reponame>kr41/GreenRocket<gh_stars>0
import asyncio
@asyncio.coroutine
def afire(self):
""" Fire signal asynchronously """
self.logger.debug('Fired %r', self)
for cls in self.__class__.__mro__:
if hasattr(cls, '__handlers__'):
self.logger.debug('Propagate on %r', cls)
for ... | 2.34375 | 2 |
src/opera/executor/ansible.py | anzoman/xopera-opera | 0 | 38704 | <reponame>anzoman/xopera-opera
import json
import os
import sys
import tempfile
import yaml
from . import utils
def _get_inventory(host):
inventory = dict(
ansible_host=host,
ansible_ssh_common_args="-o StrictHostKeyChecking=no",
)
if host == "localhost":
inventory["ansible_conn... | 2.25 | 2 |
e2e/test_ghprb_log_configure_page.py | svic/jenkins-configuration | 0 | 38705 | <gh_stars>0
import unittest
import yaml
import os
from bok_choy.web_app_test import WebAppTest
from pages.ghprb_log_configure_page import GhprbLogConfigurePage
class TestGhprbLogConfigurePage(WebAppTest):
def setUp(self):
super(TestGhprbLogConfigurePage, self).setUp()
config_path = os.getenv('CONF... | 2.234375 | 2 |
InquirerPy/prompts/__init__.py | jfilipedias/InquirerPy | 0 | 38706 | """Module contains import of all prompts classes."""
from InquirerPy.prompts.checkbox import CheckboxPrompt
from InquirerPy.prompts.confirm import ConfirmPrompt
from InquirerPy.prompts.expand import ExpandPrompt
from InquirerPy.prompts.filepath import FilePathPrompt
from InquirerPy.prompts.fuzzy.fuzzy import FuzzyPromp... | 1.484375 | 1 |
MMMaker/core/highlight_extractor.py | C4Ution/MMMaker | 9 | 38707 | <gh_stars>1-10
import numpy as np
import scipy.io.wavfile as wave
from moviepy.editor import VideoFileClip
from scipy.fftpack import fft
from misc import get_random_name
HIGHLIGHT_LENGTH = 0.65
def extract_highlights(file_paths):
"""
:param file_paths: 동영상 경로 리스트
:return: 추출한 하이라이트 동영상 경로 리스트
"""
... | 2.53125 | 3 |
fafdata/fetch.py | yaniv-aknin/fafscrape | 0 | 38708 | import json
import datetime
import requests
import urlobject
from .utils import format_faf_date
API_BASE = urlobject.URLObject('https://api.faforever.com')
ENTITY_TYPE_TO_DEFAULT_DATE_FIELD = {
'game': 'startTime',
'player': 'createTime',
'map': 'createTime',
'mapVersion': 'createTime',
}
def constr... | 2.421875 | 2 |
main.py | sschr15/tldr-discord | 2 | 38709 | <gh_stars>1-10
import discord
import os
import sys
import datetime
import glob
import tldr
# noinspection SpellCheckingInspection
token: str = "<PASSWORD>, accidentally made public"
# If you want a custom language, input the language as shown in the tldr pages here.
language = ""
# noinspection PyMethodMayBeStatic... | 2.65625 | 3 |
class3/exercises/exercise3/exercise3.py | EndlessDynamics/Fork_nornir_course | 0 | 38710 | from nornir import InitNornir
from nornir.core.filter import F
def main():
nr = InitNornir()
print("\nExercise 3a (role AGG)")
print("-" * 20)
agg_devs = nr.filter(F(role__contains="AGG"))
print(agg_devs.inventory.hosts)
print("-" * 20)
print("\nExercise 3b (sea or sfo group)")
print... | 2.265625 | 2 |
deprecated/version1/utility.py | kpimparkar/cloudmesh-cloud | 0 | 38711 | <reponame>kpimparkar/cloudmesh-cloud<filename>deprecated/version1/utility.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 19:15:04 2018
@author: yuluo
"""
import subprocess
class Utility(object):
def __init__(self, debug=False):
"""
initializes the utulity class for a... | 2.203125 | 2 |
binding.gyp | Ciccio99/electron-overlay-window | 0 | 38712 | <reponame>Ciccio99/electron-overlay-window<gh_stars>0
{
'targets': [
{
'target_name': 'overlay_window',
'sources': [
'src/lib/addon.c',
'src/lib/napi_helpers.c'
],
'include_dirs': [
'src/lib'
],
'conditions': [
['OS=="win"', {
'defines'... | 1.25 | 1 |
aserializer/fields/serializer_fields.py | orderbird/aserializer | 0 | 38713 | # -*- coding: utf-8 -*-
from collections import Iterable
from aserializer.utils import py2to3, registry
from aserializer.fields.fields import BaseSerializerField, SerializerFieldValueError
class SerializerObjectField(BaseSerializerField):
def __init__(self, fields=None, exclude=None, *args, **kwargs):
... | 2.203125 | 2 |
autotest/ogr/ogr_gpkg.py | NathanW2/gdal | 2 | 38714 | <filename>autotest/ogr/ogr_gpkg.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test GeoPackage driver functionality.
# Author: <NAME> <<EMAIL>>
#
####################################... | 1.414063 | 1 |
directory/models/directory_access_group.py | darkismus/kompassi | 13 | 38715 | from django.db import models
from django.utils.translation import ugettext_lazy as _
class DirectoryAccessGroup(models.Model):
"""
Grants expiring group access to the personnel directory.
"""
organization = models.ForeignKey('core.Organization', on_delete=models.CASCADE)
group = models.ForeignKey... | 2.109375 | 2 |
@utils/parser/templating/technology.py | RogulinSV/stellaris-aoe | 0 | 38716 | <filename>@utils/parser/templating/technology.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from string import Template
from domains import Module, Technology
class GatheringTechnologyDataTemplate(object):
def __init__(self):
self.__technologies = list()
self.__areas = set()
... | 2.609375 | 3 |
app/analyzers/indicators/sar.py | r15ch13/crypto-signal | 4 | 38717 | """ MACD Indicator
"""
import math
import pandas
from talib import abstract
from analyzers.utils import IndicatorUtils
class SAR(IndicatorUtils):
def analyze(self, historical_data, signal=['sar'], hot_thresh=None, cold_thresh=None):
"""Performs a macd analysis on the historical data
Args:
... | 3.234375 | 3 |
tests/protocol/primary/a.py | gufolabs/gufo_loader | 4 | 38718 | <reponame>gufolabs/gufo_loader
# ---------------------------------------------------------------------
# Gufo Labs Loader:
# a plugin
# ---------------------------------------------------------------------
# Copyright (C) 2022, Gufo Labs
# ---------------------------------------------------------------------
class AP... | 1.859375 | 2 |
tools/csv2kml.py | platypii/BASElineFlightComputer | 22 | 38719 | #!/usr/bin/python
import sys
if len(sys.argv) != 2:
print 'Usage: csv2kml input.csv'
exit()
kml_header = """<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:kml=\"http://www.opengis.net/kml/2.2\" xmlns:atom=\"http://www.w3... | 2.90625 | 3 |
scripts/artifacts/installedappsGass.py | Krypterry/ALEAPP | 187 | 38720 | import sqlite3
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, open_sqlite_db_readonly
def get_installedappsGass(files_found, report_folder, seeker, wrap_text):
for file_found in files_found:
file_found = str(file_found)
if file_found.endswith('.d... | 2.296875 | 2 |
6_google_trace/VMFuzzyPrediction/estimators/GAEstimator.py | nguyenthieu95/machine_learning | 1 | 38721 | <reponame>nguyenthieu95/machine_learning
# from lasagne.nonlinearities import sigmoid
from pyevolve import Crossovers
from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Initializators, Mutators
from pyevolve import Selectors
from sklearn.base import BaseEstimator
from sklearn.metrics impor... | 2.796875 | 3 |
skassist-docs/python/doc_definitions.py | radmerti/scikit-assist | 0 | 38722 | # -*- coding: utf-8 -*-
# ______________________________________________________________________________
def boolean_func(experiment):
"""Function that returns True when an experiment matches and False otherwise.
Args:
experiment (:class:`~skassist.Experiment`): Experiment that is to be tested.
... | 3.390625 | 3 |
CyTrack/sendData.py | M2I-HABET/ahac2020workshop | 0 | 38723 | <reponame>M2I-HABET/ahac2020workshop
import rot2proG
import serial
import math
import time
import requests
from queue import Queue
from threading import Thread
def _parse_degrees(nmea_data):
# Parse a NMEA lat/long data pair 'dddmm.mmmm' into a pure degrees value.
# Where ddd is the degrees, mm.mmmm is the min... | 2.984375 | 3 |
examples/rf_tmd_example.py | eltonfss/TMDLibrary | 0 | 38724 | <reponame>eltonfss/TMDLibrary<gh_stars>0
from examples.util import get_tmd_dataset
from detectors.rf_tmd import RandomForestTMD
from sklearn.metrics import accuracy_score
if __name__ == '__main__':
# load dataset
df = get_tmd_dataset()
travel_mode_column = 'target'
# train model
rf_tmd = RandomFo... | 2.703125 | 3 |
lib/core/errors.py | h3ar7dump/Zeus-Scanner | 1 | 38725 | class InvalidProxyType(Exception): pass
class ApiConnectionError(Exception): pass
class ApplicationNotFound(Exception): pass
class SqlmapFailedStart(Exception): pass
class SpiderTestFailure(Exception): pass
class InvalidInputProvided(Exception): pass
class InvalidTamperProvided(Exception): pass
class Port... | 1.6875 | 2 |
cli.py | hiway/adventofcode | 0 | 38726 | import click
import collections
@click.group()
def cli():
pass
@cli.group()
def day1():
pass
@day1.command()
@click.argument('input_file', type=click.File())
def part1(input_file):
from day1 import part1_stanta_floor_positioning_system
for directions in input_file:
floor = part1_stanta_flo... | 3.125 | 3 |
bostaSDK/pickup/create/CreatePickupResponse.py | bostaapp/bosta-python | 0 | 38727 | <reponame>bostaapp/bosta-python<gh_stars>0
class CreatePickupResponse:
def __init__(self, res):
"""
Initialize new instance from CreatePickupResponse class
Parameters:
res (dict, str): JSON response object or response text message
Returns:
instance from CreatePic... | 3.078125 | 3 |
tflowModel/pb2uff.py | moennen/sceneIllEst | 3 | 38728 | <reponame>moennen/sceneIllEst
#!/usr/bin/python
""" Tensorflow Frozen PB model to UFF
"""
import argparse
import tensorflow as tf
import uff
if __name__ == "__main__":
#------------------------------------------------------------------------------------------------
parser = argparse.ArgumentParser()
pars... | 2.328125 | 2 |
jigu/core/proposal/__init__.py | bongtrop/jigu | 14 | 38729 | <filename>jigu/core/proposal/__init__.py
from __future__ import annotations
import abc
from dataclasses import dataclass
from typing import Any, Dict, Type
from jigu.core import Coin, Coins, Timestamp
from jigu.core.denoms import uLuna
from jigu.util.serdes import JiguBox, JsonDeserializable, JsonSerializable
from ji... | 2.328125 | 2 |
interview/amazon/utilization-checks.py | Zhenye-Na/leetcode | 10 | 38730 | # Utilization Checks
# https://aonecode.com/amazon-online-assessment-utilization-checks
import math
class UtilizationChecks:
def solve(self, instances, averageUtil):
i = 0
while i < len(averageUtil):
if 25 <= averageUtil[i] <= 60:
i += 1
continue
... | 3.09375 | 3 |
code/bot/mapping-bringup/launch/slam_launch.py | jacobwaller/beer-bot | 0 | 38731 | <gh_stars>0
from launch import LaunchDescription
import launch_ros.actions
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
return LaunchDescription([
launch_ros.actions.Node(
parameters=[
get_package_share_directory("slam_toolbox... | 1.898438 | 2 |
Python/Matts_Lessons/comments.py | Josh-Luedke/Vision-Notes | 0 | 38732 | # Here is something that I am typing
# print("I am printing something") | 1.828125 | 2 |
src/src/graph_environments.py | aka-cs/ia-sim-cmp | 0 | 38733 | <filename>src/src/graph_environments.py<gh_stars>0
from __future__ import annotations
from .base_classes import Event, SetEvent, DeleteEvent, GenerateEvent, MapObject, Agent, Position, Generator, \
Environment
class GraphEnvironment(Environment):
"""
Implementación particular de entorno, en el que hay no... | 2.75 | 3 |
jsk_arc2017_common/node_scripts/candidates_publisher.py | pazeshun/jsk_apc | 0 | 38734 | #!/usr/bin/env python
import dynamic_reconfigure.server
from jsk_topic_tools import ConnectionBasedTransport
import json
import os.path as osp
import rospy
from std_msgs.msg import String
from jsk_arc2017_common.cfg import CandidatesPublisherConfig
from jsk_recognition_msgs.msg import Label
from jsk_recognition_msgs.... | 1.773438 | 2 |
award/migrations/0002_auto_20190701_0754.py | maurinesinami/awards | 0 | 38735 | <filename>award/migrations/0002_auto_20190701_0754.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-07-01 04:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('award', '0001_initial'),
]
oper... | 1.523438 | 2 |
tic_tac_toe_main.py | ilyakz/alpha-game2 | 0 | 38736 | <gh_stars>0
from framework.Coach import Coach
from tic_tac_toe.TicTacToeGame import TicTacToeGame
#from tic_tac_toe.tensorflow.NNet import NNetWrapper as nn
from tic_tac_toe.keras.NNet import NNetWrapper as nn
#from cube_tic_tac_toe.CubeTicTacToeGame import CubeTicTacToeGame
#from cube_tic_tac_toe.tensorflow.NNet impor... | 1.804688 | 2 |
hw/hw09/tests/q1_3.py | ds-modules/Colab-demo | 0 | 38737 | <gh_stars>0
test = { 'name': 'q1_3',
'points': 1,
'suites': [ { 'cases': [ {'code': '>>> type(max_estimate) in set([int, np.int32, np.int64])\nTrue', 'hidden': False, 'locked': False},
{'code': '>>> max_estimate in observations.column(0)\nTrue', 'hidden': False, 'locke... | 1.976563 | 2 |
backend/gsr_booking/management/commands/load_gsrs.py | pennlabs/penn-mobile | 2 | 38738 | <filename>backend/gsr_booking/management/commands/load_gsrs.py
import csv
from django.core.management.base import BaseCommand
from gsr_booking.models import GSR
class Command(BaseCommand):
def handle(self, *args, **kwargs):
with open("gsr_booking/data/gsr_data.csv") as data:
reader = csv.re... | 2.28125 | 2 |
src/types_constraintes.py | julien-antigny/JConfig | 0 | 38739 | TYPES = {"int","float","str","bool","list"}
MATCH_TYPES = {"int": int, "float": float, "str": str, "bool": bool, "list": list}
CONSTRAINTS = {
"is_same_type": lambda x, y: type(x) == type(y),
"int" :{
"min_inc": lambda integer, min: integer >= min,
"min_exc": lambda integer, ... | 2.765625 | 3 |
office365/sharepoint/changes/change_query.py | wreiner/Office365-REST-Python-Client | 0 | 38740 | from office365.runtime.client_value import ClientValue
class ChangeQuery(ClientValue):
"""Defines a query that is performed against the change log."""
def __init__(self,
alert=False, site=False, web=False, list_=False, item=False, activity=False, file=False, folder=False,
us... | 2.375 | 2 |
backend0bit/serializers.py | piotrb5e3/0bit-backend | 0 | 38741 | <reponame>piotrb5e3/0bit-backend
from rest_framework import serializers
from backend0bit.models import StaticPage
class StaticPageSerializer(serializers.ModelSerializer):
class Meta:
model = StaticPage
fields = ('id', 'title', 'url', 'contents', 'order')
read_only_fields = ('order',)
| 2.046875 | 2 |
visual_diarization_svm/clear_opt_flow_features_train.py | cvossos2046/visual_speaker_diarization_svm_project | 0 | 38742 | <filename>visual_diarization_svm/clear_opt_flow_features_train.py
def main():
video = "NET20070330_thlep_1_2"
file_path = "optical_flow_features_train/" + video
optical_flow_features_train = open(file_path + "/optical_flow_features_train.txt", "r")
clear_of_features_train = open(file_path + "/clear_opt... | 2.75 | 3 |
src/executor/run_mol.py | ferchault/clockwork | 0 | 38743 | #!/usr/bin/env python
from redis import Redis
import uuid
import sys
import os
import subprocess
import shutil
import numpy as np
import itertools as it
import json
from rdkit import Chem
from rdkit.Chem import AllChem, ChemicalForceFields
redis = Redis.from_url("redis://" + os.environ.get("EXECUTOR_C... | 2.03125 | 2 |
eventsourcing/tests/processrecorder_testcase.py | h11r/eventsourcing | 0 | 38744 | <reponame>h11r/eventsourcing<gh_stars>0
from abc import ABC, abstractmethod
from timeit import timeit
from unittest.case import TestCase
from uuid import uuid4
from eventsourcing.persistence import (
RecordConflictError,
StoredEvent,
Tracking,
)
class ProcessRecordsTestCase(TestCase, ABC):
@abstractm... | 2.5 | 2 |
lolexport/log.py | dleiferives/lolexport | 2 | 38745 | <gh_stars>1-10
from os import environ
import logging
from logzero import setup_logger # type: ignore[import]
# https://docs.python.org/3/library/logging.html#logging-levels
loglevel: int = logging.DEBUG # (10)
if "LOLEXPORT" in environ:
loglevel = int(environ["LOLEXPORT"])
# logzero handles this fine, can be i... | 2.078125 | 2 |
test_routes.py | Varini/CHALLENGE_SFNewsAPI | 0 | 38746 | <gh_stars>0
from operator import index
from fastapi.testclient import TestClient
from index import app
client = TestClient(app)
def test_get_item():
response = client.get("/articles/10000")
assert response.status_code == 200
assert response.json() == {"id": 10000,
"title": ... | 2.828125 | 3 |
applications/javelin/controllers/jadmin.py | jjacobson93/javelin-web2py | 0 | 38747 | # -*- coding: utf-8 -*-
"""
Javelin Web2Py Admin Controller
"""
# metadata
__author__ = "<NAME>"
__copyright__ = "(c) 2013, Jacobson and Varni, LLC"
__date__ = "7/12/2013"
__email__ = "<EMAIL>"
__data__ = {'name' : 'jadmin', 'label' : 'Admin', 'description' : 'Only accessible to admins',
'icon' : 'briefcase', 'u-ic... | 2.1875 | 2 |
Testing.py | Eric-Fernandes-529/Final_Project_SW555 | 0 | 38748 | import unittest
import sys
#sys.path.append('../')
from models.Individual import Individual
from models.Family import Family
from models.Gedcom import Gedcom
class TestSprint1(unittest.TestCase):
def setUp(self):
SUPPORT_TAGS = {"INDI", "NAME", "SEX", "BIRT", "DEAT", "FAMC", "FAMS", "FAM", "MARR", "HUSB... | 2.75 | 3 |
energyPATHWAYS/supply_classes.py | Dhruv325/energypath-hub | 0 | 38749 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 09:36:07 2015
@author: Ben
"""
from shared_classes import Stock, StockItem, SpecifiedStock
from datamapfunctions import DataMapFunctions, Abstract
import util
import numpy as np
import config as cfg
class SupplyStock(Stock, StockItem):
def __init__(se... | 2.359375 | 2 |
3.4 Knapsack Problem (Recursion with Memorization).py | INOS-soft/MOmmentum-SECList | 0 | 38750 | """
2.Question 2
This problem also asks you to solve a knapsack instance, but a much bigger one.
This file (knapsack_big.txt) describes a knapsack instance, and it has the following format:
[knapsack_size][number_of_items]
[value_1] [weight_1]
[value_2] [weight_2]
...
For example, the third line of ... | 3.921875 | 4 |
src/producto18.py | alonsosilvaallende/Datos-COVID19 | 0 | 38751 | <gh_stars>0
'''
MIT License
Copyright (c) 2020 <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, pub... | 1.757813 | 2 |
src/linebot/app.py | zaurus-yusya/AtCoderStalker | 7 | 38752 | import json
import urllib.request
from linebot import (LineBotApi, WebhookHandler)
from linebot.models import (MessageEvent, TextMessage, PostbackEvent, FollowEvent, UnfollowEvent)
from linebot.exceptions import (LineBotApiError, InvalidSignatureError)
import os
import sys
import logging
import boto3
from boto3.dynamod... | 2.1875 | 2 |
setup.py | burhan/solace | 0 | 38753 | # -*- coding: utf-8 -*-
"""
Solace
======
*a multilingual support system*
Solace is a multilingual support system developed at Plurk
for end user support. The application design is heavily
influenced by bulletin boards like phpBB and the new
stackoverflow programming community site.
For more information consult th... | 1.554688 | 2 |
relation_engine/taxa/ncbi/loaders/ncbi_taxa_delta_loader.py | jayrbolton/arangodb_biochem_importer | 0 | 38754 | <reponame>jayrbolton/arangodb_biochem_importer<filename>relation_engine/taxa/ncbi/loaders/ncbi_taxa_delta_loader.py<gh_stars>0
#!/usr/bin/env python
# TODO TEST
import argparse
import getpass
import os
from arango import ArangoClient
from relation_engine.taxa.ncbi.parsers import NCBINodeProvider
from relation_engine... | 2.40625 | 2 |
listwords.py | corbinmcneill/bonkbot | 1 | 38755 | #!/usr/bin/env python3
import discord
import config
import util
from functools import reduce
from handler import Handler
class ListWordsHandler(Handler):
name = "listwords"
async def message_handler(self, message, jail, bonkbot):
print("Starting listwords handler")
if self.cf.get("list_words_t... | 2.6875 | 3 |
threedi_custom_stats/presets.py | threedi/beta-plugins | 1 | 38756 | from typing import List
try:
from .threedi_result_aggregation import *
# from .aggregation_classes import *
# from .constants import *
from .style import *
except ImportError:
from threedi_result_aggregation import *
# from constants import *
from style import *
class Preset:
def __in... | 2.03125 | 2 |
script/build_template.py | lzztt/bbs.backend | 0 | 38757 | #! python3
from sys import argv
from pathlib import Path
from re import compile
from enum import Enum
from inflection import camelize
RE_CLASS = compile(r'^use [a-zA-Z_][a-zA-Z0-9_\\]*;$')
RE_PARAM = compile(r'^[a-zA-Z_][a-zA-Z0-9_]* \$[a-zA-Z_][a-zA-Z0-9_]*,?$')
PARAM_BEGIN = r'function ('
PARAM_END = r') {'
PARAM... | 2.609375 | 3 |
app.py | ucsc-cgp/cgp-dashboard | 1 | 38758 | import os
import requests
from bouncer import Bouncer
from flask import Flask, url_for, redirect, \
render_template, session, request, Response, \
flash, get_flashed_messages, jsonify
from flask_login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from oauthlib.oaut... | 2.125 | 2 |
setup.py | toinsson/pynatnetclient | 1 | 38759 | import io, os, re
from os import path
from setuptools import find_packages
from distutils.core import setup
# pip's single-source version method as described here:
# https://python-packaging-user-guide.readthedocs.io/single_source_version/
def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirn... | 1.960938 | 2 |
Code/circle.py | notha99y/Satellite-Scheduling | 14 | 38760 | <gh_stars>10-100
import matplotlib.pyplot as plt
circle = plt.Circle((0,0),5, fill=False)
fig, ax = plt.subplots()
ax.add_artist(circle)
ax.set_xlim((-10, 10))
ax.set_ylim((-10, 10))
plt.show()
| 2.71875 | 3 |
cwk_3b.py | mas250/Python3 | 1 | 38761 | <reponame>mas250/Python3
prize_file_1 = open("/Users/MatBook/Downloads/prize3.txt")
List = []
prizes = []
for line in prize_file_1:
List.append(int(line))
first_line = List.pop(0)
for i in List:
print(i)
for j in List:
if i + j == first_line:
prizes.append((i,j))
... | 3.328125 | 3 |
DevNetworkPython/tagAnalysis.py | ManikHossain08/Metrics-Extraction-from-GitHub-MSR_Python | 1 | 38762 | import os
import git
import csv
from datetime import datetime
from progress.bar import Bar
def tagAnalysis(repo: git.Repo, outputDir: str):
print("Analyzing tags")
tagInfo = []
tags = sorted(repo.tags, key=getTaggedDate)
lastTag = None
for tag in Bar('Processing').iter(tags):
... | 2.828125 | 3 |
keystoneworkout/benchmark.py | dstanek/keystone-exercises | 0 | 38763 | <reponame>dstanek/keystone-exercises
import shelve
import sys
import threading
import time
class Benchmark(object):
def __init__(self, concurrency=10, iterations=10):
self.concurrency = concurrency
self.iterations = iterations
self.shelf = Shelf()
def __call__(self, f):
def wr... | 3.25 | 3 |
src/dipus/search_js_t.py | shirou/dipus | 0 | 38764 | <reponame>shirou/dipus
#!/usr/bin/env python
# -*- coding: utf-8 -*-
template = """/*
* * search_dipus
* * ~~~~~~~~~~~~~~
* *
* * Dipus JavaScript utilties for the full-text search.
* * This files is based on searchtools.js of Sphinx.
* *
* * :copyright: Copyright 2007-2012 by the Sphinx team.
* * :lic... | 1.90625 | 2 |
src/offensivetextdetectionservice/src/config.py | alejgh/easidiomas | 1 | 38765 | """ Configuration variables used in the application.
These variables should be setup as environment variables
in the docker-compose.yml file when launching all the services.
If these environment variables are not present, default values
are asigned to them.
"""
import os
KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOI... | 1.796875 | 2 |
tsp_ac.py | Architecton/route-optimization-using-machine-learning | 0 | 38766 | import numpy as np
import networkx as nx
import argparse
import random
from models.distance import get_dist_func
def get_fitness(solution, initial_node, node_list):
"""
Get fitness of solution encoded by permutation.
Args:
solution (numpy.ndarray): Solution encoded as a permutation
ini... | 2.703125 | 3 |
samples/sample_file_handling.py | Wacom-Developer/universal-ink-library | 5 | 38767 | # -*- coding: utf-8 -*-
# Copyright © 2021 Wacom 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
#
# Unle... | 2.375 | 2 |
net/LcaNet.py | SoufiyanBAHADI/ALCA | 3 | 38768 | <gh_stars>1-10
"""
Created on 30.09.2020
@author: <NAME>
@director: <NAME>
@co-director: <NAME>
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from managers.ContextManager import ContextManager
from managers.LearningManager import LearningManager
from managers.PlottingManager... | 2.296875 | 2 |
util_tools/L2L_analysis_module.py | WeilabMSU/PretrainModels | 4 | 38769 | '''
Analytic Hierarchy Process, AHP.
Base on Wasserstein distance
'''
from scipy.stats import wasserstein_distance
from sklearn.decomposition import PCA
import scipy
import numpy as np
import pandas as pd
import sys
import argparse
import os
import glob
import datasets_analysis_module as dam
class idx_analysis(obje... | 2.234375 | 2 |
src/opendr/_setup.py | daoran/opendr | 0 | 38770 | <filename>src/opendr/_setup.py
# Copyright 2020-2022 OpenDR European Project
#
# 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 requ... | 1.984375 | 2 |
modules/auto_split/splitter/mxnet_splitter.py | sophon-ai-algo/sophon-inference | 18 | 38771 | """ Copyright 2016-2022 by Bitmain Technologies Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 2.265625 | 2 |
src/heuristic.py | Maasouza/MinVertexCover | 0 | 38772 | <gh_stars>0
import networkx as nx
from util import *
def heuristic_cover(graph , preprocess = False):
"""
heuristica
se preprocess entao
realiza o preprocessamento para remover vertices com apenas um vizinho
retornando os vertices ja visitados
enquanto existir verti... | 3.34375 | 3 |
autharch_sharc/editor/migrations/0042_sharciiif_order.py | kingsdigitallab/autharch_sharc | 0 | 38773 | <reponame>kingsdigitallab/autharch_sharc<gh_stars>0
# Generated by Django 3.0.10 on 2021-07-09 09:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('editor', '0041_themeobject_sort_order'),
]
operations = [
migrations.AddField(
... | 1.695313 | 2 |
turtlebot3_dqn/src/turtlebot3_dqn/simulation_environment_real.py | 2529342549/turtlebot3_m_learning | 3 | 38774 | <reponame>2529342549/turtlebot3_m_learning
#!/usr/bin/env python
#################################################################################
# Copyright 2018 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | 1.796875 | 2 |
codeforces/anirudhak47/1328/B.py | anirudhakulkarni/codes | 3 | 38775 | <gh_stars>1-10
def classfinder(k):
res=1
while res*(res+1)//2<k:
res+=1
return res
# cook your dish here
for t in range(int(input())):
#n=int(input())
n,k=map(int,input().split())
clas=classfinder(k)
i=k-clas*(clas-1)//2
str=""
for z in range(n... | 2.984375 | 3 |
ch05/ch0501_convnet.py | zhuyuanxiang/deep-learning-with-python-notebooks | 6 | 38776 | <filename>ch05/ch0501_convnet.py
# -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : <EMAIL>
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : deep-learning-with-python-notebooks
@File : ch0501_convnet.py
@Version : v0.1... | 2.4375 | 2 |
run.py | sulavmhrzn/facebook-autoreply-bot | 0 | 38777 | <reponame>sulavmhrzn/facebook-autoreply-bot
from utils.app import SendBot
try:
from dotenv import load_dotenv
import os
except ModuleNotFoundError:
print('Required modules not found.')
exit()
load_dotenv()
env = input('Load environment variables? (y/n): ').lower()
options = ['y', 'n']
if env in opti... | 2.125 | 2 |
tools/nntool/graph/manipulations/dimensions.py | gemenerik/gap_sdk | 0 | 38778 | <filename>tools/nntool/graph/manipulations/dimensions.py
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Lice... | 2 | 2 |
data/ratings/tezxt.py | SLAB-NLP/Akk | 5 | 38779 | with open(r"D:\Drive\לימודים\מאגרי מידע\זמני\ancient-text-processing\jsons_unzipped\saao\saa01\catalogue.json","r",encoding="utf_8") as file:
catalog = eval(file.read())["members"]
rulers = []
for c in catalog:
cat = catalog[c]
if cat["period"] == "Neo-Assyrian" and cat.get("ruler"):
rulers +=... | 2.609375 | 3 |
abc185/abc185_d.py | Vermee81/practice-coding-contests | 0 | 38780 | # https://atcoder.jp/contests/abc185/tasks/abc185_d
from math import ceil
N, M = map(int, input().split())
if M == 0:
print(1)
exit()
a_arr = list(map(int, input().split()))
a_arr.sort()
blanks = [0]
for i in range(M):
if i == 0:
blanks.append(a_arr[i] - 1)
continue
blanks.append(a_arr[i... | 2.71875 | 3 |
code_rejected/model_resnet_and_new_loss.py | rcalfredson/objects_counting_dmap | 0 | 38781 | """The implementation of U-Net and FCRN-A models."""
from typing import Tuple
import numpy as np
import torch
from torch import nn
from torchvision.models import resnet
from model_config import DROPOUT_PROB
class UOut(nn.Module):
"""Add random noise to every layer of the net."""
def forward(self, input_te... | 2.96875 | 3 |
tests/conftest.py | dclimber/python-kzt-exchangerates | 1 | 38782 | <filename>tests/conftest.py
import pytest
from pathlib import Path
import xml.etree.ElementTree as ET
@pytest.fixture
def date_for_tests():
return '24.04.2013'
@pytest.fixture
def result_date():
return '2013-04-24'
@pytest.fixture
def latest_url():
return 'https://nationalbank.kz/rss/rates_all.xml'
... | 2.203125 | 2 |
tests/test_UI.py | HubLot/buildH | 13 | 38783 | <reponame>HubLot/buildH
"""
Unit tests for buildH.
Test functions from module UI
"""
import os
import pathlib
import pytest
from buildh import UI, lipids, BuildHError
import sys
DIR_DATA = "test_data"
PATH_ROOT_DATA = pathlib.Path(__file__).parent / DIR_DATA
# Ignore some MDAnalysis warnings for this test file
py... | 2.46875 | 2 |
train.py | s-broda/capstoneproject | 0 | 38784 | import os
import argparse
import json
from datetime import datetime
import numpy as np
from sklearn.utils.class_weight import compute_class_weight
from sklearn.metrics import balanced_accuracy_score
from sklearn.metrics import confusion_matrix
from tensorflow import keras
from tensorflow.keras.callbacks import EarlySto... | 2.265625 | 2 |
tests/events/test_api_gateway_authorizer.py | chuckwondo/aws-lambda-typing | 29 | 38785 | <filename>tests/events/test_api_gateway_authorizer.py
from aws_lambda_typing.events import (
APIGatewayRequestAuthorizerEvent,
APIGatewayTokenAuthorizerEvent,
)
def test_api_gateway_token_authorizer_event() -> None:
event: APIGatewayTokenAuthorizerEvent = {
"type": "TOKEN",
"authorizationT... | 1.929688 | 2 |
Tools/SinGED/scene_manager.py | willcassella/SinGE | 9 | 38786 | # scene_manager.py
from copy import deepcopy
from . import editor_session
# Recursively updates a dictionary a with b.
# This assumes that b has a structure that is a subset of a
# Returns whether the dictionary a was modified.
def recursive_update(a, b):
modified = False
for k, v in b.items():
if is... | 2.65625 | 3 |
airflow/pyspark/weekday/avg_temperature.py | juliocnsouzadev/gcp-data-engineer | 0 | 38787 | #!/usr/bin/python
from pyspark.sql import SparkSession
spark = (
SparkSession.builder.master("yarn")
.appName("bigquery-analytics-avg-temperature")
.getOrCreate()
)
bucket = "01-logistics-backup"
spark.conf.set("temporaryGcsBucket", bucket)
history = (
spark.read.format("bigquery").option("table", "v... | 3.15625 | 3 |
chapter09/idqn/ddqn_agent.py | roiyeho/drl-book | 0 | 38788 | <filename>chapter09/idqn/ddqn_agent.py<gh_stars>0
import numpy as np
import tensorflow as tf
from tensorflow import keras
from idqn.dqn_agent import DQNAgent
class DoubleDQNAgent(DQNAgent):
def __init__(self, env, config):
"""
:param env: the gym environment where the agent will run
:param ... | 2.734375 | 3 |
reader.py | SimGGG/abae-pytorch | 0 | 38789 | # -*- coding: utf-8 -*-
import gensim
import numpy as np
from sklearn.cluster import MiniBatchKMeans
def read_data_batches(path, batch_size=50, minlength=5):
"""
Reading batched texts of given min. length
:param path: path to the text file ``one line -- one normalized sentence''
:return: batches i... | 3.15625 | 3 |
service.py | deeso/python-listcurator | 0 | 38790 | <reponame>deeso/python-listcurator<filename>service.py
import web, argparse, os, logging, sys
from listcurator.service.listcurator import *
from listcurator.service.listcurator import *
from sqlalchemy import *
PORT = 45000
HOST = '0.0.0.0'
ML_SAVE_DIR = 'managed_lists'
SAVE_DIR = os.path.join(os.getcwd(), ML_SAVE_DIR... | 2.28125 | 2 |
py/tests/test_cli.py | sthagen/odata-url-parser | 2 | 38791 | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring,unused-import,reimported
import io
import pytest # type: ignore
import odata_url_parser.cli as cli
import odata_url_parser.odata_url_parser as oup
def test_main_ok_minimal(capsys):
job = ['does not matter']
report_expected = job[0]
assert cli.m... | 2 | 2 |
mathics/core/attributes.py | tirkarthi/mathics-core | 90 | 38792 | # -*- coding: utf-8 -*-
# The builtin's attributes are stored in a bit set.
# Each bit represets a attribute, if that is 0, the builtin doesn't has the
# property, if that is 1, the builtin has the property.
# The Builtin class has the property Protected by default, but if you overrides
# the attributes you need to a... | 2.828125 | 3 |
openapi_documentor/openapi/views.py | codeasashu/openapi-documentor | 0 | 38793 | <gh_stars>0
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import get_object_or_404
from django.views.generic import DetailView, ListView
from taggit.models import Tag
from .models import Document
class OpenapiListView(LoginRequiredMixin, ListView):
model = Document
context_o... | 1.992188 | 2 |
scripts/version.py | DrSensor/scdlang | 80 | 38794 | <reponame>DrSensor/scdlang<filename>scripts/version.py
#!/usr/bin/env python
from tomlkit.toml_file import TOMLFile
from glob import glob
from os import path
from sys import argv, stdin
from pampy import match
from functools import reduce
import operator as op
import re
re_version = r"\d+\.\d+\.\d+-?"
def increment(... | 2.375 | 2 |
qhcfp/urls.py | kilinger/firon-qhcst | 0 | 38795 | <reponame>kilinger/firon-qhcst<filename>qhcfp/urls.py
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'regist.views.regist_index'),
url(r'^admin/', include(admin.site.urls)),
url(r'... | 1.742188 | 2 |
ecosante/newsletter/tasks/import_in_sb.py | betagouv/ecosante | 0 | 38796 | <filename>ecosante/newsletter/tasks/import_in_sb.py
from flask import current_app
from datetime import datetime
from uuid import uuid4
import os
from flask.helpers import url_for
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from ecosante.newsletter.models import Newsletter, NewsletterDB, Inscripti... | 1.828125 | 2 |
RecoVertex/BeamSpotProducer/scripts/copyFromCastor.py | ckamtsikis/cmssw | 852 | 38797 | #!/usr/bin/env python
import sys,os,commands
from CommonMethods import *
def main():
if len(sys.argv) < 3:
error = "Usage: cpFromCastor fromDir toDir (optional filter)"
exit(error)
user = os.getenv("USER")
castorDir = "/castor/cern.ch/cms/store/caf/user/" + user + "/" + sys.argv[1] + "/"
... | 2.71875 | 3 |
app/config.py | midnights-straychild/weatherman | 0 | 38798 | class Config:
conf = {
"labels": {
"pageTitle": "Weatherman V0.0.1"
},
"db.database": "weatherman",
"db.username": "postgres",
"db.password": "<PASSWORD>",
"navigation": [
{
"url": "/",
"name": "Home"
... | 2.546875 | 3 |
app.py | Terrence-Cummings/sqlalchemy-challenge | 0 | 38799 | #Dependencies, libraries, and imports
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
#SQLalchemy libraries and functions
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import S... | 2.65625 | 3 |