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 |
|---|---|---|---|---|---|---|
packstack/plugins/neutron_350.py | melroyr/havana-packstack | 0 | 23500 | """
Installs and configures neutron
"""
import logging
import os
import re
import uuid
from packstack.installer import utils
from packstack.installer import validators
from packstack.installer.utils import split_hosts
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile
# Controller o... | 2.171875 | 2 |
01-Exercicios/Aula001/Ex2.py | AmandaRH07/Python_Entra21 | 0 | 23501 | #--- Exercício 2 - Variáveis
#--- Crie um menu para um sistema de cadastro de funcionários
#--- O menu deve ser impresso com a função format()
#--- As opções devem ser variáveis do tipo inteiro
#--- As descrições das opções serão:
#--- Cadastrar funcionário
#--- Listar funcionários
#--- Editar funcionário
#--... | 4.15625 | 4 |
venv/lib/python3.8/site-packages/crispy_forms/templates/uni_form/uni_form.html.py | Solurix/Flashcards-Django | 1 | 23502 | <gh_stars>1-10
BB BBBBBBBBBBBBBBBBBB
BB BBBBBBBBBBBBBBBB
BBBBBBB BBBBBBBBBBBBBBBBBBBBBB
BBBBB
BB BBBBBBBBBB BB BB BB BBBBBBBBBB
XXXXXXXXX XXXXXXXXX
XXXXXXXXXXXXXXXXX
BBBBB
BBB BBBBB BB BBBB
BBBBBBB BBBBBBBBBBBBBB
BBBBBB
BB BBBBBBBBBB BB BB BB BBBBBBBBBB
XXXXXXXXXXX
BBBBB
| 1.359375 | 1 |
baybars/timber.py | dkanarek12/baybars | 9 | 23503 | <reponame>dkanarek12/baybars
# Copyright 2018 Jet.com
#
# 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... | 2.0625 | 2 |
nlu_hyperopt/space.py | JulianGerhard21/nlu-hyperopt | 0 | 23504 | from hyperopt import hp
# Define the search space here, e.g.
# from hyperopt.pyll.base import scope
# search_space = {
# 'epochs': hp.qloguniform('epochs', 0, 4, 2),
# 'max_df': hp.uniform('max_df', 1, 2),
# 'max_ngrams': scope.int(hp.quniform('max_ngram', 3, 9, 1))
# }
# Default search space: Try di... | 2.15625 | 2 |
lib/taurus/qt/qtgui/panel/report/basicreport.py | MikeFalowski/taurus | 1 | 23505 | <gh_stars>1-10
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under... | 1.828125 | 2 |
src/workflows/__init__.py | stufisher/python-workflows | 0 | 23506 | <reponame>stufisher/python-workflows
__version__ = "2.18"
def version():
"""Returns the version number of the installed workflows package."""
return __version__
class Error(Exception):
"""Common class for exceptions deliberately raised by workflows package."""
class Disconnected(Error):
"""Indicat... | 2.34375 | 2 |
autoarray/structures/grids/grid_decorators.py | jonathanfrawley/PyAutoArray_copy | 0 | 23507 | <reponame>jonathanfrawley/PyAutoArray_copy
import numpy as np
from functools import wraps
from autoconf import conf
from autoarray.structures.grids.one_d import abstract_grid_1d
from autoarray.structures.grids.two_d import grid_2d
from autoarray.structures.grids.two_d import grid_2d_interpolate
from autoarray.s... | 2.890625 | 3 |
079_039_189/ngram_2/get_10_summary.py | Aditya-AS/Question-Answering-System | 0 | 23508 | """
<NAME> S-2013A7PS189P
<NAME> -2013A7PS079P
<NAME> -2013A7PS039P
Artificial Intelligence Term Project
"""
import pickle
import BeautifulSoup
import re
import boto
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from google import search
def get_10_summary(query, source="google"):
... | 3.421875 | 3 |
S4/S4 Library/simulation/careers/pick_career_by_agent_interaction.py | NeonOcean/Environment | 1 | 23509 | <reponame>NeonOcean/Environment<filename>S4/S4 Library/simulation/careers/pick_career_by_agent_interaction.py<gh_stars>1-10
from event_testing.resolver import SingleSimResolver
from sims4.resources import Types
from sims4.tuning.tunable import TunableList, TunableReference
from sims4.tuning.tunable_base import GroupNam... | 2.140625 | 2 |
api/urls.py | kirklennon/Clickbait | 1 | 23510 | <gh_stars>1-10
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('json', views.api, name='api'),
] | 1.546875 | 2 |
tests/examples/minlplib/waterno2_03.py | ouyang-w-19/decogo | 2 | 23511 | <reponame>ouyang-w-19/decogo
# MINLP written by GAMS Convert at 04/21/18 13:55:18
#
# Equation counts
# Total E G L N X C B
# 617 367 103 147 0 0 0 0
#
# Variable counts
# x b i... | 1.421875 | 1 |
examples/pincell_depletion/restart_depletion.py | norberto-schmidt/openmc | 262 | 23512 | <reponame>norberto-schmidt/openmc<filename>examples/pincell_depletion/restart_depletion.py
import openmc
import openmc.deplete
import matplotlib.pyplot as plt
###############################################################################
# Load previous simulation results
########################... | 2.1875 | 2 |
app/schemas/treatment_type.py | DzhonPetrus/Treatment-Management | 0 | 23513 | <reponame>DzhonPetrus/Treatment-Management<filename>app/schemas/treatment_type.py
from datetime import datetime as dt
from typing import Optional, List
from pydantic import BaseModel
from ..utils.schemaHelper import Base, as_form
class TreatmentTypeBase(Base):
name: str
room: str
description: str
fee:... | 2.21875 | 2 |
app/daemon.py | mika-koivusaari/mqtt_db_gateway | 1 | 23514 | # -*- coding: utf-8 -*-
from pep3143daemon import DaemonContext, PidFile
import signal
import os
import sys
import time
class Daemon:
def stop(self, pidfile):
try:
pid = open(pidfile).readline()
except IOError:
print("Daemon already gone, or pidfile was deleted manually")
... | 2.75 | 3 |
src/posts/forms.py | trivvet/djangoAdvance | 0 | 23515 | <gh_stars>0
from django import forms
from crispy_forms.helper import FormHelper
from pagedown.widgets import PagedownWidget
from .models import Post
class PostForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(PostForm, self).__init__(*args, **kwargs)
self.helper = FormHelper(sel... | 2.1875 | 2 |
games/migrations/0004_auto_20150726_1430.py | rnelson/library | 0 | 23516 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('games', '0003_auto_20150725_1737'),
]
operations = [
migrations.AlterField(
model_name='game',
name=... | 1.65625 | 2 |
Exareme-Docker/src/mip-algorithms/HEALTH_CHECK/global.py | tchamabe1979/exareme | 0 | 23517 | import sys
import json
from os import path
from argparse import ArgumentParser
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))) + '/utils/')
from algorithm_utils import set_algorithms_output_data
from health_check_lib import HealthCheckLocalDT
def main():
# Parse arguments
parse... | 2.359375 | 2 |
app/search/urlmap.py | Hanaasagi/Ushio | 5 | 23518 | <gh_stars>1-10
# -*-coding:UTF-8-*-
from handler import SearchHandler
urlpattern = (
(r'/search', SearchHandler),
)
| 1.34375 | 1 |
collect_data/utils/immerseuk/gtr/gtr_extrainfo_awsreduce.py | jaklinger/nesta_dataflow | 0 | 23519 | import logging
from utils.common.datapipeline import DataPipeline
import boto3
import json
from copy import deepcopy
s3 = boto3.resource('s3')
bucket = s3.Bucket('tier-0')
def run(config=None):
orgs = []
for obj in bucket.objects.all():
key = str(obj.key)
if len(key.split("_")) != 3:
... | 2.0625 | 2 |
src/features/helpers/processing_v4.py | askoki/nfl_dpi_prediction | 0 | 23520 | import math
import numpy as np
from matplotlib.patches import FancyArrowPatch
def home_has_possession(row):
if row.possessionTeam == row.homeTeamAbbr:
return True
return False
def calculate_team_sitation(row):
ball_string = 'football'
if row.team == ball_string:
return ball_string
... | 3.640625 | 4 |
abc199/d/main.py | KeiNishikawa218/atcoder | 0 | 23521 | <gh_stars>0
#!/usr/bin/env python3
class UnionFind():
def __init__(self, n):
self.parent = [-1 for _ in range(n)]
# 正==子: 根の頂点番号 / 負==根: 連結頂点数
def find(self, x):
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.find(self.parent[x])
... | 3.734375 | 4 |
scripts/corpinfo.py | HiroshiOhta/GetCorporationInfo | 1 | 23522 | #!/usr/bin/env python
# 標準ライブラリ
from pathlib import Path
from re import search, sub
from sys import exit, argv
from xml.etree import ElementTree as ET
import csv
# サードパーティライブラリ
from requests import get
from requests.exceptions import Timeout, RequestException
# ローカルなライブラリ
from constants import ENC_API_KEY, NTA_API_... | 2.71875 | 3 |
lib/misc.py | cripplet/langmuir-hash | 0 | 23523 | # custom libs
from lib.args import getConf
# Python libs
from re import sub
from os import mkdir
from os.path import exists
from getpass import getuser
from socket import gethostname
def genFrame(file):
from classes.frame import Frame
from lib.array import getGrid
grid = getGrid(file)
return(Frame(len(grid[0]), l... | 2.578125 | 3 |
actions/geoip.py | cognifloyd/stackstorm-networking_utils | 0 | 23524 | <reponame>cognifloyd/stackstorm-networking_utils
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, ... | 1.859375 | 2 |
backend/src/dealer/helpers/result.py | codepals-org/poker | 2 | 23525 | """ This module comes with functions to decide which poker player out
of all players has the best cards.
"""
import itertools
# full_list in [('A','A'),('B','B')...,('F','F')]
def results(full_list, public_card):
""" The results function takes a list of player cards and
the community cards (in the middle of... | 3.53125 | 4 |
nimble-newts/askgrieves/chatbot/models.py | Vthechamp22/summer-code-jam-2021 | 40 | 23526 | <reponame>Vthechamp22/summer-code-jam-2021<gh_stars>10-100
from django.db import models
class Chatbot(models.Model):
name = models.CharField(max_length=500)
def __str__(self):
return f"name={self.name}"
class WikiArticle(models.Model):
name = models.CharField(max_length=500)
summary = model... | 2.296875 | 2 |
examples/example_wait_for.py | plun1331/discord.py-components-1 | 1 | 23527 | from discord.ext.commands import Bot
from discord_components import DiscordComponents, Button, ButtonStyle, InteractionType
from asyncio import TimeoutError
bot = Bot("!")
@bot.event
async def on_ready():
DiscordComponents(bot)
print(f"Logged in as {bot.user}!")
@bot.command()
async def waitforclick(ctx):
... | 2.8125 | 3 |
core/data/dataloader/upb_kitti.py | nemodrive/awesome-semantic-segmentation-pytorch | 0 | 23528 | """Pascal VOC Semantic Segmentation Dataset."""
import os
import torch
import numpy as np
from PIL import Image
from .segbase import SegmentationDataset
class VOCSegmentation(SegmentationDataset):
"""Pascal VOC Semantic Segmentation Dataset.
Parameters
----------
root : string
Path to VOCdev... | 2.765625 | 3 |
app/request.py | angelakarenzi5/News-Highlight | 0 | 23529 | <filename>app/request.py
from app import app
import urllib.request,json
from .models import source
from .models import article
Source = source.Source
Article = article.Article
# Getting api key
api_key = app.config['NEWS_API_KEY']
# Getting the source base url
base_url = app.config["SOURCE_API_BASE_URL"]
article_ur... | 2.90625 | 3 |
login.py | XM001-creater/test_one | 0 | 23530 | num1 =1
num2 = 222
| 1.59375 | 2 |
change_file_name.py | Guzhongren/picuture2thumbnail | 1 | 23531 | # -*- coding: utf-8 -*-
# Author:Guzhongren
# created: 2017-05-08
import os
path = 'C:\\geoconFailed\\willfix\\'
for file in os.listdir(path):
if os.path.isfile(os.path.join(path,file))==True:
_file= file.split(".")
_file_name=_file[0]
_file_type=_file[1]
new_file_name=_file_name[:-... | 3.015625 | 3 |
day22/day22.py | norbert-e-horn/adventofcode-2017 | 0 | 23532 | <reponame>norbert-e-horn/adventofcode-2017
import sys
c=[[2if a=="#"else 0for a in i]for i in sys.argv[1].split("\n")]
n=len(c)
def m(x):
d[0]=(d[0]+a[d[1]]+3)%4
a[d[1]]=(x+a[d[1]])%4
if a[d[1]]==2:d[2]+=1
d[1]+=(s+(1-s)*(d[0]&1))*(-1+2*(d[0]&1^(d[0]&2)>>1))
s=1001
a=[]
k=(s-n)//2
for i in range(s):a+=[0]*k+c[i-k]+... | 2.890625 | 3 |
armory/scenarios/audio_asr.py | GuillaumeLeclerc/armory | 1 | 23533 | """
Automatic speech recognition scenario
"""
import logging
from typing import Optional
from tqdm import tqdm
import numpy as np
from art.preprocessing.audio import LFilter, LFilterPyTorch
from armory.utils.config_loading import (
load_dataset,
load_model,
load_attack,
load_adversarial_dataset,
... | 2.703125 | 3 |
FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleWebCenterSites/charts/wc-sites/unicast.py | rishiagarwal-oracle/fmw-kubernetes | 0 | 23534 | <gh_stars>0
# Copyright (c) 2022, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl
import xml.dom.minidom
import re
import sys
def getManagedServerCount(domainHome):
# use the parse() function to load and parse an XML file
do... | 2.21875 | 2 |
backend/tests/unit/protocols/application/test_lists.py | pez-globo/pufferfish-software | 1 | 23535 | <gh_stars>1-10
"""Test the functionality of protocols.application.states classes."""
from ventserver.protocols.application import lists
from ventserver.protocols.protobuf import mcu_pb as pb
def test_send_new_elements() -> None:
"""Test adding new elements to a list for sending."""
example_sequence = [
... | 2.59375 | 3 |
application/api.py | DonBlaine/OpenDoorData | 0 | 23536 | # file that contains db models to be exposed via a REST API
from models import room, survey, wifi_log, timetable, module # import db models
from app import app # import Flask app
from auth import auth # import Auth app to provide user authentificaiton
from flask import request # import request object to parse json req... | 2.78125 | 3 |
www/purple_admin/urls.py | SubminO/vas | 0 | 23537 | from django.urls import path
from purple_admin import views
urlpatterns = [
path('', views.cabinet, name='admin_panel_cabinet'),
# Адмника Наименований маршрутов
path('route_list', views.cabinet_list, {'type': 'route'}, name='admin_panel_route_list'),
path('route_add', views.cabinet_add, {'type': 'rou... | 1.820313 | 2 |
tests/mock_dbcli_config.py | bluelabsio/db-facts | 2 | 23538 | <filename>tests/mock_dbcli_config.py
mock_dbcli_config = {
'exports_from': {
'lpass': {
'pull_lastpass_from': "{{ lastpass_entry }}",
},
'lpass_user_and_pass_only': {
'pull_lastpass_username_password_from': "{{ lastpass_entry }}",
},
'my-json-script': ... | 1.882813 | 2 |
java/test/src/main/resources/test_cross_language_invocation.py | hershg/ray | 2 | 23539 | # This file is used by CrossLanguageInvocationTest.java to test cross-language
# invocation.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import ray
@ray.remote
def py_func(value):
assert isinstance(value, bytes)
return b"Response f... | 2.484375 | 2 |
game_stats.py | DeqianBai/Project-Alien-Invasion | 4 | 23540 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:dabai time:2019/2/24
class GameStats():
"""跟踪游戏的统计信息"""
def __init__(self,ai_settings):
"""初始化统计信息"""
self.ai_settings=ai_settings
self.reset_stats()
# 让游戏一开始处于非活动状态
self.game_active=False
# ... | 2.171875 | 2 |
ros/src/tl_detector/light_classification/carla.py | xiangjiang/Capstone_1 | 0 | 23541 | import tensorflow as tf
from os import path
import numpy as np
from scipy import misc
from styx_msgs.msg import TrafficLight
import cv2
import rospy
import tensorflow as tf
class CarlaModel(object):
def __init__(self, model_checkpoint):
self.sess = None
self.checkpoint = model_checkpoint
... | 2.359375 | 2 |
transform/indexed_transform.py | cviaai/unsupervised-heartbeat-anomaly-detection | 2 | 23542 | from typing import Tuple, List
from transform.transformer import TimeSeriesTransformer
import numpy as np
class IndexedTransformer:
def __init__(self, transformer: TimeSeriesTransformer, padding: int, step: int):
self.transformer = transformer
self.padding = padding
self.step = step
... | 2.703125 | 3 |
dropconnect/combine_pred_mod.py | zygmuntz/kaggle-cifar | 26 | 23543 | #------------------------------------------
# this script combine result of different
# nets and report final result
#------------------------------------------
import sys
import numpy as np
from util import pickle, unpickle
def evaluate_result( result, text ):
# pre-condition check
num_batches = len( result[... | 2.296875 | 2 |
goless/__init__.py | ctismer/goless | 1 | 23544 | """
``goless`` introduces go-like channels and select to Python,
built on top of Stackless Python (and maybe one day gevent).
Use :func:`goless.chan` to create a synchronous or buffered channel.
Use :func:`goless.select` like you would the ``Select`` function in Go's reflect package
(since Python lacks a switch/case st... | 2.71875 | 3 |
data/test1.py | moses-alexander/simple-python-parser | 0 | 23545 | 1+2
3+5
7+8
6>7
abs(-3)
if 8 < 9: min(3,5)
else 4 < 5: abs(-2)
else 4 > 5: max(3, 7)
round(2.1)
round(3.6)
len("jfdgge")
type(4)
any(1, 3, 4)
any(0.0, 0.0, 0.0)
all("abc", "a")
all(0, 1)
bin(45)
lower("ABC")
upper("abc")
join("abc", "abc")
bool(0)
bool("abc")
ord('r')
chr(100)
str(130)
globals()
help()
hex(15)
oct(27)
... | 3.28125 | 3 |
python/funciones2.py | Tai-Son/Python-Chile | 0 | 23546 | # Practica de funciones
#! /usr/bin/python
# -*- coding: iso-8859-15
def f(x):
y = 2 * x ** 2 + 1
return y
# Programa que usa la funcion f
n = int(input("Ingrese número: "))
for i in range(n):
y = f(i)
print (i,y)
| 4.15625 | 4 |
setup.py | br-g/pyroaman | 2 | 23547 | from distutils.core import setup
from setuptools import find_packages
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='pyroaman',
version='0.1.1',
license='MIT',
description='Roam Research with Python',
author = '<NAME>',
author_email='<EMAIL>',
url = 'https... | 1.265625 | 1 |
pgel_sat.py | AndrewIjano/pgel-sat | 0 | 23548 | <filename>pgel_sat.py
import sys
from pgel_sat import ProbabilisticKnowledgeBase, solve
import argparse
def str_lp(lp):
return f'''lp solution:
x: {lp.x}
y: {lp.y}
cost: {lp.cost}'''
def main():
parser = init_argparse()
args = parser.parse_args()
filename = args.file[0]
kb = Probabi... | 3.109375 | 3 |
001-050/029-divide-two-integers.py | bbram10/leetcode-master | 134 | 23549 | <reponame>bbram10/leetcode-master
"""
STATEMENT
Divide two integers without using multiplication, division and mod operator.
CLARIFICATIONS
- Do I have to handle 32-bit integer overflow? Yes, return the MAX_INT in that case.
- Can the divisor be zero? Yes, return the MAX_INT.
EXAMPLES
34/3 -> 11
COMMENTS
- This solu... | 3.578125 | 4 |
lang/langs/deutsch.py | SuRoryz/surbot-osu | 0 | 23550 | class Samples:
def __init__(self):
#COMMANDS
self.PP = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {}, AR {}, '
'CS {}, {}★, {}:{}) wirst du {} {}')
self.PP_FOR = ('| {}pp bekommen für {}% ')
self.PP_PRED = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {},... | 2.46875 | 2 |
conv/setup.py | hughpyle/GW-BASIC | 26 | 23551 | <filename>conv/setup.py
from setuptools import setup, find_packages
"""
https://tia.mat.br/posts/2020/06/21/converting-gwbasic-to-z80.html
"""
setup(
name="z80conv",
version='0.0.1',
author="lp",
description="Porting GW-BASIC from 8086 back to the Z80",
license="GPLv2",
packages=find_packages(... | 1.453125 | 1 |
hera_cc_utils/catalog.py | pagano-michael/hera_cc_utils | 0 | 23552 | # -*- coding: utf-8 -*-
# Copyright (c) 2021 The HERA Collaboration
# Licensed under the MIT License
"""Utilities for dealing with galaxy/QSO catalogs."""
import numpy as np
import matplotlib.pyplot as plt
from astropy.coordinates import SkyCoord
from .util import deg_per_hr
_xshooter_ref = "https://ui.adsabs.harva... | 1.8125 | 2 |
src/myutils/__init__.py | yyHaker/TextClassification | 3 | 23553 | <reponame>yyHaker/TextClassification
#!/usr/bin/python
# coding:utf-8
"""
@author: yyhaker
@contact: <EMAIL>
@file: __init__.py
@time: 2019/3/9 15:41
"""
from .util import *
from .functions import *
from .nn import *
from .attention import *
| 0.945313 | 1 |
configs/config.py | AcordUch/open-heartmagic | 0 | 23554 | from configparser import ConfigParser
from os import path
def create_config() -> None:
_config.add_section("Telegram")
_config.set("Telegram", "api_id", "you api_id here")
_config.set("Telegram", "api_hash", "you api_hash here")
_config.set("Telegram", "username", "magicBot")
_config.set("Telegram... | 2.484375 | 2 |
Python/squirrel-simulation.py | xiaohalo/LeetCode | 9 | 23555 | # Time: O(n)
# Space: O(1)
class Solution(object):
def minDistance(self, height, width, tree, squirrel, nuts):
"""
:type height: int
:type width: int
:type tree: List[int]
:type squirrel: List[int]
:type nuts: List[List[int]]
:rtype: int
"""
... | 3.546875 | 4 |
scripts/utils/merge.py | GabrielTavernini/TelegramMap | 3 | 23556 | <reponame>GabrielTavernini/TelegramMap
import pandas as pd
import sys
from dotenv import load_dotenv
load_dotenv()
src = pd.read_csv(sys.argv[1])
dst = pd.read_csv(os.getenv('FILE_PATH'))
fdf = pd.concat([dst, src])
fdf = fdf[~((fdf['user'].duplicated(keep='first')) & (fdf['user']!='Point'))]
fdf = fdf[~fdf.duplicate... | 2.5 | 2 |
lib/locator/location_test.py | alt-locator/address-locator-python | 0 | 23557 | import location
import unittest
class LocationTest(unittest.TestCase):
def testToJson(self):
test_location = location.Location(name='foo',
local_ip_address={'en0': {'local_ip_address': '1.2.3.4'}})
test_json = test_location.to_json()
self.assertEqual(test_json['name'], 'foo')
self.assertEqual(... | 3.28125 | 3 |
ProjectiveClusteringCoreset.py | muradtuk/ProjectiveClusteringCoresets | 0 | 23558 | """*****************************************************************************************
MIT License
Copyright (c) 2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to dea... | 1.421875 | 1 |
extras/pyrepl/console.py | dillionhacker/python222 | 1 | 23559 | # Copyright 2000-2004 <NAME> <EMAIL>
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and
# that both that copyright ... | 2.578125 | 3 |
robotpy_build/hooks_datacfg.py | ConnectionMaster/robotpy-build | 0 | 23560 | #
# Defines data that is consumed by the header2whatever hooks/templates
# to modify the generated files
#
import enum
from typing import Dict, List, Tuple, Optional
from pydantic import validator
from .util import Model, _generating_documentation
class ParamData(Model):
"""Various ways to modify parameters"""
... | 2.65625 | 3 |
src/auspex/qubit/qubit_exp.py | minhhaiphys/Auspex | 0 | 23561 | <reponame>minhhaiphys/Auspex
from auspex.log import logger
from auspex.experiment import Experiment, FloatParameter
from auspex.stream import DataStream, DataAxis, SweepAxis, DataStreamDescriptor, InputConnector, OutputConnector
import auspex.instruments
import auspex.filters
import bbndb
import numpy as np
import sys... | 1.78125 | 2 |
mtconnect/mtconnect_ros_bridge/scripts/closedoor.py | mtconnect/ros_bridge | 5 | 23562 | <filename>mtconnect/mtconnect_ros_bridge/scripts/closedoor.py
#! /usr/bin/env python
"""
Copyright 2013 Southwest Research Institute
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
... | 2.0625 | 2 |
cte/__main__.py | iqbal-lab-org/covid-truth-eval | 1 | 23563 | <filename>cte/__main__.py<gh_stars>1-10
#!/usr/bin/env python3
import argparse
import logging
import sys
import cte
def main(args=None):
parser = argparse.ArgumentParser(
prog="cte", usage="cte <command> <options>", description="cte: test-covid-eval"
)
parser.add_argument("--version", action="ve... | 2.453125 | 2 |
piton/lib/inquirer/questions.py | piton-package-manager/PPM | 19 | 23564 | # -*- coding: utf-8 -*-
"""
Module that implements the questions types
"""
import json
from . import errors
def question_factory(kind, *args, **kwargs):
for clazz in (Text, Password, Confirm, List, Checkbox):
if clazz.kind == kind:
return clazz(*args, **kwargs)
raise errors.UnknownQuesti... | 3.28125 | 3 |
json_replacer.py | MrMusicMan/json-item-replacer | 0 | 23565 | import os
import json
import string
from tkinter import filedialog, simpledialog
from tkinter import *
class CsvImporter(object):
def __init__(self):
self.csv_data = None
self.languages = []
def import_csv(self, csv_filename):
with open(csv_filename, 'r') as file:
self.csv... | 3.296875 | 3 |
src/func.py | yygr/datascience_utility | 0 | 23566 | <reponame>yygr/datascience_utility
from pdb import set_trace
from time import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import random
from scipy.stats import chi2
import renom as rm
class Enc(rm.Model):
def __init__(
self, pre, latent_dim,
output_act = None,
):
... | 2.296875 | 2 |
portality/cms/implied_attr_list.py | gaybro8777/doaj | 47 | 23567 | <gh_stars>10-100
import markdown
import re
from markdown.extensions import attr_list
def makeExtension(**kwargs): # pragma: no cover
return ImpliedAttrListExtension(**kwargs)
class ImpliedAttrListExtension(markdown.Extension):
"""Extension for attatching `attr_list` entries to implied elements. Specifical... | 2.921875 | 3 |
services/web/apps/main/pool/views.py | xUndero/noc | 1 | 23568 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# main.pool application
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------... | 1.742188 | 2 |
new_corpus/_sympy.py | y-akinobu/multiese | 0 | 23569 | <filename>new_corpus/_sympy.py
import sympy
'''
@test($$;type(sympy))
@alt(シンボル|記号|変数)
@alt(数式として、|)
[代数計算|シンボル計算|数式処理][|ライブラリ]を使う
'''
s = 'z'
sympy.symbol(s)
'''
@test(sympy=missing;$$)
数式として、sをシンボルに変換する
'''
z = sympy.symbol(s)
'''
@test(sympy=missing;$$;z)
@prefix(z;[変数|式])
数式として、sを[シンボル|変数][に|化]して、zにする
'''
e = e2... | 2.734375 | 3 |
saleor/app/tests/test_models.py | fairhopeweb/saleor | 15,337 | 23570 | from ...app.models import App
from ...webhook.event_types import WebhookEventType
def test_qs_for_event_type(payment_app):
qs = App.objects.for_event_type(WebhookEventType.PAYMENT_AUTHORIZE)
assert len(qs) == 1
assert qs[0] == payment_app
def test_qs_for_event_type_no_payment_permissions(payment_app):
... | 2.03125 | 2 |
feast/DetectionModules/__init__.py | ChandlerKemp/FEAST_PtE | 3 | 23571 | from . import null
from . import abstract_detection_method
from . import tech_detect
from . import tiered_detect
| 1.140625 | 1 |
apps/transactions/__init__.py | lsdlab/djshop_toturial | 0 | 23572 | <gh_stars>0
from django.apps import AppConfig
class TransactionsConfig(AppConfig):
name = 'apps.transactions'
verbose_name = "Transactions"
def ready(self):
import apps.transactions.signals
default_app_config = 'apps.transactions.TransactionsConfig'
| 1.390625 | 1 |
8/code.py | DeclanOGorman/AdventofCode2021 | 0 | 23573 | with open('./8/input_a.txt', 'r') as f:
input = [[a.strip().split(' | ')[0].split(' '), a.strip().split(' | ')[1].split(' ')] for a in f]
num = sum([sum([1 if len(a) in {2,3,4,7} else 0 for a in o[1]]) for o in input ])
print(f'Part A: Number of 1,4,7 or 8s in output - {num}')
def getoutput(i):
nums = ['0','1... | 3.015625 | 3 |
pythonium/orders/galaxy.py | cacrespo/pythonium | 0 | 23574 | <gh_stars>0
import logging
from itertools import groupby
import attr
import numpy as np
from ..explosion import Explosion
from .core import GalaxyOrder
logger = logging.getLogger("game")
@attr.s()
class ProduceResources(GalaxyOrder):
name = "produce_resources"
def execute(self) -> None:
for plane... | 2.296875 | 2 |
pdip/processing/factories/__init__.py | ahmetcagriakca/pdip | 2 | 23575 | from .process_manager_factory import ProcessManagerFactory
| 1.078125 | 1 |
assets/src/ba_data/python/ba/_analytics.py | SahandAslani/ballistica | 2 | 23576 | <reponame>SahandAslani/ballistica
# Copyright (c) 2011-2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | 1.476563 | 1 |
todo_app/display.py | WeaverDyl/python-todo | 3 | 23577 | <filename>todo_app/display.py<gh_stars>1-10
import os
import math
import shutil
import textwrap
from datetime import datetime
from terminaltables import AsciiTable
class Display:
def __init__(self):
self.colors = {
'RED': '\033[38;5;196m',
'ORANGE': '\033[38;5;220m',
'GR... | 3.3125 | 3 |
linked_list/adding_nodes_value/test.py | Shawn-Ng/algorithms-test | 0 | 23578 | class Node:
def __init__(self, data):
self.data = data
self.next = None
def sumLinkedListNodes(list1, list2):
value1, value2 = "", ""
head1, head2 = list1, list2
while head1:
value1 += str(head1.data)
head1 = head1.next
while head2:
value2 += str(head2.dat... | 3.671875 | 4 |
env2048.py | qhduan/rl-2048 | 3 | 23579 | import logic
import numpy as np
import gym
ACTION_MAP = {
0: 'up',
1: 'down',
2: 'left',
3: 'right'
}
class Env2048(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self, n=4, max_idle=100, seed=None):
super(Env2048, self).__init__()
self.n = n
self.max... | 2.5 | 2 |
users/views.py | Paulwamaria/instagram | 0 | 23580 | <gh_stars>0
from django.shortcuts import render,redirect
from django.contrib.auth.decorators import login_required
from .forms import InstaRegistrationForm, UserUpdateForm, ProfileUpdateForm
from django.views.generic import DetailView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import ... | 2.125 | 2 |
1D_CNN.py | alex386/EEGPatternRecognition | 0 | 23581 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 12:55:47 2018
@name: CSVMachLearn.py
@description: 1D CNN using CSV vector for machine learning
@author: <NAME>
"""
from __future__ import absolute_import, division, print_function
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
fro... | 2.9375 | 3 |
eslearn/machine_learning/classfication/el_classify_sensitive_person_test.py | dongmengshi/easylearn | 0 | 23582 | # -*- coding: utf-8 -*-
"""
Created on 2020/03/16
Feature selection: Relief-based feature selection algorithm.
------
@author: <NAME>
"""
import numpy as np
from sklearn import preprocessing
import os
from sklearn.externals import joblib
from el_classify_sensitive_person_train_validation import ClassifyFourKindOfPers... | 3.171875 | 3 |
Curso em Video/D_045.py | tonmarcondes/UNIVESP | 0 | 23583 | import random
cor = {
'fim':'\033[m',
'amarelo':'\033[1;033m',
'vermelho':'\033[1;031m',
'vermelhof':'\033[7;031m',
'azul':'\033[1;034m',
'verde':'\033[1;32m',
'verdef':'\033[7;32m',
'branco':'\033[1;030m'
}
print('''
Escolha uma das opções abaixo:
\t {}1{} {... | 3.640625 | 4 |
train.py | ThiruRJST/Deformed-Yolo | 1 | 23584 | from pandas.core.algorithms import mode
import torch
import torch.nn as nn
from albumentations import Compose,Resize,Normalize
from albumentations.pytorch import ToTensorV2
import wandb
import time
import torchvision
import torch.nn.functional as F
import torch.optim as optim
from torch.cuda.amp import autocast,GradSc... | 2.34375 | 2 |
test/test_encoder.py | mickey9910326/py-asa-loader | 0 | 23585 | import conftest
from asaprog import pac_encode
from asaprog.util import *
if __name__ == "__main__":
pac = {
'command': asaProgCommand.CHK_DEVICE.value,
'data': b'test'
}
res = pac_encode(pac)
print(res)
print(res[-1])
| 2.015625 | 2 |
tests/controllers/controller_with_throttling.py | DmitryKhursevich/winter | 1 | 23586 | <filename>tests/controllers/controller_with_throttling.py
from http import HTTPStatus
import winter.web
from winter.web import ExceptionHandler
from winter.web.exceptions import ThrottleException
class CustomThrottleExceptionHandler(ExceptionHandler):
@winter.response_status(HTTPStatus.TOO_MANY_REQUESTS)
def... | 2.421875 | 2 |
appwebshare/files.py | cvakiitho/Webshare-download-manager | 3 | 23587 | # -*- coding: UTF=8 -*-
__author__ = '<NAME>'
import glob
from appwebshare.scripts import config
def get_file_list():
without_dir = []
for i in glob.glob(config.DIR + '*.*') :
without_dir.append(i.replace(config.DIR, ""))
return without_dir | 2.375 | 2 |
tests/checkout_four_sdk_test.py | riaz-bordie-cko/checkout-sdk-python | 0 | 23588 | import pytest
import checkout_sdk
from checkout_sdk.environment import Environment
from checkout_sdk.exception import CheckoutArgumentException
def test_should_create_four_sdk():
checkout_sdk.FourSdk() \
.secret_key('<KEY>') \
.public_key('<KEY>') \
.environment(Environment.sandbox()) \
... | 2.09375 | 2 |
transitfeed_web/__init__.py | ed-g/transitfeed_web | 0 | 23589 | #!/usr/bin/env python2
import sys
import transitfeed
import run_transitfeed_web_server
import util
def main():
print ("Hello, world.")
if __name__ == '__main__':
main()
| 1.671875 | 2 |
untiler/__init__.py | waissbluth/untiler | 37 | 23590 | <gh_stars>10-100
#!/usr/bin/env python
from __future__ import with_statement
from __future__ import print_function
from __future__ import division
import os
from multiprocessing import Pool
import click
import mercantile as merc
import numpy as np
import rasterio
from rasterio import Affine
from rasterio.warp import r... | 1.992188 | 2 |
loadenv.py | Natsu-dev/otenki | 0 | 23591 | <filename>loadenv.py
import os
from os.path import join, dirname
from dotenv import load_dotenv
load_dotenv(verbose=True)
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(verbose=True, dotenv_path=dotenv_path)
TOKEN = os.getenv('DISCORD_TOKEN')
| 2.078125 | 2 |
Stack/10-stack-special-design-and-implement.py | mahmutcankurt/DataStructures_Python | 1 | 23592 | class Stack:
def __init__(self):
self.array = []
self.top = -1
self.max = 100
def isEmpty(self):
if(self.top == -1):
return True
else:
return False
def isFull(self):
if(self.top == self.max -1):
return True
else:
... | 3.65625 | 4 |
fork_process/dataPreprocess/data_extraction_2.py | JianboTang/modified_GroundHog | 0 | 23593 | <filename>fork_process/dataPreprocess/data_extraction_2.py
import numpy
import pickle
readfile1 = open('intermediate_data/post_1.txt','r');
readfile2 = open('intermediate_data/cmnt_1.txt','r');
writefile = open('intermediate_data/dictionary.pkl','w');
#writefile1 = open('intermediate_data/post_2.txt','w');
#writefile2... | 2.53125 | 3 |
visualization.py | Tommy-Johannessen/MovementRecognition | 0 | 23594 | <reponame>Tommy-Johannessen/MovementRecognition<gh_stars>0
import itertools
import os
from collections import defaultdict
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
from matplotlib.ticker import FuncFormatter
import pickle
import os
import numpy as np
def calculate_cm(pred_vals, true_vals, classes):... | 2.9375 | 3 |
raw-myo-plot/Extract_Features.py | rjweld21/prostheticClinic | 0 | 23595 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 12:54:07 2018
@author: bsala_000
"""
import os
import numpy as np
import pandas as pd
def getFilename(RECORDS_DIR='myo_data'):
"""
Function to allow user to pick filename of CSV to load in the
input records directory. Filename is ... | 3.40625 | 3 |
Hartree-Fock_H2/utils.py | WonhoZhung/CH502 | 0 | 23596 | #----------------------------------------------------------------------
# Basis Set Exchange
# Version v0.8.13
# https://www.basissetexchange.org
#----------------------------------------------------------------------
# Basis set: STO-3G
# Description: STO-3G Minimal Basis (3 functions/AO)
# Role: orbital
# ... | 1.796875 | 2 |
focus_testmap.py | Driftwood2D/blue | 0 | 23597 | def setup():
# Insert light.
Driftwood.light.insert("lightmap_circle1.png", 2, 64, 60, 56, 56, "22FF66DD")
| 1.578125 | 2 |
my_wallet/apiv1/permissions.py | ibolorino/wallet_backend | 0 | 23598 | <filename>my_wallet/apiv1/permissions.py
from rest_framework import permissions
class IsAadminOrReadOnly(permissions.BasePermission):
"""
The request is authenticated as a admin, or is a read-only request.
"""
def has_permission(self, request, view):
return bool(
(request.user and ... | 2.328125 | 2 |
automate_insurance_pricing/preprocessing/descriptive_functions.py | nassmim/automate-insurance-pricing-nezz | 2 | 23599 | import pandas as pd
def derive_termination_rate_year(df, start_business_year, extraction_year, main_column_contract_date, policy_id_column_name, column_to_sum_name):
"""Derives the contracts termination rates per year
Arguments --> the dataframe, the business starting year, the extraction year
... | 3 | 3 |