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 |
|---|---|---|---|---|---|---|
cli/setup.py | Stanford-IoT-Lab/thingengine-platform-cloud | 63 | 43000 | import setuptools
setuptools.setup(
name="almond-cloud-cli",
version="0.0.0",
author="<NAME>",
author_email="<EMAIL>",
description="Command Line Interface (CLI) for Almond Cloud development and deployment",
url="https://github.com/stanford-oval/almond-cloud",
packages=setuptools.find_packag... | 1.171875 | 1 |
sydler/data/db_connection.py | mikiTesf/Sydler-py | 0 | 43001 | from os import path, environ, makedirs
from peewee import SqliteDatabase
CACHE_FOLDER_NAME = '.sydler'
DB_FILE_NAME = 'member.db'
# create the cache folder before connecting to the data store
path_to_db = path.join(environ.get('HOME'), CACHE_FOLDER_NAME)
makedirs(path_to_db, exist_ok=True)
# create and connect to data... | 3.140625 | 3 |
scoreengine/checks/ssh.py | ubnetdef/scoreengine2 | 3 | 43002 | import paramiko
import time
from . import check_function, config
# DEFAULTS
ssh_config = {
'timeout': 10,
}
# /DEFAULTS
# CONFIG
if 'ssh' in config['checks']:
ssh_config.update(config['checks']['ssh'])
# /CONFIG
@check_function('Establish an SSH connection and execute a basic command')
def check_connect(c... | 2.453125 | 2 |
src/main.py | JeyKip/autoinfo-scrapper | 0 | 43003 | import os
from dotenv import dotenv_values
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from twisted.internet.defer import inlineCallbacks
from autoinfo.cookie import CookieProvider
from autoinfo.data.mongo import MongoConnector, MongoConnectionSettings, MongoMakerSt... | 2.0625 | 2 |
setup.py | JoshPiper/Python-InterWorkshop | 0 | 43004 | <gh_stars>0
from setuptools import setup
setup(
name='InterWorkshop',
version='1.0.0.dev1',
packages=['gmad', 'workshop'],
url='doctor-internet.dev',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description='A Python binding for the Steam Workshop API',
install_requires=[... | 1.265625 | 1 |
test/test_cfg/test_table.py | wannaphong/pycfg | 8 | 43005 | <filename>test/test_cfg/test_table.py
from cfg.table import *
from read_grammar import *
from glob import glob
import unittest
def get_test_cases(folder):
return map(read_test_case, sorted(glob('../test/test_cfg/' + folder + '/*')))
table_test_cases = get_test_cases('tables')
grammar_test_cases = get_test_cases('... | 2.546875 | 3 |
ratbag/parser.py | whot/ratbag-python | 6 | 43006 | #!/usr/bin/env python3
#
# SPDX-License-Identifier: MIT
#
# This file is formatted with Python Black
"""
A Parser helper function to convert a byte array to a Python object and the
other way around. The conversion is specified in a list of :class:`Spec`
instances, for example:
>>> data = bytes(range(16))
>>> ... | 3.25 | 3 |
balsam/launcher/mpi_ensemble.py | Larofeticus/balsam | 0 | 43007 | '''mpi4py wrapper that allows an ensemble of serial applications to run in
parallel across ranks on the computing resource'''
import argparse
from collections import defaultdict
import os
import sys
import logging
import random
from subprocess import Popen, STDOUT, TimeoutExpired
import shlex
import signal
import time
... | 2.09375 | 2 |
{{cookiecutter.project}}/{{cookiecutter.project_slug}}/__init__.py | jhinAza/python-flask-microservice-template | 2 | 43008 | from flask import Flask
from {{cookiecutter.project_slug}}.{{cookiecutter.project_slug}}_root import {{cookiecutter.project_slug}}
__author__ = """{{cookiecutter.mantainer_name}}"""
__email__ = '{{cookiecutter.mantainer_email}}'
__version__ = '0.1.0'
def create_app():
app = Flask(__name__)
app.register_bluep... | 1.921875 | 2 |
ForFinance/Examples/Video2_SimulatingTrades.py | enriqueescobar-askida/Kinito.Finance | 2 | 43009 | <reponame>enriqueescobar-askida/Kinito.Finance
import pandas as pd
import numpy as np
import yfinance as yf
import datetime as dt
from pandas_datareader import data as pdr
yf.pdr_override()
stock=input("Enter a stock ticker symbol: ")
print(stock)
startyear=2018
startmonth=1
startday=1
start=dt.datetime(startyear,s... | 3.046875 | 3 |
poppler_wrap/pop.py | dannguyen/poppler_wrap | 0 | 43010 | <gh_stars>0
import subprocess as sb
class Pop():
def __init__(self, command, *params, stdout_type=sb.PIPE):
self.command = command
self.name = self.command
self.params = params
# self.output_path = output_path # this should be removed at somepoint
self.stdout_type = stdout_ty... | 2.6875 | 3 |
dialogs/treasure.py | tonningp/pirate-game | 0 | 43011 | <filename>dialogs/treasure.py
#!/usr/bin/env python3
from PyQt5.QtWidgets import (
QDialog, QPushButton,
QHBoxLayout, QVBoxLayout,
QLabel
)
class Dialog(QDialog):
def __init__(self, parent):
super(Dialog, self).__init__(parent)
self.parent = parent
self.setupUi()
... | 3.015625 | 3 |
image-editor/data_editor/image/image_view.py | flegac/deep-experiments | 0 | 43012 | <reponame>flegac/deep-experiments
import tkinter as tk
import rx.operators as ops
from PIL import ImageTk, Image
from rx.subject import Subject
from data_editor.image.view_controller import ViewController
from data_toolbox.data.data_source import DataSource
from data_toolbox.image.buffer_factory import ImageFactory
... | 2.328125 | 2 |
perplexity_lenses/perplexity_lenses/visualization.py | raineydavid/data_tooling | 0 | 43013 | import numpy as np
from bokeh.models import ColumnDataSource, HoverTool
from bokeh.palettes import Cividis256 as Pallete
from bokeh.plotting import Figure, figure
from bokeh.transform import factor_cmap
def draw_interactive_scatter_plot(
texts: np.ndarray,
xs: np.ndarray,
ys: np.ndarray,
values: np.nd... | 2.859375 | 3 |
LeetCode/October 2020 Leetcoding Challenge/Bag of Tokens.py | UtkarshPathrabe/Competitive-Coding | 13 | 43014 | <reponame>UtkarshPathrabe/Competitive-Coding<gh_stars>10-100
class Solution:
def bagOfTokensScore(self, tokens: List[int], P: int) -> int:
tokens.sort()
tokens, maxScore, currentScore = deque(tokens), 0, 0
while tokens and (P >= tokens[0] or currentScore):
while tokens and P >= t... | 2.859375 | 3 |
Chapter_3/try_3.2.py | charliealpha094/Python_Crash_Course_2nd_edition | 0 | 43015 | #Done by <NAME> on 12/06/2020
"""
Start with the list you used in Exercise 3-1, but instead of just
printing each person’s name, print a message to them. The text of each mes-
sage should be the same, but each message should be personalized with the
person’s name.
"""
friends = ['Rita', 'Catarina', 'Emilia', 'Patríci... | 4 | 4 |
analysis/drift_velocity/plots.py | lconaboy/seren3 | 1 | 43016 | def plot_power_spectra(kbins, deltab_2, deltac_2, deltac_2_nodeconv, tf, ax=None):
'''
Plot density and velocity power spectra and compare with CAMB
'''
import numpy as np
import matplotlib.pylab as plt
from seren3.cosmology.transfer_function import TF
if ax is None:
ax = plt.gca()
... | 2.5 | 2 |
scripts/Ours/stage1_train_GAN.py | IamWangYunKai/DG-TrajGen | 31 | 43017 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '../../'))
import os
import random
import argparse
from datetime import datetime
import matplotlib.pyplot as plt
plt.rcParams.update({'figure.max_open_warning': 0})
import torch
impor... | 2.015625 | 2 |
tools/dockerize/webportal/usr/share/openstack-dashboard/openstack_dashboard/backend.py | foruy/openflow-multiopenstack | 1 | 43018 | import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from keystoneclient import exceptions as keystone_exceptions
from .exceptions import KeystoneAuthException
from .user import Token
from .user import AuthUser
from .utils import get_keystone_client
from .utils impor... | 2.0625 | 2 |
src/ham/util/path_manager.py | n2qzshce/ham_radio_sync | 8 | 43019 | import os
class PathManager:
input_folder_label = None
output_folder_label = None
_input_folder_path = None
_output_folder_path = None
_import_file_path = None
_import_file_style = None
@classmethod
def set_input_folder_label(cls, label):
cls.input_folder_label = label
@classmethod
def set_output_folder... | 2.828125 | 3 |
examples/getting_started/example_simulation.py | lvayssac/bioptim | 0 | 43020 | <reponame>lvayssac/bioptim<gh_stars>0
"""
The first part of this example of a single shooting simulation from initial guesses.
It is NOT an optimal control program. It is merely the simulation of values, that is applying the dynamics.
The main goal of this kind of simulation is to get a sens of the initial guesses pass... | 3.390625 | 3 |
website/addons/dropbox/views.py | sf2ne/Playground | 0 | 43021 | """Views fo the node settings page."""
# -*- coding: utf-8 -*-
import logging
import httplib as http
from dropbox.rest import ErrorResponse
from dropbox.client import DropboxClient
from urllib3.exceptions import MaxRetryError
from framework.exceptions import HTTPError
from website.addons.dropbox.serializer import Dro... | 2.328125 | 2 |
django_twilio/settings.py | km-pg/django-twilio | 0 | 43022 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
"""
django_twilio specific settings.
"""
from .utils import discover_twilio_credentials
TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN = discover_twilio_credentials()
| 1.515625 | 2 |
2013/QualificationRound/problem1.py | radeinla/fbhackercup | 0 | 43023 |
def is_black(x):
return x == '#'
def is_square(box, N):
size = None
fbj1 = None
fbj2 = None
fbi1 = None
fbi2 = None
blank = "."*N
for i in xrange(0, N):
for j in xrange(0, N):
if fbj1 is None or fbj2 is None:
if is_black(box[i][j]):
... | 3.484375 | 3 |
lib/framework/CAISO/tool_utils.py | joollnl/ISO-DART | 13 | 43024 | <reponame>joollnl/ISO-DART<filename>lib/framework/CAISO/tool_utils.py
import requests
import xml.etree.ElementTree as ET
import csv
import zipfile
import pdb
import io
import os
import datetime
import time
import pandas as pd
import sys
URL = 'http://oasis.caiso.com/oasisapi/SingleZip'
QUERY_DATE_FORMAT = '%Y%m%dT%H:%... | 2.671875 | 3 |
container-applications/classified/app.py | emerginganalytics/ualr-cyber-gym | 3 | 43025 | <reponame>emerginganalytics/ualr-cyber-gym
import base64
import onetimepass
import os
from flask import abort, Flask, redirect
from flask_bootstrap import Bootstrap
from flask_login import LoginManager, UserMixin
from flask_sqlalchemy import SQLAlchemy
from globals import ds_client
from werkzeug.security import check_p... | 2.15625 | 2 |
blog/migrations/0001_initial.py | alireza-fm/MySite | 0 | 43026 | <filename>blog/migrations/0001_initial.py<gh_stars>0
# Generated by Django 3.1.2 on 2021-04-12 09:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 1.976563 | 2 |
nevergrad/functions/photonics/test_core.py | xavierzw/nevergrad | 0 | 43027 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
from unittest.mock import patch
import numpy as np
from ...common import testing
from . import co... | 2.15625 | 2 |
pointnet/dataset.py | Taeuk-Jang/pointcompletion | 0 | 43028 | <filename>pointnet/dataset.py<gh_stars>0
import torch.utils.data as data
import os
import os.path
#from plyfile import PlyData, PlyElement
from plyfile import PlyData
import numpy as np
def load_ply(file_name, with_faces=False, with_color=False):
ply_data = PlyData.read(file_name)
points = ply_data['verte... | 2.21875 | 2 |
e3nn/o3/tensor_product.py | SuperXiang/e3nn | 1 | 43029 | from math import sqrt
from collections import namedtuple
import torch
from e3nn import o3
from e3nn.util import eval_code
def _prod(x):
out = 1
for a in x:
out *= a
return out
class TensorProduct(torch.nn.Module):
r"""Tensor Product with parametrizable paths
Parameters
----------
... | 3.15625 | 3 |
hundo/unite_classifier.py | colinbrislawn/hundo | 0 | 43030 | import functools
from itertools import zip_longest
from Bio import Phylo
def memoize(func):
cache = func.cache = {}
@functools.wraps(func)
def memoized_func(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in cache:
cache[key] = func(*args, **kwargs)
return ... | 2.953125 | 3 |
src-simulator/simulation.py | cake-lab/CremeBrulee | 2 | 43031 | #!env python
import collections
import queue
import logging
import enum
import functools
import json
import time
import os
import gzip
import shutil
import random # ONLY USED FOR RANDOM DELAY AT BEGINNING.
import numpy as np
import argparse
import sys
sys.path.append("../src-testbed")
import events
import common
imp... | 2.484375 | 2 |
scripts/script_utils/github.py | uktrade/data-hub-api-actions-test | 0 | 43032 | <reponame>uktrade/data-hub-api-actions-test<gh_stars>0
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
class GitHubAPIClient:
def __init__(self, token):
_transport = RequestsHTTPTransport(
url='https://api.github.com/graphql',
use_json=True,
... | 2.453125 | 2 |
linux_plex_updater/api/PlexClient.py | amickael/Linux-Plex-Updater | 0 | 43033 | <filename>linux_plex_updater/api/PlexClient.py
import os
import uuid
import logging
import requests
import linux_plex_updater
class PlexClient:
def __init__(
self, username: str, password: str, host: str, port: int,
):
self.identifier = uuid.uuid4()
self.username = username
s... | 2.90625 | 3 |
2020/02/day02.py | GeoffRiley/AdventOfCode | 2 | 43034 | <filename>2020/02/day02.py<gh_stars>1-10
from typing import Tuple
def process_line(line: str) -> Tuple[int, int, str, str]:
parts, pwd = line.split(':')
rng, letter = parts.split()
lo, hi = map(int, rng.split('-'))
return lo, hi, letter, pwd
def verify_passwords_part1(text: str) -> int:
password... | 3.78125 | 4 |
gdal/perftests/overview.py | jpapadakis/gdal | 3,100 | 43035 | <reponame>jpapadakis/gdal<filename>gdal/perftests/overview.py
# SPDX-License-Identifier: MIT
# Copyright 2020 <NAME>
from osgeo import gdal
import time
def doit(compress, threads):
gdal.SetConfigOption('GDAL_NUM_THREADS', str(threads))
filename = '/vsimem/test.tif'
ds = gdal.GetDriverByName('GTiff').Cre... | 2 | 2 |
py/send_w_receive.py | bdambrosio/rfm69 | 0 | 43036 | <gh_stars>0
#!/usr/bin/env python3
from RFM69 import Radio, FREQ_915MHZ
import datetime
import time
import RPi.GPIO as GPIO
from icecream import ic
import logging
network_id = 61
node_id = 1
is_rfm_69HW = True
try:
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
handler = lo... | 2.546875 | 3 |
ps4rp/dirs.py | kingcreek/ps4-remote-play | 10 | 43037 | # Copyright (c) 2018, <NAME> <<EMAIL>>
# SPDX-License-Identifier: Apache-2.0
"""
Utility module to locate filesystem directories relevant to ps4rp. Conforms to
the XDG spec on Linux. MacOS and Windows support are TODO.
"""
import functools
from xdg import BaseDirectory
_XDG_RESOURCE = 'ps4-remote-play'
@functools.... | 2.015625 | 2 |
MovieRecommendation.py | Sk70249/Movie-Recommender-pro | 5 | 43038 | <gh_stars>1-10
# Python3 code for Movie Recommender pro
# Recommendation based on emotion.
# Import library for web scrapping.
from bs4 import BeautifulSoup as SOUP
import re
import requests as HTTP
# Main Function for scraping
def main(emotion):
# IMDb Url for Comedy Drama genre of
# movie against emotion Sa... | 3.453125 | 3 |
src/core/repository/file/__init__.py | lucassaporetti/car-rental | 1 | 43039 | # _*_ coding: utf-8 _*_
#
# Package: src.core.repository.file
__all__ = [
"car_repository",
"customer_repository",
"employee_repository",
"file_db",
"file_repository",
"rental_repository"
]
| 0.984375 | 1 |
solutions/014_longest_common_prefix.py | abawchen/leetcode | 0 | 43040 | # Write a function to find the longest common prefix string amongst an array of strings.
class Solution:
# @param {string[]} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
lcp = ""
base = strs[0]
for i in range(len(base)):
... | 3.4375 | 3 |
web/web/domain/models/__init__.py | michelangelo-prog/wishlist | 0 | 43041 | <gh_stars>0
# web/models/__init__.py
| 1.078125 | 1 |
app/launcher.py | bcheng004/reddit-recommender | 1 | 43042 | import os, confuse
config = confuse.Configuration('RecLauncher')
config.set_file('config-st.yaml')
server_port = config['streamlit']['server_port'].get()
os.system(f"streamlit run app.py --server.port {server_port}") | 2.03125 | 2 |
meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py | prakhya/luv_sai | 16 | 43043 | <reponame>prakhya/luv_sai
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.decorators import testcase
import re
import os
import sys
import logging
class Gummiboot(oeSelfTest):
def _common_setup(self):
"""
Common setup ... | 2.0625 | 2 |
tgchatbot/launch.py | osmr/tgchatbot | 1 | 43044 | <gh_stars>1-10
"""
Telegram AI chatbot launcher.
"""
__all__ = ['launch_chatbot']
import argparse
import logging
from aiogram import executor
from .telegram_ai_chatbot import TelegramAiChatbot
def launch_chatbot():
"""
Telegram AI chatbot launch script.
"""
parser = argparse.ArgumentParser(
... | 2.265625 | 2 |
apps/website/models/comments.py | shubham-thakare/tech-blog | 0 | 43045 | from django.db import models
from apps.website.models.article import Article
STATUS_CHOICES = (
("SH", "Show"),
("HD", "Hide"),
)
class Comments(models.Model):
article = models.ForeignKey(Article, on_delete=models.CASCADE)
name = models.CharField(max_length=50, null=False)
email = models.CharFie... | 2.1875 | 2 |
scrollExample.py | pavitsu/pavit-bank-reconciliation | 7 | 43046 | <reponame>pavitsu/pavit-bank-reconciliation<gh_stars>1-10
import Tkinter as tk
class App:
def __init__(self):
self.root=tk.Tk()
self.vsb = tk.Scrollbar(orient="vertical", command=self.OnVsb)
self.lb1 = tk.Listbox(self.root, yscrollcommand=self.vsb.set)
self.lb2 = tk.Listbox(self.ro... | 3.125 | 3 |
projection_layer_CSPN.py | briqr/CSPN | 17 | 43047 | # the simplex projection algorithm implemented as a layer, while using the saliency maps to obtain object size estimates
import sys
sys.path.insert(0,'/home/briq/libs/caffe/python')
import caffe
import random
import numpy as np
import scipy.misc
import imageio
import cv2
import scipy.ndimage as nd
import os.path
import... | 2.59375 | 3 |
finpack/fx_lstm.py | esvhd/pytorch_play | 0 | 43048 | import torch
import torch.nn as nn
from torch.autograd import Variable
import sklearn.preprocessing as skp
import data_util as du
import training
class FXLSTM(nn.Module):
def __init__(self, input_dim, hidden_size, num_layers, output_seq_len,
bias=True, dropout=0,
batch_first=F... | 2.609375 | 3 |
tests/test_base.py | asteven/python-consul | 0 | 43049 | import collections
from contextlib import contextmanager
import json
import os
import pytest
import consul.base
CB = consul.base.CB
Response = consul.base.Response
Request = collections.namedtuple(
'Request', ['method', 'path', 'params', 'data'])
class HTTPClient(object):
def __init__(self, base_uri, ver... | 2.1875 | 2 |
SearchForDividingCircle/__init__.py | Alladin9393/Search-For-Dividing-Circle | 0 | 43050 | """Perceptron."""
| 1.117188 | 1 |
src/model/JPPNet.py | quangostudio/fastapi | 0 | 43051 | '''
This file implements JPP-Net for human parsing and pose detection.
'''
import tensorflow as tf
import os
from tensorflow.python.framework import graph_util
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from tensorflow.python.platform import gfile
import time
class JPP(object):
... | 2.515625 | 3 |
src/cogs/core/core.py | vcokltfre/Zeek | 0 | 43052 | <filename>src/cogs/core/core.py
from datetime import datetime
from os import getenv
from discord import Message, RawMessageDeleteEvent
from discord.ext import commands
from src.internal.bot import Bot
class Core(commands.Cog):
"""Core metric collection."""
def __init__(self, bot: Bot):
self.bot = b... | 2.375 | 2 |
nodeconductor/core/routers.py | p-p-m/nodeconductor | 0 | 43053 | <reponame>p-p-m/nodeconductor
from operator import itemgetter
from django.core.urlresolvers import NoReverseMatch
from django.utils.datastructures import SortedDict
from rest_framework import views
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.routers impo... | 2.234375 | 2 |
tests/test_current_environment.py | encukou/arca | 6 | 43054 | import itertools
import subprocess
import sys
import pytest
from arca import Arca, Task, CurrentEnvironmentBackend
from arca.utils import logger
from arca.exceptions import BuildError
from common import BASE_DIR, RETURN_COLORAMA_VERSION_FUNCTION, SECOND_RETURN_STR_FUNCTION, TEST_UNICODE
def _pip_action(action, pack... | 2.078125 | 2 |
tests/perf_test/mind_expression_perf/generate_report.py | PowerOlive/mindspore | 3,200 | 43055 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 2.265625 | 2 |
Python3/32.longest-valid-parentheses.py | 610yilingliu/leetcode | 0 | 43056 | #
# @lc app=leetcode id=32 lang=python3
#
# [32] Longest Valid Parentheses
#
# @lc code=start
class Solution:
def longestValidParentheses(self, s):
if not s:
return 0
l = 0
r = len(s)
while s[r - 1] == '(' and r > 0:
r -= 1
while s[l] == ')' and l < r... | 3.28125 | 3 |
webserver/server.py | stklik/PlantMultiController | 0 | 43057 | <filename>webserver/server.py
from webserver.devices import devices_blueprint
from webserver.scheduler import scheduler_blueprint
from flask import Flask
from jinja2 import Environment, PackageLoader, select_autoescape
app = Flask(__name__)
app.register_blueprint(devices_blueprint, url_prefix='/devices')
app.register_... | 2.109375 | 2 |
isyntax2raw/cli/__init__.py | kkoz/isyntax2raw | 6 | 43058 | <gh_stars>1-10
# encoding: utf-8
#
# Copyright (c) 2017 <NAME>, Inc. All rights reserved.
#
# This software is distributed under the terms described by the LICENCE file
# you can find at the root of the distribution bundle.
# If the file is missing please request a copy by contacting
# <EMAIL>.
| 0.964844 | 1 |
geomproc/impsurf.py | WorleyD/Manifold-Model-Mesh-Shape | 0 | 43059 | #
# GeomProc: geometry processing library in python + numpy
#
# Copyright (c) 2008-2021 <NAME> <<EMAIL>>
# under the MIT License.
#
# See file LICENSE.txt for details on the copyright license.
#
"""This module contains the implicit function class of the GeomProc
geometry processing library used for defining implicit fu... | 3.421875 | 3 |
cluster_qc/data.py | romeroqe/cluster_qc | 3 | 43060 | import os
import csv
import subprocess
import matplotlib.pyplot as plt
from math import ceil
from tqdm import tqdm
from pandas import read_csv
from netCDF4 import Dataset, num2date
from multiprocessing import cpu_count, Process
from .plot import plot_filtered_profiles_data
def download_data(files, storage_path):
... | 2.421875 | 2 |
tests/test_engines.py | whitegreyblack/Spaceship | 1 | 43061 | from bearlibterminal import terminal as term
from spaceship.engine import Engine
from spaceship.menus.main import Main
def test_engine_init():
e = Engine()
assert isinstance(e.scene, Main)
def test_engine_run():
e = Engine()
e.run()
if __name__ == "__main__":
test_engine_run() | 1.90625 | 2 |
src/models/__init__.py | andrew-chang-dewitt/hoops-api | 0 | 43062 | """Data model objects."""
from .account import (
AccountChanges,
AccountIn,
AccountModel,
AccountNew,
AccountOut,
)
from .balance import (
Balance,
BalanceModel
)
from .envelope import (
EnvelopeChanges,
EnvelopeIn,
EnvelopeModel,
EnvelopeNew,
EnvelopeOut,
)
from .transa... | 1.414063 | 1 |
letterparser/generate.py | elifesciences/decision-letter-parser | 0 | 43063 | # coding=utf-8
import os
import re
from collections import OrderedDict
from xml.dom import minidom
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement
from letterparser import build, parse, utils, zip_lib
# max level of recursion adding content blocks supported
MAX_LEVEL = 5
def... | 2.703125 | 3 |
src/template_specialize/__main__.py | joshuahlang/template-specialize | 0 | 43064 | <reponame>joshuahlang/template-specialize
# Licensed under the MIT License
# https://github.com/craigahobbs/template-specialize/blob/master/LICENSE
from .main import main
if __name__ == '__main__':
main() # pragma: no cover
| 0.625 | 1 |
autoremovetorrents/torrent.py | Nuevo009/autoremove-torrents | 0 | 43065 | #-*- coding:utf-8 -*-
from .compatibility.urlparse_ import urlparse_
from .util.convertbytes import convert_bytes
from .util.convertseconds import convert_seconds
from .util.convertspeed import convert_speed
from .util.converttimestamp import convert_timestamp
class Torrent(object):
def __init__(self):
# ... | 2.453125 | 2 |
scripts/tf1_export_segmetnation.py | LaudateCorpus1/edgeai-modelzoo | 5 | 43066 | # Copyright (c) 2018-2021, Texas Instruments
# All Rights Reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions... | 1.117188 | 1 |
Model_Free_L2O/L2O-Swarm/src/loss.py | JohnZ03/Open-L2O | 112 | 43067 | import pickle
import numpy as np
import matplotlib.pyplot as plt
with open('./quadratic/eval_record.pickle','rb') as loss:
data = pickle.load(loss)
print('Mat_record',len(data['Mat_record']))
#print('bias',data['inter_gradient_record'])
#print('constant',data['intra_record'])
with open('./quadratic/evaluate_reco... | 2.828125 | 3 |
workspace/tools/data_maker_multi_plane.py | AshKelly/PyAutoLens | 0 | 43068 | <filename>workspace/tools/data_maker_multi_plane.py
from autolens.data import ccd
from autolens.data.array import grids
from autolens.lens import ray_tracing
from autolens.model.galaxy import galaxy as g
from autolens.model.profiles import light_profiles as lp
from autolens.model.profiles import mass_profiles as mp
fro... | 2.75 | 3 |
tools/similarity.py | bruinxiong/gnerf | 137 | 43069 | <reponame>bruinxiong/gnerf
import torch
from kornia.losses import ssim as dssim
from lpips_pytorch import LPIPS
lpips_fn = LPIPS(net_type='alex', version='0.1')
lpips_fn.eval()
def mse(image_pred, image_gt, valid_mask=None, reduction='mean'):
value = (image_pred - image_gt) ** 2
if valid_mask is not None:
... | 1.960938 | 2 |
cfc_app/bill_detail.py | ephyle/Legit-Info | 44 | 43070 | <filename>cfc_app/bill_detail.py<gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Bill details for extract_files
Written by <NAME>, IBM, 2020
Licensed under Apache 2.0, see LICENSE for details
"""
# System imports
import datetime as DT
import logging
import re
import sys
from urllib.parse import url... | 2.28125 | 2 |
crawler_exercises/login_and_post_douban.py | Andrewpqc/Python_Ex | 0 | 43071 | <reponame>Andrewpqc/Python_Ex
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
driver=webdriver.Phant... | 2.828125 | 3 |
Backend/Common/GenPCCToBase.py | Errare-humanum-est/HeteroGen | 1 | 43072 | <reponame>Errare-humanum-est/HeteroGen
# Copyright (c) 2021. <NAME>
# Copyright (c) 2021. University of Edinburgh
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of sourc... | 1.484375 | 1 |
angel/__init__.py | GiulioRossetti/ANGEL | 3 | 43073 | <filename>angel/__init__.py
from angel.alg.iAngel import Angel
from angel.alg.iArchAngel import ArchAngel
| 1.125 | 1 |
setup.py | DSAutomations/py-parsehub | 40 | 43074 | <reponame>DSAutomations/py-parsehub<filename>setup.py<gh_stars>10-100
from setuptools import find_packages, setup
setup(name="py-parsehub",
version="0.1",
description="Python3 module for interaction with Parsehub API",
author="<NAME>",
author_email='<EMAIL>',
platforms=["linux"],
li... | 1.65625 | 2 |
test/ServerTest.py | wmde/catgraph-client-python | 1 | 43075 | #!/usr/bin/python
# -*- coding: utf-8
import unittest
import os
import tempfile
from TestBase import *
from gp.client import *
TestGraphName = 'test' + str(os.getpid())
TestFilePrefix = '/tmp/gptest-' + str(os.getpid())
class ServerTest (ClientTestBase, unittest.TestCase):
"""Test server functions via client li... | 2.828125 | 3 |
unittest_reinvent/diversity_filter_tests/test_no_filter_output_scores.py | MolecularAI/reinvent-scoring | 0 | 43076 | <filename>unittest_reinvent/diversity_filter_tests/test_no_filter_output_scores.py<gh_stars>0
from reinvent_scoring.scoring.diversity_filters.curriculum_learning import DiversityFilterParameters
from reinvent_scoring.scoring.diversity_filters.curriculum_learning.diversity_filter import DiversityFilter
from reinvent_sco... | 2.09375 | 2 |
test.py | bentotten/irc | 0 | 43077 | import copy
# Saves room and client list
initialMsg = ':JACK! {0.0.0.0, 5000} PRIVMSG #: /JOIN #\n' # {IP,port}
msg = "PRIVMSG #cats: Hello World! I'm back!\n"
qmsg = "PRIVMSG #cats: /part #cats"
client = "('127.0.0.1', 41704)"
message = {'nick': '', 'client': '', 'chan': '', 'cmd': '', 'msg': ''}
test = ":BEN! {('127... | 2.578125 | 3 |
01/128.py | c344081/learning_algorithm | 0 | 43078 | <filename>01/128.py
'''
Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
Your algorithm should run in O(n) complex... | 4.09375 | 4 |
scripts/download_external_data.py | TomAugspurger/modis | 0 | 43079 | <reponame>TomAugspurger/modis<gh_stars>0
#!/usr/bin/env python
import os
import sys
from azure.storage.blob import BlobServiceClient
EXTERNAL_DATA_FILE_NAMES = [
"MCD15A2H.A2022025.h01v11.061.2022035062702.hdf",
"MCD15A3H.A2022033.h12v10.061.2022039062215.hdf",
"MCD43A4.A2022032.h14v10.061.2022041051831.... | 1.710938 | 2 |
define.py | qinflying/kivy_2048 | 1 | 43080 | <gh_stars>1-10
#-*- coding:utf-8 -*-
#宏定义
#字体
FONT_COMMON = "Roboto"
FONT_HEI = "FontHei"
#界面
START_MENU = "startmenu"
PLAY_MENU = "playmenu"
| 1.148438 | 1 |
vmware_nsx/tests/unit/services/lbaas/test_octavia_driver.py | yebinama/vmware-nsx | 0 | 43081 | <reponame>yebinama/vmware-nsx
# Copyright 2018 VMware, Inc.
# 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... | 1.71875 | 2 |
src/gen2/node_provider.py | project-codeflare/gen2-connector | 2 | 43082 | #
# (C) Copyright IBM Corp. 2021
#
# 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 writi... | 1.976563 | 2 |
alarme/extras/sensor/web/views/home.py | insolite/alarme | 0 | 43083 | from aiohttp.web import HTTPFound
from .core import CoreView
from ..util import login_required, handle_exception
class Home(CoreView):
@login_required
async def req(self):
return HTTPFound(self.request.app.router.get('control').url())
@handle_exception
async def get(self):
return aw... | 2.203125 | 2 |
Cut-Paste/test_recognition.py | kreimanlab/WhenPigsFlyContext | 13 | 43084 | <filename>Cut-Paste/test_recognition.py<gh_stars>10-100
import os
import pathlib
import argparse
import glob
import json
import torch, torchvision
import numpy as np
import detectron2
from detectron2.data import build_detection_test_loader
from detectron2.data.datasets import register_coco_instances
from detectron2.da... | 2.609375 | 3 |
formly/forms/widgets.py | coloradocarlos/formly | 34 | 43085 | from django.forms import TextInput
from django.forms.widgets import MultiWidget, RadioSelect
from django.template.loader import render_to_string
class MultiTextWidget(MultiWidget):
def __init__(self, widgets_length, **kwargs):
widgets = [TextInput() for _ in range(widgets_length)]
kwargs.update({"... | 2.296875 | 2 |
extras/eddn_log.py | starcraftman/cogBot | 0 | 43086 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple logger to look at eddn messages passing.
Terminate with a simple Ctlr+C
"""
import os
import sys
import time
import zlib
import argparse
import zmq
try:
import rapidjson as json
except ImportError:
import json
EDDN_ADDR = "tcp://eddn.edcd.io:9500"
T... | 2.375 | 2 |
icenumerics/__init__.py | aortiza/icenumerics | 0 | 43087 | <gh_stars>0
from pint import UnitRegistry
import sys
try:
from .magcolloids import magcolloids as mc
except ImportError as e:
try:
import magcolloids as mc
except ImportError as e:
raise ImportError
ureg = mc.ureg
from icenumerics.spins import *
from icenumerics.colloidalice import *
f... | 1.382813 | 1 |
django/BankAccount/base/migrations/0003_auto_20220309_2048.py | akrysmalski/BankAccount | 0 | 43088 | # Generated by Django 3.2 on 2022-03-09 19:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0002_auto_20220309_1545'),
]
operations = [
migrations.AlterField(
model_name='user',
name='date_of_birth',
... | 1.757813 | 2 |
pdfpng.py | FearlessDoggo21/scripts | 0 | 43089 | #!/bin/python3
# pdfpng - convert pdf to png
# Copyright (C) 2022 ArcNyxx
# see LICENCE file for licensing information
import sys
import fitz as pdf
if len(sys.argv) != 2:
print("usage: pdfpng [file]")
sys.exit()
doc = pdf.open(sys.argv[1])
for num, page in enumerate(doc):
pixmap = page.get_pixmap()
... | 3.359375 | 3 |
tests/utils.py | sjamgade/python-socks | 158 | 43090 | import socket
def is_connectable(host, port):
sock = None
try:
sock = socket.create_connection((host, port), 1)
result = True
except socket.error:
result = False
finally:
if sock:
sock.close()
return result
| 3.03125 | 3 |
main.py | bladesz/Hill | 0 | 43091 | <reponame>bladesz/Hill
import gym
'''
env = gym.make('CartPole-v0')
values = env.reset()
print(values)
for _ in range(1000):
env.render()
observation, reward, done, info = env.step(env.action_space.sample()) # take a random action
env.close()
'''
import multiprocessing
import os
import pickl... | 2.484375 | 2 |
models/blog.py | AbhishekPednekar84/personal-portfolio | 2 | 43092 | <filename>models/blog.py
from extensions import db
from sqlalchemy.dialects.postgresql import TSVECTOR
class Blog(db.Model):
__tablename__ = "blog"
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(100))
url = db.Column(db.String(100))
description = db.Column(db.String(1000... | 2.828125 | 3 |
src/singlePendulumCart/identification_clean.py | BystrickyK/SINDy | 1 | 43093 | import pandas as pd
import matplotlib.pyplot as plt
from src.utils.function_libraries import *
from src.utils.data_utils import *
from src.utils.identification.PI_Identifier import PI_Identifier
from src.utils.solution_processing import *
from differentiation.spectral_derivative import compute_spectral_derivative
from ... | 2.03125 | 2 |
fedlearner/scheduler/scheduler_service.py | codemonkey-ll/fedlearner | 2 | 43094 | <filename>fedlearner/scheduler/scheduler_service.py<gh_stars>1-10
# Copyright 2020 The FedLearner Authors. 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://... | 1.84375 | 2 |
src/test/test_FPGAVisual.py | ComputerArchitectureGroupPWr/Simulio | 0 | 43095 | <reponame>ComputerArchitectureGroupPWr/Simulio<filename>src/test/test_FPGAVisual.py<gh_stars>0
from unittest import TestCase
from src.main.fpgavisio import FPGAVisual
__author__ = 'pawel'
class TestFPGAVisual(TestCase):
def test_make_simulation_movie(self):
visualisation = FPGAVisual('../data/final.csv')... | 2.09375 | 2 |
dbms/util.py | CanburakTumer/youtube_examples | 0 | 43096 | import logging
import os
import json
from errors import throw_input_data_is_corrupted, throw_table_does_not_exist
DATA_FILE_SUFFIX = '.db'
def generate_data_file_name(table):
return table+DATA_FILE_SUFFIX
def get_table_name_from_data_file(data_file):
return data_file.replace(DATA_FILE_SUFFIX,'')
def split_d... | 3.015625 | 3 |
pythonql/Executor.py | hi117/pythonql | 0 | 43097 | <reponame>hi117/pythonql
from pythonql.algebra.operator import plan_from_list
from pythonql.algebra.operators import *
from pythonql.PQTuple import PQTuple
from pythonql.helpers import flatten
from pythonql.Rewriter import rewrite
from pythonql.debug import Debug
import json
import types
def make_pql_tuple(vals,lcs):
... | 2.671875 | 3 |
test/test_make_df.py | ryw89/pg2pd | 2 | 43098 | import tempfile
import pandas as pd
from pg2pd import Pg2Pd
def test_make_df_1(pg_conn):
"""Test of main Postgres binary data to Pandas dataframe pipeline.
This tests an integer and varchar.
"""
cursor = pg_conn.cursor()
# Copy binary data to a tempfile
path = tempfile.mkstemp()[1]
que... | 2.953125 | 3 |
NewsClassificator/reader.py | levkovalenko/pm_task_2018 | 0 | 43099 | import asyncio
from NewsClassificator.news import News
@asyncio.coroutine
def read(file_name, code='utf-8'):
"""
async generator to read file in with special delimeter
:param file_name: the way to the file
:param code: encoding of file (utf-8)
:return: generator with all parts of file
"""
... | 3.40625 | 3 |