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
gamma-correction/gamma_correction.py
svinkapeppa/image_analysis
0
24300
import argparse import os import cv2 import numpy as np def gamma_correction(source_path, destination_path, a, b, version): # Load image into memory # Algorithm can work correctly with colored and grayscale images if version == 'colored': original_image = cv2.imread(source_path) elif version ...
3.046875
3
src/cirrus_ngs/deprecated/dnaSeq/WGSPipelineManager.py
miko-798/cirrus-ngs
1
24301
__author__ = '<NAME><<EMAIL>>' import os from util import YamlFileMaker from util import QstatParser from cfnCluster import ConnectionManager import sys workspace = "/shared/workspace/Pipelines/" #log_dir = "/shared/workspace/data_archive/DNASeq/{}/logs" log_dir = "/shared/workspace/logs/DNASeq/{}" ## executing WGS ...
2.203125
2
code/12_paketierung/intents/functions/location/intent_location.py
padmalcom/AISpeechAssistant
1
24302
<gh_stars>1-10 from loguru import logger from chatbot import register_call import global_variables import random import os import yaml import geocoder import constants @register_call("location") def location(session_id = "general", dummy=0): config_path = constants.find_data_file(os.path.join('intents','functions','...
2.53125
3
sagemaker/ssedata.py
cleveranjos/Rapid-ML-Gateway
147
24303
<gh_stars>100-1000 from enum import Enum class ArgType(Enum): """ Represents data types that can be used as arguments in different script functions. """ Undefined = -1 Empty = 0 String = 1 Numeric = 2 Mixed = 3 class ReturnType(Enum): """ Represents return types that can ...
3.015625
3
ferminet/utils/system.py
shishaochen/ferminet
469
24304
<reponame>shishaochen/ferminet # Lint as: python3 # Copyright 2020 DeepMind Technologies Limited. 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 # # https://www.apac...
1.757813
2
vb2py/PythonCard/tools/codeEditor/codeEditorR.rsrc.py
ceprio/xl_vb2py
0
24305
<gh_stars>0 {'application':{'type':'Application', 'name':'codeEditor', 'backgrounds': [ {'type':'Background', 'name':'bgCodeEditor', 'title':'Code Editor R PythonCard Application', 'size':(400, 300), 'statusBar':1, 'visible':0, 'style':['resi...
1.8125
2
unittest_reinvent/diversity_filter_tests/test_murcko_scaffold_superfluous_addition.py
MolecularAI/reinvent-scoring
0
24306
from reinvent_scoring.scoring.diversity_filters.curriculum_learning.update_diversity_filter_dto import \ UpdateDiversityFilterDTO from unittest_reinvent.diversity_filter_tests.test_murcko_scaffold_base import BaseMurckoScaffoldFilter from unittest_reinvent.diversity_filter_tests.fixtures import tanimoto_scaffold_fi...
2.03125
2
python/examples/kaitai/msgpack.py
carsonharmon/binaryninja-api
1
24307
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild from pkg_resources import parse_version from .kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO import collections if parse_version(ks_version) < parse_version('0.7'): raise Excepti...
2.078125
2
awx/main/tests/unit/test_signals.py
gitEdouble/awx
11,396
24308
from awx.main import signals class TestCleanupDetachedLabels: def test_cleanup_detached_labels_on_deleted_parent(self, mocker): mock_labels = [mocker.MagicMock(), mocker.MagicMock()] mock_instance = mocker.MagicMock() mock_instance.labels.all = mocker.MagicMock() mock_instance.labe...
2.265625
2
FileUtils/__init__.py
cognitiveqe/cqepyutils
0
24309
__all__ = ['FileUtils']
1.117188
1
src/LoadData.py
josepquintana/HackUPC-2019
0
24310
import pandas as pd import numpy as np from pathlib import Path from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split class AccidentsData: def __init__(self): filename = Path('../data/accidents.csv') if not filename.exists(): print('\nERROR...
3.375
3
src/main/python/bayou/experiments/predictMethods/buildQueryJSONs/cleanup.py
rohan2606/bayou
1
24311
<gh_stars>1-10 import os import shutil import sys def rm_r(path): if os.path.isdir(path) and not os.path.islink(path): shutil.rmtree(path) elif os.path.exists(path): os.remove(path) def cleanUp(logdir = "./log/"): print("Cleaning all files in log ... ", end="") sys.stdout.flush() ...
2.703125
3
videoanalyst/model/builder.py
JIANG-CX/data_labeling
1
24312
# -*- coding: utf-8 -* from typing import Dict from yacs.config import CfgNode from .backbone import builder as backbone_builder from .loss import builder as loss_builder from .task_head import builder as head_builder from .task_model import builder as task_builder def build_model( task: str, cfg: C...
2.0625
2
tx1_pcie/demo/tx1_pcie/site_scons/xst_utils.py
CospanDesign/nysa-tx1-pcie-platform
15
24313
<gh_stars>10-100 #Distributed under the MIT licesnse. #Copyright (c) 2013 Cospan Design (<EMAIL>) #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 limitati...
1.789063
2
samples/python/13.core-bot/envs/chat_bot_02/Lib/site-packages/datatypes_date_time/timex_relative_convert.py
luzeunice/BotBuilder-Samples
0
24314
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. class TimexRelativeConvert: @staticmethod def convert_timex_to_string_relative(timex): return ''
2.171875
2
src/levitas/lib/daemonize.py
tobi-weber/levitas
1
24315
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 <NAME> <<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 appl...
1.976563
2
bootstrapvz/common/fs/virtualharddisk.py
brett-smith/bootstrap-vz
0
24316
<gh_stars>0 from .qemuvolume import QEMUVolume from ..tools import log_check_call import math class VirtualHardDisk(QEMUVolume): extension = 'vhd' qemu_format = 'vpc' ovf_uri = 'http://go.microsoft.com/fwlink/?LinkId=137171' # Azure requires the image size to be a multiple of 1 MiB. # VHDs are dy...
2.359375
2
tests/test_flight_path.py
flyinactor91/AVWX-Engine
30
24317
<gh_stars>10-100 """ Flight path tests """ from typing import List, Union from avwx import flight_path from avwx.structs import Coord FLIGHT_PATHS = ( ( [(12.34, -12.34, "12.34,-12.34"), (-43.21, 43.21, "-43.21,43.21")], [(12.34, -12.34, "12.34,-12.34"), (-43.21, 43.21, "-43.21,43.21")], ), ...
1.8125
2
reports/api/urls.py
elishaking/i-witness
0
24318
<reponame>elishaking/i-witness from django.conf.urls import url from . import views urlpatterns = [ # report route url(r'^create/$', views.ReportCreateAPIView.as_view(), name='create'), url(r'^$', views.ReportListAPIView.as_view(), name='list'), url(r'^(?P<pk>\d+)$', views.ReportRetrieveAPIView.as_vie...
1.6875
2
GitSearch.py
inishchith/GithubTools
1
24319
# Find file contents via various criteria.
1.15625
1
apysc/_event/stop_propagation_interface.py
simon-ritchie/apyscript
16
24320
"""Class implementation for the stop_propagation interface. """ from apysc._type.variable_name_interface import VariableNameInterface class StopPropagationInterface(VariableNameInterface): def stop_propagation(self) -> None: """ Stop event propagation. """ import apys...
2.640625
3
src/falconpy/custom_ioa.py
mccbryan3/falconpy
0
24321
<gh_stars>0 """ _______ __ _______ __ __ __ | _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----. |. 1___| _| _ | | | | _ | 1___| _| _| | <| -__| |. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____| |: 1 | |: ...
1.273438
1
Algorithms/Implementation/Utopian_Tree.py
gauthamkrishna-g/HackerRank
1
24322
#!/bin/python3 h = 0 t = int(input().strip()) for a0 in range(t): n = int(input().strip()) if n%2 == 1: h = 2 ** (int(n/2) + 2) - 2 elif n%2 == 0: h = 2 ** (int(n/2) + 1) - 1 print(h)
3.046875
3
pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL4Pass_test.py
hsqforfun/pymtl3
1
24323
<filename>pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL4Pass_test.py #========================================================================= # BehavioralRTLIRL4Pass_test.py #========================================================================= # Author : <NAME> # Date : Feb 2, 2019 """Test the level 4 b...
1.898438
2
api/views.py
seanpierce/django-itr
0
24324
# import json import uuid from django.apps import apps from django.core import serializers from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.shortcuts import render from django.shortcuts import redirect from django.conf import settings from .api_helpers import * Ep...
2.015625
2
saleor/graphql/csv/schema.py
ibutiti/saleor
2
24325
<reponame>ibutiti/saleor import graphene from ...core.permissions import ProductPermissions from ...core.tracing import traced_resolver from ...csv import models from ..core.fields import FilterInputConnectionField from ..decorators import permission_required from .filters import ExportFileFilterInput from .mutations ...
2.09375
2
tests/test_pytest_localftpserver_TLS.py
pythrick/pytest-localftpserver
1
24326
<filename>tests/test_pytest_localftpserver_TLS.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ test_pytest_localftpserver ---------------------------------- Tests for `pytest_localftpserver` module. """ import os from ftplib import error_perm import pytest from .test_pytest_localftpserver import (ftp_login, ...
2.609375
3
data/data_augment.py
ZHANGHeng19931123/MutualGuide
124
24327
<reponame>ZHANGHeng19931123/MutualGuide #!/usr/bin/python # -*- coding: utf-8 -*- import cv2 import numpy as np import random import math import torch def _crop(image, boxes, labels, p=0.75, min_iou=0.75, max_iou=0.25): def matrix_iou(a, b): lt = np.maximum(a[:, np.newaxis, :2], b[:, :2]) rb = n...
2.4375
2
convnet_utils.py
ramosmy/DiverseBranchBlock
0
24328
import torch import torch.nn as nn from diversebranchblock import DiverseBranchBlock from acb import ACBlock from dbb_transforms import transI_fusebn CONV_BN_IMPL = 'base' DEPLOY_FLAG = False class ConvBN(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, ...
2.078125
2
perde-tests/tests/test_attrs.py
YushiOMOTE/perde
19
24329
from dataclasses import dataclass, field from typing import Dict import perde import pytest from util import FORMATS, FORMATS_EXCEPT """rust #[derive(Serialize, Debug, new)] struct Plain { a: String, b: String, c: u64, } add!(Plain {"xxx".into(), "yyy".into(), 3}); """ @pytest.mark.parametrize("m", FORMATS) d...
2.28125
2
python/example_code/update_connectNW.py
nifcloud/nifcloud-sample
0
24330
from nifcloud import session import sys # --- define -------- # -- Server ------- SERVER_NAME = "testsv" # -------------------- # -- PRIVATE NW ------- PRIVATE_NW_NAME = 'test' PRIVATE_NW_IP = 'static' # -------------------- # ------------------- # ------ update attribute -------------------- def wait_for_instance...
2.46875
2
src/slack_scim/v1/groups.py
broadinstitute/python-slack-scim
0
24331
<reponame>broadinstitute/python-slack-scim # To use this code, make sure you # # import json # # and then, to convert JSON from a string, do # # result = groups_from_dict(json.loads(json_string)) from typing import Optional, Any, List, TypeVar, Type, cast, Callable T = TypeVar("T") def from_str(x: Any) -> ...
2.78125
3
scripts/mercedes_api_connector_bootstrap.py
eccenca/DataspaceConnector
0
24332
import requests import pprint import json # Suppress ssl verification warning requests.packages.urllib3.disable_warnings() s = requests.Session() s.auth = ("user", "password") s.verify = False host = "localhost" apis = ["https://api.mercedes-benz.com/vehicledata/v2/vehicles", "https://api.mercedes-benz.com/vehicled...
2.859375
3
nmtpytorch/datasets/text.py
toshohirasawa/mmt-with-monolingual-data
4
24333
# -*- coding: utf-8 -*- import logging from pathlib import Path import torch from torch.utils.data import Dataset from torch.nn.utils.rnn import pad_sequence from ..utils.data import read_sentences logger = logging.getLogger('nmtpytorch') class TextDataset(Dataset): r"""A PyTorch dataset for sentences. A...
2.734375
3
ChorusNGSfilter.py
zhangtaolab/Chorus2
11
24334
<reponame>zhangtaolab/Chorus2<filename>ChorusNGSfilter.py<gh_stars>10-100 import argparse import sys from Choruslib import jellyfish import os from multiprocessing import Pool, Process from pyfasta import Fasta import pyBigWig import math def main(): args = check_options(get_options()) # jfgeneratorscount(jf...
2.265625
2
nnunet/utilities/nii2niigz.py
kvpratama/nnunet
0
24335
import glob import nibabel as nib import pdb nii_files = glob.glob('./train3d/*.nii') for nii_file in nii_files: nii = nib.load(nii_file) nib.save(nii, nii_file[:-4] + '_0000.nii.gz') print(nii_file[:-4] + '.nii.gz')
2.09375
2
docs/source/conf.py
NASA-PDS/naif-pds4-bundler
0
24336
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
1.601563
2
Tests/testApi.py
garnachod/ConcursoPolicia
0
24337
<reponame>garnachod/ConcursoPolicia # -*- coding: utf-8 -*- import os import sys lib_path = os.path.abspath('../') sys.path.append(lib_path) from API.APITextos import APITextos if __name__ == '__main__': """ users = APITextos.getUsersSimilar_user_all_topic("Taxigate", "ar", 100, 1) for user in users: ...
2.140625
2
src/visualize.py
skvis/Multi_Class_Image_Classification
0
24338
<gh_stars>0 import os import matplotlib.image as mpimg import matplotlib.pyplot as plt import config def view_data(): nrows, ncols = 3, 3 pic_index = 0 fig = plt.gcf() fig.set_size_inches(nrows * 4, ncols * 4) pic_index = 2 next_rock = [os.path.join(config.TRAIN_DIR, 'rock', fname) for fname...
2.296875
2
tests/__init__.py
coras-io/lint-review
2
24339
import os import json from github3.pulls import PullFile from github3.repos.commit import RepoCommit def load_fixture(filename): path = os.path.dirname(os.path.abspath(__file__)) filename = os.path.join(path, 'fixtures', filename) fh = open(filename, 'r') return fh.read() def create_pull_files(data)...
2.296875
2
pypy/lib/cPickle.py
camillobruni/pygirl
12
24340
# # One-liner implementation of cPickle # from pickle import * from pickle import __doc__, __version__, format_version, compatible_formats BadPickleGet = KeyError UnpickleableError = PicklingError # ____________________________________________________________ # XXX some temporary dark magic to produce pickled dumps ...
2.625
3
boardgame/connectfour/connectfourviewer.py
suryaambrose/boardgame
0
24341
import os import sys from ..gameviewer import GameViewer class ConnectFourViewer(GameViewer): def __init__(self): super(ConnectFourViewer, self).__init__([6,7]) def showState(self, state): os.system("clear") sys.stdout.write("x\y|") for k in range(0, self.map_width): sys.stdout.write("%d "%(k)) sys.std...
2.78125
3
contrib/kodi/script.service.launchcontrol/launchcontrol.py
funjack/launchcontrol
20
24342
<reponame>funjack/launchcontrol """Launchcontrol client The module exposes the Launchcontrol API as a Client object. Data: scripttypes -- list of a dictionaries containing supported script formats. """ import urllib2 scripttypes = [ { "name" : "funscript", "extensions": ["funsc...
2.421875
2
python/fleetx/applications/trainer.py
ForFishes/FleetX
1
24343
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2.5
2
bin/kraken_bin_file.py
CSB5/OPERA-MS
81
24344
#! /mnt/software/unstowable/anaconda/bin/python import sys import os import argparse import subprocess def generating_mapping(kraken_report): kraken_dict = {} with open (kraken_report, "r") as fp: for line in fp: line = line.split("\t") if line[3] != 'S' and line[3] != '-': ...
2.46875
2
preprocessing/reid_preprocessing.py
Mithilesh1609/assembled-cnn
363
24345
<gh_stars>100-1000 # This code is adapted from the https://github.com/tensorflow/models/tree/master/official/r1/resnet. # ========================================================================================== # NAVER’s modifications are Copyright 2020 NAVER corp. All rights reserved. # =============================...
1.554688
2
dumbcpm/__main__.py
handicraftsman/dumbcpm
0
24346
<reponame>handicraftsman/dumbcpm import argparse import os import os.path import glob import re import sys import subprocess import shlex from pathlib import Path from functools import cmp_to_key from structlog import get_logger, wrap_logger from structlog.dev import ConsoleRenderer import yaml import semver import pk...
2.0625
2
test/simple_imputation/test_logistic_regression.py
macarro/imputena
6
24347
<filename>test/simple_imputation/test_logistic_regression.py import unittest from imputena import logistic_regression from test.example_data import * class TestLogisticRegression(unittest.TestCase): # Positive tests ---------------------------------------------------------- def test_logistic_regression_re...
3.40625
3
src/robot/libdocpkg/jsonbuilder.py
rdagum/robotframework
7,073
24348
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
2.140625
2
webapp/tests/test_storage.py
TimWhalen/graphite-web
1
24349
import os import random import shutil import time import whisper from django.conf import settings from django.test import override_settings from mock import patch, Mock from .base import TestCase from graphite.finders.utils import BaseFinder from graphite.intervals import Interval, IntervalSet from graphite.node imp...
1.90625
2
sfzgen_test.py
tavasti/sfzscripts
0
24350
<reponame>tavasti/sfzscripts<gh_stars>0 import sys from sfzgen import GetNote # Verify that GetNote gives us back the notes that we expect. midi_val = 24 # Starting midi value. for scale in range(1, 8): for note in 'cdefgab': for sharp in ('', 's', '#'): name = note + sharp + str(scale) if name[:2]...
2.515625
3
hardhat/recipes/python/py.py
stangelandcl/hardhat
0
24351
from .base import PipBaseRecipe class PyRecipe(PipBaseRecipe): def __init__(self, *args, **kwargs): super(PyRecipe, self).__init__(*args, **kwargs) self.sha256 = '1f9a981438f2acc20470b301a07a4963' \ '75641f902320f70e31916fe3377385a9' self.name = 'py' self.ver...
2.15625
2
tests/test_article.py
JohnKarima/news-hub
0
24352
<filename>tests/test_article.py import unittest from app.models import Article class ArticleTest(unittest.TestCase): ''' Test Class to test the behaviour of the Article class ''' def setUp(self): ''' Set up method that will run before every Test ''' self.new_article = A...
3.6875
4
flatten.py
FauxFaux/jdk9-repotools
0
24353
<filename>flatten.py #!/usr/bin/env python3 import collections import datetime import subprocess import dateutil.parser import os from typing import Dict, Iterator, List, TypeVar, Tuple, Optional T = TypeVar('T') RawLog = collections.namedtuple('RawLog', ['commit', 'tree', 'date']) TreeInfo = collections.namedtuple(...
2.515625
3
src/ros/rosmake/test/test_parallel_build.py
jungleni/ros_code_reading
742
24354
<filename>src/ros/rosmake/test/test_parallel_build.py #!/usr/bin/env python # Copyright (c) 2009, <NAME>, Inc. # 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...
1.65625
2
miqa/core/models/image.py
davidshq/miqa-1
0
24355
<filename>miqa/core/models/image.py from pathlib import Path from uuid import uuid4 from django.db import models from django_extensions.db.models import TimeStampedModel class Image(TimeStampedModel, models.Model): class Meta: indexes = [models.Index(fields=['scan', 'name'])] ordering = ['name'] ...
2.359375
2
src/utils/libraries/index.py
Shellyda/Algorithms-Sorting-Project
0
24356
from utils.libraries.Get_duration_execution_time import Get_duration_execution_time from utils.libraries.Bubble_sort import Bubble_sort from utils.libraries.Insertion_sort import Insertion_sort from utils.libraries.Merge_sort import Merge_sort from utils.libraries.Selection_sort import Selection_sort
1.328125
1
Python_practice.py
ftercero/Election_Analysis
0
24357
#print ("Hello World") #counties=["Arapahoes","Denver","Jefferson"] #if counties[1]=='Denver': # print(counties[1]) #counties = ["Arapahoe","Denver","Jefferson"] #if "El Paso" in counties: # print("El Paso is in the list of counties.") #else: # print("El Paso is not the list of counties.") #if "Arapahoe" in ...
4.3125
4
compss/programming_model/bindings/python/src/pycompss/matlib/algebra/mean.py
TANGO-Project/compss-tango
3
24358
# # Copyright 2002.2.rc1710017 Barcelona Supercomputing Center (www.bsc.es) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
2.5
2
account/models/addon.py
avwx-rest/account-backend
0
24359
""" Plan add-on models """ # pylint: disable=too-few-public-methods from typing import Optional from beanie import Document from pydantic import BaseModel class AddonOut(BaseModel): """Addon fields returned to the user""" key: str name: str description: str class UserAddon(AddonOut): """Addo...
2.65625
3
src/tools/cc-frame-viewer/ccfv.py
jxjnjjn/chromium
9
24360
<gh_stars>1-10 # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import sys def Init(): chromeapp_path = os.path.abspath( os.path.join(os.path.dirname(__file__), ...
2.15625
2
main.py
MarkPopovK/nhl-graph
0
24361
import json import requests import dash import dash_core_components as dcc import dash_html_components as html def server_setup(results): app = dash.Dash(__name__) app.layout = html.Div(children=[ html.H1(children='NHL 2018/2019 cumulative points stats'), html.Div(children=''' ...
2.890625
3
python_libs/train_lib.py
rubenIzquierdo/lda_wsd
1
24362
############################################## # Author: <NAME> # # VU University of Amsterdam # # Mail: <EMAIL> # # <EMAIL> # # Webpage: http://rubenizquierdobevia.com # # Version: 1.0 # # Modified: 23-mar-2015 ...
2.359375
2
pincer/utils/snowflake.py
MithicSpirit/Pincer
1
24363
# Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from __future__ import annotations class Snowflake(int): """Discord utilizes Twitter's snowflake format for uniquely identifiable descriptors (IDs). These IDs are guaranteed to be unique across all of Disco...
2.484375
2
examples/squeeze.py
coherentgraphics/python-libcpdf
1
24364
#Squeeze example import sys sys.path.insert(0,'..') import pycpdflib #DLL loading depends on your own platform. These are the author's settings. if sys.platform.startswith('darwin'): pycpdflib.loadDLL("/Users/john/repos/python-libcpdf/libpycpdf.so") elif sys.platform.startswith('linux'): pycpdflib.loadDLL("../...
2.9375
3
src/watcher.py
RHEAGROUP/OCRE-Importing
0
24365
import imaplib import email from create_orders_from_email import get_email_contents import time import sys with imaplib.IMAP4_SSL(host="imap.gmail.com", port=imaplib.IMAP4_SSL_PORT) as imap_ssl: resp_code, response = imap_ssl.login(sys.argv[1], sys.argv[2]) while True: resp_code, mail_count = imap_ssl....
2.71875
3
pytlite/__init__.py
panakuma/pytlite
0
24366
import socket import struct class Patlite(object): auto_update = True OFF = 0 BLINK = 0x20 ON = 0x01 SHORT = 0x08 LONG = 0x10 STATUS_STRING = { OFF:"Off",BLINK:"Blink",ON:"On", SHORT:"Short",LONG:"Long" } RED = 0 ...
2.9375
3
src/app/todos/routes.py
alexzanderr/metro.digital
0
24367
<reponame>alexzanderr/metro.digital<filename>src/app/todos/routes.py """ # type: ignore type ignore is to tell LSP-pyright to ignore the line because something it thinks that there are errors, but actually at runtime there are not """ from .validation import validate_password_check from .validation import ...
1.976563
2
src/arcam/fmj/server.py
evanugarte/arcam_fmj
5
24368
"""Fake server""" import asyncio import logging from typing import Callable, Dict, List, Optional, Tuple, Union from . import ( AmxDuetRequest, AmxDuetResponse, AnswerCodes, CommandNotRecognised, CommandPacket, ResponseException, ResponsePacket, read_command, write_packet ) _LOGGER...
2.421875
2
qiskit_optimization/converters/linear_inequality_to_penalty.py
X-Libor/qiskit-optimization
109
24369
# This code is part of Qiskit. # # (C) Copyright IBM 2020, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
3
3
PHASE_2/Application_SourceCode/backend/prediction_page.py
vicinx3/disease-outbreak
0
24370
from flask import Blueprint, abort, request, jsonify from prediction_utils import * prediction_page = Blueprint('prediction_page', __name__) @prediction_page.route('/map', methods=['GET']) def get_map_data(): offset = int(request.args['offset']) country = request.args['country'] if 'country' in request.args e...
2.421875
2
djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/draugiem/urls.py
DemarcusL/django_wiki_lab
6,342
24371
from django.urls import path from . import views urlpatterns = [ path("draugiem/login/", views.login, name="draugiem_login"), path("draugiem/callback/", views.callback, name="draugiem_callback"), ]
1.609375
2
Python/venv/lib/python3.7/site-packages/IPython/core/inputtransformer2.py
HenriqueBuzin/TCC
445
24372
<gh_stars>100-1000 """Input transformer machinery to support IPython special syntax. This includes the machinery to recognise and transform ``%magic`` commands, ``!system`` commands, ``help?`` querying, prompt stripping, and so forth. Added: IPython 7.0. Replaces inputsplitter and inputtransformer which were deprecat...
2.734375
3
run_metrics.py
bradyneal/realcause
35
24373
<gh_stars>10-100 from pathlib import Path import os import zipfile import json from addict import Dict from train_generator import get_data from loading import load_gen import numpy as np from collections import OrderedDict from tqdm import tqdm def get_univariate_results(model, num_tests=100, verbose=False, n=None):...
2.140625
2
Getting-Started-with-Python/pay_calculator.py
michellevrp/Python_Course
0
24374
#first exercise #This code asks the user for hours and rate for hour, calculate total pay and print it. hrs = input("Enter Hours:") rate = input("Enter Rate:") pay = float(hrs) * float(rate) print("Pay:", pay) #second exercise #This code asks the user for hours and rate for hour, calculate total pay and print...
4.21875
4
vcx/wrappers/python3/vcx/api/disclosed_proof.py
esplinr/evernym-sdk
0
24375
from typing import Optional from ctypes import * from vcx.common import do_call, create_cb from vcx.api.connection import Connection from vcx.api.vcx_stateful import VcxStateful import json class DisclosedProof(VcxStateful): def __init__(self, source_id: str): VcxStateful.__init__(self, source_id) ...
2.21875
2
pingdom/pingdom.py
srinivas-kandula/integrations
10
24376
import sys import requests import json import argparse import time parser = argparse.ArgumentParser(description='Collects monitoring data from Pingdom.') parser.add_argument('-u', '--pingdom-user-name', help='The Pingdom User Name', required=True) parser.add_argument('-p', '--pingdom-password', help='The Pingdom Passw...
2.9375
3
OpenData/Upsilon/Upsilon.py
tylern4/tylern4.github.io
0
24377
<gh_stars>0 import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy import stats from pandas.tools.plotting import scatter_matrix from scipy.optimize import curve_fit from matplotlib.colors import LogNorm df = pd.read_csv('/Users/tylern/Homework/PHYS723/pr...
2.421875
2
lib/JumpScale/lib/perftesttools/NodeBase.py
rudecs/jumpscale_core7
0
24378
<filename>lib/JumpScale/lib/perftesttools/NodeBase.py from JumpScale import j # import sys # import time # import json # import os # import psutil from MonitorTools import * # from pssh import ParallelSSHClient from gevent import monkey monkey.patch_socket() class NodeBase(MonitorTools): def __init__(self,ipadd...
1.703125
2
test/test_ABVD.py
SimonGreenhill/ABVDGet
2
24379
<gh_stars>1-10 import os import unittest import tempfile from abvdget import ABVDatabase, Record TESTDATA = os.path.join(os.path.dirname(__file__), 'nengone.json') EXPECTED = { 99: { "LID": 99, "Annotation": "arm and hand", "Cognacy": '1', "Item": "nin", "Loan": None, ...
2.453125
2
PythonAPI/scripts/analyze.py
ZhuLingfeng1993/coco
0
24380
#!/usr/bin/env python # ----------------------------------------------------- # Written by <NAME> on 2021/3/28. # ----------------------------------------------------- import sys from pycocotools.coco_analyze import COCOAnalyze, my_plot annFile = sys.argv[1] coco = COCOAnalyze(annFile) # get all cats catNms = 'all'...
1.976563
2
custom_components/ge_home/entities/ac/fan_mode_options.py
olds/ha_gehome
41
24381
import logging from typing import Any, List, Optional from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_FAN_ONLY, ) from gehomesdk import ErdAcFanSetting from ..common import OptionsConverter _LOGGER = logging.getLogger(__name__) class AcFanModeOptionsConverte...
2.234375
2
tests/test_basic.py
WSULib/combine
24
24382
<reponame>WSULib/combine import django import os import pytest import shutil import sys import time import uuid # logging import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # init django settings file to retrieve settings os.environ['DJANGO_SETTINGS_MODULE'] = 'combine.settings' sys.p...
2.015625
2
tree.py
rainer85ah/SupervisedLearning
0
24383
""" Decision Trees - Supervised learning: 1-Classification*, 2-Regression. D.T.s are a non-parametric supervised learning method used for classification and regression. The goal is to create a model that predicts the value of a target variable by learning simple decision rules inferred from the data features. Some adv...
3.625
4
src/main.py
ckbjimmy/clneg
22
24384
<gh_stars>10-100 import os import sys import re import numpy as np #from create_neglist import * import pandas as pd pd.set_option('display.max_rows', None) from create_tokenization import * from pycorenlp import StanfordCoreNLP from concept_extraction import * from syntactic_parsing import * from tree_rules import * f...
2.578125
3
sdk/python/pulumi_azure_native/edgeorder/v20201201preview/outputs.py
pulumi-bot/pulumi-azure-native
31
24385
<filename>sdk/python/pulumi_azure_native/edgeorder/v20201201preview/outputs.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 A...
1.492188
1
open-hackathon/src/hackathon/__init__.py
SpAiNiOr/LABOSS
0
24386
__author__ = '<NAME>' __version__ = '2.0' from flask import Flask from hackathon.functions import safe_get_config from flask_restful import Api from flask_cors import CORS # flask app = Flask(__name__) app.config['SECRET_KEY'] = '*K&ep_me^se(ret_!@#$' # flask restful api = Api(app) # CORS app.config['CORS_HEADERS']...
2.296875
2
nrm_django/nrm_site/settings/test.py
18F/NRM-Grants-Agreements
5
24387
<gh_stars>1-10 import os from .base import * # noqa import dj_database_url SECRET_KEY = "test mode" database_url = os.getenv("DATABASE_URL") if database_url: DATABASES = {"default": dj_database_url.parse(database_url)} else: DATABASES = { "default": { "ENGINE": "django.db.backends.postg...
1.796875
2
exampleTree_simpleS3.py
evilrovot/attackTrees
0
24388
from models import Action, Block, Detect, Discovery, Edge, Node import renderer if __name__ == "__main__": root = Node(label="Reality") goal = Node(label="Attacker gets data from bucket") apiCache = Action( label="Search API Caches", chain="recon", cost=0, time=3, o...
2.4375
2
python_scripts/geometry_factory.py
rwilliams01/isogeometric_application
0
24389
import math from KratosMultiphysics import * from KratosMultiphysics.BRepApplication import * from KratosMultiphysics.IsogeometricApplication import * ### ### This module is a factory to generate typical geometries for isogeometric analysis, e.g. circle, l-shape, ... ### nurbs_fespace_library = BSplinesFESpaceLibrary...
2.328125
2
tutorials/tutorial_imc.py
softbear/squidpy_notebooks
0
24390
#!/usr/bin/env python """ Analyze Imaging Mass Cytometry data =================================== This tutorial shows how to apply Squidpy to Imaging Mass Cytometry data. The data used here comes from a recent paper from :cite:`jackson2020single`. We provide a pre-processed subset of the data, in :class:`anndata.AnnD...
2.78125
3
music_site/mongoServices/services.py
UVG-Teams/music-space
0
24391
from pymongo import MongoClient client = MongoClient() db = client.music_space def print_collection(collection): print("/" * 75) for x in db[collection].find(): print(x) print("/" * 75) def save_sales_on_mongo(collection, data): for i in range(len(data['sales'])): data['sales'][i]['to...
2.8125
3
cryptodoge/cmds/units.py
grayfallstown-cryptodoge/cryptodoge
10
24392
from typing import Dict # The rest of the codebase uses mojos everywhere. # Only use these units for user facing interfaces. units: Dict[str, int] = { "cryptodoge": 10 ** 6, # 1 cryptodoge (XCD) is 1,000,000 mojo (1 million) "mojo:": 1, "colouredcoin": 10 ** 3, # 1 coloured coin is 1000 colouredcoin mojo...
2.875
3
scripts/build/submit_metrics.py
cypherdotXd/o3de
11
24393
<gh_stars>10-100 # # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import argparse import logging import json import socket from datetime import datetime S...
2.4375
2
pylearn2/models/local_coordinate_coding.py
Menerve/pylearn2
3
24394
""" .. todo:: WRITEME """ import logging from theano import function, shared from pylearn2.optimization import linear_cg as cg from pylearn2.optimization.feature_sign import feature_sign_search import numpy as N import theano.tensor as T from pylearn2.utils.rng import make_np_rng logger = logging.getLogger(__nam...
2.203125
2
components/mpas-source/testing_and_setup/compass/landice/hydro-radial/plot_hydro-radial_profile.py
meng630/GMD_E3SM_SCM
0
24395
#!/usr/bin/env python ''' Plots profiles for hydro-margin test case ''' from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import netCDF4 from optparse import OptionParser import matplotlib.pyplot as plt from matplotlib import cm secInYr = 3600.0 * 24.0 * 365.0 # N...
2.296875
2
abovl/app.py
romanchyla/arxiv_biboverlay
2
24396
<reponame>romanchyla/arxiv_biboverlay #!/usr/bin/python # -*- coding: utf-8 -*- from adsmutils import ADSFlask, get_date from views import bp from abovl.models import OAuthClient from flask.ext.session import Session def create_app(**config): """ Create the application and return it to the user :return: f...
2.671875
3
integration/bazel_workspace_tests/bazel_ngtsc_plugin/packages.bzl
John-Cassidy/angular
95,154
24397
<filename>integration/bazel_workspace_tests/bazel_ngtsc_plugin/packages.bzl ANGULAR_PACKAGES_CONFIG = [ ("@angular/animations", struct(entry_points = ["browser"])), ("@angular/common", struct(entry_points = ["http/testing", "http", "testing"])), ("@angular/compiler", struct(entry_points = ["testing"])), ...
1.53125
2
2017-05-13-concurrent-and-parallel-programming-in-python-part-1/threading_no_inheritance.py
funweb/blog
4
24398
<filename>2017-05-13-concurrent-and-parallel-programming-in-python-part-1/threading_no_inheritance.py #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # import requests import threading import queue URLS = [ 'https://xkcd.com/138/', 'https://xkcd.com/149/', 'https://xkcd.com/285/', 'https://xkcd....
3.328125
3
frontend/felask/__init__.py
pdonorio/restangulask
4
24399
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Factory and blueprints patterns """ import os from commons.logs import get_logger from commons.meta import Meta as m logger = get_logger(__name__) ################ config = { "default": "config.devel", "development": "config.devel", "production": "config.prod",...
2.21875
2