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/ftd/history.py | FabienTaxil/ftd | 3 | 12788551 | <reponame>FabienTaxil/ftd
"""History related utilities."""
import contextlib
import functools
import logging
import sys
import trace
from maya import cmds
from maya.api import OpenMaya
__all__ = ["repeat", "undo", "undo_chunk", "undo_repeat", "traceit"]
LOG = logging.getLogger(__name__)
def repeat(func):
"""De... | 2.4375 | 2 |
holobot/discord/sdk/servers/models/member_data.py | rexor12/holobot | 1 | 12788552 | from dataclasses import dataclass
from typing import Optional
@dataclass
class MemberData:
user_id: str
avatar_url: str
name: str
nick_name: Optional[str]
@property
def display_name(self) -> str:
return self.nick_name if self.nick_name else self.name
| 3.03125 | 3 |
python/pyutils/pyutils/terminal_color.py | ASMlover/study | 22 | 12788553 | <reponame>ASMlover/study
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2018 ASMlover. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must r... | 1.148438 | 1 |
Dynamic Programming/741. Cherry Pickup.py | beckswu/Leetcode | 138 | 12788554 | """
741. Cherry Pickup
"""
class Solution:
def cherryPickup(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
n = len(grid)
if grid[0][0] == -1 or grid[n-1][n-1] == -1: return 0
dp = [[-1,]*n for _ in range(n)] # 很重要,
"""
因为比如[[1,-1,... | 3.375 | 3 |
Fair_OS.py | Anon-git-site/Fair-Over-Sampling | 0 | 12788555 | # -*- coding: utf-8 -*-
#code adapted from https://github.com/analyticalmindsltd/smote_variants
import numpy as np
import time
import logging
import itertools
from sklearn.neighbors import NearestNeighbors
# setting the _logger format
_logger = logging.getLogger('smote_variants')
_logger.setLevel(loggin... | 2.640625 | 3 |
lambda_function.py | cloudbasic/Lambda-Update-Route53 | 0 | 12788556 | <filename>lambda_function.py
from __future__ import print_function
import boto3, json, re
HOSTED_ZONE_ID = 'YOUR_HOSTED_ZONE_ID'
def lambda_handler(event, context):
route53 = boto3.client('route53')
dns_changes = {
'Changes': [
{
'Action': 'UPSERT',
'Resou... | 2.375 | 2 |
lcd.py | zimolzak/Raspberry-Pi-newbie | 0 | 12788557 | #!/usr/bin/env python
from telnetlib import Telnet
import time
tn = Telnet('192.168.1.4', 13666, None)
tn.write("hello\n")
tn.write("screen_add s1\n")
tn.write("screen_set s1 -priority 1\n")
tn.write("widget_add s1 w1 string\n")
tn.write("widget_add s1 w2 string\n")
def lcd_string(x, telnet_obj, delay=2):
L = []... | 2.84375 | 3 |
HackerRank/10 Days of Statistics/Day4B.py | ShubhamJagtap2000/competitive-programming-1 | 1 | 12788558 | import math
print(round((pow(0.88, 10) + (1.2*pow(0.88, 9)) + (45*pow(0.88, 8)*pow(0.12, 2))), 3))
print(round((1 - (pow(0.88, 10) + (1.2*pow(0.88, 9)))), 3))
| 3.5 | 4 |
tests/api/views/v1/test_api_execution.py | angry-tony/ceph-lcm-decapod | 41 | 12788559 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 1.71875 | 2 |
torchnlp/samplers/noisy_sorted_sampler.py | MPetrochuk/PyTorch-NLP | 2,125 | 12788560 | <reponame>MPetrochuk/PyTorch-NLP
import random
from torch.utils.data.sampler import Sampler
from torchnlp.utils import identity
def _uniform_noise(_):
return random.uniform(-1, 1)
class NoisySortedSampler(Sampler):
""" Samples elements sequentially with noise.
**Background**
``NoisySortedSam... | 3.359375 | 3 |
gawseed/threatfeed/search/ssh.py | gawseed/threat-feed-tools | 2 | 12788561 | from gawseed.threatfeed.search.ip import IPSearch
class SSHSearch(IPSearch):
"""Searches data for threats, but requires the auth_success field to
be True. IE, only successful logins will be considered a match.
Use the 'ip' module if you don't want this restriction applied."""
def __init__(self, conf, s... | 2.765625 | 3 |
survey/mixins/data_mixins.py | vahndi/quant-survey | 2 | 12788562 | from typing import Callable, Optional
from numpy import nan
from pandas import Series, isnull, Interval
from pandas.core.dtypes.inference import is_number
class ObjectDataMixin(object):
_data: Optional[Series]
_validate_data: Callable[[Series], None]
def _set_data(self, data: Series):
self.dat... | 2.765625 | 3 |
tests/comply/__init__.py | repsistance/keripy | 26 | 12788563 | """
Compliance test package
"""
| 0.953125 | 1 |
src/gae_flask_boilerplate/app.py | euri10/python-gae_flask_boilerplate | 0 | 12788564 | <filename>src/gae_flask_boilerplate/app.py<gh_stars>0
from gae_flask_boilerplate import create_app
app = create_app('default')
| 1.390625 | 1 |
20-hs-redez-sem/groups/05-decentGames/src/DontGetAngry.py | Kyrus1999/BACnet | 8 | 12788565 | <gh_stars>1-10
import copy
import json
import os
import random
import socket
import sys
import xmlrpc.client
import State
from AbsGame import AbsGame, MY_IP
from DGA import DGA
from Exceptions import FileAlreadyExists
from GameInformation import GameInformation
class DontGetAngry(AbsGame):
is_looping = True
... | 2.40625 | 2 |
JDComment/JDComment/spiders/JDCommentSpider.py | Dengqlbq/JDSpider | 6 | 12788566 | <filename>JDComment/JDComment/spiders/JDCommentSpider.py<gh_stars>1-10
from scrapy_redis.spiders import RedisSpider
from JDComment.items import JDCommentItem
from scrapy.utils.project import get_project_settings
import scrapy
import json
import re
class JDCommentSpider(RedisSpider):
# 获取指定商品的评论(完整评论,非摘要)
name... | 2.515625 | 3 |
interactive/shell.py | vodik/pytest-interactive | 0 | 12788567 | """
An extended shell for test selection
"""
from IPython.terminal.embed import InteractiveShellEmbed
from IPython.core.magic import (Magics, magics_class, line_magic)
from IPython.core.history import HistoryManager
class PytestShellEmbed(InteractiveShellEmbed):
"""Custom ip shell with a slightly altered exit mes... | 2.765625 | 3 |
vmtkScripts/contrib/vmtksurfacetagger.py | michelebucelli/vmtk | 1 | 12788568 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceclipper.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.9 $
## Copyright (c) <NAME>, <NAME>. All rights reserved.
## See LICENSE file for details.
## This software is distributed WIT... | 2.1875 | 2 |
KalmanMachine/Kalman4LogisticReg.py | marc-h-lambert/L-RVGA | 0 | 12788569 | <filename>KalmanMachine/Kalman4LogisticReg.py
###################################################################################
# THE KALMAN MACHINE LIBRARY #
# Code supported by <NAME> #
############################... | 1.890625 | 2 |
day15_p1.py | venomousmoog/adventofcode2021 | 0 | 12788570 | <filename>day15_p1.py
import heapq
import sys
def compute(data):
map = [[int(e) for e in l] for l in data.split('\n')]
w = len(map)
h = len(map[0])
end = (w-1, h-1)
# pq format is [cost, length, counter, position]
q = [[0, 0, 0, (0,0)]]
counter = 1
visited = set([(0,0)])
wh... | 3.0625 | 3 |
bp/common/maths/Maths.py | JAlvarezJarreta/pecan | 5 | 12788571 | <gh_stars>1-10
#!/usr/bin/env python
#Copyright (C) 2006-2011 by <NAME> (<EMAIL>)
#
#Released under the MIT license, see LICENSE.txt
#!/usr/bin/env python
import sys
import os
import re
import math
NEG_INFINITY = -1e30000
def exp(x):
#return math.exp(x)
if x > -2:
if x > -0.5:
if x > 0:... | 2.546875 | 3 |
gehomesdk/erd/converters/laundry/tank_status_converter.py | bendavis/gehome | 0 | 12788572 | import logging
from gehomesdk.erd.converters.abstract import ErdReadOnlyConverter
from gehomesdk.erd.converters.primitives import *
from gehomesdk.erd.values.laundry import ErdTankStatus, TankStatus, TANK_STATUS_MAP
_LOGGER = logging.getLogger(__name__)
class TankStatusConverter(ErdReadOnlyConverter[TankStatus]):
... | 2.171875 | 2 |
pdc/apps/common/serializers.py | hluk/product-definition-center | 18 | 12788573 | <filename>pdc/apps/common/serializers.py
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from rest_framework import serializers
from contrib.drf_introspection.serializers import StrictSerializerMixin
from .models import Label, Arch, SigKey
class LabelSeri... | 2.171875 | 2 |
generator/make-permutations.py | Badisches-Landesmuseum/also-known-as | 2 | 12788574 | <gh_stars>1-10
import argparse
def main ():
parser = argparse.ArgumentParser()
parser.add_argument("inputFilePath", help="path of input file")
parser.add_argument("outputFilePath", help="path of output file")
parser.add_argument("--german", help="add -es suffix behind german base adjectives", action="store_tru... | 3.5 | 4 |
web/impact/impact/v1/helpers/criterion_option_spec_helper.py | masschallenge/impact-api | 5 | 12788575 | <reponame>masschallenge/impact-api
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from accelerator.models import CriterionOptionSpec
from impact.v1.helpers.model_helper import (
ModelHelper,
OPTIONAL_FLOAT_FIELD,
OPTIONAL_INTEGER_FIELD,
PK_FIELD,
REQUIRED_INTEGER_FIELD,
REQUIRED_STRING_... | 1.96875 | 2 |
rlscore/measure/fscore_measure.py | vishalbelsare/RLScore | 61 | 12788576 | <reponame>vishalbelsare/RLScore<filename>rlscore/measure/fscore_measure.py
#
# The MIT License (MIT)
#
# This file is part of RLScore
#
# Copyright (c) 2010 - 2016 <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | 1.617188 | 2 |
cve-manager/cve_manager/tests/test_function/test_cache.py | seandong37tt4qu/jeszhengq | 0 | 12788577 | #!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... | 2.265625 | 2 |
src/app.py | tdmalone/bitbucket-approvals-to-jira | 0 | 12788578 | <filename>src/app.py<gh_stars>0
# get PR details from incoming approve webhook
# quit if all approvers have not approved
# look for ticket ID in branch name
# look up ticket for any other unapproved PRs (if not possible thru Jira API, use bitbucket API - will have to spread across every repo in the team, though!) - qui... | 2.203125 | 2 |
unit_testing/test_transect_methods.py | British-Oceanographic-Data-Centre/NEMO-ENTRUST | 0 | 12788579 | """
"""
# IMPORT modules. Must have unittest, and probably coast.
import coast
from coast import general_utils
import unittest
import numpy as np
import os.path as path
import xarray as xr
import matplotlib.pyplot as plt
import unit_test_files as files
class test_transect_methods(unittest.TestCase):
def test_de... | 2.5 | 2 |
DataReader.py | DezhengLee/Labster | 1 | 12788580 | import numpy as np
from csv import reader
from decimal import *
def SDM(datalist):
"""
逐差法
:param datalist:
:return:
"""
length = len(datalist)
resultlist = []
halfLen = int(length/2)
for i in range(0, halfLen):
resultlist.append((Decimal(datalist[i+halfLen])... | 2.984375 | 3 |
CodeGen/hmlFhirConverterCodeGenerator/codegen/PathYamlGenerator.py | nmdp-bioinformatics/service-hmlFhirConverter | 1 | 12788581 | from swagger import RoutingSpecGenerator
import os
def replace_class_instances(className, fileContents):
fileContents = replace_class_named_instances(className, fileContents)
fileContents = str(fileContents).replace('**CLASSNAME**', className)
return replace_class_plural_instances(className, fileContents)... | 2.421875 | 2 |
tondo/tests.py | feliperuhland/tondo-api | 0 | 12788582 | # -*- coding: utf-8 -*-
import random
import unittest
import tondo
class TestSequenceFunctions(unittest.TestCase):
JSON_ITEMS = [
'content',
'contributor',
'type',
'url'
]
def setUp(self):
self.json = tondo.loadjsons()
def test_json_integrity(self):
... | 2.734375 | 3 |
migrations/versions/a7acd67386c9_users_table.py | Armalon/PizzaTask | 0 | 12788583 | """users table
Revision ID: a7acd67386c9
Revises:
Create Date: 2020-07-21 16:17:36.492935
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by ... | 1.867188 | 2 |
tobiko/openstack/stacks/_ubuntu.py | 4383/tobiko | 0 | 12788584 | # Copyright 2019 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 1.4375 | 1 |
backend/tests/wallet_tests/services/offchain/test_offchain.py | tanshuai/reference-wallet | 14 | 12788585 | # Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
import dataclasses
import context
import wallet.services.offchain.p2p_payment as pc_service
import wallet.services.offchain.utils as utils
from diem import identifier, LocalAccount, jsonrpc
from diem_utils.types.currencies import DiemCurr... | 1.789063 | 2 |
slack_bot/bot.py | dietrichsimon/slack-bot | 0 | 12788586 | import logging
import sqlalchemy as db
import pandas as pd
from slack import WebClient
import config
# establish connection to postgres database
try:
engine = db.create_engine("postgres://postgres:1234@postgresdb:5432")
except:
logging.critical('Could not establish connection to postgres database.')
initializ... | 2.9375 | 3 |
cra_helper/server_check.py | Maronato/django-cra-helper | 54 | 12788587 | from urllib import request, error as url_error
from django.conf import settings
from cra_helper.logging import logger
def hosted_by_liveserver(file_url: str) -> bool:
# Ignore the server check if we're in production
if settings.DEBUG:
try:
resp = request.urlopen(file_url)
if ... | 2.34375 | 2 |
dist/Basilisk/fswAlgorithms/inertial3DSpin/inertial3DSpin.py | ian-cooke/basilisk_mag | 0 | 12788588 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | 1.695313 | 2 |
Source/Squiddy/src/tema-android-adapter-3.2-sma/AndroidAdapter/screencapture.py | samini/gort-public | 1 | 12788589 | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2010 Tampere University of Technology
#
# 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 ... | 1.6875 | 2 |
dynamic_programming/fibonacci_modified.py | laanak08/algorithms | 0 | 12788590 | def main():
A,B,N = raw_input().split(" ")
print T(int(A),int(B),int(N))
def T(A,B,N):
if N == 1:
return A
elif N == 2:
return B
else:
return ( T(A,B,(N-1)) ** 2 ) + T(A,B,(N-2))
main() | 3.515625 | 4 |
care/facility/migrations/0190_auto_20201001_1134.py | gigincg/care | 189 | 12788591 | <filename>care/facility/migrations/0190_auto_20201001_1134.py<gh_stars>100-1000
# Generated by Django 2.2.11 on 2020-10-01 06:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('facility', '0189_auto_20200929_1258'),
]
operations = [
mig... | 1.554688 | 2 |
nuplan/planning/metrics/evaluation_metrics/common/ego_lat_jerk.py | motional/nuplan-devkit | 128 | 12788592 | <gh_stars>100-1000
from typing import List
from nuplan.planning.metrics.evaluation_metrics.base.within_bound_metric_base import WithinBoundMetricBase
from nuplan.planning.metrics.metric_result import MetricStatistics
from nuplan.planning.metrics.utils.state_extractors import extract_ego_jerk
from nuplan.planning.scena... | 2.34375 | 2 |
examples/many_frames.py | RcSepp/asyncframes | 2 | 12788593 | # -*- coding: utf-8 -*-
# Copyright (c) <NAME>. All Rights Reserved.
# Distributed under the MIT License. See LICENSE file for more info.
import time
from asyncframes import Frame, PFrame, sleep, all_
from asyncframes.asyncio_eventloop import EventLoop
@Frame
async def main_frame():
subframes = [sub_frame(i) for ... | 3.21875 | 3 |
backend/FlaskAPI/mf_insert_table_data.py | steruel/CovalentMFFPrototype | 0 | 12788594 | <reponame>steruel/CovalentMFFPrototype
# coding: utf-8
# In[1]:
##Includes
from flask import request, url_for
from flask_api import FlaskAPI, status, exceptions
from flask_cors import CORS, cross_origin
from flask import Blueprint, render_template, abort
import numpy as np # linear algebra
import pandas as pd # dat... | 2.203125 | 2 |
abc/abc063/abc063c.py | c-yan/atcoder | 1 | 12788595 | N = int(input())
s = [int(input()) for _ in range(N)]
result = sum(s)
if result % 10 != 0:
print(result)
exit()
t = [i for i in s if i % 10 != 0]
if len(t) == 0:
print(0)
else:
result -= min(t)
print(result)
| 2.6875 | 3 |
scale/job/messages/failed_jobs.py | kaydoh/scale | 121 | 12788596 | <filename>scale/job/messages/failed_jobs.py
"""Defines a command message that sets FAILED status for job models"""
from __future__ import unicode_literals
import logging
from collections import namedtuple
from django.db import transaction
from error.models import get_error
from job.models import Job
from messaging.m... | 2.65625 | 3 |
hoc/5_clear.py | DolceVii/astropi | 2 | 12788597 | from sense_hat import SenseHat
sense = SenseHat()
sense.set_rotation(270)
magenta=(255,0,255)
sense.clear(magenta)
| 1.5625 | 2 |
sources/algorithms/sweepln/rstdregioncyclesweep.py | tipech/OverlapGraph | 0 | 12788598 | #!/usr/bin/env python
"""
Restricted Cyclic Multi-Pass Sweep-line Algorithm for RegionSet
Implements an cyclic multi-pass sweep-line algorithm over a set of Regions,
within a restricting Region (all Begin and End events must have context Regions
that intersect with the specified restricting Region) and within a spec... | 2.984375 | 3 |
tests/test_input_checker.py | pzarabadip/PopOff | 4 | 12788599 | <gh_stars>1-10
#! /usr/bin/env python3
import pytest
import numpy as np
from mock import Mock
from popoff.fitting_code import FitModel
from popoff.lammps_data import LammpsData
from popoff.atom_types import AtomType
from popoff.input_checker import (check_coreshell, check_scaling_limits,
... | 2.0625 | 2 |
app/helpers/helpers_search.py | geoadmin/service-search-wsgi | 0 | 12788600 | <gh_stars>0
import logging
import math
import unicodedata
from decimal import Decimal
from functools import reduce
import pyproj.exceptions
from pyproj import Proj
from pyproj import Transformer
from shapely.geometry.base import BaseGeometry
from shapely.ops import transform as shape_transform
from shapely.wkt import ... | 2.09375 | 2 |
deployer/__init__.py | cezio/deployer | 0 | 12788601 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
import subprocess
from flask import Flask, Response, request
from deployer.runner import run_child
app = Flask('deployer')
@app.route('/incoming/<deployment_name>/', methods=["POST"])
def incoming(deployment_name):
r = request
config_path = os.en... | 2.1875 | 2 |
build_dataset/check_track.py | hotelll/Music_Plagiarism_Detection | 2 | 12788602 | import pretty_midi
import numpy as np
'''
Note class: represent note, including:
1. the note pitch
2. the note duration
3. downbeat
4. intensity of note sound
'''
class Note:
def __init__(self):
self.pitch = 0
self.length = 0
self.downbeat = False
self.force = 0
... | 3.125 | 3 |
Q/mindmaps/migrations/0001_initial.py | ES-DOC/esdoc-questionnaire | 0 | 12788603 | <reponame>ES-DOC/esdoc-questionnaire
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='MindMapDomain',
fields=[
... | 1.703125 | 2 |
6 - Python/Strings/2 - String Split And Join.py | Terence-Guan/Python.HackerRank | 88 | 12788604 | l = input()
print('-'.join(input().split()))
# print(l.replace(" ", "-")) | 3.546875 | 4 |
dataspace/count/__init__.py | Sam-prog-sudo/dataspace | 3 | 12788605 | <gh_stars>1-10
from .count import _count_empty_, _count_null_, _count_unique_, _count_zero_
| 1.03125 | 1 |
allenact_plugins/manipulathor_plugin/manipulathor_viz.py | zcczhang/allenact | 2 | 12788606 | """Utility functions and classes for visualization and logging."""
import os
from datetime import datetime
import cv2
import imageio
import numpy as np
from allenact_plugins.manipulathor_plugin.manipulathor_utils import initialize_arm
from allenact_plugins.manipulathor_plugin.manipulathor_utils import (
reset_env... | 2.46875 | 2 |
hijackingprevention/user.py | michardy/account-hijacking-prevention | 3 | 12788607 | import logging
from tornado import gen
import hijackingprevention.db_int as db_int
logger = logging.getLogger(__name__)
class User(db_int.Interface):
"""This class handles reading, writing, and manipulating user objects."""
def __init__(self, uid, site, db):
self.__id_type = "uid"
self.__id = uid
self.__dat... | 2.671875 | 3 |
utils/fit.py | sean-mackenzie/gdpyt-analysis | 0 | 12788608 | <gh_stars>0
# gdpyt-analysis: utils.fit
"""
Notes
"""
# imports
import math
import numpy as np
from scipy.optimize import curve_fit, minimize
from scipy.interpolate import SmoothBivariateSpline
import functools
from utils import functions
# scripts
def gauss_1d_function(x, a, x0, sigma):
return a * np.exp(-(x... | 2.375 | 2 |
examples/gt.py | bhatiadivij/kgtk | 0 | 12788609 | <gh_stars>0
import kgtk.gt.io_utils as gtio
import kgtk.gt.analysis_utils as gtanalysis
#datadir='data/'
mowgli_nodes=f'{datadir}nodes_v002.csv'
mowgli_edges=f'{datadir}edges_v002.csv'
output_gml=f'{datadir}graph.graphml'
gtio.transform_to_graphtool_format(mowgli_nodes, mowgli_edges, output_gml, True)
g=gtio.load_gt_... | 2.234375 | 2 |
transforms/__init__.py | arpastrana/coronary-mesh-convolution | 26 | 12788610 | <reponame>arpastrana/coronary-mesh-convolution
from .feature_descriptors import FeatureDescriptors
from .flow_extensions import RemoveFlowExtensions
from .geodesics import InletGeodesics
from .heat_sampling import HeatSamplingCluster
from .rotation import RandomRotation
| 0.601563 | 1 |
tests/integrations/config/session.py | josephmancuso/masonite | 35 | 12788611 | import os
DRIVERS = {
"default": "cookie",
"cookie": {},
"redis": {
"host": "127.0.0.1",
"port": 6379,
"password": "",
"options": {"db": 1}, # redis module driver specific options
"timeout": 60*60,
"namespace": "masonite4",
},
}
| 1.78125 | 2 |
source/Screen.py | dibala21/Ergocycle | 0 | 12788612 | <filename>source/Screen.py<gh_stars>0
# Screen class
# Imports (libraries)
import sys
import math
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWidgets import QPu... | 2.796875 | 3 |
carball/json_parser/actor/team.py | unitedroguegg/carball | 119 | 12788613 | <reponame>unitedroguegg/carball
from .ball import *
class TeamHandler(BaseActorHandler):
@classmethod
def can_handle(cls, actor: dict) -> bool:
return actor['ClassName'] == 'TAGame.Team_Soccar_TA'
def update(self, actor: dict, frame_number: int, time: float, delta: float) -> None:
self.p... | 2.359375 | 2 |
zongheng/zongheng_lib/machine.py | meetbill/zongheng | 0 | 12788614 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import g
def show_machines():
ml = load_machine_list()
for m in ml:
print m
def load_machine_list(skip_ban=True):
client = g.mongo_client()
db = client.cap
cursor = db.machines.find()
results = []
ban_list = load_banned_machine_list()... | 2.921875 | 3 |
app/main.py | hesusruiz/Canispy | 0 | 12788615 | # Standard python library
import logging
# The Fastapi web server
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
# Import uvicorn for debugging
import uvicorn
# The settings for the system
from settings import settings
# Acces to the bockchain
... | 2.015625 | 2 |
contest_questions/Nth_no_prime.py | mukul20-21/python_datastructure | 0 | 12788616 | import math
num = int(input("Enter the number:"))
try:
result = math.factorial(num)
print(result)
except:
print("factorial is not print for negative number") | 4.125 | 4 |
sra2variant/VCF2CSV.py | wuaipinglab/sra2variant | 0 | 12788617 | <filename>sra2variant/VCF2CSV.py
import sys
import pathlib
from sra2variant.pipeline.cmd_wrapper import ErrorTolerance
from sra2variant.artifacts.base_file import _FileArtifacts
from sra2variant.artifacts.vcf_file import init_vcf_file
from sra2variant.vcfparser.vcf2csv import vcf2csv
from sra2variant.cmdutils.parser_m... | 2.546875 | 3 |
dfme/dfme/approximate_gradients.py | cleverhans-lab/model-extraction-iclr | 0 | 12788618 | <reponame>cleverhans-lab/model-extraction-iclr<filename>dfme/dfme/approximate_gradients.py
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy.linalg
import matplotlib.pyplot as plt
import network
from tqdm import tqdm
import torchvision.models as models
import torchvision... | 2.484375 | 2 |
Image_classification_sorter.py | OpenVessel/RedTinSaintBernard-for-BraTS2021-challenge | 0 | 12788619 | # https://www.tensorflow.org/tutorials/images/classification
import matplotlib.pyplot as plt
import numpy as np
import os
import PIL
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
#Load PNGs using image_dataset_from_directory -... | 3.125 | 3 |
keras/mlflow/model/pipeline_train.py | PipelineAI/models | 44 | 12788620 | <reponame>PipelineAI/models<filename>keras/mlflow/model/pipeline_train.py
"""
Example of image classification with MLflow using Keras to classify flowers from photos. The data is
taken from ``http://download.tensorflow.org/example_images/flower_photos.tgz`` and may be
downloaded during running this project if it is mis... | 2.984375 | 3 |
bindings/python/scripts/__init__.py | matthieuvigne/pinocchio | 1 | 12788621 | #
# Copyright (c) 2015-2016,2018 CNRS
#
import numpy as np
from pinocchio.robot_wrapper import RobotWrapper
from . import libpinocchio_pywrap as pin
from . import utils
from .explog import exp, log
from .libpinocchio_pywrap import *
from .deprecated import *
from .shortcuts import *
pin.AngleAxis.__repr__ = lambda s... | 1.734375 | 2 |
calculate_single_lstm_cell_error.py | placibo/LSTM | 0 | 12788622 | <reponame>placibo/LSTM
#calculate error for single lstm cell
def calculate_single_lstm_cell_error(activation_output_error,next_activation_error,next_cell_error,parameters,lstm_activation,cell_activation,prev_cell_activation):
#activation error = error coming from output cell and error coming from the next lstm cel... | 2.703125 | 3 |
chapter 3/sampleCode6.py | DTAIEB/Thoughtful-Data-Science | 15 | 12788623 | <gh_stars>10-100
[[GitHubTracking]]
@route(query="*")
@templateArgs
def do_search(self, query):
self.first_url = "https://api.github.com/search/repositories?q={}".format(query)
self.prev_url = None
self.next_url = None
self.last_url = None
response = requests.get(self.first_url)
if not resp... | 2.75 | 3 |
tests/auth_tests/test_apps.py | carlospalol/django | 1 | 12788624 | <filename>tests/auth_tests/test_apps.py
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
from django.db import ConnectionHandler
SETTINGS = """
SECRET_KEY = 'django_auth_tests_secret_key'
INSTALLED_APPS = [
'django.contrib.auth.apps.BaseAuthConfig',
'django.contrib.conten... | 2.328125 | 2 |
Assignments/CH485---Artificial-Intelligence-and-Chemistry-master/Practice 06/gcn_logP.py | SeungsuKim/CH485--AI-and-Chemistry | 2 | 12788625 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
plt.switch_backend('agg')
from utils import read_ZINC_smiles, smiles_to_onehot, convert_to_graph
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
import sys
import time
# execution) python gcn_logP.py 3 64 256 0.001 gsc
# Def... | 2.171875 | 2 |
Evaluation/pairwise_distance.py | DigitalPhonetics/SpeechRepresentationFinetuning | 1 | 12788626 | # Average Pariwsie Distance:
import argparse
import pickle
import pandas as pd
from scipy.spatial import distance
parser = argparse.ArgumentParser(
description="Average Pariwsie Distance Evaluation (Quality Analysis)"
)
parser.add_argument("embed_type", type=str, metavar="N", help="")
parser.add_argument("label... | 3.015625 | 3 |
views/__init__.py | nakpisang/dicoding | 0 | 12788627 | <filename>views/__init__.py
from PIL import Image
from flask import Flask, Blueprint, render_template, request, jsonify, redirect, url_for, g, session
from torch_mtcnn import detect_faces
from flask_bootstrap import Bootstrap
from util import is_same, ModelLoaded
base = Blueprint('base', __name__, template_folder='te... | 2.375 | 2 |
product_search_python/tests/run_unittests.py | sp4350/Test | 34 | 12788628 | #!/usr/bin/env python2.7
#
# Copyright 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 2.4375 | 2 |
ROI_Arrival_Viewer.py | alangburl/NWIC_Spectrum_Viewer | 0 | 12788629 | import numpy as np
from ROI_Arrival import ROI_Arrival,ROI_Location
#prefined imports
import sys,time,winsound
import numpy as np
from PyQt5.QtWidgets import (QApplication, QPushButton,QWidget,QGridLayout,
QSizePolicy,QLineEdit,
QMainWindow,QAction,QVBoxLayout
... | 2.109375 | 2 |
scripts/aggregate_tool_info.py | dhrithideshpande/review-technology-dictates-algorithms | 3 | 12788630 | <reponame>dhrithideshpande/review-technology-dictates-algorithms
import numpy as np
import pandas as pd
if __name__ == '__main__':
table_df = pd.read_csv('../summary_data/table1_final.csv')
table_df.loc[:,'seed_type'] = table_df.loc[:,'fix_length_seed'] + table_df.loc[:,'spaced_seed'] + table_df.loc[:,'seed_ch... | 2.578125 | 3 |
src/gausskernel/dbmind/sqldiag/test/test_demo.py | wotchin/openGauss-server | 1 | 12788631 | """
Copyright (c) 2020 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI... | 2.390625 | 2 |
deep_gw_pe_followup/plotting/corner.py | avivajpeyi/gw_pe_judge | 0 | 12788632 | from corner import corner
import numpy as np
CORNER_KWARGS = dict(
smooth=0.9,
label_kwargs=dict(fontsize=30),
title_kwargs=dict(fontsize=16),
color="tab:blue",
truth_color="tab:orange",
quantiles=[0.16, 0.84],
levels=(1 - np.exp(-0.5), 1 - np.exp(-2), 1 - np.exp(-9.0 / 2.0)),
plot_dens... | 2.609375 | 3 |
223_test_time_augmentation_for_semantic_segmentation.py | Data-Laboratory/WorkExamples | 1 | 12788633 | #Ref: <NAME>
"""
# TTA - Should be called prediction time augmentation
#We can augment each input image, predict augmented images and average all predictions
"""
import os
import cv2
from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
import tensorflow as tf
import random
model = tf.ker... | 2.8125 | 3 |
constants.py | Sinica-SLAM/COSPRO-mix | 5 | 12788634 | <reponame>Sinica-SLAM/COSPRO-mix
NUM_BANDS = 4
SNR_THRESH = -6.
PRE_NOISE_SECONDS = 2.0
SAMPLERATE = 16000
MAX_SAMPLE_AMP = 0.95
MIN_SNR_DB = -3.
MAX_SNR_DB = 6.
PRE_NOISE_SAMPLES = PRE_NOISE_SECONDS * SAMPLERATE | 1.3125 | 1 |
ArraysAndStrings/bfs.py | ashaik4/CodeVault | 0 | 12788635 | <reponame>ashaik4/CodeVault
from collections import deque
"""
Find the minimum distance required to move the robot (9) from the field.
Idea: BFS
"""
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
class QueueNode:
def __init__(self, pt, distance):
self.point = pt
... | 3.875 | 4 |
analyze/lookup.py | patarapolw/HanziSRS | 10 | 12788636 | <gh_stars>1-10
import re
from HanziSRS.dir import database_path
class Cedict:
def __init__(self):
super().__init__()
self.dictionary = dict()
with open(database_path('cedict_ts.u8'), encoding='utf8') as f:
for row in f.readlines():
result = re.fullmatch(r'(\w+)... | 2.875 | 3 |
flask-backend/migrations/versions/ca6c6171cdbe_added_task_model.py | harshagrawal523/OpenMF | 92 | 12788637 | """Added task model
Revision ID: ca6c6171cdbe
Revises: 989dbc01a9b0
Create Date: 2021-06-11 08:31:03.584401
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ca6c6171cdbe'
down_revision = '989dbc01a9b0'
branch_labels = None
depends_on = None
def upgrade():
... | 1.71875 | 2 |
test/test_crosscorr.py | thunder-project/thunder-register | 16 | 12788638 | <gh_stars>10-100
import pytest
from numpy import arange, allclose, asarray, expand_dims
from scipy.ndimage.interpolation import shift
from registration import CrossCorr
pytestmark = pytest.mark.usefixtures("eng")
def test_fit(eng):
reference = arange(25).reshape(5, 5)
algorithm = CrossCorr()
deltas = [[1, 2], [-2... | 1.890625 | 2 |
src/limecc/first.py | avakar/limecc | 2 | 12788639 | """
This module defines some basic operations on words and sets of words.
A word is any iterable of symbols (strings), i.e. ('list', 'item') is a word.
The iterable must support slices, joining with operator + and must return
their length through the 'len' function.
"""
from .rule import Rule
from .grammar import Gra... | 3.9375 | 4 |
tests.py | ctcampbell/veracode-python | 13 | 12788640 | <filename>tests.py
if __name__ == '__main__':
import doctest
from veracode import application, sandbox, build
from veracode.exceptions import *
try:
doctest.testmod(application, raise_on_error=True)
doctest.testmod(sandbox, raise_on_error=True)
doctest.testmod(build, raise_on_er... | 1.679688 | 2 |
src/medius/mediuspackets/policy.py | Metroynome/robo | 8 | 12788641 | <gh_stars>1-10
from enums.enums import MediusEnum, CallbackStatus
from utils import utils
from medius.mediuspackets.policyresponse import PolicyResponseSerializer
class PolicySerializer:
data_dict = [
{'name': 'mediusid', 'n_bytes': 2, 'cast': None},
{'name': 'message_id', 'n_bytes': MediusEnum.MES... | 2.53125 | 3 |
Users/forms.py | tifat58/lsv-c4-django-webexperiment | 1 | 12788642 | <gh_stars>1-10
from django import forms
from django.utils.translation import activate
from Common import constants
from Users.enums import *
from Users.models import *
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.forms import PasswordChangeForm
class UserInfoForm(forms.Form):
... | 2.171875 | 2 |
datasets/regdb_dataset.py | JDAI-CV/CM-NAS | 31 | 12788643 | <reponame>JDAI-CV/CM-NAS<gh_stars>10-100
import os
import random
import numpy as np
from PIL import Image
import torch.utils.data as data
class RegDBData(data.Dataset):
def __init__(self, data_root, trial, transform=None, visibleIndex=None, thermalIndex=None, img_size=(128,256)):
# Load training images (path) and ... | 2.296875 | 2 |
wqxlib-python/wqxlib/wqx_v3_0/ComparableAnalyticalMethod.py | FlippingBinary/wqxlib | 0 | 12788644 | <reponame>FlippingBinary/wqxlib
from ..common import WQXException
from .SimpleContent import (
MethodIdentifier,
MethodIdentifierContext,
MethodModificationText
)
from yattag import Doc
class ComparableAnalyticalMethod:
"""Identifies the procedures, processes, and references required to determine the analytica... | 2.265625 | 2 |
lightctr/layer.py | yanyachen/LightCTR | 0 | 12788645 | import tensorflow as tf
class ResidualDense(tf.keras.layers.Layer):
def __init__(
self,
units,
activation=None,
dropout=None,
kernel_initializer=None,
kernel_regularizer=None,
output_activation=None
):
super(ResidualDense, self).__init__()
... | 2.65625 | 3 |
mutatest/transformers.py | EvanKepner/m | 49 | 12788646 | """
Transformers
------------
Transformers defines the mutations that can be applied. The ``CATEGORIES`` dictionary lists all
valid category codes that are valid filters. The primary classes are:
1. ``LocIndex``
2. ``MutateAST``
The ``LocIndex`` is a location index within a given Abstract Syntax Tree (AST) that can ... | 2.453125 | 2 |
examples/connect.py | adrienverge/aiocouch | 0 | 12788647 | import asyncio
from aiocouch import CouchDB
async def main_with():
async with CouchDB(
"http://localhost:5984", user="admin", password="<PASSWORD>"
) as couchdb:
database = await couchdb["config"]
async for doc in database.docs(["db-hta"]):
print(doc)
if __name__ == "_... | 2.484375 | 2 |
tests/test_hotfix_class.py | wo1fsea/PyHotfixer | 0 | 12788648 | <filename>tests/test_hotfix_class.py
# -*- coding: utf-8 -*-
"""----------------------------------------------------------------------------
Author:
<NAME>
<EMAIL>
Date:
2019/8/19
Description:
test_hotfix_class.py
----------------------------------------------------------------------------"""
import un... | 2.53125 | 3 |
scaffoldgraph/core/fragment.py | shenwanxiang/ScaffoldGraph | 0 | 12788649 | <reponame>shenwanxiang/ScaffoldGraph<gh_stars>0
"""
scaffoldgraph.core.fragment
"""
from abc import ABC, abstractmethod
from rdkit import RDLogger
from rdkit.Chem import (
RWMol,
MolToSmiles,
rdmolops,
SanitizeMol,
GetMolFrags,
BondType,
CHI_UNSPECIFIED,
SANITIZE_ALL,
SANITIZE_CLEA... | 2.40625 | 2 |
sekh/highlighting.py | movermeyer/django-sekh | 4 | 12788650 | <reponame>movermeyer/django-sekh
"""Highlighting for django-sekh"""
from bs4 import BeautifulSoup
from sekh.utils import compile_terms
from sekh.settings import PROTECTED_MARKUPS
from sekh.settings import HIGHLIGHTING_PATTERN
def highlight(content, terms):
"""
Highlight the HTML with BeautifulSoup.
"""
... | 2.59375 | 3 |