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 |
|---|---|---|---|---|---|---|
owllook/fetcher/cache.py | 5665750/owllook | 1 | 31700 | #!/usr/bin/env python
"""
Created by howie.hu.
"""
import re
import aiohttp
import async_timeout
from bs4 import BeautifulSoup
from aiocache.serializers import PickleSerializer,JsonSerializer
from urllib.parse import urlparse, parse_qs, urljoin
from owllook.database.mongodb import MotorBase
from owllook.fetcher.de... | 2.1875 | 2 |
asnets/experiments/actprop_2l_h_add_pe.py | xf1590281/ASNets | 21 | 31701 | """A two-layer configuration for the action/proposition network w/ h-add
teacher & probabilistic evaluation (hence "_pe" at end of name)."""
# use defaults from actprop_2l
from .actprop_2l_h_add import * # noqa F401
# stochastic evaluation!
DET_EVAL = False
EVAL_ROUNDS = 30
| 1.414063 | 1 |
tests/conftest.py | catalystneuro/HDF5Zarr | 7 | 31702 | <reponame>catalystneuro/HDF5Zarr
import pytest
import os
from shutil import copy
from test_hdf5zarr import HDF5ZarrBase
def pytest_addoption(parser):
parser.addoption(
"--hdf5files",
action="append",
type=str,
default=[],
help="list of hdf5 files to test",
)
parser.... | 2.25 | 2 |
ksj.py | itspuneet/itspuneet | 0 | 31703 | <filename>ksj.py
a=list(input().split(','))
st,num=[],[]
for i in a:
s1,n=i.split(':')
st.append(s1)
num.append(n)
print(st)
print(num)
for i in range(len(num)):
for j in range(i):
print(st[j])
| 3.5 | 4 |
tutorials/W3D1_RealNeurons/solutions/W3D1_Tutorial3_Solution_a0b79725.py | NinelK/course-content | 26 | 31704 |
"""
Discussion:
Because we have a facilitatory synapses, as the input rate increases synaptic
resources released per spike also increase. Therefore, we expect that the synaptic
conductance will increase with input rate. However, total synaptic resources are
finite. And they recover in a finite time. Therefore, at... | 2.515625 | 3 |
Gathered CTF writeups/2018-09-01-tokyowesterns/crypto_mixed/MTRecover.py | mihaid-b/CyberSakura | 1 | 31705 | <reponame>mihaid-b/CyberSakura
import random
class MT19937Recover:
"""Reverses the Mersenne Twister based on 624 observed outputs.
The internal state of a Mersenne Twister can be recovered by observing
624 generated outputs of it. However, if those are not directly
observed following a twist, another... | 3.234375 | 3 |
src/oci/ocvp/models/hcx_license_summary.py | Manny27nyc/oci-python-sdk | 0 | 31706 | <gh_stars>0
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.... | 1.90625 | 2 |
nlpaug/model/audio/normalization.py | techthiyanes/nlpaug | 3,121 | 31707 | import numpy as np
from nlpaug.model.audio import Audio
class Normalization(Audio):
def manipulate(self, data, method, start_pos, end_pos):
aug_data = data.copy()
if method == 'minmax':
new_data = self._min_max(aug_data[start_pos:end_pos])
elif method == 'max':
new_data = self._max(aug_data[start_pos:en... | 2.90625 | 3 |
most_valuable_features.py | littlepretty/NetLearner | 22 | 31708 | from __future__ import print_function, division
import numpy as np
weights = np.transpose(np.load('w0.npy'))
print(weights.shape)
feature_names = ["" for i in range(125)]
prev = 0
prev_name = ''
for line in open('feature_names.txt'):
if line.startswith('#'):
continue
words = line.split()
index = ... | 2.53125 | 3 |
auscophub/geomutils.py | CopernicusAustralasia/auscophub | 4 | 31709 | <filename>auscophub/geomutils.py
"""
Some utility functions for handling the geometries given with Sentinel files.
ESA have done a fairly minimal job with their footprint geometries. The routines in this
file are mostly aimed at providing a bit more support beyond that, mostly for things like
crossing the Internation... | 2.71875 | 3 |
visualize.py | mac389/semantic-distance | 2 | 31710 | <reponame>mac389/semantic-distance
import os, json, matplotlib
matplotlib.use('Agg')
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
READ = 'rb'
directory = json.load(open('directory.json',READ))
filename = os.path.join(directory['data-prefix'],'test-similarity-matrix... | 2.609375 | 3 |
packages/mono-basic.py | bratsche/bockbuild | 0 | 31711 | GitHubTarballPackage ('mono', 'mono-basic', '3.0', 'a74642af7f72d1012c87d82d7a12ac04a17858d5',
configure = './configure --prefix="%{prefix}"',
override_properties = { 'make': 'make' }
)
| 1.046875 | 1 |
idadesRenovacao/main.py | felipefreitassilva/Smaller-Projects | 0 | 31712 | <gh_stars>0
import sys
def main():
#idade para abilitação
ipa = int(input("Quantos anos você tinha quando se inscreveu para tirar a habilitação? "))
if ipa < 18:
print()
print("Opa, tem algo errado! Você precisa de pelo menos 18 anos para tirar a carteira")
sys.exit()
#datas d... | 3.734375 | 4 |
volume/src/backend/db_create.py | sunokpa/st-kilda-pier | 1 | 31713 | from run import db
import sqlalchemy
import os, uuid, base62
DB_HOST = "mysql-skp"
DB_USER = "root"
DB_PW = os.environ['MYSQL_ROOT_PASSWORD']
DB_NAME = "flask_skp"
DB_ENGINE_URI = "mysql://{}:{}@{}".format(DB_USER, DB_PW, DB_HOST)
engine = sqlalchemy.create_engine(DB_ENGINE_URI)
try:
engine.execute("DROP DATABA... | 2.46875 | 2 |
orcid_oauth/tests/views/test_user_complete_account_view.py | betagouv/euphrosyne | 1 | 31714 | from http import HTTPStatus
from unittest.mock import patch
from django.test.testcases import TestCase
from django.urls import reverse
from euphro_auth.models import User
from ...views import UserCompleteAccountView
class PartialMock:
kwargs = {
"user": User(
id=1,
email="<EMAIL... | 2.625 | 3 |
src/conductor/task_types/base.py | geoffxy/conductor | 0 | 31715 | <gh_stars>0
import pathlib
from typing import Callable, Dict, Sequence, Optional
import conductor.context as c # pylint: disable=unused-import
import conductor.filename as f
from conductor.task_identifier import TaskIdentifier
from conductor.utils.output_handler import OutputHandler
class TaskType:
def __init__... | 2.046875 | 2 |
blog/migrations/0008_auto_20190107_1755.py | dkowsikpai/librolet | 0 | 31716 | # Generated by Django 2.1.3 on 2019-01-07 12:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0007_auto_20190107_1750'),
]
operations = [
migrations.RemoveField(
model_name='postpick',
name='user',
... | 1.601563 | 2 |
lintcode/0521-remove-duplicate-numbers-in-array.py | runzezhang/Data-Structure-and-Algorithm-Notebook | 1 | 31717 | # Description
# 中文
# English
# Given an array of integers, remove the duplicate numbers in it.
# You should:
# Do it in place in the array.
# Move the unique numbers to the front of the array.
# Return the total number of the unique numbers.
# You don't need to keep the original order of the integers.
# Have you met... | 4.15625 | 4 |
GCE/data_generation.py | FloList/GCE_NN | 6 | 31718 | """
Generate and save maps for each template.
"""
import random
import numpy as np
from scipy import stats
import healpy as hp
import matplotlib.pyplot as plt
import os
import pickle
from .data_utils import get_fermi_pdf_sampler, masked_to_full
from .utils import multipage, auto_garbage_collect
import ray
import time
i... | 2.234375 | 2 |
test/test_torch.py | li012589/tf_gpu_manager | 1 | 31719 | <reponame>li012589/tf_gpu_manager
import os
import sys
sys.path.append(os.getcwd())
import torch
from manager_torch import torchGPUmanager
def test_tf_auto_choice():
t = torchGPUmanager()
with t.choice():
x = torch.Tensor(8, 42)
x = x.cuda()
print(x)
if __name__ == "__main__":
te... | 2.28125 | 2 |
100_days_challenge/days_1-5/day2_practice_bmi_calculator.py | AJP-432/python_100days_course | 0 | 31720 | # Asking for height and weight input
height = float(input("What is your height in meters: "))
weight = float(input("What is your weight in kilograms: "))
# Calculating BMI (formula is weight/height^2)
bmi = str(round(weight/(height ** 2), 2))
# Printing BMI
print("Your BMI is " + bmi)
| 4.1875 | 4 |
slack-to-lake/function_ingest/main.py | data-learning-guild/slack-data-pipeline | 0 | 31721 | import datetime
import io
import json
import jsonlines
import logging
import os
import pytz
import shutil
import sys
import tempfile
from flask import Request
from google.cloud import exceptions
from google.cloud import storage
from google.cloud import pubsub_v1
from google.api_core.exceptions import AlreadyExists
from... | 2.21875 | 2 |
posthog/settings/overrides.py | msnitish/posthog | 0 | 31722 | # Imported before anything else to overwrite env vars!
import os
import sys
"""
There are several options:
1) running in pycharm
second argument is "test"
2) running pytest at the CLI
first argument is the path to pytest and ends pytest
3) running pytest using the script at /bin/tests
first ar... | 2.484375 | 2 |
BleVibrationDevice.py | Suitceyes-Project-Code/Vibration-Pattern-Player | 0 | 31723 | from bluepy.btle import UUID, Peripheral
from VestDeviceBase import VestDevice
class BleVestDevice(VestDevice):
def __init__(self, deviceAddr):
try:
self._peripheral = Peripheral(deviceAddr)
serviceUUID = UUID("713d0000-503e-4c75-ba94-3148f18d941e")
characteristicUUID = ... | 2.859375 | 3 |
src/maintenance/pushover.py | dragonee/maintenance | 0 | 31724 |
import requests
from .config.pushover import PushoverConfigFile
def notify(message, title=None, priority=None):
c = PushoverConfigFile()
payload = {
'user': c.user,
'token': c.token,
'message': message,
}
if title:
payload['title'] = title
if priority:
p... | 2.46875 | 2 |
app.py | zalando-incubator/github-user-team-sync | 5 | 31725 | #!/usr/bin/env python3
import collections
import itertools
import json
import logging
import os
import requests
import time
import zign.api
from unittest.mock import MagicMock
ALL_ORGANIZATION_MEMBERS_TEAM = 'All Organization Members'
github_base_url = "https://api.github.com/"
logger = logging.getLogger('app')
s... | 2.078125 | 2 |
corehq/ex-submodules/casexml/apps/case/xform.py | akashkj/commcare-hq | 0 | 31726 | from collections import namedtuple
from itertools import groupby
import itertools
from django.db.models import Q
from casexml.apps.case.const import UNOWNED_EXTENSION_OWNER_ID, CASE_INDEX_EXTENSION
from casexml.apps.case.signals import cases_received
from casexml.apps.case.util import validate_phone_datetime, prune_pr... | 1.804688 | 2 |
src/adverts/migrations/0002_auto_20150809_2147.py | alekseyr/pyjobs | 1 | 31727 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('adverts', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name=... | 1.679688 | 2 |
src/data_generators/pricing_generator.py | pasin30055/planning-evaluation-framework | 0 | 31728 | <reponame>pasin30055/planning-evaluation-framework<filename>src/data_generators/pricing_generator.py
# Copyright 2021 The Private Cardinality Estimation Framework Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | 2.421875 | 2 |
flow_py_sdk/templates.py | peeksocial/flow-py-sdk | 0 | 31729 | from typing import Annotated
import flow_py_sdk.cadence as cadence
from flow_py_sdk.signer import AccountKey
from flow_py_sdk.tx import Tx, ProposalKey
def create_account_template(
*,
keys: list[AccountKey],
reference_block_id: bytes = None,
payer: cadence.Address = None,
proposal_key: ProposalKe... | 2.203125 | 2 |
base_python/cogment_verse/run/run_sample_producer_session.py | kharyal/cogment-verse | 23 | 31730 | # Copyright 2021 AI Redefined Inc. <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 1.960938 | 2 |
tests/unit/scalar/test_datetime.py | alexchamberlain/tartiflette | 0 | 31731 | import datetime
import pytest
@pytest.mark.parametrize(
"val,expected",
[
(datetime.datetime(1986, 12, 24, 15, 0, 4), "1986-12-24T15:00:04"),
(None, AttributeError),
("A", AttributeError),
],
)
def test_scalar_datetime_coerce_output(val, expected):
from tartiflette.scalar.buil... | 2.78125 | 3 |
mymail.py | metaperl/freegold-focus | 0 | 31732 | <filename>mymail.py
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send(text, html, email, name, cc):
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
me = "<EMAIL>"
you = email
COMMAS... | 3.578125 | 4 |
keras_frcnn/pascal_voc_parser.py | touchylk/fgcnn | 0 | 31733 | <reponame>touchylk/fgcnn<filename>keras_frcnn/pascal_voc_parser.py<gh_stars>0
# -*- coding: utf-8 -*-
import os
import cv2
import xml.etree.ElementTree as ET
import config
import numpy as np
cfg = config.Config()
def get_data(input_path):
all_imgs = []
classes_count = {}
class_mapping = {}
bird_classes_count ={}... | 2.296875 | 2 |
constants.py | granthitson/8ballbot | 1 | 31734 |
# IMAGES #
# UI NAVIGATION #
img_addFriend = "add_friend.png"
img_allow = "allow.png"
img_allowFlash = "enableflash_0.png"
img_allowFlash1 = "enableflash_1.png"
img_allowFlash2 = "enableflash_2.png"
img_alreadyStarted = "alreadystarted.png"
img_alreadyStarted1 = "alreadystarted1.png"
img_backButton = "back_button.png... | 1.21875 | 1 |
code/pyto/analysis/test/all_catalogs/catalog_3.py | anmartinezs/pyseg_system | 12 | 31735 | <gh_stars>10-100
../catalogs_a/catalog_3.py | 1.101563 | 1 |
tests/contracts/KT1Ki9hCRhWERgvVvXvVnFR3ruwM9sR5eLAN/test_michelson_coding_KT1Ki9.py | juztin/pytezos-1 | 1 | 31736 | from unittest import TestCase
from tests import get_data
from pytezos.michelson.micheline import michelson_to_micheline
from pytezos.michelson.formatter import micheline_to_michelson
class MichelsonCodingTestKT1Ki9(TestCase):
def setUp(self):
self.maxDiff = None
def test_michelson_parse_code_KT... | 2.71875 | 3 |
data_generation/chatbots/restaurant/state_ordering.py | ivanmkc/helpdesk-assistant | 0 | 31737 | <filename>data_generation/chatbots/restaurant/state_ordering.py<gh_stars>0
from typing import List
from rasa.shared.nlu.state_machine.conditions import (
IntentCondition,
OnEntryCondition,
SlotEqualsCondition,
)
from rasa.shared.nlu.state_machine.state_machine_models import (
BooleanSlot,
IntentWit... | 2.21875 | 2 |
day10/part1.py | mtn/advent15 | 0 | 31738 | #!/usr/bin/env python3
from itertools import groupby
inp = "1113222113"
for i in range(40):
next_str = "".join(str(len(list(v))) + k for k, v in groupby(inp))
inp = next_str
print(len(inp))
| 3.21875 | 3 |
nuvolaris/main.py | giusdp/nuvolaris-operator | 0 | 31739 | <reponame>giusdp/nuvolaris-operator
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version ... | 1.789063 | 2 |
didcomm/common/utils.py | alex-polosky/didcomm-python | 8 | 31740 | from typing import Iterable, Callable, Optional, Any
# TODO check the same helper in standard lib
# TODO test
def search_first_in_iterable(
it: Iterable, cond: Callable, not_found_default=None
) -> Optional[Any]:
return next((el for el in it if cond(el)), not_found_default)
| 3 | 3 |
derbot/names/signals.py | bdunnette/derbot | 0 | 31741 | <reponame>bdunnette/derbot
from django.db.models.signals import pre_save
from django.dispatch import receiver
import random
import fractions
import humanize
# from derbot.names.tasks import generate_number
from derbot.names.models import DerbyName
@receiver(pre_save, sender=DerbyName)
def generate_number(sender, ins... | 2 | 2 |
letalisce_splet.py | kulan89/PyJet | 0 | 31742 | import modeli as modeli
from bottle import *
from datetime import datetime
from collections import defaultdict
import hashlib
glavniMenuAktivniGumb=""
glavniMenuTemplate = '''<li><a {gumbRezervacija} href="/izbiraDestinacije" >Rezervacija leta</a></li>
<li><a {gumbReferencna} href="/referencna">Informacije o r... | 2.421875 | 2 |
daml_dit_if/main/common.py | digital-asset/daml-dit-if | 1 | 31743 | <reponame>digital-asset/daml-dit-if<gh_stars>1-10
import sys
import collections
from asyncio import wait_for
from dataclasses import dataclass
from datetime import datetime
from functools import wraps
from typing import Optional
from dazl import AIOPartyClient
from ..api import IntegrationResponse
from .log import ... | 1.992188 | 2 |
setup.py | Kleinrotti/py-senertec | 0 | 31744 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="py-senertec",
version="0.2.2",
author="Kleinrotti",
author_email="",
package_dir={"": "src"},
packages=setuptools.find_packages("src"),
description="Senertec energy system gen2 int... | 1.507813 | 2 |
sunpy-example.py | wtbarnes/rice-hpc-examples | 0 | 31745 | """
Some simple coordinate transformations with SunPy
Adapted from https://github.com/sunpy/sunpy/blob/master/examples/units_and_coordinates/AltAz_Coordinate_transform.py
"""
from astropy.coordinates import EarthLocation, AltAz, SkyCoord
from astropy.time import Time
from sunpy.coordinates import frames, get_sunearth_d... | 3.109375 | 3 |
src/types/program.py | embiem/chia-blockchain | 2 | 31746 | <reponame>embiem/chia-blockchain<gh_stars>1-10
import io
from typing import Any, List, Set
from src.types.sized_bytes import bytes32
from src.util.clvm import run_program, sexp_from_stream, sexp_to_stream
from clvm import SExp
from src.util.hash import std_hash
from clvm_tools.curry import curry
class Program(SExp)... | 2.375 | 2 |
src/extract_image_features.py | Bashkeel/petfinderadoption | 0 | 31747 | import cv2
import pandas as pd
import numpy as np
import os
from pathlib import Path
from keras.applications.densenet import preprocess_input, DenseNet121
from keras.models import Model
from keras.layers import GlobalAveragePooling2D, Input, Lambda, AveragePooling1D
import keras.backend as K
def resize_to_square(im):
... | 2.53125 | 3 |
scripts/checkPatterns.py | bbloomf/hyphen-la | 18 | 31748 | <filename>scripts/checkPatterns.py<gh_stars>10-100
#!/usr/bin/env python3
"""
Hyphenation file checker
Copyright (C) 2016 <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 Softw... | 3.390625 | 3 |
python/coroutine/operatingSystem/echoServer.py | wjiec/packages | 0 | 31749 | <filename>python/coroutine/operatingSystem/echoServer.py
#!/usr/bin/env python3
import scheduler
from systemCall import *
import threading
import socket, time, random
def handleClient(client, address):
print('>>> client connect[%s:%s]' % address)
while True:
data = yield sockRecv(client, 1... | 2.90625 | 3 |
benchmarks/Python/towers.py | OvermindDL1/are-we-fast-yet | 0 | 31750 | <gh_stars>0
# This code is based on the SOM class library.
#
# Copyright (c) 2001-2021 see AUTHORS.md file
#
# 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 wit... | 2.171875 | 2 |
src/panoramic/cli/metadata/engines/inspector.py | kubamahnert/panoramic-cli | 5 | 31751 | from datetime import date, datetime, time
from typing import cast
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql.type_api import TypeEngine
from tqdm import tqdm
from panoramic.cli.connection import Connection
from panoramic.cli.husky.core.taxonomy.enums import ValidationType
from panoramic.cl... | 2.234375 | 2 |
pymeasure/virtual/power_test_setup.py | tinix84/pymeasure | 2 | 31752 | class EfficiencyMeasurement():
# input_voltage = None
# input_current = None
# output_voltage = None
# output_current = None
# input_power = None
# output_power = None
# loss_power = None
# efficiency = None
def __init__(self, input_voltage: float, input_current: float,
... | 2.875 | 3 |
NeoSparkAnalyzer.py | m4rok97/NeoSparkAnalyzer | 1 | 31753 | <gh_stars>1-10
from pyspark.sql import SparkSession
import pyspark.sql.functions as F
from pyspark.sql.types import *
from AnomalyDetection import *
from NeoDatabase import *
import pyspark
import time as tm
import numpy as np
# region NeoSaprk Analyzer Class
class NeoSparkAnalyzer:
"""
Class that represent ... | 2.453125 | 2 |
scripts/common/parse_spark_logs/taskDuration.py | SobhanOmranian/spark-dca | 2 | 31754 | <gh_stars>1-10
import json
from pprint import pprint
from urllib.request import urlopen
import csv
class Task:
def __init__(self, taskId, duration, gcTime, executorId):
self.taskId = int(taskId)
self.duration = int(duration)
self.gcTime = int(gcTime)
self.executorId = int(executorI... | 2.984375 | 3 |
heksher/api/v1/settings_metadata.py | biocatchltd/Heksher | 3 | 31755 | <reponame>biocatchltd/Heksher<gh_stars>1-10
from logging import getLogger
from typing import Any, Dict, Optional
from fastapi import APIRouter, Response
from pydantic import Field
from starlette import status
from starlette.responses import PlainTextResponse
from heksher.api.v1.util import ORJSONModel, application
fr... | 2.328125 | 2 |
package/Y.py | onnoeberhard/scipro-primer-notebooks | 16 | 31756 | <filename>package/Y.py
class Y:
def __init__(self, v0):
self.v0 = v0
self.g = 9.81
def value(self, t):
return self.v0*t - 0.5*self.g*t**2
def formula(self):
return "v0*t - 0.5*g*t**2; v0=%g" % self.v0
| 3.25 | 3 |
array.py | nkukadiya89/learn-python | 1 | 31757 | #Array In Python
from array import array
numbers = array("i",[1,2,3])
numbers[0] = 0
print(list(numbers))
| 3.640625 | 4 |
day19/part2.py | mtn/advent16 | 0 | 31758 | <gh_stars>0
#!/usr/bin/env python3
from collections import deque
inp = 3005290
l = deque()
r = deque()
for i in range(1, inp+1):
if i <= inp // 2:
l.append(i)
else:
r.appendleft(i)
while l and r:
if len(l) > len(r):
l.pop()
else:
r.pop()
r.appendleft(l.popleft())... | 3.140625 | 3 |
src/figcli/test/cli/config.py | figtools/figgy-cli | 36 | 31759 | <reponame>figtools/figgy-cli
import os
### For PS items stored with this value, we will auto-clean them up from our audit table. Used for automated E2E testing.
DELETE_ME_VALUE = 'DELETE_ME' ### <-- use this for ALL VALUES
MFA_USER_ENV_KEY = 'MFA_USER'
MFA_SECRET_ENV_KEY = 'MFA_SECRET'
# Env vars
GOOGLE_SSO_USER = '... | 1.546875 | 2 |
SushiCat.py | Carlos-E-Souza/Pyxel_Game | 0 | 31760 | from collections import deque, namedtuple
from random import randint
import pyxel
Point = namedtuple("Point", ["x", "y"])
BACKGRD_COL = 3
WIDTH = 200
HEIGHT = 200
UP = Point(0, -3)
DOWN = Point(0, 3)
RIGHT = Point(3, 0)
LEFT = Point(-3, 0)
START = Point(125, 125)
class Cat:
def __init__(self):
self.cat ... | 3.171875 | 3 |
helper_functions.py | dadam1026/Homework1v2 | 0 | 31761 | <reponame>dadam1026/Homework1v2
# Contains helper functions for your apps!
from os import listdir, remove
# If the io following files are in the current directory, remove them!
# 1. 'currency_pair.txt'
# 2. 'currency_pair_history.csv'
# 3. 'trade_order.p'
def check_for_and_del_io_files():
# Your code goes here.
... | 3.609375 | 4 |
kinesis/serializers.py | graphyteai/async-kinesis | 17 | 31762 | try:
import ujson as json
except ModuleNotFoundError:
# https://github.com/python/mypy/issues/1153 (mypy bug with try/except conditional imports)
import json # type: ignore
try:
import msgpack
except ModuleNotFoundError:
pass
class Serializer:
pass
class StringSerializer(Serializer):
d... | 2.5 | 2 |
test.py | joders/logging_tqdm | 0 | 31763 | <filename>test.py
from logging_tqdm import tqdm
import time
print("Testing tqdm-logging:")
for i in tqdm(range(100)):
time.sleep(.02)
print("\n\n\n")
print("Testing tqdm-logging with exception:")
try:
for i in tqdm(range(100)):
if i == 75:
raise Exception("Some Exception")
time.s... | 2.8125 | 3 |
commontail/default_settings.py | einsfr/commontail | 0 | 31764 | <gh_stars>0
from typing import List, Tuple
COMMONTAIL_CONTENT_STREAM_PAGE_BODY_BLOCK: str = 'commontail.blocks.ContentStreamBlock'
COMMONTAIL_LINK_ICON_DOCUMENT_DEFAULT = 'far fa-file'
COMMONTAIL_LINK_ICON_EXTERNAL = 'fas fa-globe'
COMMONTAIL_NAMED_URL_CACHE_KEY_PREFIX: str = 'named_url_'
COMMONTAIL_NAMED_URL_CACHE_... | 1.601563 | 2 |
python_basics/4.arithmetic_operators/discount_challenge.py | edilsonmatola/Python_Master | 2 | 31765 | <gh_stars>1-10
"""
* Problem Description
*Suppose you are a university student and you need to pay 1536 dollars as a tuition fee.
*The college is offering a 10% discount on the early payment. How much money do you have to pay if you make an early payment?
*Task
*Create a variable named fee and assign 1536 to it.
*... | 4 | 4 |
robogym/envs/rearrange/tests/test_object_creation.py | 0xflotus/robogym | 288 | 31766 | import numpy as np
from numpy.testing import assert_allclose
from robogym.envs.rearrange.common.utils import (
get_mesh_bounding_box,
make_block,
make_blocks_and_targets,
)
from robogym.envs.rearrange.simulation.composer import RandomMeshComposer
from robogym.mujoco.mujoco_xml import MujocoXML
def _get_d... | 1.929688 | 2 |
package/tests/base/test_grid.py | mondas-mania/cipher-py | 0 | 31767 | <reponame>mondas-mania/cipher-py<filename>package/tests/base/test_grid.py
from cipherpy.base import create_grid, playfair_digram_encode
import numpy as np
import pytest
alphabet = "abcdefghiklmnopqrstuvwxyz" # j has been removed
inv_alph = "zyxwvutsrqponmlkihgfedcba" # j has been removed
grid = np.array([
["a","b"... | 2.375 | 2 |
dnppy/landsat/atsat_bright_temp.py | NASA-DEVELOP/dnppy | 65 | 31768 | <filename>dnppy/landsat/atsat_bright_temp.py<gh_stars>10-100
#standard imports
import arcpy
import os
from dnppy import core
from landsat_metadata import landsat_metadata
if arcpy.CheckExtension('Spatial')=='Available':
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
__all__=['atsat_brigh... | 2.671875 | 3 |
Scripts/Fig 8 - Compare optimal APs.py | CardiacModelling/Gamma_0 | 0 | 31769 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 9 09:42:00 2021
@author: barraly
"""
import sabs_pkpd
import numpy as np
import matplotlib.pyplot as plt
import os
# Select the folder in which this repo is downloaded in the line below
os.chdir('The/location/of/the/root/folder/of/this/repo')
# In[Loa... | 1.945313 | 2 |
keras_sample.py | JustinFletcher/patterns | 0 | 31770 |
import sys
import argparse
import numpy as np
import tensorflow as tf
from tensorflow import keras
class SampleModel(keras.Model):
def __init__(self, num_classes=10):
super(SampleModel, self).__init__(name='my_model')
self.num_classes = num_classes
# Define your layers here.
s... | 3.390625 | 3 |
main.py | glhrmfrts/instr | 0 | 31771 | from instr.instruments import *
from instr.effects import *
s = Sqr().bind(tremolo(), echo(0.4, 0.8)).loop(2, [(244, 1), (289, 1), (365, 2)]).loop(4, [(244, 0.1), (289, 0.1), (365, 0.1), (1, 0.1), (237, 0.1), (1, 0.1)]).save('tests/instr.wav')
| 1.5625 | 2 |
mistral/notifiers/default_notifier.py | Abnerzhao/mistral | 0 | 31772 | <reponame>Abnerzhao/mistral<filename>mistral/notifiers/default_notifier.py
# Copyright 2018 - Extreme Networks, Inc.
#
# 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.726563 | 2 |
class_4/dungeon.py | goosemanjack/python_intro_class | 0 | 31773 | # Dungeon Crawler
import asciiart
import level1
import level2
import time # timer
import hero
#def test():
# print(asciiart.baby_dragon())
# print(asciiart.big_skull())
# print(asciiart.dragon())
# print(asciiart.samurai())
# print(asciiart.skull_cross())
# print(asciiart.warrior())
# print(as... | 3.53125 | 4 |
getTotalCount.py | bdo311/chirpseq-analysis | 3 | 31774 | <gh_stars>1-10
# getTotalCount.py
# 3/1/14
# Gets total count for all ChIP-seq reads
import csv, sys, fileinput
csv.register_dialect("textdialect", delimiter='\t')
if len(sys.argv) > 1:
fn = sys.argv[1]
ifile = open(fn, 'r')
reader = csv.reader(ifile, 'textdialect')
total = 0
counter = 0
for ro... | 2.65625 | 3 |
heatclient/tests/fakes.py | jasondunsmore/python-heatclient | 0 | 31775 | <reponame>jasondunsmore/python-heatclient
# 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... | 2.046875 | 2 |
mail/mail.py | Infosecurity-LLC/thehive_responders | 0 | 31776 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from logging.handlers import TimedRotatingFileHandler
from logging import Formatter, getLogger
import os
from socutils import mail
from responder_commons.report_maker import IncidentReportMaker, logger as responder_commons_logger
from responder_commons.mailreporter_clien... | 2.234375 | 2 |
open_alchemy/column_factory/column.py | codingjoe/OpenAlchemy | 0 | 31777 | <gh_stars>0
"""Column factory functions relating to columns."""
import typing
import sqlalchemy
from open_alchemy import exceptions
from open_alchemy import helpers
from open_alchemy import types
def handle_column(
*,
schema: types.Schema,
schemas: typing.Optional[types.Schemas] = None,
required: t... | 2.484375 | 2 |
planar_ising/lipton_tarjan/__init__.py | ValeryTyumen/planar_ising | 8 | 31778 | from .planar_separator import PlanarSeparator
from . import separation_class
| 1.210938 | 1 |
ecs_infra/ecs-devops-sandbox-cdk/ecs_devops_sandbox_cdk/ecs_devops_sandbox_cdk_stack.py | Covert-Operations/aws_codebuild_test | 0 | 31779 | <reponame>Covert-Operations/aws_codebuild_test
"""AWS CDK module to create ECS infrastructure"""
from aws_cdk import (core, aws_ecs as ecs, aws_ecr as ecr, aws_ec2 as ec2, aws_iam as iam)
class EcsDevopsSandboxCdkStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
supe... | 2.125 | 2 |
binanceapi/constant.py | ramoslin02/binanceapi | 4 | 31780 | <reponame>ramoslin02/binanceapi<filename>binanceapi/constant.py
from enum import Enum
class OrderStatus(object):
"""
Order Status
"""
NEW = "NEW"
PARTIALLY_FILLED = "PARTIALLY_FILLED"
FILLED = "FILLED"
CANCELED = "CANCELED"
PENDING_CANCEL = "PENDING_CANCEL"
REJECTED = "REJECTED"
... | 2.890625 | 3 |
js_services/forms.py | evgeny-dmi3ev/js-services | 0 | 31781 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.conf import settings
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.utils.text import slugify
from django.utils.safestring import mark_safe
try:
from sortedm2m_filter_horizontal_widget.f... | 2.140625 | 2 |
src/python/grpcio/grpc/experimental/aio/__init__.py | nondejus/grpc | 3 | 31782 | <reponame>nondejus/grpc
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 2.03125 | 2 |
trainer.py | Ayush8120/PocketTanks | 0 | 31783 | import os
import threading
import time
from collections import deque
import numpy as np
from threading import Thread
from agents.dqn_agent import DqnAgent
from main import App
# Number of games to play
from utils.logger import DataLogger
n_episodes = 10000
save_period = 50 # Saves off every n episodes' model
bat... | 2.6875 | 3 |
tests/splinter/repeating_area/test_areas.py | jsfehler/stere | 17 | 31784 | import logging
import pytest
from selenium.webdriver.remote.remote_connection import LOGGER
from stere.areas import Area, Areas
LOGGER.setLevel(logging.WARNING)
def test_areas_append_wrong_type():
"""Ensure a TypeError is raised when non-Area objects are appended
to an Areas.
"""
a = Areas()
... | 2.703125 | 3 |
tests/sqlstore_tests.py | tistaharahap/oauth1-provider | 1 | 31785 | import with_sql as sqlprovider
import unittest
class SQLStoreTestCase(unittest.TestCase):
def setUp(self):
sqlprovider.app.config['TESTING'] = True
self.app = sqlprovider.app.test_client()
def error_mime_json(self):
return "Return payload data must be a JSON String"
def error_no... | 2.53125 | 3 |
saph/users/views/auth.py | smallproblem/saph | 0 | 31786 | from django.contrib.auth.models import User
from django.contrib.auth.views import LoginView
from django.contrib.auth.forms import AuthenticationForm
from django.views.generic import CreateView
from django.shortcuts import reverse, redirect
from users.forms import JoinusForm
class LoginView(LoginView):
template_n... | 2.15625 | 2 |
workers/portscanner.py | wotschel/Forker | 0 | 31787 | <filename>workers/portscanner.py
#!/usr/bin/env python3
import socket
#debugon = False
#forks = 3
worklist = ["localhost", "127.0.0.1"]
def worker(var):
sock = None
ports = [21, 22, 25, 80, 110, 443, 445, 3306]
# for port in range(1, 65536):
for port in ports:
try:
sock = sock... | 2.9375 | 3 |
bin/sm_mp_incd.py | pjmartel/consequent | 0 | 31788 | import numpy as np
from random import sample, seed
#import matplotlib.pyplot as plt
from sys import argv, stdout
#from scipy.stats import gumbel_r
from score_matrix import readScoreMatrix, getMatrix
from seqali import smithWaterman, smithFast, plotMat, plotTraceMat
from multiprocessing import Process, Manager
def scra... | 2.234375 | 2 |
Grayscale Image Denoising/noise.py | Yemen-Romanian/pattern-recognition | 0 | 31789 | <filename>Grayscale Image Denoising/noise.py<gh_stars>0
import numpy as np
def gaussian_noise(image, mean=0, var=1):
n_rows, n_cols = image.shape
noise = np.random.normal(mean, var**0.5, (n_rows, n_cols))
noise = noise.reshape((n_rows, n_cols))
result = (noise + image).astype(np.uint8)
# print(np.... | 2.828125 | 3 |
tweet.py | Mar199605/sentiment_visual | 0 | 31790 | import os
import time
import csv
import json
import re
import twint
from cleantext import clean
from textblob import TextBlob
from google.cloud import translate_v2
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"C:\\Users\\ht_ma\\env\\service-account-file.json" # Key needed
translate_client_0 = translate... | 2.828125 | 3 |
hydroserver/physical_interfaces/camera_controller.py | gfvandehei/hydroponics-rpi-server | 0 | 31791 | <reponame>gfvandehei/hydroponics-rpi-server<gh_stars>0
import time
import cv2
from threading import Thread
import numpy as np
from hydroserver.physical_interfaces.camera_streamer import CameraStreamer
from hydroserver.physical_interfaces.camera_storage import CameraStore
import hydroserver.model.model as Model
... | 2.90625 | 3 |
src/bpmn_python/graph/classes/events/intermediate_catch_event_type.py | ToJestKrzysio/ProcessVisualization | 0 | 31792 | # coding=utf-8
"""
Class used for representing tIntermediateCatchEvent of BPMN 2.0 graph
"""
import graph.classes.events.catch_event_type as catch_event
class IntermediateCatchEvent(catch_event.CatchEvent):
"""
Class used for representing tIntermediateCatchEvent of BPMN 2.0 graph
"""
def __init__(sel... | 2.21875 | 2 |
pyIOS/exceptions.py | jtdub/pyIOS | 12 | 31793 | <gh_stars>10-100
class InvalidInputError(Exception):
pass
| 1.09375 | 1 |
purestorage/__init__.py | sile16/rest-client | 20 | 31794 | from .purestorage import FlashArray, PureError, PureHTTPError, VERSION
| 0.972656 | 1 |
gerryopt/compile.py | pjrule/gerryopt | 0 | 31795 | """Compiler/transpiler for the GerryOpt DSL."""
import ast
import json
import inspect
from copy import deepcopy
from textwrap import dedent
from dataclasses import dataclass, field, is_dataclass, asdict
from enum import Enum
from itertools import product
from typing import (Callable, Iterable, Sequence, Set, Dict, List... | 2.359375 | 2 |
tdi/dev_support/DevHelp.py | orozda/mdsplus | 0 | 31796 | <filename>tdi/dev_support/DevHelp.py
#
# Copyright (c) 2017, Massachusetts Institute of Technology 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 ... | 1.875 | 2 |
ncbi_single_use_genome.py | marco-mariotti/ncbi_single_use_genome | 0 | 31797 | #! /usr/bin/env -S python3 -u
import os, shutil, sys, glob, traceback
from easyterm import *
help_msg="""This program downloads one specific NCBI assembly, executes certains operations, then cleans up data
### Input/Output:
-a genome NCBI accession
-o folder to download to
### Actions:
-c bash command ... | 2.8125 | 3 |
World_1/002Usingformat.py | wesleyendliche/Python_exercises | 0 | 31798 | <reponame>wesleyendliche/Python_exercises
nome = input('Digite seu nome: ')
name = input('Type your name: ')
print('É um prazer te conhecer, {}{}{}!'.format('\033[1;36m', nome, '\033[m'))
print('It is nice to meet you, {}{}{}!'.format('\033[4;30m', name, '\033[m'))
| 3.59375 | 4 |
Module_06/tests/sauce_lab/test_checkout_details.py | JoseGtz/2021_python_selenium | 0 | 31799 | """Test cases for inventory item"""
import pytest
from Module_06.src.elements.inventory_item import InventoryItem
from Module_06.src.pages.login import LoginPage
from Module_06.tests.common.test_base import TestBase
from Module_06.src.pages.checkout_details import CheckoutDetailsPage
from Module_06.src.pages.checkout_... | 2.515625 | 3 |