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 |
|---|---|---|---|---|---|---|
heat/engine/resources/neutron/floatingip.py | NeCTAR-RC/heat | 1 | 25700 | <gh_stars>1-10
#
# 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 in writin... | 2.03125 | 2 |
netgpibdata/netgpibcmd.py | daccordeon/summerSHG | 1 | 25701 | #! /usr/bin/env python
import sys
import optparse
import netgpib
# Usage text
usage = """usage: %prog [options] CMD
Issue a command or query from a network-connected GPIB device.
example:
%prog -i 192.168.113.105 -d AG4395A -a 10 'POIN?'"""
# Parse options
parser = optparse.OptionParser(usage=usage)
parser.add_opt... | 2.828125 | 3 |
microcosm_postgres/tests/test_toposort.py | globality-corp/microcosm-postgres | 2 | 25702 | <filename>microcosm_postgres/tests/test_toposort.py
"""
Test topological sort.
"""
from hamcrest import assert_that, contains
from microcosm_postgres.dag import Edge
from microcosm_postgres.toposort import toposorted
class Node:
def __init__(self, id):
self.id = id
def test_toposort():
nodes = dic... | 2.84375 | 3 |
examples/accessing_variables.py | Rory-Sullivan/yrlocationforecast | 13 | 25703 | <reponame>Rory-Sullivan/yrlocationforecast
"""An example of accessing individual forecast variables."""
from metno_locationforecast import Place, Forecast
USER_AGENT = "metno_locationforecast/1.0 https://github.com/Rory-Sullivan/yrlocationforecast"
new_york = Place("New York", 40.7, -74.0, 10)
new_york_forecast = Fo... | 3.609375 | 4 |
photometry/run_simulateFITS.py | aditya-sengupta/tesscomp-prototyping | 0 | 25704 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Command-line utility to simulate TESS FITS images for the photometry pipeline.
Structure inspired by `run_tessphot` by <NAME>.
.. codeauthor:: <NAME> <<EMAIL>>
"""
#import os
import argparse
#import logging
from simulation.simulateFITS import simulateFIT... | 2.421875 | 2 |
src/pythonScripts/DrivePart/download.py | sahilbest999/FVS-GIT-CLONE | 0 | 25705 | <reponame>sahilbest999/FVS-GIT-CLONE
import pickle
import os
import re
import io
import response
import upload
import authenticate
from googleapiclient.errors import HttpError
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import R... | 2.3125 | 2 |
MakeRelativePaths.py | Ccantey/ArcGIS-Scripting | 11 | 25706 | import arcpy, os
#walk through all subdirectories and change mxd to store relative paths
for root, dirs, files in os.walk(r"Q:\Geodata\shape"):
for f in files:
if f.endswith(".mxd"):
filepath = root + '\\' + f
print filepath
try:
... | 2.625 | 3 |
ind3.py | Nebula139/Sky3 | 0 | 25707 | <filename>ind3.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import math
if __name__ == '__main__':
a = input('Введите время: ')
t = 0
A = 1
V = int(int(a)/3)
if V == 0:
print('Ошибка')
else:
while t < int(a):
t = t + 3
A... | 3.859375 | 4 |
src/k8s-extension/azext_k8s_extension/custom.py | anagg929/azure-cli-extensions | 0 | 25708 | <reponame>anagg929/azure-cli-extensions<gh_stars>0
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------... | 1.625 | 2 |
settings.py | arakilian0/calcupy | 1 | 25709 | <reponame>arakilian0/calcupy
screen = {
"bg": "blue",
"rows": 0,
"columns": 0,
"columnspan": 4,
"padx": 5,
"pady": 5,
}
input = {
"bg": "blue",
"fg": "red",
"fs": "20px",
}
button = {
"bg": "blue",
"fg": "red",
"fs": "20px",
}
| 1.632813 | 2 |
pymcuprog/nvmpic.py | xthanhn/mcuprog | 1 | 25710 | """
PIC NVM implementation
"""
import os
import sys
from pyedbglib.util import binary
from pymcuprog import utils
from pymcuprog.nvm import NvmAccessProviderCmsisDapTool
from pymcuprog.pymcuprog_errors import PymcuprogNotSupportedError
from pymcuprog.deviceinfo.memorynames import MemoryNames
from pymcuprog.deviceinfo... | 2.0625 | 2 |
03-Simple-Neuron-Layer(Looping).py | KisanThapa/Neural-Networks-Scratch- | 0 | 25711 | <reponame>KisanThapa/Neural-Networks-Scratch-<filename>03-Simple-Neuron-Layer(Looping).py
# 3. Single layered 4 inputs and 3 outputs(Looping)
mInputs = [3, 4, 1, 2]
mWeights = [[0.2, -0.4, 0.6, 0.4],
[0.4, 0.3, -0.1, 0.8],
[0.7, 0.6, 0.3, -0.3]]
mBias1 = [3, 4, 2]
layer_output = []
for neur... | 3.28125 | 3 |
doubly_stochastic_dgp/layer_initializations.py | ayush29/Doubly-Stochastic-DGP | 126 | 25712 |
import tensorflow as tf
import numpy as np
from gpflow.params import DataHolder, Minibatch
from gpflow import autoflow, params_as_tensors, ParamList
from gpflow.models.model import Model
from gpflow.mean_functions import Identity, Linear
from gpflow.mean_functions import Zero
from gpflow.quadrature import mvhermgauss... | 1.90625 | 2 |
backend_django/login_api/serializers.py | oereo/cau-lion-server | 2 | 25713 | #2020-04-20 <NAME> created.
#serializer는 모두 ModelSerializer로 간단히 처리함
from rest_framework import serializers
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from .models import Profile
#Sign Up 회원가입
class UserSerializer(serializers.ModelSerializer):
class meta:
m... | 2.53125 | 3 |
menu_view.py | MCOxford/tile_miner | 0 | 25714 | <gh_stars>0
import arcade
import arcade.gui
from arcade.gui import UIManager
from constants import *
import os
dirname = os.path.dirname(__file__)
button_normal = arcade.load_texture(os.path.join(dirname, 'images/red_button_normal.png'))
hovered_texture = arcade.load_texture(os.path.join(dirname, 'images/red_button_ho... | 2.828125 | 3 |
Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/TypeInfo/FundamentalTypes/All.py | davidbrownell/v3-Common_Environment | 0 | 25715 | # ----------------------------------------------------------------------
# |
# | All.py
# |
# | <NAME> <<EMAIL>>
# | 2018-04-23 10:05:42
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-22.
# | Distributed under the Boost Software Lice... | 1.664063 | 2 |
train.py | runhani/person-classification | 0 | 25716 |
import os
import matplotlib.pyplot as plt
from keras import applications
from keras.preprocessing.image import ImageDataGenerator, load_img
from keras import optimizers
from keras.models import Sequential, Model, load_model
from keras.layers import Dropout, Flatten, Dense, MaxPooling2D
from keras.regularizers import ... | 2.625 | 3 |
custom_config.py | prise-3d/Thesis-NoiseDetection-rfe-attributes | 0 | 25717 | <gh_stars>0
from modules.config.attributes_config import *
# store all variables from global config
context_vars = vars()
# folders
logs_folder = 'logs'
backup_folder = 'backups'
## min_max_custom_folder = 'custom_norm'
## correlation_indices_folder ... | 1.515625 | 2 |
optable_submission/optable_package/optable/manipulations/target_encodings/hist_neighborhood_target_encoding.py | pfnet-research/KDD-Cup-AutoML-5 | 18 | 25718 | <filename>optable_submission/optable_package/optable/manipulations/target_encodings/hist_neighborhood_target_encoding.py
import numpy as np
from scipy import stats
from sklearn import metrics
from optable.synthesis import manipulation
from optable.synthesis import manipulation_candidate
from optable.dataset import fea... | 2.09375 | 2 |
PullVectorsFromSQLandRunSimilarity.py | aktivkohle/youtube-curation | 4 | 25719 | import sys
sys.path.append('../')
import config
import pymysql.cursors
import pandas as pd
import numpy as np
from scipy import io as scipyio
from tempfile import SpooledTemporaryFile
from scipy.sparse import vstack as vstack_sparse_matrices
# Function to reassemble the p matrix from the vectors
def reconstitute_vect... | 2.578125 | 3 |
core/views.py | lcs-amorim/OPE-EasyParty | 0 | 25720 | from django.shortcuts import render, redirect , HttpResponseRedirect, get_object_or_404
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm
from django.views.generic import View, TemplateView, CreateView, UpdateView
from ... | 2.109375 | 2 |
adminlte_log/tests.py | beastbikes/django-only-admin | 32 | 25721 | from django.contrib.auth.models import User
from django.test import TestCase
from adminlte_log.models import AdminlteLogType, AdminlteLog
class AdminlteLogTest(TestCase):
def setUp(self):
AdminlteLogType.objects.create(name='test', code='test')
self.user = User.objects.create_user(username='boha... | 2.359375 | 2 |
pygmt/tests/test_text.py | tawandamoyo/pygmt | 0 | 25722 | <reponame>tawandamoyo/pygmt
# pylint: disable=redefined-outer-name
"""
Tests text.
"""
import os
import numpy as np
import pytest
from pygmt import Figure
from pygmt.exceptions import GMTCLibError, GMTInvalidInput
from pygmt.helpers import GMTTempFile
from pygmt.helpers.testing import check_figures_equal
TEST_DATA_DI... | 2.296875 | 2 |
Python/count-primes.py | xtt129/LeetCode | 2 | 25723 | <reponame>xtt129/LeetCode
# Time: O(n)
# Space: O(n)
# Description:
#
# Count the number of prime numbers less than a non-negative number, n
#
# Hint: The number n could be in the order of 100,000 to 5,000,000.
#
from math import sqrt
class Solution:
# @param {integer} n
# @return {integer}
def countPrim... | 3.65625 | 4 |
src/mds/api/signals.py | rryan/sana.mds | 0 | 25724 | <filename>src/mds/api/signals.py<gh_stars>0
'''
Created on Aug 11, 2012
:author: Sana Development Team
:version: 2.0
'''
from django.dispatch import Signal
class ExternalDispatch(Signal):
""" Simple dispatching signal. The superclass providing_args are a
'dispatcher' key and 'data' dictionary.
"""
... | 2.296875 | 2 |
word2vec.py | SilhouettesForYou/Word2vec | 1 | 25725 | from __future__ import print_function
import math
import tensorflow as tf
from sklearn.manifold import TSNE
from word2vec_input import *
from word2vec_plot import *
dataset_path = 'dataset/'
dataset = 'text8.zip'
vocabulary_size = 50000
batch_size = 128
embedding_size = 128
skip_window = 1
num_skips = 2
num_sampled =... | 2.734375 | 3 |
citeyoursoftware/main.py | rodluger/citeyoursoftware | 3 | 25726 | <reponame>rodluger/citeyoursoftware
from .packages import get_packages
from .pypi import get_pypi_bib
def get_bibliography(
env_file="environment.yml", env_path=None, exclude=["python"]
):
# Get all user-listed packages w/ channels & exact versions
packages = get_packages(env_file=env_file, env_path=None... | 2.71875 | 3 |
Exercises/folhaDePagamento.py | JeffersonOliveira/Exercises--OO2-with-Python3 | 0 | 25727 | class FolhaDePagamento:
@staticmethod
def log():
return f'Isso é um log qualquer.'
#folha = FolhaDePagamento()
#print(folha.log())
print(FolhaDePagamento.log()) | 2.859375 | 3 |
pytorch-edu/torch_learning.py | kedaduck/Python-Projects | 0 | 25728 | import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
print("Python Version:", torch.__version__)
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1,... | 3.140625 | 3 |
utils.py | aimir-lab/hebbian-learning-cnn | 18 | 25729 | <gh_stars>10-100
import os
import csv
import matplotlib.pyplot as plt
import torch
import params as P
# Compute the shape of the output of the convolutional layers of a network. This is useful to correctly set the size of
# successive FC layers
def get_conv_output_shape(net):
training = net.training
net.eval()
# ... | 3.109375 | 3 |
Chapter 01/Chap01_Example1.92.py | Anancha/Programming-Techniques-using-Python | 0 | 25730 | # reading 2 numbers from the keyboard and printing maximum value
r = int(input("Enter the first number: "))
s = int(input("Enter the second number: "))
x = r if r>s else s
print(x)
| 4.125 | 4 |
training/model.py | jim-schwoebel/allie | 87 | 25731 | '''
AAA lllllll lllllll iiii
A:::A l:::::l l:::::l i::::i
A:::::A l:::::l l:::::l iiii
A:::::::A l:::::l l:::::l
... | 2.3125 | 2 |
migrations/versions/a2c88ed3a94a_.py | crossgovernmentservices/csd_notes | 0 | 25732 | """empty message
Revision ID: <PASSWORD>
Revises: None
Create Date: 2016-04-27 16:54:34.185442
"""
# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
... | 1.867188 | 2 |
opus/opus_server.py | chezecz/research-project | 0 | 25733 | <filename>opus/opus_server.py
import asyncio
import zlib
import queue
import threading
import audioop
from google.cloud import speech
from opuslib import Decoder
from config.config import Config
from config.config import Server
from config.config import Opus
buffer = queue.Queue()
buffer_response = queue.Queue()
de... | 2.65625 | 3 |
Artesian/_Query/VersionedQuery.py | ARKlab/Artesian.SDK-Python | 2 | 25734 | <gh_stars>1-10
from Artesian._Query.Query import _Query
from Artesian._Query.QueryParameters.VersionedQueryParameters import VersionedQueryParameters
from Artesian._Query.Config.ExtractionRangeConfig import ExtractionRangeConfig
from Artesian._Query.Config.VersionSelectionType import VersionSelectionType
from Artesian.... | 1.914063 | 2 |
start.py | JoshuaMcroberts/DeliveryDilemmaLite | 0 | 25735 | from libraries import *
from text import *
from game import *
from reception import recep
# DISPLAY HELP TEXT
def help_text():
clear_screen()
print_tab("Help text will go here!")
# DISPLAY ABOUT TEXT
def cred_text():
clear_screen()
print_tab(pr_colour("l_green","-- CREDITS --"))
print_tab("Intro ... | 3.203125 | 3 |
apps/store/urls.py | Quanfita/QTechCode | 0 | 25736 | <reponame>Quanfita/QTechCode
# -*- coding: utf-8 -*-
from django.urls import path
# from .views import goview
from .views import IndexView, DetailView, PayView, CallbackView, DeliverView
urlpatterns = [
path('', IndexView.as_view(), name='index'), # 主页,自然排序
path('goods/<slug:slug>/', DetailView.as_view(), nam... | 1.53125 | 2 |
day3/test_crossed_wires_part2.py | capsulecorplab/adventofcode2019 | 0 | 25737 | from crossed_wires import FuelManagementSystem
import pytest
class Test1:
@pytest.fixture
def fms(self):
return FuelManagementSystem("R8,U5,L5,D3", "U7,R6,D4,L4")
def test_steps_combined_min(self, fms):
assert fms.steps_combined_min() == 30
class Test2:
@pytest.fixture
def fms(s... | 2.1875 | 2 |
pomdp.py | gongjue/pocm | 0 | 25738 | import numpy as np
import cvxpy as cvx
import util
def set_contains_array(S, a):
"""
:param S: list of np.ndarray
:param a: np.ndarray
:return: contains, 0 or 1
"""
contains = 0
for b in S:
if not (a - b).any(): # if a contained in S
contains = 1
return contains
... | 3.15625 | 3 |
main.py | bernatfogarasi/lempel-ziv-compression | 0 | 25739 | def main():
STRING = "aababbabbaaba"
compressed = compress(STRING)
print(compressed)
decompressed = decompress(compressed)
print(decompressed)
def compress(string):
encode = {} # string -> code
known = ""
count = 0
result = []
for letter in string:
if known + letter in... | 3.796875 | 4 |
scripts/process_gh_mapping.py | ptrebert/reference-data | 0 | 25740 | #!/usr/bin/env python
# coding=utf-8
import os as os
import sys as sys
import traceback as trb
import argparse as argp
import csv as csv
import functools as fnt
import collections as col
import multiprocessing as mp
import numpy as np
import pandas as pd
import intervaltree as ivt
def parse_command_line():
"""
... | 2.546875 | 3 |
tests/test_save_load.py | dev-rinchin/RePlay | 63 | 25741 | <filename>tests/test_save_load.py
# pylint: disable-all
from os.path import dirname, join
import pytest
import pandas as pd
from implicit.als import AlternatingLeastSquares
from pyspark.sql import functions as sf
import replay
from replay.model_handler import save, load
from replay.models import *
from tests.utils i... | 2.15625 | 2 |
scripts/total_damage.py | Masanori-Suzu1024/mypkg | 0 | 25742 | #!/usr/bin/env python3
# BSD 3-Clause "New" or "Revised" License
# Copyright (c) 2021, Masanori-Suzu1024 RyuichiUeda
# All rights reserved.
# Genshin is a copyrighted work of miHoYo co., Ltd
import rospy
from std_msgs.msg import Int32
n = 0
def cb(message):
global n
n = message.data
if __name__== '__mai... | 2.28125 | 2 |
download-deveres/para-execicios-curso-em-video/exe046.py | Hugo-Oliveira-RDO11/meus-deveres | 0 | 25743 | <gh_stars>0
from time import sleep
for c in range(10, -1, -1):
print(c)
sleep(1)
print('BOMMMMMMMMM\nE ANO NOVO!!!')
| 2.5625 | 3 |
sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/credential.py | iscai-msft/azure-sdk-for-python | 8 | 25744 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 1.734375 | 2 |
prime/postrefine/mod_partiality.py | rimmartin/cctbx_project | 0 | 25745 | <gh_stars>0
from __future__ import division
from cctbx.array_family import flex
from scitbx.matrix import sqr, col
from cctbx.crystal_orientation import crystal_orientation, basis_type
import math
import numpy as np
class partiality_handler(object):
"""
mod_partiality:
1. Calculate partiality for given
miller ... | 1.984375 | 2 |
python/large-class/1_extract-class.py | mario21ic/refactoring-guru | 1 | 25746 | <filename>python/large-class/1_extract-class.py
# When one class does the work of two, awkwardness results.
class Person:
def __init__(self, name, office_area_code, office_number):
self.name = name
self.office_area_code = office_area_code
self.office_number = office_number
def tel... | 3.5 | 4 |
utils.py | btq/Seph_scrape | 1 | 25747 | <gh_stars>1-10
'''
every module in the system must use the following import:
from utils import log
'''
import os
import sys
import re
import logging
from subprocess import Popen, PIPE
from configparser import ConfigParser
#log_format = '%(asctime)s %(levelname)-8s [%(filename)s,%(lineno)d] %(message)s'
#logging.basi... | 2.53125 | 3 |
pcompile/tests/test_items.py | cb01/pcompile | 1 | 25748 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from pcompile.items import NameRegistry, Items, min_container_type
from pcompile.tests.test_context import TestContext
from pcompile import ureg
import json
from pcompile.solution import Solution
class TestNameRegistry(unittest.TestCase):
... | 2.484375 | 2 |
SC101/SC101_week2/zonegraphics.py | ariel98po/SC101-projects | 0 | 25749 | from campy.graphics.gwindow import GWindow
from campy.graphics.gobjects import GOval, GRect
from campy.gui.events.mouse import onmouseclicked
import random
WINDOW_WIDTH = 600
WINDOW_HEIGHT = 400
ZONE_WIDTH = 100
ZONE_HEIGHT = 100
BALL_RADIUS = 15
MAX_SPEED = 6
MIN_Y_SPEED = 2
class ZoneGraphics:
def __init__(se... | 3.1875 | 3 |
database_replication/python/mock_ripper.py | ryland-e-atkins/complexa | 0 | 25750 | <reponame>ryland-e-atkins/complexa
# This module is used to combine and remove duplicates from raw mockaroo data
from subprocess import call
from util import *
# def generateCleanFiles():
# """
# DEPRECATED
# """
# filePrefix = 'mockaroo/mock_data_raw/'
# fileNames = [
# filePre... | 2.75 | 3 |
eval/scripts/__init__.py | mbatchkarov/dc_evaluation | 0 | 25751 | <reponame>mbatchkarov/dc_evaluation
__author__ = 'mmb28'
import sys
sys.path.append('.')
sys.path.append('..')
sys.path.append('../..') | 1.390625 | 1 |
LeetcodeAlgorithms/598. Range Addition II/range-addition-ii.py | Fenghuapiao/PyLeetcode | 3 | 25752 | class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops: List[List[int]]
:rtype: int
"""
return reduce(operator.mul, map(min, zip(*ops + [[m,n]])))
| 2.421875 | 2 |
test/test3.py | v-smwang/AI-NLP-Tutorial | 0 | 25753 | # -*- coding: utf-8 -*-
# @author : wanglei
# @date : 2021/2/19 1:47 PM
# @description :
import numpy as np
"""
感应器对象
"""
class Perceptron(object):
"""
该方法为感应器的初始化方法
eta:学习速率
n_iter:学习次数(迭代次数)
"""
def __init__(self, eta=0.01, n_iter=10):
self.eta = eta
self.n_iter = n_iter
... | 3.265625 | 3 |
python/depthcharge/arch/arm.py | youssefms/depthcharge | 0 | 25754 | # SPDX-License-Identifier: BSD-3-Clause
# Depthcharge: <https://github.com/nccgroup/depthcharge>
"""
ARM 32-bit support
"""
import os
import re
from .arch import Architecture
class ARM(Architecture):
"""
ARMv7 (or earlier) target information - 32-bit little-endian
"""
_desc = 'ARM 32-bit, little-end... | 2 | 2 |
server/ffstore/ErrorInfo.py | AsherYang/ThreeLine | 1 | 25755 | <filename>server/ffstore/ErrorInfo.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
class OpenError(StandardError):
def __init__(self, error_code, error, error_info):
self.error_code = error_code
self.error = error
self.error_info = error_info
StandardError.__init__(self, error)
d... | 2.484375 | 2 |
gdpr_search.py | thebirdsbeak/gdpr_search | 0 | 25756 | <gh_stars>0
import requests
import json
def search_article(search_art, j):
''' Searches GDPR by Article number '''
for line in j:
if search_art == line['article']:
print("\n{}({})\n{}".format(line['article'], line['num'], line['text']))
def search_text(search_term, j):
''' Search... | 3.5 | 4 |
191225/Python/solution.py | ktaletsk/daily-problem | 1 | 25757 | from collections import defaultdict
import copy
def get_next(current, d, finish):
flag=False
if len(d[current])==1:
if d[current][0]==finish and len(d.keys())==1:
flag= True
else:
new_d = copy.deepcopy(d)
new_current = d[current][0]
new_d.pop(cur... | 3.546875 | 4 |
QtQmlViewport/Viewport.py | maxlem/pioneer.common.gui | 0 | 25758 | <reponame>maxlem/pioneer.common.gui
from QtQmlViewport import InFboRenderer, utils, Product, CustomActors
from QtQmlViewport.Actors import Actors, Renderable
from QtQmlViewport.Camera import Camera
from QtQmlViewport.Geometry import Geometry, BVH
from PyQt5.QtQuick import QQuickFramebufferObject
from PyQt5.QtGui impor... | 1.945313 | 2 |
examples/example_utils.py | rmorshea/purly | 2 | 25759 | import os
def localhost(protocol, port=8000):
"""Returns the host URL.
When examples are running on mybinder.org this is not simply "localhost" or
"127.0.0.1". Instead we use ``nbserverproxy`` whose proxy is used instead.
"""
if 'JUPYTERHUB_OAUTH_CALLBACK_URL' in os.environ:
protocol += '... | 2.546875 | 3 |
pyroomacoustics/experimental/__init__.py | oleg-alexandrov/pyroomacoustics | 1 | 25760 | """
Experimental
============
A bunch of routines useful when doing measurements and experiments.
"""
__all__ = [
"measure_ir",
"physics",
"point_cloud",
"delay_calibration",
"deconvolution",
"localization",
"signals",
"rt60",
]
from .deconvolution import *
from .delay_calibration imp... | 1.148438 | 1 |
tekstovni_vmesnik.py | tjazerzen/Vislice-vaje2021 | 0 | 25761 | import model
def izpis_igre(igra):
return (
f"Igraš igro vislic:\n" +
f"Narobe ugibane črke so: {igra.nepravilni_ugibi()}\n" +
f"Trenutno stanje besede: {igra.pravilni_del_gesla()}\n"
)
def izpis_poraza(igra):
return (
f"Izgubil si. Več sreče prihodnjič.\n" +
f"Naro... | 2.5625 | 3 |
seoaudit/__main__.py | Guber/seoaudit | 7 | 25762 | <filename>seoaudit/__main__.py
import argparse
from seoaudit.analyzer.site_parser import SiteParser, LXMLPageParser
from seoaudit.analyzer.seo_auditor import SEOAuditor
def main():
"""The main routine."""
parser = argparse.ArgumentParser(description='Run SEO checks on a set of urls')
parser.add_argument... | 2.90625 | 3 |
.circleci/scripts/chlogger.py | hackaugusto/scenario-player | 0 | 25763 | <filename>.circleci/scripts/chlogger.py
import pathlib
import re
import subprocess
from typing import List, Tuple
from constants import PROJECT_GIT_DIR, CURRENT_BRANCH, COMMIT_PATTERN, COMMIT_TYPE
def read_git_commit_history_since_tag(
tag
) -> Tuple[List[Tuple[str, str]], List[Tuple[str, str]], List[Tup... | 2.53125 | 3 |
bayesian_deep_learning/libs/distribution_shift_generator.py | mandt-lab/variational-beam-search | 1 | 25764 | <filename>bayesian_deep_learning/libs/distribution_shift_generator.py
import struct
import sys
import pickle
import abc
import gzip
from copy import deepcopy
import numpy as np
import cv2
from albumentations import ShiftScaleRotate, ElasticTransform, HorizontalFlip
from albumentations import VerticalFlip, Compose
# if... | 2.25 | 2 |
Pre-Interview Challenges/camelcase.py | Wryhder/solve-with-code | 0 | 25765 | # Andela
"""
Problem Statement:
Write a function called camelCase that takes a string containing a Python-like variable name,
e.g. is_prime and turns it into the corresponding Java-like camel-case variable name, i.e. isPrime.
"""
def camelCase(python_var_name):
"""
This function takes a string containing a... | 3.90625 | 4 |
neighborapp/models.py | Maureen-1998DEV/watch_Hood | 0 | 25766 |
from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
# Create your models here.
class Neighborhood(models.Model):
name = models.CharField(max_length = 50)
location = models.ForeignKey('Location',on_delete = models.CASCADE,null = True)
admin ... | 2.390625 | 2 |
oidc_provider/migrations/0029_auto_20190606_1218.py | omunozn/django-oidc-provider | 2 | 25767 | <reponame>omunozn/django-oidc-provider<gh_stars>1-10
# Generated by Django 2.2.2 on 2019-06-06 12:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oidc_provider', '0028_auto_20190502_1654'),
]
operations = [
migrations.AddField(
... | 1.695313 | 2 |
infra/lib/functions/hitcounter/update/adapters.py | haandol/aws-observability-example | 0 | 25768 | from abc import ABC, abstractmethod
from typing import Protocol, Callable
from aws_lambda_powertools import Tracer
tracer = Tracer()
class UpdateTable(Protocol):
update_item: Callable
class UpdateAdapter(ABC):
@abstractmethod
def update(self, path: str) -> int:
"""return hitCount for the given ... | 2.84375 | 3 |
lib/textwin.py | tomjackbear/python-0.9.1 | 4 | 25769 | # Module 'textwin'
# Text windows, a subclass of gwin
import stdwin
import stdwinsupport
import gwin
S = stdwinsupport # Shorthand
def fixsize(w):
docwidth, docheight = w.text.getrect()[1]
winheight = w.getwinsize()[1]
if winheight > docheight: docheight = winheight
... | 2.71875 | 3 |
src/main/py/nlp_insights/nlp/acd/acd_to_fhir/confidence.py | LinuxForHealth/nlp-insights | 0 | 25770 | <reponame>LinuxForHealth/nlp-insights
# Copyright 2021 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 2.265625 | 2 |
dassh/correlations/flowsplit_ctd.py | khurrumsaleem/dassh | 11 | 25771 | ########################################################################
# Copyright 2021, UChicago Argonne, LLC
#
# Licensed under the BSD-3 License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a
# copy of the License at
#
# https://opensource.org/licenses/BSD-... | 1.953125 | 2 |
nexthop_summary.py | dalekirkman1/SecureCRT-tools | 2 | 25772 | # $language = "python"
# $interface = "1.0"
# ################################################ SCRIPT INFO ###################################################
# Author: <NAME>
# Email: <EMAIL>
#
# This script will grab the route table information from a Cisco IOS or NXOS device and export details about each
# ne... | 2.3125 | 2 |
find_str_in_dump_bin.py | jasonivey/scripts | 0 | 25773 | #!/usr/bin/env python
import os
import sys
import re
import fnmatch
import subprocess
import tempfile
import Utils
def GetFiles(dir, filePattern):
paths = []
for root, dirs, files in os.walk(dir):
for file in files:
if fnmatch.fnmatch(os.path.join(root, file), filePattern):
... | 2.640625 | 3 |
bracex/__main__.py | moreati/bracex | 0 | 25774 | """
Expands a bash-style brace expression, and outputs each expansion.
Licensed under MIT
Copyright (c) 2018 - 2020 <NAME> <<EMAIL>>
Copyright (c) 2021 <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... | 3.125 | 3 |
libs/ALICE/parsing_ALICE.py | EGI-Foundation/impact-report | 0 | 25775 | #!/usr/bin/env python3
import csv
import os
import requests
from bs4 import BeautifulSoup
from dateutil.parser import parse
def print_details(url, csv_filename, years):
"""
Parsing the scientific publications from the web site and
export the list in a CSV file
"""
item_year = item_journal = ite... | 3.640625 | 4 |
ohlc.py | liam-e/wsb-tracker | 1 | 25776 | <gh_stars>1-10
#!/usr/bin/env python3
import datetime as dt
import os
import sys
import matplotlib as mpl
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import numpy as np
from matplotlib import style
from mplfinance.original_flavor import candlestick_ohlc
import... | 2.328125 | 2 |
grapaold/layerfiles/gcomgraphand2.py | psorus/grapa | 0 | 25777 | <filename>grapaold/layerfiles/gcomgraphand2.py<gh_stars>0
import numpy as np
import math
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer,Dense, Activation
import tensorflow.keras as keras# as k
import tensorflow as t
from tensorflow.keras.models import Sequential
from tensorflow.ker... | 2.34375 | 2 |
rl/meta_ppo_agent.py | clvrai/coordination | 33 | 25778 | import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from rl.dataset import ReplayBuffer, RandomSampler
from rl.base_agent import BaseAgent
from rl.policies.mlp_actor_critic import MlpActor, MlpCritic
from util.logger import logger
from util.mpi import mpi_average
from util.pytorch import ... | 1.8125 | 2 |
article/tests.py | AngleMAXIN/nomooc | 1 | 25779 |
# Create your tests here.
from article.db_manager.article_manager import create_article_db
from utils.api.tests import APIClient, APITestCase
from utils.constants import ArticleTypeChoice
from utils.shortcuts import rand_str
def mock_create_article(title=None, content=None, art_type=None, owner_id=None):
title =... | 2.515625 | 3 |
util/geometry.py | c-ali/boomgan | 3 | 25780 | <reponame>c-ali/boomgan
import numpy as np
def orthogonalize(normal, non_ortho):
h = normal * non_ortho
return non_ortho - normal * h
def make_orthonormal_vector(normal, dims=512):
# random unit vector
rand_dir = np.random.randn(dims)
# make orthonormal
result = orthogonalize(normal, rand_di... | 3.375 | 3 |
services/models.py | hanaahajj/Serviceinfo_hanaa | 0 | 25781 | <filename>services/models.py
from collections import defaultdict
from django.conf import settings
from django.contrib.gis.db import models
from django.contrib.gis.geos import Point
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.urlresolvers import revers... | 1.992188 | 2 |
accounts/models.py | barissaslan/eventhub | 4 | 25782 | from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
from event.models import Event
class UserManager(BaseUserManager):
def create_user(self, email, password=None):
if not email:
raise ValueError('Users must have an email address')
user... | 2.5 | 2 |
tracer/test.py | leopiney/tscf | 0 | 25783 | <filename>tracer/test.py
import numpy as np
from scipy.optimize import linear_sum_assignment
np.random.seed(0)
c = np.random.rand(128, 128)
row_ind, col_ind = linear_sum_assignment(c)
| 2.078125 | 2 |
Exercicios/matriz.py | beatrizflorenccio/Projects-Python | 1 | 25784 | #MaBe
matriz = [[0, 0, 0], [0, 0, 0,], [0, 0, 0]]
for l in range(0, 3):
for c in range(0,3):
matriz[l][c] = int(input(f'Digite o valor da posição {(c, l)}: '))
for obj in range(0, 3):
for i in range(0, 3):
print(f'[{matriz[obj][i]}]', end=' ')
print()
| 3.953125 | 4 |
iminuit/__init__.py | danielbrener/iminuit | 1 | 25785 | """MINUIT from Python - Fitting like a boss
Basic usage example::
from iminuit import Minuit
def f(x, y, z):
return (x - 2) ** 2 + (y - 3) ** 2 + (z - 4) ** 2
m = Minuit(f)
m.migrad()
print(m.values) # {'x': 2,'y': 3,'z': 4}
print(m.errors) # {'x': 1,'y': 1,'z': 1}
Further informati... | 2.921875 | 3 |
opendata_module/opmon_opendata/api/postgresql_manager.py | nordic-institute/X-Road-Metrics | 2 | 25786 | <filename>opendata_module/opmon_opendata/api/postgresql_manager.py<gh_stars>1-10
# The MIT License
# Copyright (c) 2021- Nordic Institute for Interoperability Solutions (NIIS)
# Copyright (c) 2017-2020 Estonian Information System Authority (RIA)
#
# Permission is hereby granted, free of charge, to any person obtain... | 1.734375 | 2 |
koapy/backtrader/KrxHistoricalDailyPriceDataFromSQLite.py | resoliwan/koapy | 1 | 25787 | import pandas as pd
from backtrader import TimeFrame, date2num
from sqlalchemy import create_engine, inspect
from tqdm import tqdm
from koapy.backtrader.SQLiteData import SQLiteData
from koapy.utils.data.KrxHistoricalDailyPriceDataForBacktestLoader import (
KrxHistoricalDailyPriceDataForBacktestLoader,
)
class ... | 2.328125 | 2 |
cid/parser/pre_processing.py | zeljko-bal/CID | 1 | 25788 | from textx.exceptions import TextXSemanticError
from cid.parser.model import ParameterCliValue, BoolWithPositivePattern
from cid.common.utils import get_cli_pattern_count, is_iterable, element_type
# ------------------------------- HELPER FUNCTIONS -------------------------------
def contains_duplicate_names(lst):... | 2.21875 | 2 |
jsfuzz/fuzzer/grammarinator_deps/ECMAScriptUnparser.py | gustavopinto/entente | 5 | 25789 | <filename>jsfuzz/fuzzer/grammarinator_deps/ECMAScriptUnparser.py
# Generated by Grammarinator 17.7
from itertools import chain
from grammarinator.runtime import *
import ECMAScriptUnlexer
class ECMAScriptUnparser(Grammarinator):
def __init__(self, unlexer):
super(ECMAScriptUnparser, self).__init__()
... | 2.453125 | 2 |
ml-scripts/transform-to-numpy.py | thejoeejoee/SUI-MIT-VUT-2020-2021 | 0 | 25790 | <filename>ml-scripts/transform-to-numpy.py
#!/usr/bin/env python3
# Project: VUT FIT SUI Project - Dice Wars
# Authors:
# - <NAME> <<EMAIL>>
# - <NAME> <<EMAIL>>
# - <NAME> <<EMAIL>>
# - <NAME> <<EMAIL>>
# Year: 2020
# Description: Transforms game configurations into a numpy array.
import os
impo... | 2.203125 | 2 |
facegram/profiles/serializers/v1/serializers.py | mabdullahadeel/facegram | 1 | 25791 | from django.db.models import fields
from rest_framework import serializers
from facegram.profiles.models import Profile
from facegram.users.api.serializers import UserSerializer
class RetrieveUserProfileSerializerV1(serializers.ModelSerializer):
user = UserSerializer(read_only=True)
class Meta:
model ... | 2.171875 | 2 |
exampleMain.py | marcoprenassi/medical_informatics_examples | 0 | 25792 | <reponame>marcoprenassi/medical_informatics_examples
import UMLS_Api_search_example as UAex
if __name__ == '__main__':
UAex.runExample("[INSERT API HERE]")
| 1.414063 | 1 |
oms_cms/backend/api/v2/socialaccount/views.py | RomanYarovoi/oms_cms | 18 | 25793 | from rest_framework import generics, permissions
from rest_framework import filters as filters_rf
from django_filters import rest_framework as filters
from allauth.socialaccount.models import SocialAccount, SocialApp, SocialToken
from .serializers import SocialAppSerializer, SocialAppExtendedSerializer, SocialAccountS... | 1.929688 | 2 |
biosimulators_test_suite/test_case/cli.py | Ryannjordan/Biosimulators_test_suite | 0 | 25794 | <reponame>Ryannjordan/Biosimulators_test_suite
""" Methods for test cases involving checking command-line interfaces
:Author: <NAME> <<EMAIL>>
:Date: 2020-12-21
:Copyright: 2020, Center for Reproducible Biomedical Modeling
:License: MIT
"""
from ..data_model import TestCase
from ..warnings import TestCaseWarning
from... | 2.296875 | 2 |
akimous/editor.py | akimous/akimous | 12 | 25795 | <reponame>akimous/akimous<gh_stars>10-100
import json
import shlex
import sys
from asyncio import (CancelledError, create_subprocess_shell, create_task,
subprocess)
from collections import namedtuple
from functools import partial
from importlib import resources
from pathlib import Path
import jedi... | 1.695313 | 2 |
user_interface/run_tests/test3/files_for_dakota/mycode.py | ukaea/ALC_UQ | 2 | 25796 | import numpy as np
import xarray as xr
import exceptions
from dakota_file import DakotaFile
my_netcdf = DakotaFile()
filename = 'DAKOTA.nc'
my_netcdf.read(filename)
variable_dict1 = my_netcdf.get_variable_as_dict('test_scan1')
variable_dict2 = my_netcdf.get_variable_as_dict('test_scan2')
variable_dict3 = my_netcdf.g... | 2.46875 | 2 |
jvd/capa/data.py | ccDev-Labs/JARV1S-Disassembler | 0 | 25797 | from collections import defaultdict
from jvd.normalizer.syntax import get_definition
import sys
from jvd.utils import AttrDict
class DataUnit:
def __init__(self, json_obj, file_path):
super().__init__()
with open(file_path, "rb") as f:
self.fbytes = f.read()
self.obj = AttrDic... | 2.453125 | 2 |
anchore/anchore_policy.py | berez23/anchore | 401 | 25798 | import os
import json
import re
import sys
import logging
import hashlib
import uuid
import jsonschema
import tempfile
import controller
import anchore_utils
import anchore_auth
from anchore.util import contexts
_logger = logging.getLogger(__name__)
default_policy_version = '1_0'
default_whitelist_version = '1_0'
de... | 2.15625 | 2 |
config.py | tdaff/automation | 1 | 25799 | #!/usr/bin/env python
"""
configuration for faps
Provides the Options class that will transparently handle the different option
sources through the .get() method. Pulls in defaults, site and job options plus
command line customisation. Instantiating Options will set up the logging for
the particular job.
"""
__all_... | 2.5 | 2 |