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 |
|---|---|---|---|---|---|---|
python_cuda/NewVisualization.py | suvam0451/vehicle-counting-toolkit | 0 | 12785751 | <reponame>suvam0451/vehicle-counting-toolkit
import cv2
import json
import math
from os import listdir
from os.path import isfile, join
def pixel_to_screen(coords, size):
return (coords[0]/size[0], coords[1]/size[1])
# Converts screen-space position to pixel-space position
def screen_to_pixel(coor... | 2.6875 | 3 |
white_matter/wm_recipe/synapse_types/__init__.py | alex4200/Long-range-micro-connectome | 9 | 12785752 | <filename>white_matter/wm_recipe/synapse_types/__init__.py
from ...utils.data_from_config import read_config
class SynapseTypes(object):
def __init__(self, cfg_file=None):
import os
from white_matter.utils.paths_in_config import path_local_to_cfg_root
if cfg_file is None:
cfg_f... | 2.046875 | 2 |
RDS/code/est_py/interface1.py | chrisjcameron/chrisjcameron.github.io | 0 | 12785753 | <gh_stars>0
from jpype import *
import numpy as np
#Interface1.py puts rdsat_analyze and rdsat_aggregate into a class so that the jpype portion is defined only once.
#This is an effort to reduce the potential of memory leakage. -pp286 1/25/2013
###################################################################... | 2.28125 | 2 |
backend/run.py | kendricktan/quantum-game-theory | 0 | 12785754 | <reponame>kendricktan/quantum-game-theory
from quantum_game_theory.logic import Game
GAME = '4-minority'
PROTOCOL = 'EWL'
game = Game(GAME, PROTOCOL)
print(f'Running game: {GAME}')
print('-'*25)
print('Options: X, Y, S, Z, H, T, W, Rz1, X, Ry1, Rz2')
print('Please type as a list, eg. W, Rz1, Z')
print('-'*25)
print(... | 3.359375 | 3 |
text_messaging/mms_example/mms.py | cerna/example_robot_programs | 1 | 12785755 | # imports
# re and datetime live on the base OS image, but twilio, dropbox, and cv2 must be installed every time a new docker container is started
# this may take a minute or two the first time you run this program after restarting your computer
import sh
import re
import datetime
from robot_command.rpl import *
# Set... | 2.828125 | 3 |
pythonlearn/riverpoll.py | kuljotbiring/Python | 0 | 12785756 | # Make a dictionary containing three major rivers and the country
# each river runs through. One key-value pair might be 'nile': 'egypt'.
major_rivers = {'egypt': 'nile', 'brazil': 'amazon', 'china': 'yangtze'}
# • Use a loop to print a sentence about each river, such as The Nile runs
# through Egypt.
for key, value i... | 4.6875 | 5 |
kios/tests/test_operations.py | apleshakov/kios | 0 | 12785757 | #
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 <NAME>
#
# 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 app... | 1.804688 | 2 |
tonclient/test/test_crypto.py | move-ton/ton-client-py | 28 | 12785758 | <reponame>move-ton/ton-client-py
import base64
import os
import unittest
from tonclient.errors import TonException
from tonclient.objects import AppSigningBox, AppEncryptionBox
from tonclient.test.helpers import async_core_client, sync_core_client, \
SAMPLES_DIR
from tonclient.types import KeyPair, MnemonicDictio... | 1.859375 | 2 |
utz/tests/test_collections.py | ryan-williams/jupyter-rc | 0 | 12785759 | <filename>utz/tests/test_collections.py
from utz.collections import *
from utz.test import raises
def test_singleton():
assert singleton([123]) == 123
with raises(ValueError, '2 elems found: 456,123'):
singleton([123,456])
assert singleton([123,123]) == 123
with raises(ValueError, '2 elems fou... | 2.796875 | 3 |
workflow/scripts/download_genomes.py | MGXlab/pvogs_function | 2 | 12785760 | <gh_stars>1-10
#!/usr/bin/env python
import argparse
from Bio import SeqIO, Entrez
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
import time
from math import ceil
parser = argparse.ArgumentParser(description='Download a list of ncbi accessions to the output file')
optional... | 2.875 | 3 |
src/bitmessageqt/bitmessage_icons_rc.py | coffeedogs/PyBitmessage | 1,583 | 12785761 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sa 21. Sep 13:45:58 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x03\x66\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x... | 1.078125 | 1 |
update/parser_clickagain.py | kuna/iidxranktable | 6 | 12785762 | #-*- coding: utf-8 -*-
# site: http://clickagain.sakura.ne.jp/cgi-bin/sort11/data.cgi?level10=1&mix=1
from bs4 import BeautifulSoup
import urllib
import re
def getGroup(arr, g):
for ele in arr:
if (ele[0] == g):
return ele
# if not, add group
new_group = (g, [])
arr.append( new_group )
return new_group
def... | 2.578125 | 3 |
scripts/buildit.py | rojkov/yottaci-azure-backend | 0 | 12785763 | <filename>scripts/buildit.py<gh_stars>0
#!/usr/bin/env python3
import asyncio
import logging
import os
import shutil
import tempfile
import tarfile
import json
import base64
import time
import jwt
import yaml
from urllib.parse import urlparse
from http.client import HTTPSConnection
from tempfile import NamedTempora... | 1.671875 | 2 |
data/upload_waterpoints.py | taarifa/taarifa_backend | 0 | 12785764 | #!/usr/bin/env python
import csv
import requests
import json
CSV_FN = 'waterpoints.csv'
REPORTS_URL = 'http://localhost:5000/reports'
SERVICES_URL = 'http://localhost:5000/services'
class Status(object):
FUNCTIONAL, NOT_FUNCTIONAL, IN_PROGRESS, UNKNOWN = range(4)
def resolve_status(status):
if status.lower... | 3.03125 | 3 |
lifeline.py | goggledefogger/BlinkyTapeQueue | 0 | 12785765 | #!/usr/bin/env python
from BlinkyTapeV2 import BlinkyTape
import sys
import logging
import time
import glob
import os
import pickle
import datetime
import calendar
import re
logging.basicConfig()
if sys.platform.startswith('win'):
serialPorts = ['COM%s' % (i + 1) for i in range(256)]
elif sys.platform.startswith... | 2.328125 | 2 |
predict.py | koderjoker/Image-Classifier | 0 | 12785766 | import argparse
import torch
from torch import nn
from torch import optim
from torchvision import transforms, datasets, models
from collections import OrderedDict
from PIL import Image
import numpy as np
import json
#Take inputs from user
parser = argparse.ArgumentParser()
parser.add_argument('path_to_image', type=st... | 2.4375 | 2 |
python_integration/Lecture_3_5_company_nemid_fat_sms/company_app.py | Jepp0103/System_Integration_Tasks | 1 | 12785767 | from bottle import run, get, view, post, request
import json
import jwt
import requests
##############################
@get("/company")
@view("index_company.html")
def do():
return dict(company_name="SUPER")
@get("/company-token")
@view("index_company_token.html")
def do():
return dict(company_name="Token ... | 2.859375 | 3 |
busy_beaver/common/models.py | alysivji/github-adapter | 55 | 12785768 | from redis.exceptions import RedisError
from rq.exceptions import NoSuchJobError
from rq.job import Job
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy_utils import ChoiceType
from busy_beaver.extensions import db, rq
class BaseModel(db.Model):
__abstract__ = True
id = db.Column(db.Inte... | 2.046875 | 2 |
timidy/testing.py | meawoppl/tiMIDI | 0 | 12785769 | import unittest, sys
import timidi.tests
def test():
return unittest.main(timidi.tests)
if __name__ == "__main__":
sys.exit(0 if test() else 1)
| 1.898438 | 2 |
stanCode_Projects/weather_master/weather_master.py | Cherry-RB/sc-projects | 0 | 12785770 | """
File: weather_master.py
Name:Cherry
-----------------------
This program should implement a console program
that asks weather data from user to compute the
average, highest, lowest, cold days among the inputs.
Output format should match what is shown in the sample
run in the Assignment 2 Handout.
"""
LEAVING = -1
... | 4.3125 | 4 |
atlas/prodtask/management/commands/synccvmfsevgen.py | PanDAWMS/panda-bigmon-atlas | 0 | 12785771 | from django.core.management.base import BaseCommand, CommandError
import time
from atlas.prodtask.mcevgen import sync_cvmfs_db
class Command(BaseCommand):
args = ''
help = 'Sync cvmfs JOs'
def handle(self, *args, **options):
self.stdout.write('Start sync cvmfs for JOs at %s'%time.ctime())
... | 2.265625 | 2 |
test/misc/test_query_performance/old_stuff/graph_drawer.py | madineniguna/EHR | 23 | 12785772 | <filename>test/misc/test_query_performance/old_stuff/graph_drawer.py
import json
import networkx as nx
import matplotlib.pyplot as plt
def get_structures(fname):
with open(fname) as struct_files:
structures = json.loads(struct_files.read())
return structures
def get_colors():
colors = {
'... | 2.609375 | 3 |
management/commands/update_transaction_status.py | utkarshohm/mutual-fund-platform | 62 | 12785773 | <reponame>utkarshohm/mutual-fund-platform
'''
Author: utkarshohm
Description: update status of all transactions that need a status update (i.e. not completed or failed), using
(1) BSEStar api - only payment status has an API endpoint currently
(2) by crawling BSEStar web portal (bsestarmf.in) for all other tra... | 2.390625 | 2 |
old_scripts/atddm.py | clancia/air-traffic-data-driven-modelling | 0 | 12785774 | <filename>old_scripts/atddm.py
import glob
import pandas as pd
from pytz import timezone, utc
from scipy.stats import sem
from constants import PREFIX, POSTFIX, CLMNS, TIMERESAMPLE
def load(subset=None, pathtocsv=PREFIX, **kwargs):
"""
Read data from csv files in pathtocsv
Datasets must be named as XXXX.... | 2.53125 | 3 |
ditto/pinboard/views.py | philgyford/django-ditto | 54 | 12785775 | from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic import DetailView, ListView
from django.views.generic.detail import SingleObjectMixin
from ..core.views import PaginatedListView
from .models import Account, Bookmark, BookmarkTag
class SingleAccountMixin(Sin... | 2.125 | 2 |
cpp/conan/sqlite3/conanfile.py | dmerejkowsky/cpp-mobile-example | 23 | 12785776 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import os
class ConanSqlite3(ConanFile):
name = "sqlite3"
version = "3.21.0"
year = "2017"
sha1 = "ebe33c20d37a715db95288010c1009cd560f2452"
description = "Self-contained, serverless, in-process SQL database ... | 2.03125 | 2 |
lib/operators_expr/logic.py | goosemayor/AutoMarketFeature | 0 | 12785777 | <reponame>goosemayor/AutoMarketFeature
# coding=utf-8
#====================================逻辑====================================
def iff(cond, expr1, expr2):
'''
[Definition] 如果cond成立,则为expr1,否则为expr2,cond? expr1: expr2,cond is a matrix with True or False in each postion
[Category] 逻辑
'''
... | 3.078125 | 3 |
tests/test_xarray_resample.py | uofuseismo/anxcor | 9 | 12785778 | <gh_stars>1-10
import unittest
# travis execution
try:
from tests.synthetic_trace_factory import create_sinsoidal_trace
except:
from synthetic_trace_factory import create_sinsoidal_trace
#ide testing
#from synthetic_trace_factory import create_sinsoidal_trace
import numpy as np
from anxcor.xarray_routines impor... | 1.867188 | 2 |
simulation/main/SimulationResult.py | BillMakwae/Simulation | 8 | 12785779 | class SimulationResult:
def __init__(self, arrays=None, distance_travelled=None, time_taken=None, final_soc=None):
"""
Instantiates a SimulationResult object. This is used in the MainSimulation class when
running a simulation. This object simply stores desired simulation results while the
... | 3.296875 | 3 |
dictest/main.py | moreal/EngExam-Helper | 1 | 12785780 | <reponame>moreal/EngExam-Helper
# -*- coding: utf-8 -*-
import random
import json
import config
__author__ = "dsm_helper"
def get_quiz_data_from_input():
return input("입학년도를 입력해주세요 ex) 2017 >> "), input("학기를 입력해주세요 ex) 1st >> "), input("파일명을 입력해주세요 ex) 01 >> ")
def get_words_by_info(enter_year, semester, fil... | 3 | 3 |
app/tests/routers/test_sections.py | NewShadesDAO/api | 1 | 12785781 | <reponame>NewShadesDAO/api<gh_stars>1-10
import pytest
from fastapi import FastAPI
from httpx import AsyncClient
from pymongo.database import Database
from app.models.server import Server
from app.models.user import User
class TestSectionRoutes:
@pytest.mark.asyncio
async def test_update_section_name(
... | 2.21875 | 2 |
s_vae/data/__init__.py | tillaczel/s_vae | 1 | 12785782 | from s_vae.data.mnist import create_MNIST, vis_mnist
from s_vae.data.synthetic_hypersphere import create_synthetic_hypersphere
def create_dataset(config: dict, seed=0):
data_config = config['data']
name = data_config['name']
path = data_config['path']
train_ratio = data_config['train_ratio']
if n... | 2.25 | 2 |
mvdnet/modeling/roi_heads/mvdnet_box_head.py | qiank10/MVDNet | 51 | 12785783 | import numpy as np
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from typing import Dict
from detectron2.layers import Conv2d, Linear, ShapeSpec, get_norm
from detectron2.modeling.roi_heads import ROI_BOX_HEAD_REGISTRY
from ..attention import SelfAtt... | 2.046875 | 2 |
src/reactive/storage.py | erik78se/layer-nextcloud | 2 | 12785784 | <reponame>erik78se/layer-nextcloud
import os
import shutil
import subprocess
import time
from charms.reactive import ( when_all, when, when_not, set_flag, set_state,
when_none, when_any, hook, clear_flag )
from charms import reactive, apt
from charmhelpers.core import ( hookenv, host, un... | 1.96875 | 2 |
dog-agent-game/ml-agents-envs/mlagents/envs/communicator_objects/brain_parameters_proto_pb2.py | antopraju/FiRescue | 58 | 12785785 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/brain_parameters_proto.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.pro... | 1.429688 | 1 |
GettingStartedWithMobSF/static-analysis/Mobile-Security-Framework-MobSF/mobsf/StaticAnalyzer/views/android/cert_analysis.py | Aviyel-oss/live-coding | 7 | 12785786 | <filename>GettingStartedWithMobSF/static-analysis/Mobile-Security-Framework-MobSF/mobsf/StaticAnalyzer/views/android/cert_analysis.py<gh_stars>1-10
# -*- coding: utf_8 -*-
"""Module holding the functions for code analysis."""
import binascii
import hashlib
import logging
import os
import re
from androguard.core.bytec... | 2.40625 | 2 |
helperfunctions.py | WhiteGobo/plyhandler | 0 | 12785787 | def get_dataarray_as_strings( plyobject, elementname, propertyname, \
encoding="utf8" ):
stringdata = plyobject.get_dataarray( elementname, propertyname )
return [ str( single, encoding="utf8" ) for single in stringdata ]
def strings_to_uchararrays( s... | 2.96875 | 3 |
ui/home.py | FellowHashbrown/MediaQueue | 0 | 12785788 | <reponame>FellowHashbrown/MediaQueue<filename>ui/home.py
import os
import sys
from functools import partial
from PyQt5 import QtWidgets, QtCore
from media import Movie, TVShow, Podcast, LimitedSeries
from media.util import get_type
from ui import MovieDialog, MediaListWidget, add_grid_to_layout, media_objects
from ui... | 2.765625 | 3 |
mmaction/models/localizers/utils/__init__.py | HypnosXC/mmaction2 | 648 | 12785789 | from .post_processing import post_processing
__all__ = ['post_processing']
| 1 | 1 |
deplugins/s3.py | arndtroth/AWSomeOverview | 1 | 12785790 | <gh_stars>1-10
"""
Class for Data Extraction of S3
"""
import boto3
from deplugins.base import AWSFact
class S3Buckets (AWSFact):
NAME = 'S3'
OPTION = 's3'
def get_all_regions(self):
return [None]
def retrieve(self, conn):
for bucket in boto3.resource('s3').buckets.all():
... | 2.5625 | 3 |
var/spack/repos/builtin/packages/r-rviennacl/package.py | jeanbez/spack | 0 | 12785791 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RRviennacl(RPackage):
"""'ViennaCL' C++ Header Files.
'ViennaCL' is a free op... | 1.242188 | 1 |
setup.py | jannessm/quadric-mesh-simplification | 23 | 12785792 | from setuptools import Extension, setup
from Cython.Build import cythonize
import numpy as np
import os.path as osp
__version__ = '1.1.4'
url = 'https://github.com/jannessm/quadric-mesh-simplification'
files = [
'simplify.c',
'array.c',
'clean_mesh.c',
'contract_pair.c',
'edges.c',
'maths.c',
'mesh_inversion.... | 1.710938 | 2 |
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py | Polidea/SiriusObfuscator | 427 | 12785793 | <reponame>Polidea/SiriusObfuscator
"""
Describe the purpose of the test class here.
"""
from __future__ import print_function
import os
import time
import re
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class RenameThisSampleTestTestCase(TestBase):
mydir = TestB... | 2.140625 | 2 |
openprocurement/auctions/insider/tests/award.py | oleksiyVeretiuk/openprocurement.auctions.insider | 0 | 12785794 | <gh_stars>0
# -*- coding: utf-8 -*-
import unittest
from datetime import timedelta
from openprocurement.api.models import get_now
from openprocurement.auctions.insider.tests.base import (
BaseInsiderAuctionWebTest, test_financial_bids,
test_insider_auction_data, test_financial_organization,
)
class InsiderAu... | 2.234375 | 2 |
hostray/web/component/__init__.py | hsky77/hostray | 9 | 12785795 | <reponame>hsky77/hostray<gh_stars>1-10
# Copyright (C) 2019-Present the hostray authors and contributors
#
# This module is part of hostray and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php:
'''
This module contains the "yaml" configurable component classes for hostray applica... | 2.28125 | 2 |
restful_client_lite/contrib/__init__.py | huandzh/restful-client-lite | 0 | 12785796 | import restful_client_lite.contrib.aliyun # noqa
| 0.9375 | 1 |
coral_ordinal/layer.py | stephengmatthews/coral-ordinal | 39 | 12785797 | import tensorflow as tf
from tensorflow.python.keras import activations
class CoralOrdinal(tf.keras.layers.Layer):
# We skip input_dim/input_shape here and put in the build() method as recommended in the tutorial,
# in case the user doesn't know the input dimensions when defining the model.
def __init__(self, n... | 3.5625 | 4 |
homu/tests/test_pr_body.py | jtgeibel/homu | 89 | 12785798 | <reponame>jtgeibel/homu<filename>homu/tests/test_pr_body.py<gh_stars>10-100
from homu.main import (
suppress_ignore_block,
suppress_pings,
IGNORE_BLOCK_START,
IGNORE_BLOCK_END,
)
def test_suppress_pings_in_PR_body():
body = (
"r? @matklad\n" # should escape
"@bors r+\n" ... | 2.21875 | 2 |
hw3/09/9.py | dutta-alankar/PH-354-2018-IISc-Assignment-Problems | 9 | 12785799 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 9 17:53:39 2019
@author: alankar
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special.orthogonal import p_roots #Legendre Polynomial roots
from scipy import constants
def gauss_quad(func,a,b,n,*args):#Legendre
[x,w] = p_r... | 2.640625 | 3 |
src/product/admin.py | ivanjo39191/ivankao-erp | 0 | 12785800 | from django.contrib import admin
from django import forms
from django.db.models import Sum
from django.shortcuts import redirect
from django.http import HttpResponseRedirect
from .models import *
from .forms import *
# Register your models here.
class RelationalProductInline(admin.TabularInline):
search_fields = ... | 1.945313 | 2 |
sympymod/__init__.py | mathcube7/sympymod | 0 | 12785801 | import types
import sys
from .equation import *
from .pick import *
from .calculus import *
from functools import wraps
this_module = sys.modules[__name__]
def _get_imported_names(module):
names = module.__all__ if hasattr(module, '__all__') else dir(module)
return [name for name in names if not name.start... | 2.453125 | 2 |
phantasy/library/exception/__init__.py | phantasy-project/phantasy | 0 | 12785802 | from .err import CSVFormatError, DataError
from .exceptions import TimeoutError
from .exceptions import PutFinishedException
| 1.226563 | 1 |
ikats/objects/tests/test_operator.py | IKATS/ikats_api | 0 | 12785803 | <filename>ikats/objects/tests/test_operator.py
# -*- coding: utf-8 -*-
"""
Copyright 2019 CS Systèmes d'Information
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... | 2.53125 | 3 |
fault_injector/io/task.py | AlessioNetti/fault_injector | 8 | 12785804 | """
MIT License
Copyright (c) 2018 AlessioNetti
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, publish, ... | 2.03125 | 2 |
xos/synchronizer/steps/sync_exampletenant.py | pan2za/exampleservice | 0 | 12785805 | import os
import sys
from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
parentdir = os.path.join(os.path.dirname(__file__), "..")
sys.path.insert(0, parentdir)
logger = Logger(level=logging.INFO... | 1.976563 | 2 |
models/game_states.py | bumasi/matchTaker | 0 | 12785806 | <filename>models/game_states.py<gh_stars>0
"""Module defining game-state and its operations.
A game-state is a sequence of rows containing matches.
If rows are numbered from 1 .. 5, then row n must contain 0..n matches.
Here, rows are indexed from 0 .. 4, thus row with index k must contain 0 .. k+1 matches.
The rows a... | 3.484375 | 3 |
app/models/component_group.py | arxcdr/silverback | 0 | 12785807 | """
Component Model
"""
# Third Party Library
from django.db import models
class ComponentGroup(models.Model):
UPTIME_CHOICES = (
('on', 'ON'),
('off', 'OFF')
)
name = models.CharField(max_length=100, verbose_name="Name")
description = models.CharField(max_length=200, verbose_name="... | 2.234375 | 2 |
get_diff_coverage2.py | poweredbygrow/coverage_tools | 0 | 12785808 | <filename>get_diff_coverage2.py<gh_stars>0
#!/usr/bin/env python3
import argparse
import math
import re
import subprocess # nosec
import xml.etree.ElementTree as element_tree # nosec
from collections import Counter, OrderedDict
from itertools import chain
IGNORED_PACKAGES = [".venv/", "target/"]
def _parse_coverag... | 2.703125 | 3 |
project/migrations/0006_post_like_num.py | tatsuki5820iso/birth-pro | 0 | 12785809 | <gh_stars>0
# Generated by Django 2.2.1 on 2019-07-06 15:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0005_like'),
]
operations = [
migrations.AddField(
model_name='post',
name='like_num',
... | 1.453125 | 1 |
messaging_components/services/service_artemis.py | fgiorgetti/qpid-dispatch-tests | 0 | 12785810 | <filename>messaging_components/services/service_artemis.py
import posixpath
import re
import logging
import time
from enum import Enum
from iqa_common.executor import Command, Execution, ExecutorAnsible, CommandAnsible, Executor
from iqa_common.utils.tcp_util import TcpUtil
from messaging_abstract.component import Serv... | 2.046875 | 2 |
knoema/view_definitions.py | FromPerm/knoema-python-driver | 8 | 12785811 | class Dimension:
def __init__(self):
self.key = None
self.id = None
self.name = None
self.isGeo = None
self.datasetId = None
self.fields = []
self.members = None
class Field:
def __init__(self, field_info):
self.key = field_info['key']
... | 2.6875 | 3 |
services/core-api/app/api/securities/models/bond_type.py | bcgov/mds | 25 | 12785812 | <reponame>bcgov/mds
from sqlalchemy.schema import FetchedValue
from app.extensions import db
from app.api.utils.models_mixins import Base, AuditMixin
class BondType(Base, AuditMixin):
__tablename__ = "bond_type"
bond_type_code = db.Column(db.String, nullable=False, primary_key=True)
description = db.Col... | 2.15625 | 2 |
keras/downstream_tasks/config.py | joeranbosma/ModelsGenesis | 574 | 12785813 | import os
import shutil
import csv
import random
class bms_config:
arch = 'Vnet'
# data
data = '/mnt/dataset/shared/zongwei/BraTS'
csv = "data/bms"
deltr = 30
input_rows = 64
input_cols = 64
input_deps = 32
crop_rows = 100
crop_cols = 100
crop_deps = 50
# mode... | 2.0625 | 2 |
hysynth/pwl/adaptation/__init__.py | HySynth/HySynth | 4 | 12785814 | from .modecreation import wrapper_adapt_ha as adapt_ha
from .relaxation import relax_ha
| 1.0625 | 1 |
code/candy_crush.py | ajhalthor/candy-crush | 1 | 12785815 | <filename>code/candy_crush.py
import copy
import signal
import time
class V:
"""The value of a node
A node consists of 2 values:
- value (int): score of obtained till end of game
- move (tuple): the candy crushed
"""
def __init__(self, player):
if player == 'min':
s... | 3.765625 | 4 |
genomepy/annotation/__init__.py | vanheeringen-lab/genomepy | 146 | 12785816 | <reponame>vanheeringen-lab/genomepy<gh_stars>100-1000
"""Annotation class, modules & related functions"""
import os
import re
from pathlib import Path
from typing import Iterable, Optional, Union
import numpy as np
import pandas as pd
from loguru import logger
from genomepy.annotation.mygene import map_genes as _map_... | 2.484375 | 2 |
config/generate.py | BYU-PCCL/conversational-ai | 4 | 12785817 | """Generates a gin config from the current task/mixture list.
Usage: `python3 -m config.generate`
"""
from itertools import chain, product
from pathlib import Path
import t5
import conversational_ai.tasks # noqa: F401
WHITELIST = ["chitchat", "dailydialog", "convai2"]
sizes = ["small", "base", "large", "3b", "11b... | 2.390625 | 2 |
GraphGeneration.py | arunkumaraqm/Prims-Algorithm-Using-Fibonacci-Heap | 1 | 12785818 | <reponame>arunkumaraqm/Prims-Algorithm-Using-Fibonacci-Heap
# Program to generate a test case (adjacency matrix) for Prim's and Krukal's algorithms
# The graph generated will be connected.
from random import shuffle, sample, randint
import sys
def read():
nfverts = int(input("Number of vertices: "))
density = int(i... | 3.8125 | 4 |
setup.py | fgolemo/segar | 19 | 12785819 | <gh_stars>10-100
from setuptools import setup, find_packages
setup(
author='<NAME>, <NAME>, <NAME>, <NAME>, '
'and <NAME>',
name='segar',
install_requires=[
"absl-py",
"numpy",
"scipy",
"aenum",
"matplotlib",
"opencv-python-headless",
"scik... | 1.296875 | 1 |
setup.py | sashaafm/cloudbridge | 0 | 12785820 | <reponame>sashaafm/cloudbridge
import ast
import os
import re
from setuptools import setup, find_packages
# Cannot use "from cloudbridge import get_version" because that would try to
# import the six package which may not be installed yet.
reg = re.compile(r'__version__\s*=\s*(.+)')
with open(os.path.join('cloudbridge... | 1.875 | 2 |
getNetCDFile.py | jmpmcmanus/adcirc2mbtiles | 0 | 12785821 | <filename>getNetCDFile.py
#!/usr/bin/env python
import sys, os, wget
def getDataFile(dirpath, storm, url):
# Create storm netcdf directory path
if not os.path.exists(dirpath+storm):
mode = 0o755
os.makedirs(dirpath+storm, mode)
# Get infilename and download netcdf file
infilename = url... | 2.953125 | 3 |
pipelines/p1_orca_by_stop.py | CSE482Winter2021/Major-Dudes | 0 | 12785822 | <gh_stars>0
import os
import pandas as pd
import numpy as np
import sklearn.neighbors as knn
from tqdm import tqdm
from scripts.census_reader import TractCensusReader
from utils import constants
NAME = 'p1_orca_by_stop'
KNN_LEAF_SIZE = 50
OUTPUT_FILENAME = f'{NAME}.csv'
WRITE_DIR = constants.PIPELINE_OUTPUTS_DIR
... | 2.640625 | 3 |
apps/contrib/response_codes.py | jimialex/django-wise-template-mysql | 1 | 12785823 | <reponame>jimialex/django-wise-template-mysql
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
# >> Providers
OPS_SERVER_UNAVAILABLE = {
'code': 'ops.ServerUnavailable',
'detail': _('Ops Server is unavailable.'),
}
INVALID_OPS_SERVER_REQUEST = {
'code': 'ops.InvalidRequest... | 1.734375 | 2 |
super_taxi/model/taxis.py | sanjayatb/taxi-booking-system | 0 | 12785824 | from super_taxi.model.generics import Vehicle, Coordinate
from super_taxi.model.cars import Car,SUVCar
class Taxi(Vehicle):
def __init__(self, id=None):
Vehicle.__init__(self, id=id)
self.position = Coordinate(0, 0)
self.ride = None
self.booked = False
self.pickup_distance ... | 2.984375 | 3 |
ms_teams_webhook_hook.py | mendhak/Airflow-MS-Teams-Operator | 47 | 12785825 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 1.976563 | 2 |
profiles_api/urls.py | juliatan/django-rest-api | 0 | 12785826 | <filename>profiles_api/urls.py
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from profiles_api import views
# Specifically for ViewSet example
router = DefaultRouter()
router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset') # base_name is for internal... | 2.5625 | 3 |
pype9/utils/arguments.py | tclose/Pype9 | 0 | 12785827 | """
Author: <NAME> (<EMAIL>)
Copyright: 2012-2014 <NAME>.
License: This file is part of the "NineLine" package, which is released under
the MIT Licence, see LICENSE for details.
"""
# from pype9.utils.mpi import mpi_comm
import os.path
import nineml
import ninemlcatalog
from argparse import ArgumentTyp... | 2.03125 | 2 |
heritage/migrations/0032_interview_attendees.py | stewardshiptools/stewardshiptools | 0 | 12785828 | <reponame>stewardshiptools/stewardshiptools<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0004_auto_20160202_1146'),
('heritage', '0031_interview_other_interview... | 1.726563 | 2 |
testlibs/test_modules.py | kaistshadow/blockchain-sim | 1 | 12785829 | <reponame>kaistshadow/blockchain-sim<filename>testlibs/test_modules.py
#
# 2021-03-15
# created by <NAME>
#
import os
from subprocess import check_output
import argparse
import sys
import os
import lxml.etree as ET
import subprocess
import math
sys.path.append("")
from testlibs import utils, test_result
def exec_shell... | 2.203125 | 2 |
ex024-Nome com Silva.py | Mathelzu/PythonExercicios | 0 | 12785830 | nome = input('Nome: ')
a = nome.upper()
b = 'SILVA' in a
print(f'Seu nome tem Silva: {b}')
| 3.59375 | 4 |
s3dxrd/utils/topology.py | FABLE-3DXRD/scanning-xray-diffraction | 2 | 12785831 | import numpy as np
#import matplotlib.pyplot as plt
import shapely.geometry
from scipy.ndimage.morphology import binary_dilation
from scipy.ndimage import label
from multiprocessing import Pool
def voxels_to_polygon(image_stack, pixel_size, center=(0.5, 0.5)):
"""Take a stack of images and produce a stack of shap... | 3.078125 | 3 |
test_lex_re.py | marcos-mv/ruspy | 0 | 12785832 | <filename>test_lex_re.py
"""
# lex-re
Converter e associar expressões regulares da teoria de compiladores com
expressões regulares escritas em linguagem de programação
Criar e manipular expressões regulares em Python ou outra linguagem de programação.
Vamos testar esta habilidade traduzindo as regras para símbolos t... | 3.125 | 3 |
moebiusgol/render.py | lorenzocerrone/moebius-game-of-life | 0 | 12785833 | <filename>moebiusgol/render.py
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from moebiusgol.utils import add_pattern_from_macro, add_pattern_from_file
from moebiusgol.gol_step import update_grid2d
import numpy as np
from PIL import Image
import os
from skimage.transform import rescale
import... | 2.21875 | 2 |
day/008/prime_number_checker.py | Wanzaz/100-days-of-code | 0 | 12785834 |
def prime_checker(number):
counter = 0
for i in range(1, number):
if number%i == 0:
counter += 1
if counter <= 2:
print("It's a prime number.")
else:
print("It's not a prime number.")
n = int(input("Check this number: "))
prime_checker(number=n)
| 4.03125 | 4 |
lightfield_plane.py | IDLabMedia/blender-lightfield-addon | 1 | 12785835 | <filename>lightfield_plane.py
import math
import random
import bpy
import bmesh
from mathutils import Color
from .lightfield import LightfieldPropertyGroup
from .camera_position import CameraPosition
class LightfieldPlane(LightfieldPropertyGroup):
def construct(self):
visuals = self.default_construct()
... | 2.421875 | 2 |
samples-python1/101-datatypes-hard.py | LunaticNeko/chandrakasem-lectures | 0 | 12785836 | # Int and Float
x = 100
y = 22.4
xpx = x+x
xpy = x+y
# print(type(xpx), xpx)
# print(type(xpy), xpy)
very_large_number = 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
very_large_float = float(very_large_number)
back_to_int = int(very_large_float)
# print(type(... | 3.640625 | 4 |
deskew/__init__.py | jwbargsten/deskew | 0 | 12785837 | <reponame>jwbargsten/deskew
import numpy.typing as npt
import numpy as np
from skimage.feature import canny
from skimage.transform import hough_line, hough_line_peaks
def determine_skew(img, sigma=3.0, num_peaks=20):
# scale to 0-255
# makes deskewing possible in light-coloured images with low contrast
i... | 2.6875 | 3 |
angr_platforms/tricore/rcrr_instr.py | shahinsba/angr-platforms | 0 | 12785838 | #!/usr/bin/env python3
""" rcrr_instr.py
Implementation of RCRR format instructions.
"""
from pyvex.lifting.util import Type, Instruction
import bitstring
from .logger import log_this
class RCRR_Instructions(Instruction):
""" Insert Bit Field instruction.
op = 0x97
op2 = 0x00 3-bit
User S... | 2.609375 | 3 |
wagtail_localize_git/test/__init__.py | kaedroho/wagtail-localize-pontoo | 5 | 12785839 | <filename>wagtail_localize_git/test/__init__.py
default_app_config = "wagtail_localize_git.test.apps.WagtailLocalizeGitTestAppConfig"
| 1.046875 | 1 |
docs/Deployments/grabcut_mesher/main.py | erdc/AdhUI | 2 | 12785840 | import panel as pn
import holoviews as hv
from earthsim.grabcut import GrabCutPanel, SelectRegionPanel
from adhui import CreateMesh, ConceptualModelEditor
hv.extension('bokeh')
stages = [
('Select Region', SelectRegionPanel),
('Grabcut', GrabCutPanel),
('Path Editor', ConceptualModelEditor),
('Mesh',... | 2.234375 | 2 |
etk/unit_tests/test_language_identification_extractor.py | donaq/etk | 77 | 12785841 | import unittest
from etk.extractors.language_identification_extractor import LanguageIdentificationExtractor
class TestLanguageIdentificationExtractor(unittest.TestCase):
def test_langid(self):
extractor = LanguageIdentificationExtractor()
text_en = "langid.py comes pre-trained on 97 languages (I... | 2.90625 | 3 |
reference/generated/numpy-arccos-1.py | ahaldane/ahaldane.github.io | 16 | 12785842 | # We expect the arccos of 1 to be 0, and of -1 to be pi:
np.arccos([1, -1])
# array([ 0. , 3.14159265])
# Plot arccos:
import matplotlib.pyplot as plt
x = np.linspace(-1, 1, num=100)
plt.plot(x, np.arccos(x))
plt.axis('tight')
plt.show()
| 2.8125 | 3 |
953/Verifying an Alien Dictionary.py | cccccccccccccc/Myleetcode | 0 | 12785843 | <gh_stars>0
from typing import List
class Solution:
def isAlienSorted(self, words: List[str], order: str) -> bool:
orderdict = {c:i for i,c in enumerate(order)}
for i in range(len(words)-1):
word1 = words[i]
word2 = words[i+1]
for j in range(min(len(word1),len(wor... | 3.171875 | 3 |
functions.py | mimmospoto/ADM-HW2-Group9 | 0 | 12785844 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import copy
import os
import datetime
import time
from functools import reduce
# Function that provide some information about the cvs files
def infos(old_df_names, months):
"""
Print informations about databases
... | 3.375 | 3 |
app_core.py | licaiwang/Line_Bot_Heroku | 1 | 12785845 | # linebotTest1
# ngrok http 5000
import random
import re
from flask import Flask, abort, render_template, request
from linebot import LineBotApi, WebhookHandler
from linebot.exceptions import InvalidSignatureError
from linebot.models import (
ImageSendMessage,
LocationSendMessage,
MessageAction,
Messag... | 2.40625 | 2 |
mango-python/bdgenomics/mango/test/notebook_test.py | heuermh/mango | 120 | 12785846 | <reponame>heuermh/mango
#
# Licensed to Big Data Genomics (BDG) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The BDG licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); ... | 1.8125 | 2 |
setup.py | amstan/jackclient-python | 0 | 12785847 | <filename>setup.py
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import ... | 1.96875 | 2 |
uwb/export.py | unfoldingWord-dev/tools | 6 | 12785848 | #!/usr/bin/env python2
# -*- coding: utf8 -*-
#
# Copyright (c) 2015 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# Contributors:
# <NAME> <<EMAIL>>
"""
This script exports a Bible into the given format from the API.
Requires that https://github.com/Door43/USFM-Tool... | 2.796875 | 3 |
normalizing_flows/flows/affine/planar.py | TanguyUrvoy/normalizing-flows | 0 | 12785849 | <filename>normalizing_flows/flows/affine/planar.py
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
from normalizing_flows.flows import AmortizedTransform
class Planar(AmortizedTransform):
def __init__(self, **kwargs):
super().__init__(**kwargs)
# define nonlinearity ... | 2.296875 | 2 |
appengine/findit/services/test/resultdb_util_test.py | xswz8015/infra | 0 | 12785850 | # Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import mock
from services import parameters
from services import resultdb
from waterfall.test import wf_testcase
from go.chromium.org.luci.resultdb.proto.v1... | 1.90625 | 2 |