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 |
|---|---|---|---|---|---|---|
examples/example_ME5ME6.py | bmachiel/python-substratestack | 1 | 39300 | #!/bin/env python
# import the technology's complete stack definition
from example import stack
# in order to decrease simulation times, some metal layers can be removed from
# the stack, allowing more oxide layers to be merged in the next step
stack.remove_metal_layer_by_name('PO1')
stack.remove_metal_layer_by_name... | 2.859375 | 3 |
other/dingding/dingtalk/api/rest/OapiProjectPointAddRequest.py | hth945/pytest | 0 | 39301 | <reponame>hth945/pytest<filename>other/dingding/dingtalk/api/rest/OapiProjectPointAddRequest.py<gh_stars>0
'''
Created by auto_sdk on 2020.12.24
'''
from dingtalk.api.base import RestApi
class OapiProjectPointAddRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.action_time = None
sel... | 1.507813 | 2 |
Q6.2_brain_teaser.py | latika18/learning | 0 | 39302 | <reponame>latika18/learning
There is an 8x8 chess board in which two diagonally opposite corners have been cut off.
You are given 31 dominos, and a single domino can cover exactly two squares.
Can you use the 31 dominos to cover the entire board? Prove your answer (by providing an example, or showing why it’s impossib... | 3.359375 | 3 |
make-web.py | blockulator/mpm-wasm | 10 | 39303 | #!/usr/bin/env python
import os
import stat
from sys import platform
from shutil import rmtree
from subprocess import check_call
def get_platform_type():
if platform == "linux" or platform == "linux2" or platform == "darwin":
return "unix"
elif platform == "win32":
return "windows"
else:
... | 2.46875 | 2 |
django_site/parser_vacancies/migrations/0005_vacancies_count.py | StGrail/v.it | 0 | 39304 | # Generated by Django 3.1.4 on 2021-02-28 15:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parser_vacancies', '0004_auto_20210207_0052'),
]
operations = [
migrations.CreateModel(
name='Vacancies_count',
fiel... | 1.695313 | 2 |
online.py | abraker95/auto-loved-bot | 0 | 39305 | <reponame>abraker95/auto-loved-bot<filename>online.py
import time
import requests
import json
class Online():
session = requests.session()
REQUEST_OK = 0 # Data can be handled
REQUEST_RETRY = 1 # Try getting data again
REQUEST_BAD = 2 # No point in trying, skip and go to next one
@stat... | 2.8125 | 3 |
env/lib/python3.6/site-packages/txaio/__init__.py | CanOzcan93/TriviaServer | 0 | 39306 | <filename>env/lib/python3.6/site-packages/txaio/__init__.py
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... | 1.242188 | 1 |
ml/FirstTry.py | mzs9540/covid19 | 1 | 39307 | <filename>ml/FirstTry.py
import numpy as np
import pandas as pd
import matplotlib as plt
import seaborn as sns
df = pd.read_csv('from_april.csv', parse_dates=['Date'])
df = df[(df.T !=0).any()]
india = df[df['Country/Region'] == 'India']
india = india.drop(['Country/Region', 'Province/State', 'Lat', 'Long'], axis=1)... | 2.9375 | 3 |
packetracer/ppcap.py | hatamiarash7/PacketTracer | 3 | 39308 | <filename>packetracer/ppcap.py
"""
Packet read and write routines for pcap format.
See http://wiki.wireshark.org/Development/LibpcapFileFormat
"""
import logging
import types
from packetracer import packetracer
from packetracer.layer12 import ethernet, linuxcc, radiotap, btle, can
from packetracer.structcbs import pac... | 2.5 | 2 |
ExomeDepth/ed_csv_to_vcf.py | UMCUGenetics/Dx_resources | 1 | 39309 | #! /usr/bin/env python3
import sys
import os
import re
import subprocess
import argparse
import collections
import copy
import decimal
import vcf
import pysam
import pandas as pd
import settings
def cnv_locationtype(region, par1, par2):
chrom = str(region[0]).upper()
start = int(region[1])
stop = int(regio... | 2.578125 | 3 |
wallet.py | ock666/python-blockchain | 0 | 39310 | import binascii
import json
import os
import requests
from time import time
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from Crypto.Hash import RIPEMD160
from Crypto.Signature import pkcs1_15
import Validation
import PySimpleGUI as sg
import hashlib
class Wallet:
unix_time = time()
def __i... | 2.71875 | 3 |
opps/core/tags/views.py | jeanmask/opps | 159 | 39311 | <reponame>jeanmask/opps
# -*- encoding: utf-8 -*-
from django.utils import timezone
from django.contrib.sites.models import get_current_site
from django.conf import settings
from haystack.query import SearchQuerySet
from opps.views.generic.list import ListView
from opps.containers.models import Container
from opps.c... | 2.015625 | 2 |
Scripts/TK_xls-to-peaks.py | colinwalshbrown/CWB_utils | 0 | 39312 | <reponame>colinwalshbrown/CWB_utils
#!/usr/bin/env python
import sys
if len(sys.argv) < 2:
print "usage: TK_xls-to-peaks.py <TK_xls>"
sys.exit(0)
for line in open(sys.argv[1]):
l = line[:-1].split()
for (i,x) in enumerate(l[4][:-1].split(",")):
print "\t".join((l[0],l[1],x,l[5][:-1].split(","... | 2.796875 | 3 |
ibsng/handler/invoice/get_invoice_by_i_d.py | ParspooyeshFanavar/pyibsng | 6 | 39313 | """Get invoice by id API method."""
from ibsng.handler.handler import Handler
class getInvoiceByID(Handler):
"""Get invoice by id method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
"""
self.is_valid(self.invoice_id, i... | 2.828125 | 3 |
data/semialigned_dataset.py | jlim13/pytorch-CycleGAN-and-pix2pix | 0 | 39314 | <filename>data/semialigned_dataset.py
import os.path
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import random
import torchvision
import numpy as np
class SemiAlignedDataset(BaseDataset):
"""
This dataset class can load unaligned/unp... | 3.109375 | 3 |
iotcookbook/device/pi/neopixel/client.py | Weeshlow/crossbarexamples | 2 | 39315 | <reponame>Weeshlow/crossbarexamples<filename>iotcookbook/device/pi/neopixel/client.py<gh_stars>1-10
import time
import random
import Adafruit_ADS1x15
from neopixel import *
LED_COUNT = 8 # Number of LED pixels.
LED_PIN = 12 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ =... | 3.09375 | 3 |
src/strokes.py | jafetimbre/pil-to-ps | 0 | 39316 |
def inner_stroke(im):
pass
def outer_stroke(im):
pass
| 1.046875 | 1 |
find_sources.py | DarthPumpkin/github-search | 0 | 39317 | import requests
import json
import time
import os
import sys
green = "\x1b[38;2;0;255;0m"
greenish = "\x1b[38;2;93;173;110m"
red = "\x1b[38;2;255;0;0m"
grey = "\x1b[38;2;193;184;192m"
reset = "\033[0m"
clear_line = "\033[0K"
# Maximum repository size in megabytes
MAX_REPO_SIZE = 5
def load_cache():
result = []
... | 2.5625 | 3 |
aproaches/edit_distance.py | tyomik-mnemonic/genling | 0 | 39318 | import numpy as np
class JaroDist:
def __init__(w1:str, w2:str):
self.w1 = w1
self.w2 = w2
self.m:list = None
self.t:int = None
def compare(self):
for w,wo in zip(w1,w2):
self.m.append(1) if w == wo else self.m.append(0)
self.t = sum(self.m)/2
... | 3.234375 | 3 |
packages/plugins/minos-broker-kafka/tests/test_kafka/test_publisher.py | sorasful/minos-python | 0 | 39319 | <reponame>sorasful/minos-python<filename>packages/plugins/minos-broker-kafka/tests/test_kafka/test_publisher.py
import unittest
from unittest.mock import (
AsyncMock,
)
from aiokafka import (
AIOKafkaProducer,
)
from minos.common import (
MinosConfig,
)
from minos.networks import (
BrokerMessage,
... | 2.15625 | 2 |
training.py | BertilBraun/Keras-Testing | 0 | 39320 | from model import make_model, IMAGE_SIZE
from tensorflow.keras.preprocessing.image import ImageDataGenerator
model = make_model()
batch_size = 16
# this is the augmentation configuration we will use for training
train_datagen = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
zoom_range=0.2,
hori... | 3.21875 | 3 |
examples/custom_node.py | tomaszkurgan/sapling | 0 | 39321 | import uuid
import sapling
# create your own node by inheritance from sapling.Node
class MyNode(sapling.Node):
def __init__(self, name, data=None, id=None):
self.id = id or uuid.uuid4()
super(MyNode, self).__init__(name, data=data)
# There are two ways to force the sapling.Tree to use your node... | 3.625 | 4 |
lesson_06/Classwork_03.py | rotorypower/lessons | 0 | 39322 | """Написать функцию которая возвращают случайным образом одну карту из стандартной колоды в 36 карт,
где на первом месте номинал карты номинал (6 - 10, J, D, K, A),
а на втором название масти (Hearts, Diamonds, Clubs, Spades)."""
import random
"""faces = ["6", "7", "8", "9", "10", "J", "D", "K", "A"]
suits = ["Heart... | 4.21875 | 4 |
permon/frontend/native/__init__.py | bminixhofer/permon | 25 | 39323 | <reponame>bminixhofer/permon
import sys
import os
import logging
import signal
from permon.frontend import Monitor, MonitorApp
# these modules will be imported later because PySide2
# might not be installed
QtWidgets = None
QtGui = None
QtCore = None
QtQuick = None
Qt = None
MonitorModel = None
SettingsModel = None
... | 2.140625 | 2 |
experiments/ring_buffer.py | reip-project/reip-pipelines | 0 | 39324 | <gh_stars>0
from interface import *
import numpy as np
import copy
class Pointer:
def __init__(self, ring_size):
self.counter = 0
self.ring_size = ring_size
@property
def pos(self):
return self.counter % self.ring_size
@property
def loop(self):
return self.counter... | 2.421875 | 2 |
solvcon/tests/test_numpy.py | j8xixo12/solvcon | 16 | 39325 | # -*- coding: UTF-8 -*-
from unittest import TestCase
class TestNumpy(TestCase):
def test_dot(self):
from numpy import array, dot
A = array([[1,2],[3,4]], dtype='int32')
B = array([[5,6],[7,8]], dtype='int32')
R = array([[19,22],[43,50]], dtype='int32')
for val in (dot(A,B... | 2.90625 | 3 |
localized_fields/__init__.py | GabLeRoux/django-localized-fields | 0 | 39326 | <gh_stars>0
default_app_config = 'localized_fields.apps.LocalizedFieldsConfig'
| 1.09375 | 1 |
influxgraph/classes/tree.py | InfluxGraph/influxgraph | 97 | 39327 | # Copyright (C) [2015-2017] [Thomson Reuters LLC]
# Copyright (C) [2015-2017] [<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
# Unle... | 2.109375 | 2 |
agent/alembic/versions/d04cf726555d_create_pipeline_retries_table.py | anodot/daria | 16 | 39328 | """create pipeline_retries table
Revision ID: d04cf726555d
Revises: <PASSWORD>
Create Date: 2021-09-02 13:04:36.053768
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd04cf726555d'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgra... | 1.414063 | 1 |
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/animation/scatter.py | wdobbels/CAAPR | 7 | 39329 | <reponame>wdobbels/CAAPR<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# ******************************... | 2.234375 | 2 |
2409.py | ShawonBarman/URI-Online-judge-Ad-Hoc-level-problem-solution-in-python | 1 | 39330 | <gh_stars>1-10
a, b, c = map(int, input().split())
h, l = map(int, input().split())
if a <= h and b <= l:
print("S")
elif a <= h and c <= l:
print("S")
elif b <= h and a <= l:
print("S")
elif b <= h and c <= l:
print("S")
elif c <= h and a <= l:
print("S")
elif c <= h and b <= l:
pr... | 3.1875 | 3 |
tests/bitserv/test_channels.py | febuiles/two1-python | 0 | 39331 | <gh_stars>0
"""Tests for payment channel functionality."""
import time
import codecs
import pytest
import collections
import multiprocessing
import two1.bitcoin.utils as utils
from two1.bitcoin import Script, Hash
from two1.bitcoin import PrivateKey
from two1.bitcoin import Transaction, TransactionInput, TransactionOu... | 2.25 | 2 |
aiida/cmdline/groups/__init__.py | aiidateam/aiida_core | 153 | 39332 | <filename>aiida/cmdline/groups/__init__.py
# -*- coding: utf-8 -*-
"""Module with custom implementations of :class:`click.Group`."""
# AUTO-GENERATED
# yapf: disable
# pylint: disable=wildcard-import
from .dynamic import *
from .verdi import *
__all__ = (
'DynamicEntryPointCommandGroup',
'VerdiCommandGroup'... | 1.476563 | 1 |
templates/pythonScripts/ExtraMeeting.py | cameronosmith/webreg-to-google-calendar | 0 | 39333 | #class for meetings other than lecture
class ExtraMeeting:
def __init__(self):
self.type="TBA"
self.days="TBA"
self.time="TBA"
self.building="TBA"
self.room="TBA"
#self explanatory setter methods
def setType(self,type):
if type == 'DI':
self.type... | 3.609375 | 4 |
tests/module/module_orm_test.py | codacy-badger/graphit | 0 | 39334 | <reponame>codacy-badger/graphit
# -*- coding: utf-8 -*-
"""
file: module_graphorm_test.py
Unit tests for the Graph Object Relations Mapper (orm)
"""
import os
from unittest_baseclass import UnittestPythonCompatibility
from graphit.graph_io.io_tgf_format import read_tgf
from graphit.graph_orm import GraphORM
# OR... | 2.8125 | 3 |
naoqi-sdk-2.5.5.5-linux64/lib/python2.7/site-packages/ialbehavior.py | applejenny66/docker_pepper | 0 | 39335 | <gh_stars>0
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.11
#
# 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
if version_info >= (2,6,0):
def swig_import_helper():
from ... | 1.851563 | 2 |
src/storage-preview/azext_storage_preview/tests/latest/test_storage_file_scenarios.py | haroonf/azure-cli-extensions | 207 | 39336 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 2.09375 | 2 |
API/conftest.py | BahrmaLe/otus_python_homework | 1 | 39337 | """Fixtures for tests.py (Dogs API testing)"""
import pytest
import requests
URLS = ["https://dog.ceo/dog-api/",
"https://dog.ceo/api/breeds/list/all",
"https://dog.ceo/api/breeds/image/random",
"https://dog.ceo/api/breeds/image/random/3",
"https://dog.ceo/api/breed/hound/images",
... | 2.703125 | 3 |
incubator/kafka-connect/kafka-connect.py | CiscoM31/functions | 74 | 39338 | <filename>incubator/kafka-connect/kafka-connect.py
import json
import base64
from kubernetes import client, config
config.load_incluster_config()
v1=client.CoreV1Api()
#Get slack secret
for secrets in v1.list_secret_for_all_namespaces().items:
if secrets.metadata.name == 'slack':
token = base64.b64decode(... | 2.0625 | 2 |
Sentinel2_genAnalytics.py | silentassasin0111/pySatLib | 0 | 39339 | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
from __future__ import print_function
import numpy as np
import os
import argparse
import time
import pandas as pd
from termcolor import colored
from analytics.analyzer import Sentinel2Analyzer
parser = argparse.ArgumentParser(description='Sentinel 2 All band median anal... | 2.703125 | 3 |
clfzoo/instance.py | SeanLee97/clfzoo | 44 | 39340 | <gh_stars>10-100
# -*- coding: utf-8 -*-
import os
import pickle
from clfzoo.dataloader import DataLoader
from clfzoo.vocab import Vocab
class Instance(object):
def __init__(self, config, training=False):
self.logger = config.logger
self.dataloader = DataLoader(config)
if training:
... | 2.53125 | 3 |
fastapi-transformer-baseline/app/main.py | DeDeckerThomas/NLPiP | 3 | 39341 | <gh_stars>1-10
from fastapi import FastAPI
from routers.api_router import api_router
from core.config import settings
app: FastAPI = FastAPI(title=settings.APP_NAME)
app.include_router(api_router)
| 1.382813 | 1 |
girlfriend_project/apps.py | paressuex11/mysite | 0 | 39342 | <filename>girlfriend_project/apps.py
from django.apps import AppConfig
class GirlfriendProjectConfig(AppConfig):
name = 'girlfriend_project'
| 1.335938 | 1 |
home/migrations/0010_auto_20190604_1147.py | xni06/wagtail-CMS | 4 | 39343 | <filename>home/migrations/0010_auto_20190604_1147.py<gh_stars>1-10
# Generated by Django 2.1.8 on 2019-06-04 11:47
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0009_homepage_header'),
]
o... | 1.523438 | 2 |
evaluation/read_mat.py | JACKYLUO1991/DCBNet | 6 | 39344 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/9/16 13:23
# @Author : JackyLUO
# @E-mail : <EMAIL>
# @Site :
# @File : read_mat.py
# @Software: PyCharm
import pandas as pd
import scipy.io as scio
dataFile = "roc_curves/CUHKMED/roc_curve.mat"
data = scio.loadmat(dataFile)
fpr = data['fpr'][0... | 2.65625 | 3 |
src/clm/views/user/message.py | cc1-cloud/cc1 | 11 | 39345 | <reponame>cc1-cloud/cc1
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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 Licens... | 2.015625 | 2 |
src/Models/loss.py | HomerW/CSGNet | 0 | 39346 | <gh_stars>0
import torch
import torch.nn as nn
from torch.autograd import Variable
nllloss = nn.NLLLoss()
def losses_joint(out, labels, time_steps: int):
"""
Defines loss
:param out: output from the network
:param labels: Ground truth labels
:param time_steps: Length of the program
:return los... | 2.75 | 3 |
Curso/123.py | Rivelton/Python_Project1 | 0 | 39347 | <gh_stars>0
def funcao1 (a, b):
mult= a * b
return mult
def funcao2 (a, b):
divi = a / b
return divi
multiplicacao = funcao1(3, 2)
valor = funcao2(multiplicacao, 2)
print(multiplicacao)
print(int(valor))
| 3.15625 | 3 |
rl-ros-agents/scripts/training/train_dqn.py | FranklinBF/arena2D | 18 | 39348 | <reponame>FranklinBF/arena2D<gh_stars>10-100
import rospy
from stable_baselines.common.vec_env import SubprocVecEnv
from rl_ros_agents.env_wappers.arena2dEnv import get_arena_envs, Arena2dEnvWrapper
from rl_ros_agents.utils.callbacks import SaveOnBestTrainingRewardCallback
from rl_ros_agents.utils import getTimeStr
fro... | 1.796875 | 2 |
src/crud/user.py | JuanFKurucz/proyecto-seguridad | 0 | 39349 | import os
from datetime import datetime, timedelta
from src.database.models.user import User # noqa
from src.database.models.file import File # noqa
from src.database.session import db_session # noqa
from src.utils.hash import hash_pass
from sqlalchemy.orm.exc import NoResultFound
from src.utils.cipher import encr... | 2.484375 | 2 |
symbolic_functionals/syfes/symbolic/enhancement_factors_test.py | shaun95/google-research | 1 | 39350 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | 1.921875 | 2 |
tests/test_demo.py | nielsonf/hello_world | 0 | 39351 | import pytest
def test_cube():
from demo.demo import cube
assert cube(2) == 8
| 2.0625 | 2 |
orglearn/mind_map/backend/graphviz.py | MatejKastak/orglearn | 5 | 39352 | <filename>orglearn/mind_map/backend/graphviz.py
import colour
import graphviz
from orglearn.mind_map.backend.backend import Backend
class Graphviz(Backend):
def __init__(self, *args, **kwargs):
self.ignore_shallow_tags = set(kwargs.get("ignore_shallow_tags_list", []))
self.ignore_tags = set(kwargs... | 2.609375 | 3 |
parser/team17/Interprete/TYPE/type.py | webdev188/tytus | 35 | 39353 | <filename>parser/team17/Interprete/TYPE/type.py<gh_stars>10-100
from Interprete.NodoAST import NodoArbol
from Interprete.Tabla_de_simbolos import Tabla_de_simbolos
from Interprete.Arbol import Arbol
from Interprete.Valor.Valor import Valor
from Interprete.Primitivos.TIPO import TIPO
from Interprete.SELECT.indexador_aux... | 2.75 | 3 |
card_detection_module/nanodet/__init__.py | nhatnxn/ID_Passport-OCR | 1 | 39354 | <reponame>nhatnxn/ID_Passport-OCR
from .dectect import detect_card
__all__ = [detect_card] | 0.988281 | 1 |
backend/risks/tests/e2e/test_e2e.py | andrew-snek/project-x | 0 | 39355 | <filename>backend/risks/tests/e2e/test_e2e.py
from unittest.mock import patch # mocker.patch can't be a context manager
from django.contrib.auth import get_user_model
from django.db import DatabaseError
from rest_framework.test import APIClient
def test_e2e(transactional_db, field_type_data, abstract_risk_data, risk... | 2.5625 | 3 |
src/wl/resources/config.py | AlphaTechnolog/wl | 6 | 39356 | import json
from typing import Dict, TypeVar
from ..paths import config_dir_path, config_path
from ..cli.log import warn
V = TypeVar("V")
class Config:
def __init__(self):
self.options = [
'wallpapers_folder'
]
def check(self, create: bool=False):
if not config_dir_path.i... | 2.65625 | 3 |
ferris/core/retries.py | palladius/gae-ferris-ricc | 2 | 39357 | import functools
from time import sleep
import logging
def retries(max_tries, should_retry, delay=1, backoff=2):
"""
Decorator that implements exponential backoff retry logic. If you have
a function that may fail, this decorator can catch the exception and retry at
exponentially increasing intervals u... | 3.5 | 4 |
memory.py | wotmd5731/pytorch_dqn | 11 | 39358 | <filename>memory.py
# -*- coding: utf-8 -*-
import random
from collections import namedtuple
import torch
from torch.autograd import Variable
import numpy as np
class SumTree:
write = 0
def __init__(self, capacity):
self.capacity = capacity
self.tree = numpy.zeros( 2*capacity - 1 )
s... | 2.796875 | 3 |
plugins/lucid/ui/explorer.py | gaasedelen/lucid | 342 | 39359 | import ctypes
import ida_ida
import ida_funcs
import ida_graph
import ida_idaapi
import ida_kernwin
import ida_hexrays
from PyQt5 import QtWidgets, QtGui, QtCore, sip
from lucid.ui.sync import MicroCursorHighlight
from lucid.ui.subtree import MicroSubtreeView
from lucid.util.python import register_callback, notify_c... | 2.140625 | 2 |
tests/data/plain_old_module.py | danielcompton/mitogen | 0 | 39360 | <reponame>danielcompton/mitogen<filename>tests/data/plain_old_module.py
"""
I am a plain old module with no interesting dependencies or import machinery
fiddlery.
"""
import math
def get_sentinel_value():
# Some proof we're even talking to the mitogen-test Docker image
return open('/etc/sentinel').read()
d... | 1.265625 | 1 |
alipay/aop/api/domain/PaidOuterCardTemplateConfDTO.py | antopen/alipay-sdk-python-all | 0 | 39361 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.PaidOuterCardCycleSellConfDTO import PaidOuterCardCycleSellConfDTO
from alipay.aop.api.domain.PaidOuterCardManageUrlConfDTO import PaidOuterCardManageUrlConfDTO
from alipay.aop.api.... | 1.875 | 2 |
1441. Build an Array With Stack Operations.py | alijon30/Leetcode | 0 | 39362 | <gh_stars>0
You are given an array target and an integer n.
In each iteration, you will read a number from list = [1, 2, 3, ..., n].
Build the target array using the following operations:
"Push": Reads a new element from the beginning list, and pushes it in the array.
"Pop": Deletes the last element of the array.
If... | 4.125 | 4 |
third_party/libtcod/.ci/conan_build.py | csb6/libtcod-ada | 686 | 39363 | <reponame>csb6/libtcod-ada<filename>third_party/libtcod/.ci/conan_build.py<gh_stars>100-1000
#!/usr/bin/env python3
"""Build script for conan-package-tools:
https://github.com/conan-io/conan-package-tools
"""
import os
import subprocess
from cpt.packager import ConanMultiPackager
try:
version = subprocess.check_... | 1.78125 | 2 |
introduction-to-data-visualization-in-python/3. Statistical plots with Seaborn/script_11.py | nhutnamhcmus/datacamp-playground | 1 | 39364 | <reponame>nhutnamhcmus/datacamp-playground
# Plotting distributions pairwise (1)
# Print the first 5 rows of the DataFrame
print(auto.head())
# Plot the pairwise joint distributions from the DataFrame
sns.pairplot(auto)
# Display the plot
plt.show()
| 3.234375 | 3 |
terraform_model/model/SQSQueuePolicy.py | rubelw/terraform-validator | 7 | 39365 | <gh_stars>1-10
from __future__ import absolute_import, division, print_function
from terraform_model.model.ModelElement import ModelElement
class SQSQueuePolicy(ModelElement):
"""
SQS Queue Policy Model
"""
def __init__(self, cfn_model):
"""
Initialize
:param cfn_model:
... | 2.203125 | 2 |
import_pem_certificate/panos/pem_cert_import.py | silliker-paloaltonetworks/IdentitySkillets | 0 | 39366 | import requests
import argparse
import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)
parser = argparse.ArgumentParser()
parser.add_argument("--TARGET_IP", help="IP address of the firewall", type=str)
parser.add_argument("--api_key", help="Firewall API K... | 2.859375 | 3 |
day06/ftp_server.py | zhangyage/Python-oldboy | 1 | 39367 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
G:/temp 目录要提前创建一下,做为ftp的根目录
'''
import SocketServer
import os
class MyServer(SocketServer.BaseRequestHandler):
def handle(self):
base_path = 'G:/temp'
conn = self.request
print 'connected...'
while True:
pre_data = co... | 3.109375 | 3 |
built-in/ACL_PyTorch/Official/cv/STGCN_for_Pytorch/st_gcn_export.py | Ascend/modelzoo | 12 | 39368 | # ============================================================================
# Copyright 2018-2019 Open-MMLab. All rights reserved.
# Apache License
# Version 2.0, January 2004
# http://www.apache.org/licenses/
#
# TERMS AND CONDITI... | 1.617188 | 2 |
project-euler/solutions/015.py | ikumen/problems-solvers | 0 | 39369 | <filename>project-euler/solutions/015.py
#!/usr/bin/env python
'''
015.py: https://projecteuler.net/problem=15
Lattice paths
Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
How many such routes are there through... | 3.328125 | 3 |
allthingsnlp/ml_classifier.py | Pranavj94/All-things-NLP | 0 | 39370 | <gh_stars>0
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
from sklearn.model_selection import StratifiedKFold,train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import linear_model
from sklearn.metrics import precision_recall_fscore_sup... | 2.546875 | 3 |
project_common/tests/test_abc.py | KostyaEsmukov/airflow-docker | 0 | 39371 | <gh_stars>0
from contextlib import ExitStack
from typing import Any
from unittest.mock import patch
import click
import pendulum
import pytest
from airflow import DAG, configuration, macros
from click.testing import CliRunner
import project_common.abc
from project_common.abc import AirflowContext, AirflowTask, create... | 1.867188 | 2 |
word2vec.py | doc-doc/HQGA | 16 | 39372 | <gh_stars>10-100
from build_vocab import Vocabulary
from utils import *
import numpy as np
import random as rd
rd.seed(0)
def word2vec(vocab, glove_file, save_filename):
glove = load_file(glove_file)
word2vec = {}
for line in glove:
line = line.split(' ')
word2vec[line[0]] = np.array(line[1... | 2.625 | 3 |
src/msys_opt/modules/sql.py | willi-z/msys-opt | 0 | 39373 | from msys.core import Module,Connectable, Type
class SQL(Module):
def __init__(self):
super().__init__(inputs=[], outputs=[]) | 1.929688 | 2 |
Algorithms/5_Searching/11.py | abphilip-codes/Hackerrank_DSA | 1 | 39374 | <filename>Algorithms/5_Searching/11.py
# https://www.hackerrank.com/challenges/short-palindrome/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'shortPalindrome' function below.
#
# The function is expected to return an INTEGER.
# The function accepts STRING s as para... | 3.921875 | 4 |
efficientnet/border.py | kentslaney/efficientnet | 0 | 39375 | # fits better in a StyleGAN or small network implementation, but provides a good
# proof of concept (especially for things like fashion MNIST)
import tensorflow as tf
from .utils import Conv2D as SpecializedConv2D
def nslice(rank, dim):
start = tuple(slice(None) for i in range(dim))
end = tuple(slice(None) for... | 2.59375 | 3 |
post/views.py | Neknu/news-site | 0 | 39376 | from django.shortcuts import render, redirect
from django.urls import reverse
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from .models i... | 2.109375 | 2 |
src/neuro_comma/logger.py | Andhs/neuro-comma | 32 | 39377 | <gh_stars>10-100
def log_text(file_path, log):
if not log.endswith('\n'):
log += '\n'
print(log)
with open(file_path, 'a') as f:
f.write(log)
def log_args(file_path, args):
log = f"Args: {args}\n"
log_text(file_path, log)
def log_train_epoch(file_path, epoch, train_loss, train_a... | 2.8125 | 3 |
Image Classifier Project.py | Harish4948/Image-Classifier-using-Deep-Learning | 0 | 39378 | #!/usr/bin/env python
# coding: utf-8
# # Developing an AI application
#
# Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho... | 3.96875 | 4 |
70_question/linked_list/reverse_linked_list.py | alvinctk/google-tech-dev-guide | 26 | 39379 | class Node:
def __init__(self, value, next):
self.value = value
self.next = next
class LinkedList:
def __init__(self):
self.head = None
def add(self, value):
self.head = Node(value, self.head)
def remove(self):
to_remove = self.head
self.head = self.hea... | 3.96875 | 4 |
models/notification.py | tranquilitybase-io/tb-houston-service | 1 | 39380 | from config import db, ma
class Notification(db.Model):
__tablename__ = "notification"
__table_args__ = {"schema": "eagle_db"}
id = db.Column(db.Integer(), primary_key=True)
isActive = db.Column(db.Boolean())
lastUpdated = db.Column(db.String(20))
toUserId = db.Column(db.Integer(), db... | 2.375 | 2 |
Pequenos Projetos/Programa_TabelaIdade.py | HenriquePantaroto/Python-Projetos | 2 | 39381 | <gh_stars>1-10
lista = []
dicio = {}
idadeTot = 0
cont = 0
contMulher = 0
while True:
dicio['nome'] = str(input('Digite o nome: '))
while True:
dicio['sexo'] = str(input('Digite o sexo: [M/F] ')).upper()[0]
if dicio['sexo'] in 'MF':
break
else:
dicio['sexo'] = str... | 3.453125 | 3 |
plot_cov.py | translunar/lincov | 2 | 39382 | #!/usr/bin/env python3
from spiceypy import spiceypy as spice
from lincov.spice_loader import SpiceLoader
import pandas as pd
import numpy as np
from scipy.linalg import norm
from scipy.stats import chi2
import sys
import matplotlib
matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
from matplotlib.patches imp... | 2.046875 | 2 |
nn_redis_config/nn_redis.py | tseth92/NN_grpc_kube_deployment | 0 | 39383 | import redis
redis_db = redis.StrictRedis(host="nn-sq-svc", port=6379, db=0)
print(redis_db.keys())
redis_db.set('n_samples',100000)
redis_db.set('epochs', 150)
redis_db.set('batch_size', 1000)
redis_db.set('mid_range', 10)
| 1.65625 | 2 |
unittests/test_plot.py | red5alex/ifm_contrib | 0 | 39384 | import unittest
import ifm_contrib as ifm
from ifm import Enum
import numpy as np
import geopandas as gpd
import pandas as pd
class TestPlot(unittest.TestCase):
def test_faces(self):
ifm.forceLicense("Viewer")
self.doc = ifm.loadDocument(r".\models\example_2D.dac")
self.doc.c.plot.faces()
... | 2.328125 | 2 |
client.py | ashu20071/backdoor-shell | 0 | 39385 | <reponame>ashu20071/backdoor-shell
#!/usr/bin/python3
import requests;
import json;
import os;
import threading;
from sys import argv;
import time;
''' GLOBAL VARS '''
VICTIM = ["127.0.0.1",1337]; # (<ip_address>, <port_no.>)
''' FUNCTIONS '''
def menu():
choices = ["tunnel", "keylogger", "quit"];
print(" :: MENU ... | 2.59375 | 3 |
app.py | WiIIiamTang/logistic-map-encryption | 0 | 39386 | import os
import uuid
from werkzeug.utils import secure_filename
from pathlib import Path
import random
from flask import Flask, flash, request, redirect, url_for, render_template, jsonify
from flask_cors import CORS, cross_origin
import chaosencryptor.src.models
from PIL import Image
import json
DEBUG = False
dirp = ... | 2 | 2 |
rest_framework_push_notifications/serializers.py | incuna/rest-framework-push-notifications | 1 | 39387 | from push_notifications import models
from rest_framework.serializers import HyperlinkedModelSerializer
class APNSDevice(HyperlinkedModelSerializer):
class Meta:
fields = ('url', 'registration_id', 'name', 'device_id', 'active')
model = models.APNSDevice
class APNSDeviceUpdate(APNSDevice):
c... | 2.171875 | 2 |
galleries/admin.py | Ingabineza12/gallery-app | 1 | 39388 | <reponame>Ingabineza12/gallery-app<filename>galleries/admin.py
from django.contrib import admin
# Register your models here.
from .models import Photographer,Location,Image,Category
# Register your models here.
admin.site.register(Photographer)
admin.site.register(Location)
admin.site.register(Image)
admin.site.regis... | 1.390625 | 1 |
utils/prepare.py | Mehrad0711/HUBERT | 3 | 39389 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import os
from modules.model import BertForSequenceClassification_tpr
from utils.data_utils import convert_examples_to_features, logger
from transformers.file_utils import PYTORCH_PRETRAINED_BERT_... | 2.125 | 2 |
scripts/mnpr_system.py | semontesdeoca/MNPR | 218 | 39390 | """
@license: MIT
@repository: https://github.com/semontesdeoca/MNPR
_
_ __ ___ _ __ _ __ _ __ ___ _ _ ___| |_ ___ _ __ ___
| '_ ` _ \| '_ \| '_ \| '__| / __| | | / __| __/ _ \ '_ ` _ \
| | | | | | | | | |_) | | \__ \ |_| \__ \ || __/ | | | | ... | 2.046875 | 2 |
social_blog/blog_posts/forms.py | higorspinto/Social-Blog | 0 | 39391 | # blogs_posts/forms.py
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import DataRequired
class BlogPostForm(FlaskForm):
title = StringField("Title", validators=[DataRequired()])
text = TextAreaField("Text", validators=[DataRequired()])
... | 2.515625 | 3 |
python/dgl/contrib/data/__init__.py | ketyi/dgl | 9,516 | 39392 | <filename>python/dgl/contrib/data/__init__.py
from __future__ import absolute_import
from . import knowledge_graph as knwlgrh
def load_data(dataset, bfs_level=3, relabel=False):
if dataset in ['aifb', 'mutag', 'bgs', 'am']:
return knwlgrh.load_entity(dataset, bfs_level, relabel)
elif dataset in ['FB15k... | 2.296875 | 2 |
blog/migrations/0001_initial.py | ht-90/django-blog | 0 | 39393 | # Generated by Django 3.1.7 on 2021-02-26 08:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 1.898438 | 2 |
inference.py | CraigWang1/EfficientDet-1 | 0 | 39394 | from model import efficientdet
import cv2
import os
import numpy as np
import time
from utils import preprocess_image
from utils.anchors import anchors_for_shape
from utils.draw_boxes import draw_boxes
from utils.post_process_boxes import post_process_boxes
def main():
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
... | 2.140625 | 2 |
sklearn_pmml_model/svm/_base.py | iamDecode/sklearn-pmml-model | 62 | 39395 | <reponame>iamDecode/sklearn-pmml-model
# License: BSD 2-Clause
from sklearn_pmml_model.base import PMMLBaseRegressor, parse_array
import numpy as np
class PMMLBaseSVM:
"""
Abstract class for Support Vector Machines.
The PMML model consists out of a <SupportVectorMachineModel> element,
containing a <SupportV... | 2.546875 | 3 |
enaml/mpl_canvas.py | viz4biz/PyDataNYC2015 | 11 | 39396 | <filename>enaml/mpl_canvas.py
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------... | 2.25 | 2 |
evaluate/previous_works/svsyn/supervision/photometric.py | Syniez/Joint_360depth | 92 | 39397 | <filename>evaluate/previous_works/svsyn/supervision/photometric.py<gh_stars>10-100
import torch
from .ssim import *
class PhotometricLossParameters(object):
def __init__(self, alpha=0.85, l1_estimator='none',\
ssim_estimator='none', window=7, std=1.5, ssim_mode='gaussian'):
super(Photometri... | 1.804688 | 2 |
Python/waytoolong.py | pretam591/All_Program_helper | 16 | 39398 | # A. Way Too Long Words
# -------------------------------
# time limit per test1 second
# memory limit per test 256 megabytes
# input :standard input
# ... | 4.03125 | 4 |
stake-pool/py/stake/constants.py | wowswap-io/solana-program-library | 0 | 39399 | """Stake Program Constants."""
from solana.publickey import PublicKey
STAKE_PROGRAM_ID: PublicKey = PublicKey("Stake11111111111111111111111111111111111111")
"""Public key that identifies the Stake program."""
SYSVAR_STAKE_CONFIG_ID: PublicKey = PublicKey("StakeConfig11111111111111111111111111111111")
"""Public key t... | 1.710938 | 2 |