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 |
|---|---|---|---|---|---|---|
templates/kvm.py | kakwa/kouignamann-core | 0 | 12772251 | <reponame>kakwa/kouignamann-core
<%
import uuid
import os
import random
imgdir = os.getenv("IMGDIR", "/var/lib/kvm")
isopath = os.getenv("ISOPATH", "/var/lib/kvm/isos/CentOS-7-custom-install.iso")
slot=1
global diskLetter
diskLetter='a'
# increment disk letter
def nextDiskLetter():
global diskLetter
diskLette... | 2.4375 | 2 |
src/datalakebundle/table/write/DataWriter.py | bricksflow/datalake-bundle | 0 | 12772252 | import string
import random
from logging import Logger
from pyspark.sql.session import SparkSession
from pyspark.sql.dataframe import DataFrame
from pyspark.sql.types import StructType
from datalakebundle.table.upsert.UpsertQueryCreator import UpsertQueryCreator
from datalakebundle.delta.DeltaStorage import DeltaStorag... | 2.546875 | 3 |
End2End_train.py | Tlili-ahmed/2BiVQA | 14 | 12772253 | """
Author :
<NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
from keras import backend as K
from tqdm.keras import TqdmCallback
from scipy.stats import spearmanr
from tensorflow.keras import Input
from tensorflow.keras import optimizers
from tensorflow.keras import models
from t... | 2.0625 | 2 |
alembic/versions/80ecdb88cee2_add_thumbnails_column.py | nemanjamart/graphics_service | 1 | 12772254 | <reponame>nemanjamart/graphics_service
"""Add thumbnails column
Revision ID: <KEY>
Revises: b9308d306405
Create Date: 2021-02-05 16:32:50.041223
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<... | 1.4375 | 1 |
platypush/backend/pushbullet/__init__.py | shineit/platypush | 1 | 12772255 | import logging
import json
import requests
import time
import websocket
from platypush.config import Config
from platypush.message import Message
from platypush.message.event.pushbullet import PushbulletEvent
from .. import Backend
class PushbulletBackend(Backend):
def __init__(self, token, device, **kwargs):
... | 2.453125 | 2 |
pkg/package.py | bruce30262/idapkg | 125 | 12772256 | <reponame>bruce30262/idapkg
"""
Package-related classes and methods are in pkg.package module. All constructing arguments are accessible via property.
"""
import ctypes
import glob
import json
import os
import random
import runpy
import shutil
import sys
import traceback
import zipfile
import ida_kernwin
import ida_l... | 2 | 2 |
setup.py | ofbennett/GreenGrapher | 0 | 12772257 | <filename>setup.py
from setuptools import setup, find_packages
setup(
name = 'greengrapher',
version = '1.0',
packages = find_packages(exclude = ['*test']),
scripts = ['scripts/greengraph.py'],
install_requires = ['numpy','matplotlib','geopy','requests','nose']
)
| 1.382813 | 1 |
tests/integration/test_groups.py | mobidevke/py-fineract | 7 | 12772258 | import random
from fineract.objects.group import Group
number = random.randint(0, 10000)
def test_create_group(fineract):
group = Group.create(fineract.request_handler, 'Test ' + str(number), 1)
assert isinstance(group, Group)
def test_get_group_by_name(fineract):
group = Group.get_group_by_name(finer... | 2.265625 | 2 |
src/tree.py | kinow/rosalind-exercises | 0 | 12772259 | import networkx as nx
if __name__ == '__main__':
n = 872
data = '''
633 397
336 423
583 800
457 20
707 797
61 1
494 672
382 140
282 62
782 188
463 478
571 456
531 8
119 294
863 190
49 205
224 70
88 118
80 139
854 273
66 74
234 155
789 120
225 353
446 767
346 163
796 779
66 450
130 38
228 793
262 263
41 204
21 ... | 2.03125 | 2 |
hammer2cbt.py | datguywitha3ds/CBT-FX | 2 | 12772260 | #!/usr/bin/env python3
import argparse
note_name = [
"FX_C_0", "FX_Cs0", "FX_D_0", "FX_Ds0", "FX_E_0", "FX_F_0", "FX_Fs0", "FX_G_0", "FX_Gs0", "FX_A_0", "FX_As0", "FX_B_0",
"FX_C_1", "FX_Cs1", "FX_D_1", "FX_Ds1", "FX_E_1", "FX_F_1", "FX_Fs1", "FX_G_1", "FX_Gs1", "FX_A_1", "FX_As1", "FX_B_1",
"FX_C_2", "FX_Cs2", "FX_D... | 1.671875 | 2 |
ml_service/app/auxiliary/celery_tools.py | AsAsgard/trading_pr | 2 | 12772261 | #!/usr/bin/env python
# coding: utf-8
import smtplib
import datetime
from dateutil.parser import parse
from flask_mail import Mail, Message
from app.auxiliary.query_tools import calc_time
from app.logger import Logger
def sendEmail(email, msg_body):
from app.fl_app import application
mail = Mail(application)... | 2.59375 | 3 |
sdk/python/pulumi_equinix_metal/organization.py | pulumi/pulumi-equinix-metal | 1 | 12772262 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 2.109375 | 2 |
test/test_polar_decoding.py | NVlabs/sionna | 163 | 12772263 | #
# SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
try:
import sionna
except ImportError as e:
import sys
sys.path.append("../")
import tensorflow as tf
gpus = tf.config.list_physical_devices('GPU')
print('Number ... | 2.015625 | 2 |
packages/legacycomponents/mcstas2/tests/mcstas2/parserFixtures.py | mcvine/mcvine | 5 | 12772264 | # -*- Python -*-
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 2010 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 2.03125 | 2 |
sdk/tests/ecs/test_graph.py | bentobox-dev/bento-box | 1 | 12772265 | #
# Bentobox
# SDK - Specifications
# Graph Specifications
#
from collections import OrderedDict
from typing import Set
from bento.ecs.graph import (
GraphComponent,
GraphEntity,
GraphNode,
to_str_attr,
wrap_const,
)
from bento.spec.ecs import ComponentDef, EntityDef
from bento.example.specs impor... | 2.234375 | 2 |
src/righter/utils.py | ef-ctx/righter | 6 | 12772266 | <filename>src/righter/utils.py<gh_stars>1-10
"""
Utilities for text analysis and parsing.
"""
import string
import unicodedata
def contains_digit(text):
"""
Check if text contains any number.
"""
for char in string.digits:
if char in text:
return True
return False
def remove_... | 3.125 | 3 |
final_results/csvplot_strong.py | pc2/n-body-ring-solver | 0 | 12772267 | <filename>final_results/csvplot_strong.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 13 14:39:12 2020
@author: tnellius
"""
import csv
import sys
from matplotlib import pyplot as plt
from matplotlib import rc
import numpy as np
import matplotlib.scale
#Configuration:
FONTSIZE = 12
BOLD = ... | 2.921875 | 3 |
viewer.py | MaddAddaM/LightRender | 0 | 12772268 | #!/usr/bin/env python
import argparse
import sys
import os
import pygame
import pygame.locals
import pygame.key
import pygame.time
from constants import CARTESIAN_COORDS
NUM_PIXELS = len(CARTESIAN_COORDS)
BYTES_PER_FRAME = 3 * NUM_PIXELS
FPS = 20
FRAMES_PER_SKIP = 5 * FPS
CANVAS = pygame.Rect((0, 0), (575, 575))
ST... | 2.96875 | 3 |
network/onet_layers.py | valeoai/NeeDrop | 26 | 12772269 | import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
# Resnet Blocks
class ResnetBlockFC(nn.Module):
''' Fully connected ResNet Block class.
Args:
size_in (int): input dimension
size_out (int): output dimension
size_h (int): hidden dimension
... | 2.53125 | 3 |
tests/tickets/test_views.py | allisson/django-pagseguro2-example | 13 | 12772270 | import pytest
import responses
import status
from django.urls import reverse
from apps.tickets.models import Purchase
pytestmark = pytest.mark.django_db
def test_event_list(admin_client, event):
url = reverse('tickets:event_list')
response = admin_client.get(url)
assert response.status_code == status.HT... | 2.15625 | 2 |
core/system.py | mackay/ble_detector | 0 | 12772271 | <reponame>mackay/ble_detector
from bunch import Bunch
from core.models import SystemOption
class SystemBase(object):
MODE_KEY = "mode"
MODES = Bunch({
"OFF": "off",
"RUN": "run",
"TRAINING": "training",
"TESTING": "testing",
"DEMO": "demo"
})
FILTER_KEY = "fil... | 2.3125 | 2 |
fix-clip-text-vit-32-float32---scratch.py | josephrocca/onnx-typecast | 0 | 12772272 | <gh_stars>0
# I'm not sure why this script works, but it fixes this problem: https://github.com/microsoft/onnxruntime/issues/9760#issue-1053052192
# without causing this int64 error: https://github.com/microsoft/onnxruntime/issues/9760#issuecomment-968967562
# I just commented out all the actual conversion stuff (excep... | 2.21875 | 2 |
Phase Diagram Visualization/phase_diagram.py | THE-RAF/Mathematics | 0 | 12772273 | from scipy.integrate import odeint
from scipy.optimize import fsolve
import numpy as np
import itertools
import matplotlib.pyplot as plt
from colorlines import colorline
from matplotlib import style
class PhaseDiagram:
def __init__(self, system):
self.system = system
self.fig, self.a... | 2.71875 | 3 |
tests/openbb_terminal/stocks/due_diligence/test_csimarket_model.py | tehcoderer/GamestonkTerminal | 255 | 12772274 | <gh_stars>100-1000
# IMPORTATION STANDARD
# IMPORTATION THIRDPARTY
import pytest
# IMPORTATION INTERNAL
from openbb_terminal.stocks.due_diligence import csimarket_model
@pytest.mark.vcr
def test_get_suppliers(recorder):
result_txt = csimarket_model.get_suppliers(ticker="TSLA")
recorder.capture(result_txt)
... | 1.992188 | 2 |
read_and_write.py | zyhhh123/Deep-learning | 0 | 12772275 | <filename>read_and_write.py
# gdal2numpy and numpy2g
import sys
import numpy as np
from osgeo import gdal,gdal_array
def gdal2np(path):
# driver = gdal.GetDriverByName('HFA')
# driver.Register()
ds =gdal.Open(path,gdal.GA_ReadOnly)
if ds is None:
print('Could not open '+path)
sys.ex... | 2.734375 | 3 |
tests/commands/test_mapping_sheet.py | mariob0y/ocdskit | 0 | 12772276 | import pytest
from ocdskit.cli.__main__ import main
from tests import assert_command, assert_command_error, path
def test_command(capsys, monkeypatch):
assert_command(capsys, monkeypatch, main,
['mapping-sheet', '--infer-required', path('release-schema.json')],
'mapping-shee... | 2.203125 | 2 |
figure2a_learningcurves_perlab.py | shenshan/paper-behavior | 0 | 12772277 | <filename>figure2a_learningcurves_perlab.py
"""
Learning curves for all labs
@author: <NAME>
15 January 2020
"""
import pandas as pd
import numpy as np
import os
import seaborn as sns
import matplotlib.pyplot as plt
from paper_behavior_functions import (query_subjects, seaborn_style, figpath,
... | 2.828125 | 3 |
parser/team04/Interpreter/Expression/bitwise.py | webdev188/tytus | 35 | 12772278 | from Interpreter.Expression.expression import Expression
class BitWise(Expression):
def __init__(self, left, right=None):
self.left = left
self.right = right
def isNumeric(self, value):
return isinstance(value, int) or isinstance(value, float)
def getGraph(self, graph, idParent):... | 3.109375 | 3 |
proxy_server.py | AcidCannon/CMPUT404.W2021.LAB2 | 0 | 12772279 | <reponame>AcidCannon/CMPUT404.W2021.LAB2
#!/usr/bin/env python3
import socket
# CONSTANTS
INBOUND_HOST = "" # Listen for all possible hosts
INBOUND_PORT = 8001
INBOUND_BUFFER_SIZE = 1024
OUTBOUND_HOST = "www.google.com"
OUTBOUND_PORT = 80
OUTBOUND_BUFFER_SIZE = 1024
def main():
# Create a socket obje... | 3.125 | 3 |
snippets - machine learning sklearn/preprocessing-encoding-categorical-features.py | bjfisica/MachineLearning | 52 | 12772280 | <reponame>bjfisica/MachineLearning<filename>snippets - machine learning sklearn/preprocessing-encoding-categorical-features.py
from sklearn.preprocessing import LabelEncoder
encoder = LabelEncoder()
y = encoder.fit_transform(y) | 2.609375 | 3 |
monte/runtime/equalizer.py | washort/monte | 0 | 12772281 | <gh_stars>0
import warnings
from monte.runtime.base import MonteObject, toQuote
from monte.runtime.data import (null, true, false, bwrap, Integer, Float,
String, Character, Bool)
from monte.runtime.guards.base import deepFrozenGuard, selflessGuard
from monte.runtime.tables import ConstL... | 2.03125 | 2 |
WebMirror/management/rss_parser_funcs/feed_parse_extractSharramycatsTranslations.py | fake-name/ReadableWebProxy | 193 | 12772282 | def extractSharramycatsTranslations(item):
"""
'Sharramycats Translations'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
tagmap = [
('11 Ways to Forget Your Ex-Boyfriend', '11 Ways to Forget Y... | 2.546875 | 3 |
contacts/processors.py | phildini/logtacts | 56 | 12772283 | <filename>contacts/processors.py
def book(request):
if hasattr(request, 'current_book'):
return {'book': request.current_book}
return {'book': None } | 2.25 | 2 |
database_setup.py | melissapott/CharacterSheets | 0 | 12772284 | from sqlalchemy import Column, ForeignKey, Integer, String, Enum
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
import psycopg2
Base = declarative_base()
# define database tables
class Person(Base):
__tablename__ = 'person'
id = C... | 2.703125 | 3 |
components/collector/tests/source_collectors/api_source_collectors/test_cobertura_jenkins_plugin.py | Gamer1120/quality-time | 1 | 12772285 | <filename>components/collector/tests/source_collectors/api_source_collectors/test_cobertura_jenkins_plugin.py
"""Unit tests for the Cobertura Jenkins plugin source."""
from .jenkins_plugin_test_case import JenkinsPluginTestCase, JenkinsPluginTestsMixin
class CoberturaJenkinsPluginTest(JenkinsPluginTestCase, JenkinsP... | 2.21875 | 2 |
source/Graphs.py | tomaslaz/Grand_Cannonical_Potential | 0 | 12772286 | <gh_stars>0
"""
@author <NAME>, 2018
A module for plotting the results
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import Constants
import Utilities
from Utilities import log
def _setup_temperature_legend(ax):
"""
Sets up a legend for temperatures
"""
... | 2.9375 | 3 |
argparsex/__init__.py | J-A-M-E-5/argparsex | 0 | 12772287 | <reponame>J-A-M-E-5/argparsex
import argparse
SUPPRESS = argparse.SUPPRESS
class SentinelValue:
pass
class ArgumentParser(argparse.ArgumentParser):
_supplied_defaults = None
_defaults = None
def parse_supplied_args(self, args=None, namespace=None):
sentinel = SentinelValue()
real_def... | 2.625 | 3 |
features/tests/test_urls.py | KDD-OpenSource/fexum | 6 | 12772288 | <gh_stars>1-10
from django.test import TestCase
from django.urls import reverse
class TestExperimentListUrl(TestCase):
def test_sexperiment_list_url(self):
url = reverse('experiment-list')
self.assertEqual(url, '/api/experiments')
class TestExperimentDetailUrl(TestCase):
def test_experiment_... | 2.4375 | 2 |
temboo/core/Library/Kiva/LendingActions/__init__.py | jordanemedlock/psychtruths | 7 | 12772289 | <reponame>jordanemedlock/psychtruths
from temboo.Library.Kiva.LendingActions.GetRecentLending import GetRecentLending, GetRecentLendingInputSet, GetRecentLendingResultSet, GetRecentLendingChoreographyExecution
| 1.007813 | 1 |
ex3-multi-class-classification/1_logistic_regression.py | themech/Machine-Learning-Coursera-Tensorflow | 5 | 12772290 | <filename>ex3-multi-class-classification/1_logistic_regression.py
import argparse
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy import io, misc
from sklearn import metrics
import tensorflow as tf
# Parse the command line arguments (or use default values).
parser = argparse.ArgumentPar... | 2.859375 | 3 |
datastructures/trees/binary/lca_with_pre_processing_seg_tree.py | hariharanragothaman/pymaster | 10 | 12772291 | class RangeQuery:
def __init__(self, data, func=min):
self.func = func
self._data = _data = [list(data)]
i, n = 1, len(_data[0])
while 2 * i <= n:
prev = _data[-1]
_data.append([func(prev[j], prev[j + i]) for j in range(n - 2 * i + 1)])
i <<= 1
... | 3.296875 | 3 |
tervis/api/submit_event.py | robopsi/sentry-health | 3 | 12772292 | import json
from tervis.environment import CurrentEnvironment
from tervis.auth import Auth
from tervis.producer import Producer
from tervis.exceptions import ApiError, PayloadTooLarge, ClientReadFailed, \
ClientBlacklisted
from tervis.web import Endpoint, ApiResponse, get_remote_addr
from tervis.filter import Filt... | 1.875 | 2 |
test_app/apps.py | fcfangcc/django-editor-md | 1 | 12772293 | from django.apps import AppConfig
class EditormdConfig(AppConfig):
name = 'test_app'
| 1.15625 | 1 |
paddlevideo/modeling/backbones/encoder.py | 0shelter0/pingpong_action_temport_generation_based_Paddle | 1 | 12772294 | <reponame>0shelter0/pingpong_action_temport_generation_based_Paddle
from dataclasses import replace
from tkinter.tix import Tree
import numpy as np
import paddle
import paddle.nn as nn
import paddle.optimizer as optim
import matplotlib.pyplot as plt
import math
from paddle import ParamAttr
## 6. MultiHeadAttention k... | 2.625 | 3 |
sd3/tools/jap_tbl.py | rofferom/seiken_densetsu_3 | 5 | 12772295 | import os
import errno
import threading
import queue
from collections import namedtuple
import jinja2
from PIL import Image
import tesserocr
import sd3.gfx
import sd3.text_table
_Char = namedtuple("_Char", ["idx", "char", "img_path"])
_WorkDesc = namedtuple("_WorkDesc", ["idx", "tile"])
_WorkRes = namedtuple("_WorkDes... | 2.390625 | 2 |
tests/planar_tests/test_contour_self_intersects.py | lycantropos/bentley_ottmann | 13 | 12772296 | from itertools import (chain,
combinations)
import pytest
from ground.base import (Context,
Relation)
from ground.hints import Contour
from hypothesis import given
from bentley_ottmann.planar import contour_self_intersects
from tests.utils import (contour_to_edges,
... | 2.34375 | 2 |
GUI/models.py | muhammadtarek98/Graduation-project | 0 | 12772297 | import torch
import torch.nn as nn
from torchvision import models
import numpy as np
from torch.autograd import Variable
import os
class Model:
def __init__(self, key = 'abnormal'):
self.INPUT_DIM = 224
self.MAX_PIXEL_VAL = 255
self.MEAN = 58.09
self.STDDEV = 49.73
self.mode... | 2.390625 | 2 |
main.py | 17jrb17/01-Introduction | 0 | 12772298 | #!/usr/bin/env python3
import utils
utils.check_version((3,7))
utils.clear()
print('Hello, my name is <NAME>')
print('My favorite game is Bioshock Infinite')
print('My only concern is getting back into the groove of coding for this class')
print('I just want to learn more about what goes into creating the things I l... | 2.015625 | 2 |
tests/groups/family/__init__.py | aiidateam/aiida-pseudo | 3 | 12772299 | # -*- coding: utf-8 -*-
"""Tests for the :mod:`aiida_pseudo.groups.family` module."""
| 1.179688 | 1 |
contact/migrations/0004_auto_20181010_1631.py | djangulo/integralpsychology.life | 0 | 12772300 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-10 16:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contact', '0003_contactcaptchaformfield_hide_label'),
]
operations = [
mig... | 1.640625 | 2 |
crawl_good_softwares/crawl_good_softwares/spiders/firehorse_scrapy_software_spider.py | skihyy/GT-Spring-2017-CS-6262 | 2 | 12772301 | # -*- coding: utf-8 -*-
import scrapy
import urllib
import os
from scrapy.http import Request
from scrapy.selector import Selector
from crawl_good_softwares.items import CrawlGoodSoftwaresItem
class TestSpiderSpider(scrapy.Spider):
name = "firehorse_scrapy_software_spider"
start_urls = ['http://www.filehorse.... | 2.734375 | 3 |
backend/src/dataloaders/milestone.py | spiritutumduo/spiritumDuo | 1 | 12772302 | <reponame>spiritutumduo/spiritumDuo<gh_stars>1-10
from typing import List, Dict, Optional
from aiodataloader import DataLoader
from models import Milestone
from typing import Union
class MilestoneByDecisionPointLoader(DataLoader):
"""
This is class for loading milestones using IDs from
DecisionPoi... | 2.578125 | 3 |
playerpiano/terminal_target.py | wearpants/playerpiano | 19 | 12772303 | import sys
def write(s):
"""write s to stdout"""
s = s.replace('\n', '\r\n')
sys.stdout.write(s)
sys.stdout.flush()
def make_target(options):
return write
def free_target():
pass
| 2.859375 | 3 |
torch_glow/tests/nodes/copy_test.py | YaronBenAtar/glow | 2,838 | 12772304 | <reponame>YaronBenAtar/glow<gh_stars>1000+
# Copyright (c) Glow Contributors. See CONTRIBUTORS file.
#
# 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/LIC... | 1.90625 | 2 |
e2edet/criterion/__init__.py | eladb3/BoxeR | 18 | 12772305 | <filename>e2edet/criterion/__init__.py
import e2edet.criterion.metrics
import e2edet.criterion.losses
from e2edet.criterion.metrics import build_metric
from e2edet.criterion.losses import build_loss
__all__ = ["build_metric", "build_loss"]
| 1.085938 | 1 |
pyCMR/tests/test_cmr_integration.py | jasonduley/cmr | 12 | 12772306 | '''
Copyright 2017, United States Government, as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
The pyCMR platform is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obt... | 1.679688 | 2 |
reding/settings.py | BuongiornoMIP/Reding | 3 | 12772307 | import os
REDIS_CONFIG = {
'host': os.getenv('REDING_REDIS_HOST', 'localhost'),
'port': int(os.getenv('REDING_REDIS_PORT', 6379)),
'db': int(os.getenv('REDING_REDIS_DB', 0)),
}
DAEMON_CONFIG = {
'host': os.getenv('REDING_DAEMON_HOST', '0.0.0.0'),
'port': int(os.getenv('REDING_DAEMON_PORT', 5000)),... | 1.75 | 2 |
test_fit.py | QianLabUSC/cognitively-enhanced-decision-framework | 0 | 12772308 | from scipy import optimize
import matplotlib.pyplot as plt
import numpy as np
x = np.array([1, 1.1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11, 12, 13, 14, 15], dtype=float)
y = np.array([5, 3, 7, 9, 11, 13, 15, 28.92, 42.81, 56.7, 70.59,
84.47, 98.36, 112.25, 126.14, 140.03])
# 一个输入序列,4个未知参数,2个分段函数
d... | 2.96875 | 3 |
tests/tasks/sodaspark/test_sodaspark_tasks.py | suryatmodulus/prefect | 8,633 | 12772309 | from unittest.mock import MagicMock
import pytest
from pyspark.sql import SparkSession
from prefect.tasks.sodaspark import SodaSparkScan
class TestSodaSparkScan:
def test_construction_provide_scan_and_df(self):
expected_scan_def = "/foo/bar.yaml"
expected_df = SparkSession.builder.getOrCreate()... | 2.21875 | 2 |
Cura/Cura/cura/Settings/CuraStackBuilder.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 0 | 12772310 | <gh_stars>0
# Copyright (c) 2019 <NAME>.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
from UM.Logger import Logger
from UM.Settings.Interfaces import DefinitionContainerInterface
from UM.Settings.InstanceCont... | 2.125 | 2 |
tests/test_gs_convert.py | rogeriosan4/pdf2txt | 0 | 12772311 | <reponame>rogeriosan4/pdf2txt<filename>tests/test_gs_convert.py
import gs_convert as gs
x = gs.pdf2string("file.pdf")
print(x) | 2.453125 | 2 |
sssdevops/list_tools.py | doaa-altarawy/sssdevops | 2 | 12772312 | <filename>sssdevops/list_tools.py<gh_stars>1-10
"""
Main python file for the sssdevops example
"""
def mean(num_list):
"""
Calculate the mean of a list of numbers
Parameters
----------
num_list: list of int or float
Returns
-------
float of the mean of the list
Examples
---... | 2.875 | 3 |
sem03_for/sem_03_192.py | AnnetteNegovora/dap_2020_fall | 23 | 12772313 | # %%
"""
<NAME> любит французские багеты. Длина французского
багета равна 1 метру. За один заглот <NAME> заглатывает
кусок случайной длины равномерно распределенной на отрезке
[0; 1]. Для того, чтобы съесть весь багет удаву потребуется случайное
количество N заглотов.
Оцените P(N=2), P(N=3), E(N)
"""
# %%
import nump... | 3.359375 | 3 |
tests/conftest.py | Github-shipchain/transmission | 1 | 12772314 | import json
import pytest
from django.conf import settings as test_settings
from rest_framework import status
from rest_framework.request import ForcedAuthentication
from rest_framework.test import APIClient
from shipchain_common.utils import random_id
from shipchain_common.test_utils import get_jwt, mocked_rpc_respo... | 1.84375 | 2 |
test/05_environment/setup.py | mtreinish/cibuildwheel | 1 | 12772315 | from setuptools import setup, Extension
import sys, os
# explode if environment isn't correct, as set in CIBW_ENVIRONMENT
CIBW_TEST_VAR = os.environ.get('CIBW_TEST_VAR')
CIBW_TEST_VAR_2 = os.environ.get('CIBW_TEST_VAR_2')
PATH = os.environ.get('PATH')
if CIBW_TEST_VAR != 'a b c':
raise Exception('CIBW_TEST_VAR sh... | 2.328125 | 2 |
what-is-a-coroutine/8-asyncio-aiohttp.py | jreese/pycon | 32 | 12772316 | # Copyright 2019 <NAME>
# Licensed under the MIT License
import asyncio
import time
from aiohttp import request
URLS = [
"https://2019.northbaypython.org",
"https://duckduckgo.com",
"https://jreese.sh",
"https://news.ycombinator.com",
"https://python.org",
]
# Coroutines with aiohttp
async def... | 3.265625 | 3 |
examples/meeting_room/views/rest_mediators.py | billyrrr/onto | 1 | 12772317 | <reponame>billyrrr/onto
from flask import Response, jsonify
from examples.meeting_room.domain_models import Meeting
from examples.meeting_room.view_models import MeetingSession
from examples.meeting_room.view_models.meeting_session import MeetingSessionC
from onto.source.rest import RestViewModelSource
from onto.view ... | 2.265625 | 2 |
CodeGen/symbolTableItem.py | MMDBadCoder/Compiler-project | 0 | 12772318 | class SymbolTableItem:
def __init__(self, type, name, customId, value):
self.type = type
self.name = name
self.value = value
# if type == 'int' or type == 'bool':
# self.value = 0
# elif type == 'string':
# self.value = ' '
# else:
# ... | 3.03125 | 3 |
Desafios/Desafio 014 (Conversor de temp.).py | Kimberly07-Ernane/Pythondesafios | 0 | 12772319 | <gh_stars>0
#Desafio14
#Escreva um programa que converta uma temperatura digitando em
#graus Celsius e converta para graus Fahrenheit
temp=int(input('Digite a temperatura °C: '))
f=9*temp/5+32
print('A temperatura de {}°C corresponde a {}°F!'.format(temp,f))
| 4.15625 | 4 |
tbf/harness_generation.py | leostrakosch/testbasedfalsification | 10 | 12772320 | import tbf.utils as utils
class HarnessCreator(object):
def _get_vector_read_method(self):
return b"""char * parse_inp(char * __inp_var) {
unsigned int input_length = strlen(__inp_var)-1;
/* Remove '\\n' at end of input */
if (__inp_var[input_length] == '\\n') {
__inp_var[input_length... | 2.5625 | 3 |
declaraciones/declaracion/urls/informacion_personal.py | rafaelhn2021/proyecto | 0 | 12772321 | from django.urls import path, re_path
from declaracion.views import (DeclaracionFormView, DatosCurricularesView,
DatosEncargoActualView, ExperienciaLaboralView,
ConyugeDependientesView,
DatosCurricularesDelete,
... | 2.03125 | 2 |
lido_sdk/methods/typing.py | lidofinance/lido-validator.py | 6 | 12772322 | try:
# For python >= 3.8
from typing import TypedDict
except ImportError:
# For python 3.7
from typing_extensions import TypedDict
class Operator(TypedDict):
index: int
active: bool
name: str
rewardAddress: str
stakingLimit: int
stoppedValidators: int
totalSigningKeys: int
... | 2.125 | 2 |
heartbeat/views.py | zouyapeng/instance_monitor_server | 0 | 12772323 | #!/usr/bin/env python
# -*- coding: utf8 -*-
from django.shortcuts import render
from heartbeat.models import MonitorAgent, InstanceUUID
from trigger.models import Trigger
from heartbeat.serializers import MonitorAgentSerializer
from rest_framework import generics
from rest_framework.renderers import JSONRenderer
from ... | 1.882813 | 2 |
uploader/config.py | wingez/G-CPU | 0 | 12772324 | <reponame>wingez/G-CPU
from pathlib import Path
import json
import os
def loadconfig(name):
thisPath = Path(__file__)
basefolder = thisPath.resolve().parent.parent
configfolder = basefolder / 'config'
path = configfolder / (name + '.json')
if not path.exists():
raise ValueError(... | 2.46875 | 2 |
fairmodels/plotnine/geoms/geom_map.py | Locust2520/python-fairmodels | 0 | 12772325 | import pandas as pd
import numpy as np
from matplotlib.collections import PatchCollection, LineCollection
from descartes.patch import PolygonPatch
try:
import geopandas # noqa: F401
except ImportError:
HAS_GEOPANDAS = False
else:
HAS_GEOPANDAS = True
from ..doctools import document
from ..exceptions impo... | 2.78125 | 3 |
src/datasets/spectrometer.py | IBM/optimizing-precision-in-imbalanced-datasets | 6 | 12772326 | # Copyright 2021 IBM Corporation
#
# 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 writing, ... | 2 | 2 |
sb2web/pyscripts/sb2web_create.py | pepstack/java-training | 0 | 12772327 | <reponame>pepstack/java-training<gh_stars>0
#!/usr/bin/python
#-*- coding: UTF-8 -*-
#
# @file: sb2web_create.py
#
# @version:
# @create:
# @update: 2019-09-20
#
#######################################################################
from __future__ import print_function
import os, sys, stat, signal, shutil, inspect, c... | 2.078125 | 2 |
pyscf/geomopt/berny_solver.py | robert-anderson/pyscf | 1 | 12772328 | <gh_stars>1-10
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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/LI... | 1.960938 | 2 |
image_aug.py | EnochMHforever/CCF-BDCI2019-Multi-person-Face-Recognition-Competition-Baseline-master | 1 | 12772329 | <filename>image_aug.py<gh_stars>1-10
import os
import pickle
import random
import cv2 as cv
import numpy as np
from PIL import Image
from imgaug import augmenters as iaa
from torchvision import transforms
from config import IMG_DIR
from config import pickle_file
# Data augmentation and normalization for training
# J... | 2.71875 | 3 |
functions/charge.py | pangq2/charge | 0 | 12772330 | <filename>functions/charge.py
from sys import *
import os
def read_ACF():
""" read the ACF.dat file
parameters
---------------
The index number of the atoms
Return
----------------
The charge of the selected atoms
"""
| 3.015625 | 3 |
object_detection/faster_rcnn_tracker.py | UDC-GAC/HybridTracker | 0 | 12772331 | #!/home/roberto/anaconda3/envs/tensorflow/bin/python
# Copyright 2022 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 2.140625 | 2 |
freezing/model/__init__.py | freezingsaddles/freezing-model | 2 | 12772332 | <filename>freezing/model/__init__.py
import warnings
import sqlalchemy as sa
from alembic import command
from alembic.script import ScriptDirectory
from alembic.util import CommandError
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.engine.reflection import Inspector
from sql... | 2.53125 | 3 |
gym/envs/debugging/__init__.py | enterstudio/gym | 49 | 12772333 | <reponame>enterstudio/gym<gh_stars>10-100
from gym.envs.debugging.one_round_deterministic_reward import OneRoundDeterministicRewardEnv
from gym.envs.debugging.two_round_deterministic_reward import TwoRoundDeterministicRewardEnv
from gym.envs.debugging.one_round_nondeterministic_reward import OneRoundNondeterministicRew... | 1.15625 | 1 |
Ch9/09-FileHandling-02.py | akuks/Python3.6---Novice-to-Ninja | 0 | 12772334 | # Define the fileName as a variable
fileToWrite = 'outputFile.txt'
fileHandle = open(fileToWrite, 'w')
i = 0
while i < 10:
fileHandle.write("This is line Number " + str(i) + "\n")
i += 1
fileHandle.close()
| 3.03125 | 3 |
library/telegram/session_backend/orm.py | RobbiNespu/hyperboria | 54 | 12772335 | <filename>library/telegram/session_backend/orm.py
import datetime
from typing import (
TYPE_CHECKING,
Any,
Optional,
Tuple,
Union,
)
from sqlalchemy import orm
from telethon import utils
from telethon.crypto import AuthKey
from telethon.sessions.memory import (
MemorySession,
_SentFileType,... | 2.125 | 2 |
cluster_viz/make_tree.py | sunlightlabs/fcc-net-neutrality-comments | 18 | 12772336 | <gh_stars>10-100
from collections import defaultdict
import csv, json, operator
SAMPLE_THRESHOLD = 150000
SAMPLE_SIZE = 20000
NUM_LEVELS = 11
ADD_CID = False
leaf_prefix = str(NUM_LEVELS - 1)
# map out the parent-child relationships
children = defaultdict(set)
levels = defaultdict(set)
for row in csv.DictReader(open... | 2.421875 | 2 |
demos/map_depth_to_color_and_3d_demo.py | thecreativecontrollab/KinZ-Python | 13 | 12772337 | <gh_stars>10-100
"""
Mapping from depth to color demo
How to use:
- Clic on the depth image to show the corresponding point on color image
and the 3D coordinates
"""
import numpy as np
import cv2
import kinz
depth_points = []
def mouse_event(event, x, y, flags, param):
global depth_points
... | 3 | 3 |
NOTES/c1-notes.py | frawst/cs207-chaykowj | 0 | 12772338 | <filename>NOTES/c1-notes.py
NOTES = """
(c) 2017 <NAME>
PROVIDED UNDER MIT LICENSE
SCHOOLOGY.COM
ACCESS CODE: GNH9N-KZ2C2
RIC 115 <-- OFFICE HOURS:
M 4-6 PM
W 12-6 PM
##########################################
# RICE LAB
#
# TEXT BOOK = ARDX ARDUINO EXPERIMENTER'S KIT - OOMLOUT
#
# CLASS PROJECT --MUST-- BUILD OFF ... | 2.3125 | 2 |
examples/eg02r__exploring_conwhat_atlases.py | GriffithsLab/conwhat | 1 | 12772339 | <reponame>GriffithsLab/conwhat<gh_stars>1-10
"""
Exploring the ConWhAt Atlases
===============================
"""
# There are four different atlas types in ConWhat, corresponding to the 2 ontology types (Tract-based / Connectivity-Based) and 2 representation types (Volumetric / Streamlinetric).
#
# (More on this sc... | 2.078125 | 2 |
kalmus/tkinter_windows/ReshapeBarcodeWindow.py | yc015/KALMUS | 7 | 12772340 | """ ReshapeBarcodeWindow Class """
import tkinter
import copy
import cv2
from kalmus.tkinter_windows.gui_utils import update_graph, resource_path
class ReshapeBarcodeWindow():
"""
ReshapeBarcodeWindow Class
GUI window for user to reshape the selected barcode into the desirable shape
"""
def __in... | 3.40625 | 3 |
system/t09_repo/add.py | Yelp/aptly | 0 | 12772341 | import tempfile
import shutil
import os
import inspect
from lib import BaseTest
class AddRepo1Test(BaseTest):
"""
add package to local repo: .deb file
"""
fixtureCmds = [
"aptly repo create -comment=Repo1 -distribution=squeeze repo1",
]
runCmd = "aptly repo add repo1 ${files}/libboost-... | 2.3125 | 2 |
Challenges/30/tests/test_hashtable.py | makkahwi/data-structures-and-algorithms | 0 | 12772342 | <reponame>makkahwi/data-structures-and-algorithms
from hashtable.hashtable import Hashtable
import pytest
def test_initializing():
ht = Hashtable()
assert ht.size == 100
assert ht.table == [None] * 100
# 7. Successfully hash a key to an in-range value
def test_key_hash():
ht = Hashtable()
actua... | 3.8125 | 4 |
examples/Ex4_fit_line_SPT0346-52_CO21.py | dchx/visilens | 16 | 12772343 | """
Example 4, to be run in python. In this example, we fit the CO
emission using the data made from Ex2 (which you should be
able to download from the same place you got this script).
For these data, I just fixed the lens properties to those
we got from the ALMA 870um data, because the ALMA data have
way highe... | 3.0625 | 3 |
python_venv_legacy/mediapipe/calculators/util/landmarks_smoothing_calculator_pb2.py | 4sunshine/mediapipe | 0 | 12772344 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/util/landmarks_smoothing_calculator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messag... | 1.289063 | 1 |
pssvi/cubature.py | AntixK/parallel-SSVI | 0 | 12772345 | import objax
from jax import vmap, grad, jacrev
import jax.numpy as np
from jax.scipy.linalg import cholesky, cho_factor
from .utils import inv, solve, gaussian_first_derivative_wrt_mean, gaussian_second_derivative_wrt_mean
from numpy.polynomial.hermite import hermgauss
import numpy as onp
import itertools
class Cuba... | 2.140625 | 2 |
tests/test_cqcconnection.py | Doomsk/CQC-Python | 16 | 12772346 | import pytest
from cqc.util import parse_cqc_message
from cqc.pythonLib import CQCConnection, qubit
from cqc.pythonLib import CQCMixConnection
from cqc.cqcHeader import (
CQCCmdHeader,
CQCHeader,
CQCType,
CQC_CMD_H,
CQC_CMD_NEW,
CQC_CMD_RELEASE,
)
from utilities import get_header
from test_ca... | 2.015625 | 2 |
udps.py | arunlakshmanan/pathgen_processing | 8 | 12772347 | <filename>udps.py<gh_stars>1-10
#!/usr/bin/env python
#Edit however required
import socket
import struct
import math
UDP = "localhost"
PORT = 10000
xs = [1.0, -1.0, 1.0]
ys = [1.0, -1.0, -1.0]
yaw = [1.0, -0.5, -3.141]
status = 1.0
nbots = 3
count = 1
try:
while True:
for i in range(0,nbots):
sock = socket.s... | 2.84375 | 3 |
steampipe_alchemy/models/aws_vpc_route.py | RyanJarv/steampipe_alchemy | 9 | 12772348 | from sqlalchemy import Column
from sqlalchemy.types import JSON, Text, Boolean, TIMESTAMP, BigInteger
from sqlalchemy.dialects import postgresql as psql
from steampipe_alchemy.mixins import FormatMixins
from steampipe_alchemy import Base
class AwsVpcRoute(Base, FormatMixins):
__tablename__ = 'aws_vpc_route'
d... | 2.140625 | 2 |
apps/equipment/views/basicinfor_view.py | kane-zh/MES_server | 0 | 12772349 | from rest_framework import viewsets
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.authentication import SessionAuthentication
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework.permissions import IsAuth... | 1.875 | 2 |
RandomGenerator/randomIntSeed.py | mjdroz/StatisticsCalculator | 0 | 12772350 | from RandomGenerator.randomInt import randomInt
from numpy import random
def randomIntSeed (start, end, seed):
state = random.get_state()
random.seed(seed)
try:
randIntSeeded = randomInt(start, end)
return randIntSeeded
finally:
random.set_state(state)
| 2.96875 | 3 |