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 |
|---|---|---|---|---|---|---|
rbk_shares_grab.py | adamrfox/rbk_nas_bulk_add | 3 | 49600 | #!/usr/bin/python
from __future__ import print_function
import sys
import rubrik_cdm
import getopt
import getpass
import urllib3
urllib3.disable_warnings()
def usage():
sys.stderr.write("Usage: rbk_share_grab.py [-h] [-c creds] [-p protocol] [-t token] [-o outfile] rubrik\n")
sys.stderr.write("-h | --help: P... | 2.328125 | 2 |
Pyton_Codes/Python Data Structures/3.Lists/ex_9.4.py | Bombjack88/Python-for-Everybody--PY4E- | 0 | 49601 | name = input("Enter file:")
if len(name) < 1:
name = "mbox-short.txt"
handle = open(name)
hist=dict()
for line in handle:
if line.startswith('From:'):
words=line.split()
if words[1] not in hist:
hist[words[1]]=1
else:
hist[words[1]]=hist[words[1]]+1
#print(hist)
n... | 3.28125 | 3 |
Pacote/Python/teste.py | Rezende31/Primeiros-programas-em-Python | 0 | 49602 | <filename>Pacote/Python/teste.py
maior = 0
menor = 0
totalPessoas = 10
for pessoa in range(1, 11):
idade = int(input("Digite a idade: "))
if idade >= 18:
maior += 1
else:
menor += 1
print("Quantidade de pessoas maior de idade: ", maior)
print("Quantidade de pessoas menor de idade: ", menor)
print("Porce... | 3.84375 | 4 |
BackpackTF/__init__.py | danocmx/BackpackTF | 0 | 49603 | name = "BackpackTF"
| 1.078125 | 1 |
soapfish/py2wsdl.py | jocassid/soapfish | 0 | 49604 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import argparse
import imp
import logging
import sys
import six
from lxml import etree
from . import namespaces as ns, xsd
from .py2xsd import generate_xsdspec
from .soap import SOAP_HTTP_Transport
from ... | 2.40625 | 2 |
tests/test_realtime.py | nickgaya/redbucket | 0 | 49605 | """Realtime rate limiting tests."""
import sched
import threading
import time
import pytest
from pytest import approx
from redbucket import (InMemoryRateLimiter, RedisScriptRateLimiter,
RedisTransactionalRateLimiter, RateLimit, Zone)
@pytest.fixture
def in_memory_rate_limiter():
return I... | 2.171875 | 2 |
napari/util/colormaps/colormaps.py | donovanr/napari | 0 | 49606 | import os
from .vendored import colorconv
import numpy as np
import vispy.color
_matplotlib_list_file = os.path.join(os.path.dirname(__file__),
'matplotlib_cmaps.txt')
with open(_matplotlib_list_file) as fin:
matplotlib_colormaps = [line.rstrip() for line in fin]
def _all_r... | 2.515625 | 3 |
pass.py | gabrielbiasi/password-finder | 1 | 49607 | #!/usr/bin/env python3
"""
pass.py
Find hardcoded passwords on source code of your project.
python pass.py path/to/project
"""
import os
import sys
import re
import fnmatch
import json
from argparse import ArgumentParser
DEFAULT_BAD_WORDS = ['token', 'oauth', 'secret', 'pass', 'password', '<PASSWORD>']
DEFAULT_ANAL... | 3.34375 | 3 |
api/test/test_authentication/test_authentication.py | ghalonso94/wswallet | 0 | 49608 | from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import authenticate
class AuthenticationUserTestCase(APITestCase):
def setUp(self):
self.list_url = reverse('Company-list')
... | 2.71875 | 3 |
qcengine/compute.py | dsirianni/QCEngine | 0 | 49609 | """
Integrates the computes together
"""
from typing import Any, Dict, Optional, Union
from qcelemental.models import ComputeError, FailedOperation, Optimization, OptimizationInput, ResultInput
from .config import get_config
from .procedures import get_procedure, list_all_procedures, list_available_procedures
from .p... | 2.625 | 3 |
Logic/OR.py | Oumourin/Deep-Learning-Study | 1 | 49610 | <filename>Logic/OR.py
import numpy as np
def OR(x1, x2):
x = np.array([x1, x2])
y = np.array([0.5, 0.5])
b = -0.2
tmp = np.sum(x*y) + b
if tmp <= 0:
return 0
else:
return 1
| 3.546875 | 4 |
tweet/migrations/0002_auto_20190801_1335.py | destro6984/Twitecs | 0 | 49611 | <reponame>destro6984/Twitecs
# Generated by Django 2.2.3 on 2019-08-01 13:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('tweet', '0001_initial'),
migration... | 1.71875 | 2 |
iroko/records/marshmallow/__init__.py | tocororo/iroko | 0 | 49612 | # -*- coding: utf-8 -*-
# Copyright (c) 2021. Universidad de Pinar del Rio
# This file is part of SCEIBA (sceiba.cu).
# SCEIBA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Schemas for marshmallow."""
from __future__ impo... | 1.25 | 1 |
wotpy/wot/dictionaries/filter.py | JKRhb/wot-py | 24 | 49613 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Wrapper class for dictionaries to represent Thing filters.
"""
from wotpy.wot.dictionaries.base import WotBaseDict
from wotpy.wot.enums import DiscoveryMethod
class ThingFilterDict(WotBaseDict):
"""The ThingFilter dictionary that represents the
constraints f... | 2.28125 | 2 |
discord/types/enums/stickerformattype.py | AA1999/Disthon | 14 | 49614 | <reponame>AA1999/Disthon
from __future__ import annotations
from enum import IntEnum
class StickerFormatType(IntEnum):
png = 1
apng = 2
lottie = 3
@property
def file_extension(self) -> str:
lookup: dict[StickerFormatType, str] = {
StickerFormatType.png: "png",
Sti... | 2.578125 | 3 |
ch2_practice/13_pdf_word/00_decryptPDF/test.py | dreddsa5dies/automatePy | 2 | 49615 | #! python
import PyPDF2
pdf = open('encrypted.pdf', 'rb')
pdfRead = PyPDF2.PdfFileReader(pdf)
if pdfRead.isEncrypted:
# если зашифрован, то пароль
pdfRead.decrypt('rosebud')
for i in range(pdfRead.getNumPages()):
data = pdfRead.getPage(i)
print(data.extractText())
pdf.close()
| 3.296875 | 3 |
lab4/part3.py | neo-mashiro/MRI | 2 | 49616 | from dipy.denoise.nlmeans import nlmeans_3d, nlmeans
from dipy.denoise.noise_estimate import estimate_sigma
import cv2 as cv
import numpy as np
import nibabel as nib
def preprocess(nifti, name):
"""Preprocess the 3D MRI image before image segmentation"""
image = nifti.get_fdata()
sigma = estimate_sigma(im... | 2.640625 | 3 |
frites/dataset/ds_fmri.py | StanSStanman/frites | 0 | 49617 | <reponame>StanSStanman/frites<gh_stars>0
"""Dataset representation of fMRI data."""
class DatasetFMRI(object):
"""docstring for DatasetFMRI."""
def __init__(self):
"""Init."""
pass
| 1.28125 | 1 |
shiyanlougithub/shiyanlougithub/spiders/repositories.py | xizhongzhao/challenge10 | 0 | 49618 | <reponame>xizhongzhao/challenge10<filename>shiyanlougithub/shiyanlougithub/spiders/repositories.py
# -*- coding: utf-8 -*-
import scrapy
from shiyanlougithub.items import RepositoryItem
class RepositoriesSpider(scrapy.Spider):
name = 'repositories'
@property
def start_urls(self):
return ('htt... | 2.625 | 3 |
conanfile.py | odant/conan-pion | 0 | 49619 | from conans import ConanFile, CMake, tools
class PionConan(ConanFile):
name = "pion"
version = "5.0.7+12"
license = "Boost Software License 1.0 - https://raw.githubusercontent.com/splunk/pion/develop/COPYING"
description = "C++ framework for building lightweight HTTP interfaces"
url = "https://git... | 1.976563 | 2 |
test/20200923_fungar_network.py | CITA-cph/deep-sight | 0 | 49620 | <reponame>CITA-cph/deep-sight
'''
Copyright 2020 CITA
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 i... | 1.703125 | 2 |
old/app/minixs.py | CoCongV/scheduler-service | 2 | 49621 | from sqlalchemy.inspection import inspect
from . import db
class CRUDMixin(object):
"""Implements methods to create, read, update, and delete."""
@classmethod
def create(cls, commit=True, **kwargs):
instance = cls(**kwargs)
return instance.save(commit=commit)
@classmethod
def ge... | 2.65625 | 3 |
decimate_mesh_blender.py | CarolineBao/mouse-brain-atlases_generator | 8 | 49622 | import bpy
import os
import sys
import argparse
## Example call from commandline: blender -b -P decimate_mesh_blender.py -- -f mesh.obj -o mesh_dec.obj -r 0.5 -i 2 -n 4 -l 0.5
## Blender will ignore all options after -- so parameters can be passed to python script.
# get the args passed to blender after "--", all of ... | 2.75 | 3 |
Q03__/51_Android_Unlock_Patterns/test.py | hsclinical/leetcode | 0 | 49623 | #!/usr/bin/python
from Solution import Solution
obj = Solution()
A = 1
B = 9
print(obj.numberOfPatterns(A, B)) | 2.375 | 2 |
images/MER/create_lexicon.py | nleguillarme/snr_tools_and_methods | 2 | 49624 | <reponame>nleguillarme/snr_tools_and_methods
import merpy
merpy.create_lexicon_from_file("ncbi.txt", "ncbi")
merpy.process_lexicon("ncbi")
| 1.4375 | 1 |
numba/misc/inspection.py | luk-f-a/numba | 6,620 | 49625 | """Miscellaneous inspection tools
"""
from tempfile import NamedTemporaryFile
def disassemble_elf_to_cfg(elf):
"""
Gets the CFG of the disassembly of an ELF object, elf, and renders it
appropriately depending on the execution environment (terminal/notebook).
"""
try:
import r2pipe
exce... | 2.640625 | 3 |
StatisticsFunctions/variance.py | mkm99/TeamProject_StatsCalculator | 0 | 49626 | <gh_stars>0
import numpy as np
class Variance():
@staticmethod
def variance(data):
return np.var(data) | 2.359375 | 2 |
dtc/message_types/open_orders_request.py | jseparovic/python-ws-dtc-client | 15 | 49627 | <filename>dtc/message_types/open_orders_request.py
from dtc.enums.message_types import MessageTypes
from lib.base_message_type import BaseMessageType
class OpenOrdersRequest(BaseMessageType):
def __init__(self,
request_id=None,
request_all_orders=None,
server_or... | 2.09375 | 2 |
apps/decors/urls.py | gurnitha/django-torang-bisa-apa | 0 | 49628 | <reponame>gurnitha/django-torang-bisa-apa<gh_stars>0
# apps/decors/urls.py
# Django modules
from django.urls import path
# Locals
from apps.decors import views
# Appname
app_name = 'decors'
urlpatterns = [
# SKILLS CRUD
path('create-skill/', views.create_skill, name='create_skill'),
path('update-skill/<str:pk>/... | 1.820313 | 2 |
crits/exploits/urls.py | dutrow/crits | 738 | 49629 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^add/$', views.add_exploit, name='crits-exploits-views-add_exploit'),
url(r'^edit/cve/$', views.edit_exploit_cve, name='crits-exploits-views-edit_exploit_cve'),
url(r'^edit/name/(?P<id_>\S+)/$', views.edit_exploit_name, name='crits... | 1.789063 | 2 |
cs28_project/cs28/models/grade.py | desuderata/cs28_project | 0 | 49630 | """Grades Model
"""
from django.core.exceptions import ValidationError
from django.db import models
from cs28.models import Student
from ..convert_to_ttpt import to_ttpt
class Grade(models.Model):
courseCode = models.CharField("Course Code",
max_length=30)
matricNo = models... | 2.453125 | 2 |
install.py | Trick-17/arch-installer | 9 | 49631 | """
Installs Arch-Linux when called from a live-iso
"""
import argparse
from pyscripts import s000_detect_hardware as hardware
from pyscripts import s00_user_input as user_input
from pyscripts import s01_partitions as partitions
from pyscripts import s02_basic_arch as basic_arch
from pyscripts import s03_package_m... | 2.484375 | 2 |
platformio/exception.py | ufo2011/platformio-core | 0 | 49632 | <filename>platformio/exception.py<gh_stars>0
# Copyright (c) 2014-present PlatformIO <<EMAIL>>
#
# 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.... | 2.0625 | 2 |
matrix_inverse_using_numpy.py | 6895mahfuzgit/Linear_Algebra_for_Machine_Learning | 0 | 49633 | <filename>matrix_inverse_using_numpy.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 15 23:57:35 2021
@author: Mahfuz_Shazol
"""
import numpy as np
X=np.array([[4,2],[-5,-3]])
X_inv=np.linalg.inv(X)
print('Inverse of X ',X_inv)
Y=np.array([4,-7])
#w=(X**-1)Y
result=np.dot(X_inv,Y)
print(result)
#Y=Xw
... | 3.6875 | 4 |
dglib/modules/sampler.py | billzhonggz/Transfer-Learning-Library | 1,474 | 49634 | """
@author: <NAME>
@contact: <EMAIL>
"""
import random
import copy
import numpy as np
from torch.utils.data.dataset import ConcatDataset
from torch.utils.data.sampler import Sampler
class DefaultSampler(Sampler):
r"""Traverse all :math:`N` domains, randomly select :math:`K` samples in each domain to form a mini-... | 2.5625 | 3 |
wol/views/pages.py | JleMyP/wol | 0 | 49635 | from flask import Blueprint, render_template
from ..logic.crud import get_all_targets
pages = Blueprint('web', __name__, template_folder='../templates')
@pages.route('/targets/', methods=['GET'])
def get_web_targets():
targets = get_all_targets()
return render_template('targets.html', targets=targets)
| 2.015625 | 2 |
orderportal/designs.py | NationalGenomicsInfrastructure/OrderPortal | 4 | 49636 | <gh_stars>1-10
"CouchDB design documents (view index definitions)."
import json
import logging
import couchdb2
from . import constants
from . import settings
DESIGNS = dict(
account=dict(
all=dict(reduce="_count", # account/all
map=
"""function(doc) {
if (doc.orderportal_doctype !=... | 2.1875 | 2 |
foxylib/tools/socialmedia/naver/foxylib_naver.py | foxytrixy-com/foxylib | 0 | 49637 | <reponame>foxytrixy-com/foxylib<filename>foxylib/tools/socialmedia/naver/foxylib_naver.py
import os
from functools import lru_cache
from foxylib.tools.function.function_tool import FunctionTool
class FoxylibNaver:
@classmethod
@FunctionTool.wrapper2wraps_applied(lru_cache(maxsize=1))
def client_id(cls):
... | 1.742188 | 2 |
ensembl/datacheck/client.py | danstaines/ensembl-prodinf | 0 | 49638 | #!/usr/bin/env python
import argparse
import logging
import json
import re
from collections import defaultdict
from ensembl.rest_client import RestClient
from ensembl.server_utils import assert_mysql_uri, assert_mysql_db_uri
class DatacheckClient(RestClient):
"""Client for checking databases using the datacheck s... | 2.703125 | 3 |
osvc_python/osvc_python_connect.py | rajangdavis/osc_python | 7 | 49639 | import requests
import json
from .osvc_python_file_handling import OSvCPythonFileHandler
from .osvc_python_config import OSvCPythonConfig
from .osvc_python_validations import OSvCPythonValidations
from .osvc_python_examples import CLIENT_NOT_DEFINED,CLIENT_NO_INTERFACE_SET_EXAMPLE,CLIENT_NO_USERNAME_SET_EXAMPLE,CLIENT_... | 2.28125 | 2 |
mes_examples/example_remeshing.py | Anthys/slam | 0 | 49640 | <gh_stars>0
"""
.. _example_remeshing:
===================================
Remeshing example in slam
===================================
"""
# Authors: <NAME> <<EMAIL>>
# License: BSD (3-clause)
# sphinx_gallery_thumbnail_number = 2
###############################################################################
# ... | 2.046875 | 2 |
st2common/tests/unit/test_internal_trigger_types_registrar.py | UbuntuEvangelist/st2 | 1 | 49641 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the 'License'); you may not use th... | 1.851563 | 2 |
pypay/interfaces/PayInterface.py | huangxingx/pypay | 1 | 49642 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: x.huang
# @date:29/05/19
import abc
class PayInterface(metaclass=abc.ABCMeta):
@abc.abstractmethod
def pay(self, endpoint, payload):
pass
| 2.296875 | 2 |
sb3.py | monoclecat/SPFlow | 0 | 49643 | <reponame>monoclecat/SPFlow
import stable_baselines3 as sb3
import gym
from stable_baselines3.sac.policies import SACPolicy
from stable_baselines3.sac.sac import SAC
from stable_baselines3.common.utils import polyak_update
from stable_baselines3.common.policies import BasePolicy, register_policy, ContinuousCritic, Base... | 1.796875 | 2 |
src/integral_timber_joints/process/compute_process_assembly_tools.py | gramaziokohler/integral_timber_joints | 3 | 49644 | <reponame>gramaziokohler/integral_timber_joints<filename>src/integral_timber_joints/process/compute_process_assembly_tools.py
try:
from typing import Dict, List, Optional, Tuple
from integral_timber_joints.process import RFLPathPlanner, RobotClampAssemblyProcess
except:
pass
import itertools
from copy impo... | 2.15625 | 2 |
src/apis/image/image/restoration.py | theunifai/unifai-apis-core | 2 | 49645 | <reponame>theunifai/unifai-apis-core
from fastapi import APIRouter
from gladia_api_utils.submodules import TaskRouter
router = APIRouter()
TaskRouter(
router=router,
input="image",
output="image",
default_model="bringing-old-photos-back-to-life",
)
| 1.648438 | 2 |
path.py | jihuacao/Putil | 1 | 49646 | import os
def touch_dir(wanted_dir):
not_exist_collection = []
while os.path.exists(wanted_dir) is not True and wanted_dir != '':
wanted_dir, step = os.path.split(wanted_dir)
not_exist_collection.append(step)
pass
while len(not_exist_collection) != 0:
step = not_exist_coll... | 3.015625 | 3 |
views/views_users.py | SideShowBoBGOT/EPAM-project | 1 | 49647 | """
Module contains all functions working on users page.
Functions:
users_page()
edit_user(id)
delete_user(id)
check_session()
"""
import os
import sys
import urllib.parse
from flask_login import login_user, login_required
from flask import render_template, request, redirect, Blueprint, session
sys.pa... | 2.90625 | 3 |
polls/migrations/0001_initial.py | zzZ5/compost | 1 | 49648 | # Generated by Django 3.0.8 on 2020-11-23 11:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('account', '0003_confirmstring'),
]
operations = [
migrations.CreateModel(
n... | 1.742188 | 2 |
models/python/hypothalamus/dynamical/miro_experiments/recurrent_3_mot.py | ABRG-Models/MammalBot | 0 | 49649 | import numpy as np
import matplotlib.pyplot as plt
N = 100
T = 20000
# nonlinearilties
qg= 0.950997659088
xg= 26.594968159566278
bg= 0.2818239551304378
A= 3.5505937843746906
qf= 0.8274882807912485
xf= 26.594968159566278
bf= 0.2818239551304378
# Presynaptic nonlinearity
def f(x):
return 0.5*(2*qf-1.+np.tanh(bf*(x... | 2.390625 | 2 |
laceworksdk/api/v2/vulnerability_policies.py | alannix-lw/python-sdk | 2 | 49650 | # -*- coding: utf-8 -*-
"""
Lacework VulnerabilityPolicies API wrapper.
"""
from laceworksdk.api.crud_endpoint import CrudEndpoint
class VulnerabilityPoliciesAPI(CrudEndpoint):
def __init__(self, session):
"""
Initializes the VulnerabilityPoliciesAPI object.
:param session: An instance ... | 2.109375 | 2 |
fabfile.py | clemsos/fabric-node-deploy | 0 | 49651 | <reponame>clemsos/fabric-node-deploy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import *
from fabric.contrib import files
import os
from settings import *
# create
RUN_DIR=os.path.join(HOME_DIR, "run")
LOG_DIR=os.path.join(HOME_DIR, "log")
REMOTE_REPO_DIR = os.path.join(HOME_DIR, APP_NAME)
OUT_LOG... | 2.203125 | 2 |
fhir/resources/STU3/tests/test_contract.py | mmabey/fhir.resources | 0 | 49652 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Contract
Release: STU3
Version: 3.0.2
Revision: 11917
Last updated: 2019-10-24T11:53:00+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import contract
from ..fhirdate import FHIRDate
from .fixtures import fo... | 2.109375 | 2 |
restapi/project/urls.py | shuvro/docker-django-postgres-pgadmin | 1 | 49653 | from django.contrib import admin
from django.urls import path
# See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf
admin.autodiscover()
# See: https://docs.djangoproject.com/en/dev/topics/http/urls/
urlpatterns = [
path('admin/', admin.site.urls),
]
| 1.632813 | 2 |
alipay/aop/api/domain/AntMerchantExpandIndirectTiansuoBindModel.py | snowxmas/alipay-sdk-python-all | 213 | 49654 | <reponame>snowxmas/alipay-sdk-python-all<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.TiansuoIsvBindVO import TiansuoIsvBindVO
class AntMerchantExpandIndirectTiansuoBindModel(object):
def __init__(self... | 1.75 | 2 |
chain/p2p/start.py | tsifrer/ark | 5 | 49655 | <reponame>tsifrer/ark<gh_stars>1-10
from chain.p2p.websocket_server import start_server
if __name__ == "__main__":
start_server()
| 1.375 | 1 |
VOCgrowth/EarlyOmicronEstimate/extractsgtf.py | alex1770/Covid-19 | 5 | 49656 | from stuff import *
# Get weekday pattern from case data in order to identify exact date on SGTF graph
# 0 mod 7 is Thursday in daytodate notation (being 1970-01-01)
nc={}
with open('SAcases','r') as fp:
for x in fp:
y=x.split()
nc[datetoday(y[0])]=int(y[1])
minday=min(nc)
maxday=max(nc)
c0=[0]*7
c1=[0]*7
f... | 2.546875 | 3 |
pytimize/programs/__init__.py | TerrayTM/pytimize | 10 | 49657 | <filename>pytimize/programs/__init__.py<gh_stars>1-10
from ._linear import LinearProgram
from ._integer import IntegerProgram
from ._nonlinear import NonlinearProgram
from ._unconstrained import UnconstrainedProgram
__all__ = [
"LinearProgram",
"IntegerProgram",
"NonlinearProgram",
"UnconstrainedProgra... | 1.585938 | 2 |
komoog/paths.py | benmaier/komoog | 2 | 49658 | # -*- coding: utf-8 -*-
"""
Path handling
"""
import pathlib
from pathlib import Path
import simplejson as json
customdir = Path.home() / ".komoog"
def _prepare():
customdir.mkdir(exist_ok=True)
cred_file = customdir / "komoot.json"
if not cred_file.exists():
data = {
"email"... | 2.625 | 3 |
test/py/boundary/test01.py | Ahdhn/lar-cc | 1 | 49659 | <filename>test/py/boundary/test01.py
""" testing boundary operators (correct result) """
from larlib import *
filename = "test/svg/inters/boundarytest0.svg"
lines = svg2lines(filename)
VIEW(STRUCT(AA(POLYLINE)(lines)))
V,FV,EV,polygons = larFromLines(lines)
VV = AA(LIST)(range(len(V)))
submodel = STRUCT(MKPOLS((V... | 2.734375 | 3 |
source/mcl_launcher.py | MChenLiang/pipelineLauncher | 3 | 49660 | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
# @email : <EMAIL>
__author__ = 'ChenLiang.Miao'
# +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ #
from .message_button import MessageCtrlLabel, MessageLabels
from .software_frame import PicturePrev
from... | 2.28125 | 2 |
criterium/urls.py | andywar65/rp_repo | 0 | 49661 | <gh_stars>0
from django.urls import path
from .views import (RaceDetailView, RaceRedirectView, CorrectRedirectView,
RaceListView, RaceListAthleteView)
app_name = 'criterium'
urlpatterns = [
path('', RaceRedirectView.as_view(), name = 'all_editions'),
path('<int:year>/', CorrectRedirectView.as_view(), name ... | 1.734375 | 2 |
Py2048_Engine/Test.py | http-samc/2048.py | 0 | 49662 | """
Test.py 10/10/2021
MIT License
Copyright (c) 2021 http-samc
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... | 3.15625 | 3 |
rest_gae/rest_gae.py | emarinizquierdo/xentinels | 56 | 49663 | <reponame>emarinizquierdo/xentinels<filename>rest_gae/rest_gae.py
"""
Wraps NDB models and provided REST APIs (GET/POST/PUT/DELETE) arounds them. Fully supports permissions.
Some code is taken from: https://github.com/abahgat/webapp2-user-accounts
"""
import importlib
import json
import re
from urlparse import urlpa... | 2.40625 | 2 |
leetcode/medium/1396-Design_underground.py | shubhamoli/practice | 1 | 49664 | <filename>leetcode/medium/1396-Design_underground.py
"""
Leetcode #1396
"""
from collections import defaultdict
class UndergroundSystem:
def __init__(self):
self.transit = defaultdict(list)
self.dest = defaultdict(list)
def checkIn(self, id: int, stationName: str, t: int) -> None:
... | 3.4375 | 3 |
bireme/account/admin.py | bireme/feedback | 0 | 49665 | <reponame>bireme/feedback<gh_stars>0
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from models import UserProfile
admin.site.unregister(User)
class UserProfileInline(admin.StackedInline):
model = UserProfile
extra = 1
class UserPr... | 1.65625 | 2 |
post_processing/default_config.py | 5trobl/oaisys | 0 | 49666 | <gh_stars>0
from yacs.config import CfgNode as CN
_C = CN(new_allowed=True)
###############
# General
###############
_C.FORMAT = "" # this defines the data format. it is recommended to leave this blank and define it via the cmd-line; ["coco", "hdf5"]
_C.BASE_PATH="" # absolute path to the rendered image batches
_C.B... | 1.890625 | 2 |
gallery/mode/photo_manager.py | bob-chen/gallery | 0 | 49667 | <filename>gallery/mode/photo_manager.py
# -*- coding: utf-8 -*-
'''
Created on Mar 19, 2015
@author: Bob.Chen
'''
import sys
import urllib2
import time
from PIL import Image
from constant import PHOTO_DATA_ROOT
from common import Logger, RandomID, getPhotoUrl, getPhotoPath
from error_api import Err
from gallery.models... | 2.4375 | 2 |
megastone/rsp/server.py | giltom/megastone | 2 | 49668 | from megastone.util import round_up
import threading
import logging
import io
import enum
import dataclasses
import abc
from megastone.errors import UnsupportedError
from megastone.mem import SegmentMemory, MemoryAccessError
from megastone.debug import Debugger, StopReason, StopType, HookType, CPUError, InvalidInsnErr... | 2.078125 | 2 |
hddcoin/hodl/cli/cmd_profits.py | u4ma-hdd/hddcoin-blockchain | 37 | 49669 | <reponame>u4ma-hdd/hddcoin-blockchain<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import annotations
import decimal
import json
import blspy #type:ignore
from hddcoin.hodl.hodlrpc import HodlRpcClient
from hddcoin.hodl.util import vlog
from .colours import *
from .colours import _
async def cmd_profit... | 2.359375 | 2 |
test_topology.py | rammses/onos_tests | 0 | 49670 | #!/usr/bin/python
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.node import RemoteController
# Traffic Control
from mininet.link import TCLink
REMOTE_CONTROLLER_IP = "172.21.22.... | 2.53125 | 3 |
PyObjCTest/test_nsimage.py | Khan/pyobjc-framework-Cocoa | 132 | 49671 | <reponame>Khan/pyobjc-framework-Cocoa<gh_stars>100-1000
from PyObjCTools.TestSupport import *
import AppKit
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSImageHelper (NSObject):
def image_didLoadRepresentation_withStatus_(self, i, r, s): pass
def image_didLoadPartOfRepr... | 1.90625 | 2 |
go/apps/access_mobile_http_api/__init__.py | lynnUg/vumi-go | 0 | 49672 | <reponame>lynnUg/vumi-go
from zope.interface import implements
from twisted.cred import portal, checkers, credentials, error
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.web import resource
from twisted.web.guard import HTTPAuthSessionWrapper, BasicCredentialFactory | 1.382813 | 1 |
app/content/streamlit_examples_radio.py | thatscotdatasci/streamlit-example | 0 | 49673 | <reponame>thatscotdatasci/streamlit-example
import time
import numpy as np
import pandas as pd
import streamlit as st
from app.abstract_classes.abstract_navigation_radio import AbstractNavigationRadio
class StreamlitExamplesRadio(AbstractNavigationRadio):
name = "Streamlit Examples"
def _action(self):
... | 4.09375 | 4 |
src/vgf/lego_alpha_team/cli_main.py | Robmaister/VideoGameFormats | 1 | 49674 | #Copyright (c) 2012 <NAME> <<EMAIL>>
#
#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, distrib... | 2.421875 | 2 |
supersaver/common/utils/datetime.py | ftkghost/SuperSaver | 0 | 49675 | from datetime import tzinfo, timedelta, datetime
from dateutil.zoneinfo import getzoneinfofile_stream, ZoneInfoFile
class GeneralTZ(tzinfo):
"""
General timezone with hour offset.
"""
def __init__(self, hour_offset):
self.hour_offset = hour_offset
def __repr__(self):
return "<TZ{0... | 3.1875 | 3 |
visualize/colors.py | victorkitov/common | 1 | 49676 | # A set of distinct colors for visualization purposes.
# Author: <NAME> (<EMAIL>), 03.2016
from pylab import *
# this is a set of well distinguishable colors. Useful for visualizing many graphs on one plot.
COLORS=[[0,0.5,1],[1,0,0],[0.2,1,0],[1,0.5,0],[1,0,1],[0.5,0.5,0.5],[0.5,0,1],[1,1,0],[0,1,1],[ 0.25 , 0... | 2.9375 | 3 |
asm.py | Syntox32/LittleMan | 4 | 49677 | <reponame>Syntox32/LittleMan<filename>asm.py
#!/usr/bin/env python3
def runLittleMan(mem):
# Initialiser
ac = 0
pc = 0
running = True
# Kjør instruksjonssyklus
while running:
# Fetch
instr = mem[pc]
pc += 1
# Execute
if instr // 100 == 1: # ADD
... | 3.296875 | 3 |
19. Backtracking/subsets of an array.py | Ujjawalgupta42/Hacktoberfest2021-DSA | 225 | 49678 | #Input: nums = [1,2,3]
#Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
def subsets(self, nums: List[int]) -> List[List[int]]:
self.result = []
self.helper(nums, 0, [])
return self.result
def helper(self, nums, start, subset):
self.result.append(subset[::])
... | 3.5625 | 4 |
demos/visualize_feeder_feature_correlation.py | AlexanderHoogsteyn/PhaseIdentification | 1 | 49679 | import sys
from os.path import dirname
sys.path.append(dirname("../src/"))
from src.PhaseIdentification.common import *
from src.VisualizePhaseIdentification.visualization import *
from src.PhaseIdentification.voltageBasedPhaseIdentification import *
from src.PhaseIdentification.powerBasedPhaseIdentification import *
... | 2.265625 | 2 |
src/sage/manifolds/differentiable/examples/symplectic_space_test.py | UCD4IDS/sage | 0 | 49680 | <filename>src/sage/manifolds/differentiable/examples/symplectic_space_test.py
import sage.all
from sage.manifolds.differentiable.symplectic_form import SymplecticForm
from sage.manifolds.differentiable.examples.symplectic_space import (
StandardSymplecticSpace,
)
import pytest
class TestR2VectorSpace:
@pytest... | 2.578125 | 3 |
tests/test_version.py | marten-cz/citools | 0 | 49681 | <gh_stars>0
import click
from click.testing import CliRunner
from cctools.commands.version.commands import cli
def test_version():
runner = CliRunner()
result = runner.invoke(cli, ['raw', '--show', '--file', './tests/stubs/version.txt'])
assert result.exit_code == 0
assert '2.5.3' in result.output
| 1.734375 | 2 |
reversi/test/ReversiPlayTest.py | yuta-yoshinaga/ReversiPython | 1 | 49682 | ################################################################################
# @file ReversiPlayTest.py
# @brief リバーシプレイテストクラス実装ファイル
# @author <NAME>
# @date 2018.11.13
# $Version: $
# $Revision: $
#
# (c) 2018 <NAME>.
#
# - 本ソフトウェアの一部又は全てを無断で複写複製(コピー)することは、
# 著作権侵害にあたりますので、これを禁止します。
# - 本製品... | 2.09375 | 2 |
scripts/Qubit/Analysis/Two tone/sideband_drive.py | sourav-majumder/qtlab | 0 | 49683 | <gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
def volt(dBm):
return np.sqrt(50*1e-3*(10**(dBm/10)))
path = r'D:\data\20190320\200420_omit_5to6_good'
data_name = path+path[16:]+r'.dat'
data = np.loadtxt(data_name, unpack=True)
n = 1
# power= np.array_split(data[0],n)
freq = data[6]... | 2.1875 | 2 |
GenNet_utils/LocallyDirectedConnected.py | reneevdw/GenNet | 34 | 49684 | <reponame>reneevdw/GenNet
# For the article see https://www.biorxiv.org/content/10.1101/2020.06.19.159152v1
# For an explenation how to use this layer see https://github.com/ArnovanHilten/GenNet
# Locallyconnected1D is used as a basis to write the LocallyDirected layer
# ================================================... | 2.46875 | 2 |
tests/validation/lib/rke_client.py | XianglongLuo/rancher | 6 | 49685 | <reponame>XianglongLuo/rancher
import os
import jinja2
import logging
import tempfile
import time
import subprocess
from yaml import load
logging.getLogger('invoke').setLevel(logging.WARNING)
DEBUG = os.environ.get('DEBUG', 'false')
DEFAULT_CONFIG_NAME = 'cluster.yml'
DEFAULT_NETWORK_PLUGIN = os.environ.get('DEFAULT... | 1.945313 | 2 |
lighting.py | KonosSgouras/PhongReflection | 0 | 49686 | from OpenGL.GL import *
from OpenGL.GLU import *
cameraposition=(0,0,-5)
class Material:
def __init__(self,ks,kd,ka,a,color):
self.ks=ks
self.kd=kd
self.ka=ka
self.a=a
self.color=color
iss=10
idd=10
iaa=10
def DotProduct(a,b):
return (a[0]*b[0])+(a[1]*b[1])+(a[2]*b[2])
def CrossProduct(a,b):
return ((a[1]*... | 2.8125 | 3 |
method/pruning_googlenet.py | Nuctech-AI/LBS_pruning | 6 | 49687 | <reponame>Nuctech-AI/LBS_pruning
import torch.nn as nn
import torch
import copy
import numpy as np
import collections
def pruning_grad_densent_layer(namex,layer,index=None,groups_y=None,re_num=None):
if isinstance(layer, nn.Conv2d):
if index is not None:
layer.weight.data = layer.weight.data[:, ... | 2.203125 | 2 |
rtgraph/ui/mainWindow_ui.py | spewil/RTGraph | 0 | 49688 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWin... | 1.976563 | 2 |
server/amberalertcn/api/v1/lib/__init__.py | fuzhouch/amberalertcn | 151 | 49689 | <filename>server/amberalertcn/api/v1/lib/__init__.py
"""
lib
"""
| 1.0625 | 1 |
utils/tests/test_osmand.py | posm/osm-export-tool2 | 2 | 49690 | <reponame>posm/osm-export-tool2
# -*- coding: utf-8 -*-
import logging
import os
from mock import Mock, patch
from django.conf import settings
from django.test import TestCase
from ..osmand import OSMToOBF, UpdateBatchXML
logger = logging.getLogger(__name__)
class TestUpdateBatchXML(TestCase):
def setUp(self... | 2.09375 | 2 |
leetcode/1290_convert_binary_number_in_a_linked_list_to_integer.py | chaosWsF/Python-Practice | 0 | 49691 | """
Given head which is a reference node to a singly-linked list. The value of each node in the
linked list is either 0 or 1. The linked list holds the binary representation of a number.
Return the decimal value of the number in the linked list.
Example 1:
https://assets.leetcode.com/uploads/2019/12/05/graph-1.png
... | 3.90625 | 4 |
sys_utils/keep_awake.py | ant358/ML_tools | 0 | 49692 | """
Prevent the system from shutting down if you have
no admin control and need it to run for many hours
"""
import pyautogui
import time
import sys
from datetime import datetime
# quickly move the mouse to the upper left corner to exit
pyautogui.FAILSAFE=True
numMin = 3
run = True
while(run == True):
x=0
... | 3.390625 | 3 |
2020/15/solution.py | Rexcantor/advent-of-code | 1 | 49693 | <reponame>Rexcantor/advent-of-code<gh_stars>1-10
lines = [line.strip() for line in open("input.txt", 'r') if line.strip() != ""]
startingNumbers = [int(i) for i in lines[0].split(",")]
##########################################
# PART 1 #
##########################################
def... | 3.0625 | 3 |
monitor/monitor_util.py | so366/web5 | 33 | 49694 | import json
import random
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String, MetaData, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import select
import monitor_db
import monitor_logger
import monitor_util
Base = declar... | 2.390625 | 2 |
scinol/__init__.py | mihahauke/scinol_icml2019 | 3 | 49695 | from ._scinol import *
from ._nag import *
from ._prescinol import *
from ._sfmd import *
# __all__ = TODO
| 1.164063 | 1 |
download-scripts/from-url.py | halilkocaerkek/GitHub-amazon-sagemaker-stock-prediction-alphavantage | 0 | 49696 | <reponame>halilkocaerkek/GitHub-amazon-sagemaker-stock-prediction-alphavantage
import pandas as pd
import matplotlib.pyplot as plt
from enum import Enum
Adjusted = Enum('Adjusted', 'true false')
Interval = Enum('Interval', '_1min _5min _15min _30min _60min')
OutputSize = Enum('outputsize', 'compact full')
DataType ... | 2.96875 | 3 |
virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ovirt_api_facts.py | lakhlaifi/RedHat-Ansible | 1 | 49697 | <gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version':... | 2.125 | 2 |
kwaf/core.py | PyDever/kwaf | 0 | 49698 | <gh_stars>0
"""
core functionalities
"""
# known-good imports
from __future__ import print_function
class ModuleNotFound (Exception):
def __str__ (self):
return "Could not import required module."
class InvalidAction (Exception):
def __str__ (self):
return "Requested action does not exist."
im... | 2.671875 | 3 |
generator_app/utils.py | badf00d21/JSD2021 | 0 | 49699 | # author: badf00d21
import os
from os.path import dirname, join
from textx import metamodel_from_file
from textx.export import metamodel_export, model_export
from datetime import datetime
from distutils.dir_util import copy_tree
CURRENT_DIR = dirname(__file__)
PROJECT_DIRECTORY_TREE = {}
PROJECT_GENERAL_INFO = {}
def... | 2.015625 | 2 |