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
pretrain/CP/model.py
datawhales/RE-by-MKD
0
48700
import copy import torch import torch.nn as nn from pytorch_metric_learning.losses import NTXentLoss from transformers import BertForMaskedLM, BertForPreTraining, BertTokenizer def mask_tokens(inputs, tokenizer, not_mask_pos=None): """ Prepare masked tokens of inputs and labels for masked language modeling (80% MA...
2.5
2
monitor/services/send_notification_email.py
BrianWaganerSTL/RocketDBaaS
1
48701
<gh_stars>1-10 from django.core.exceptions import FieldDoesNotExist, FieldError from django.core.mail import EmailMessage from django.db import IntegrityError from RocketDBaaS.settings_local import emailCcPostgres, emailFromPostgres, emailCcMongo, emailFromMongo, replyToPostgres, replyToMongo from dbaas.models import ...
2.109375
2
src/train_test_split.py
JanMalinowski/Neurabble
0
48702
import pandas as pd import os if __name__ == "__main__": data_dir = os.environ.get("DATA_DIRECTORY") data_file = os.environ.get("DATA_FILE") print(data_dir) data_df = pd.read_pickle(data_dir + data_file) test_df = pd.DataFrame() # Creating two non-overlapping datasets for training and validati...
2.8125
3
ADT/acl.py
UKHomeOffice/dq-ssm_ingest
1
48703
## ACL Import Module # ACL CSV Import # Version 5 # 2015-10-30 # we only need the datetime class & the static function strptime from datetime module from datetime import datetime import re import sys import os import logging # best postgresql module so far, install it "yum install python-psycopg2" import psycopg2 im...
2.359375
2
drdown/medicalrecords/views/view_static_data.py
fga-gpp-mds/2018.1-Cris-Down
11
48704
from drdown.users.models.model_health_team import HealthTeam from ..models.model_static_data import StaticData from ..models.model_medical_record import MedicalRecord from drdown.users.models.model_user import User from drdown.users.models.model_patient import Patient from django.views.generic import CreateView, Delete...
1.703125
2
homeassistant/components/fixer/__init__.py
domwillcode/home-assistant
30,023
48705
<filename>homeassistant/components/fixer/__init__.py """The fixer component."""
1.179688
1
beatbrain/utils/visualization.py
tasercake/BeatBrain
5
48706
<filename>beatbrain/utils/visualization.py<gh_stars>1-10 import matplotlib.pyplot as plt import seaborn as sns import numpy as np import librosa import librosa.display import IPython.display as ipd from .config import Config, get_default_config default_config = get_default_config() def show_heatmap( spec, n...
2.796875
3
misty2py_skills/demonstrations/explore.py
ChrisScarred/misty2py-skills
0
48707
<reponame>ChrisScarred/misty2py-skills """This module implements a SLAM mapping skill. """ from typing import Union from misty2py.utils.utils import get_misty from pynput import keyboard misty = get_misty() INFO_KEY = keyboard.KeyCode.from_char("i") """The key to print for SLAM information.""" START_KEY = keyboard.K...
2.78125
3
18/part2.py
jcsesznegi/advent-of-code-2017
1
48708
import os, queue from tablet import Tablet f = open(os.path.join(os.path.dirname(__file__), '../input/18/part1.txt'), 'r') def main(): instructionStrings = [] line = f.readline() while line: instructionStrings.append(line.rstrip()) line = f.readline() q0 = queue.Queue() q1 = queue...
2.796875
3
viz.py
Zoetic-Zephyr/CarND-Behavioral-Cloning-P3
0
48709
<reponame>Zoetic-Zephyr/CarND-Behavioral-Cloning-P3<filename>viz.py import numpy as np from scipy import ndimage from matplotlib import pyplot as plt p_c = "writeup_images/center_2016_12_01_13_36_47_622.jpg" p_l = "writeup_images/left_2016_12_01_13_36_47_622.jpg" p_r = "writeup_images/right_2016_12_01_13_36_47_622.jp...
2.109375
2
app/model.py
fras2560/flask-pytest-cypress-ci-template
0
48710
<reponame>fras2560/flask-pytest-cypress-ci-template<filename>app/model.py<gh_stars>0 # -*- coding: utf-8 -*- """Holds a database model for the application.""" from flask_sqlalchemy import SQLAlchemy """The database object.""" DB = SQLAlchemy() class Entity(DB.Model): """ A class used to store some entity...
2.625
3
data_from_nse.py
anshjeengar/PyFin
0
48711
import datetime import os from zipfile import ZipFile import requests from icecream import ic from wget import download ic.enable() date_from = (datetime.date.today() - datetime.timedelta(days=5)).isoformat() date_to = (datetime.date.today()).isoformat() ic(f'Date Range: {date_from} to {date_to}') def getbhav_dat...
2.546875
3
aioruuvitag/ruuvitag_calc.py
hulttis/ruuvigw
7
48712
# coding=utf-8 # !/usr/bin/python3 # Name: ruuvitag calc - calculations # Copyright: (c) 2019 TK # Licence: MIT # ------------------------------------------------------------------------------- import logging logger = logging.getLogger('ruuvitag') import math # ----------------------------------------...
2.765625
3
testware/utils/transforms.py
amansinha/testware
0
48713
# -*- coding: utf-8 -*- ''' Copyright (c) 2021, Trustworthy AI, 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: 1. Redistributions of source code must retain the above copyright notice, this list ...
1.179688
1
bigfix_connector.py
splunk-soar-connectors/bigfix
0
48714
<filename>bigfix_connector.py # File: bigfix_connector.py # # Copyright (c) 2017-2022 Splunk 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://www.apache.org/licenses/LICENS...
2.109375
2
files/hacktm-ctf-2020/strange-pcap/solution/solve.py
J4sp3r/j4sp3r.github.io
0
48715
<filename>files/hacktm-ctf-2020/strange-pcap/solution/solve.py<gh_stars>0 #!/usr/bin/env python3 usb_codes = { 0x04:"aA", 0x05:"bB", 0x06:"cC", 0x07:"dD", 0x08:"eE", 0x09:"fF", 0x0A:"gG", 0x0B:"hH", 0x0C:"iI", 0x0D:"jJ", 0x0E:"kK", 0x0F:"lL", 0x10:"mM", 0x11:"nN", 0x12:"oO", 0x13:"pP", 0x14:"qQ", 0x15:"rR", ...
2.328125
2
problems/easy.py
mrcoles/coding-bee
1
48716
# original problems def easy_sum(a, b): """Takes two numbers and returns their sum""" return a + b def easy_product(a, b): """Takes two numbers and returns their product""" return a * b def easy_concat(a, b): """Takes two strings and returns their concatenation""" return a + b def easy_empty...
3.859375
4
vivisect/analysis/generic/impapi.py
cmaruti/vivisect
1
48717
<gh_stars>1-10 """ Function analysis module which sets function APIs based on function's name matching impapi. This should ideally go early in the module order to get the APIs marked asap. """ def analyzeFunction(vw, fva): fname = vw.getName(fva) api = vw.getImpApi(fname) if api == None: return ...
2.390625
2
jira_webhook/apps.py
uw-it-aca/jira-webhook
0
48718
<reponame>uw-it-aca/jira-webhook # Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.apps import AppConfig class JiraWebhookConfig(AppConfig): name = 'jira_webhook'
1.234375
1
src/util/knn.py
FlorianWestphal/ICDAR2019
1
48719
import numpy as np class KNearestNeighbors: def __init__(self, distances, labels, k=10): self.distances = distances self.labels = labels self.k = k def _kNN(self, instance, train, k): nearest = np.argpartition(self.distances[instance][train], k) nearest_labels = self....
3.125
3
src/princeton_scraper_cos_courses/__init__.py
jlumbroso/princeton-scraper-cos-courses
1
48720
""" Library to fetch and parse the public Princeton COS courses history as a Python dictionary or JSON data source. """ __version__ = '1.0.0' __author__ = "<NAME> <<EMAIL>>" __all__ = [ "CosCourseInstance", "CosCourseTerm", "fetch_cos_courses", ] from princeton_scraper_cos_courses.parsing import CosCo...
2.90625
3
tests/test_print.py
syegulalp/myjit
11
48721
import unittest from jit import jit from jit import j_types as j @jit def test_print(x: j.i64): return print(x) class Test(unittest.TestCase): def test_void_zero(self): self.assertEqual(test_print(8), 2) self.assertEqual(test_print(64), 3)
2.59375
3
lab.py
LiuDaveLiu/dj-spineimaging
0
48722
import datajoint as dj schema = dj.schema('boazmohar_lab', locals()) @schema class Person(dj.Manual): definition = """ username : varchar(12) ---- fullname : varchar(60) """ contents = [('boazmohar', '<NAME>')] @schema class Rig(dj.Lookup): # This list will be everchanging and espanding fo...
2.59375
3
data_processing.py
neverstoplearn/remote_sensing_change_detection
56
48723
# coding: utf-8 # In[1]: from path import Path from matplotlib import pyplot as plt import numpy as np import skimage.io as io import os from PIL import Image import cv2 import random import shutil def crop_by_sequence(image_path,img_class_path,crop_size_w,crop_size_h,prefix,save_dir ,same_scale = False): ...
3.1875
3
arc/util/profile.py
dereklarson/ARC_study
0
48724
import cProfile import functools import pstats import resource import signal import time from typing import Any, Callable # This list is passed to @profile() which aggregates the cumulative runtime # into these functions, which represent the primary stages of task solutioning. PROFILE_BREAKOUT_STD: list[str] = [ "...
2.484375
2
black-hat/chapter-10/bhvulnservice/vulnservice.py
nwiizo/joke
1
48725
# -*- coding: utf-8 -*- #Requires Win32 Python Extensions import os import servicemanager import shutil import subprocess import sys import win32api import win32event import win32service import win32serviceutil import tempfile class VulnService(win32serviceutil.ServiceFramework): _svc_na...
2.4375
2
src/xsd_auth/management/commands/delete_orphaned_users.py
minyiky/xSACdb
2
48726
<gh_stars>1-10 from django.core.management.base import BaseCommand from xsd_auth.models import User class Command(BaseCommand): help = 'Delete users without an attached member profile' def handle(self, *args, **options): qs = User.objects.filter(memberprofile=None) if qs.count() == 0: ...
2.390625
2
0886 Square Submatrix Sum Below Target.py
ansabgillani/binarysearchcomproblems
1
48727
class Solution: def solve(self, matrix, target): for r in range(len(matrix)): for c in range(len(matrix[0])): if r-1 >= 0: matrix[r][c] += matrix[r-1][c] if c-1 >= 0: matrix[r][c] += matrix[r][c-1] if r-1 >= 0 and c-1 >= 0: matrix[r][c] -= matrix[r...
3.359375
3
files/spam-filter/tracspamfilter/admin.py
Puppet-Finland/puppet-trac
0
48728
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Edgewall Software # Copyright (C) 2015 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/...
1.492188
1
bin/convert_to_wdiff.py
zerogerc/wikiedits
0
48729
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from difflib import SequenceMatcher SKIP_COMMENTS = False ONE_LINE_COMMENTS = False def main(): err = None cor = None comment = '' for line in sys.stdin: line = line.strip() if line.startswith('###'): if...
3.015625
3
apps/stock_members.py
ohjho/open_terminal
0
48730
<reponame>ohjho/open_terminal<gh_stars>0 import os, sys, json, requests import streamlit as st from stqdm import stqdm import pandas as pd #Paths cwdir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(1, os.path.join(cwdir, "../")) from toolbox.st_utils import show_plotly from toolbox.yf_utils import tick...
2.578125
3
fashion_mnsit.py
samarthbhargav/symstat
0
48731
import copy import logging import torch import numpy as np from torch.utils.data import DataLoader from torchvision import datasets, transforms log = logging.getLogger(__name__) def balanced_batches(dataset, batch_size): unlabled_idx = dataset.unlabeled_idx labeled_idx = list(filter(lambda _: _ not in unlab...
2.421875
2
rlgraph/components/layers/preprocessing/image_crop.py
RLGraph/RLGraph
290
48732
<reponame>RLGraph/RLGraph # Copyright 2018/2019 The RLgraph 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 # ...
1.851563
2
mvpa2/tests/test_gnb.py
arnaudsj/PyMVPA
1
48733
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ###...
2.078125
2
test/conftest.py
GillesBouissac/blender-amf
3
48734
# MIT License # # Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
1.601563
2
madpy/amplitude.py
seismomomo/madpy
1
48735
""" amplitude.py measure the maximum peak-to-peak amplitude """ import obspy import types import numpy as np import pandas as pd import madpy.noise as n from typing import Tuple import madpy.checks as ch import madpy.config as config import matplotlib.pyplot as plt import madpy.plotting.amp as plot def measure_ampl...
3.140625
3
accounts/forms.py
rijalanupraj/halkapan
0
48736
# External Import from django.contrib.auth import get_user_model from django import forms from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.core.exceptions import ValidationError from django.contrib import messages from django.urls import reverse from django.contrib.sites.shortcuts ...
2.34375
2
umbra/common/protobuf/umbra_grpc.py
RafaelAPB/umbra
0
48737
# Generated by the Protocol Buffers compiler. DO NOT EDIT! # source: umbra.proto # plugin: grpclib.plugin.main import abc import typing import grpclib.const import grpclib.client if typing.TYPE_CHECKING: import grpclib.server import google.protobuf.struct_pb2 import google.protobuf.timestamp_pb2 from umbra.common...
1.71875
2
box/apps.py
mamalmaleki/maktab-community
0
48738
<reponame>mamalmaleki/maktab-community from django.apps import AppConfig class BoxConfig(AppConfig): name = 'box'
1.242188
1
pythonforandroid/recipes/pydantic/__init__.py
syrykh/python-for-android
6,278
48739
<reponame>syrykh/python-for-android<gh_stars>1000+ from pythonforandroid.recipe import PythonRecipe class PydanticRecipe(PythonRecipe): version = '1.8.2' url = 'https://github.com/samuelcolvin/pydantic/archive/refs/tags/v{version}.zip' depends = ['setuptools'] python_depends = ['Cython', 'devtools', '...
2
2
p1_navigation/src/models/dueling_qnetwork.py
JeffersonH44/deep-reinforcement-nd
0
48740
import torch import torch.nn as nn import torch.nn.functional as F from src.utils import get_seed class DuelingQNetwork(nn.Module): def __init__(self, state_size, action_size): super().__init__() self.seed = torch.manual_seed(get_seed()) self.V_fc1 = nn.Linear(state_size, 64) self...
2.546875
3
leetcode/2.Add_Two_Numbers/python/add_two_numbers_v2.py
realXuJiang/research_algorithms
1
48741
class ListNode(object): def __init__(self, x): self.val = x self.next = None def addTwoNumbers(l1, l2): carry = 0 root = n = ListNode(0) while l1 or l2 or carry: v1 = v2 = 0 if l1: v1 = l1.val l1 = l1.next i...
3.78125
4
gan/evaluation/gan.py
rharish101/mnist-gan
1
48742
"""Class for generation using the GAN.""" from pathlib import Path import tensorflow as tf from tensorflow.keras import Model from tqdm import tqdm from ..utils import Config class GANEvaluator: """Class to generate images using a GAN. Attributes: generator: The generator model to be evaluated ...
2.953125
3
alpyro_msgs/actionlib/testresult.py
rho2/alpyro_msgs
1
48743
<filename>alpyro_msgs/actionlib/testresult.py<gh_stars>1-10 from alpyro_msgs import RosMessage, int32 class TestResult(RosMessage): __msg_typ__ = "actionlib/TestResult" __msg_def__ = "aW50MzIgcmVzdWx0Cgo=" __md5_sum__ = "034a8e20d6a306665e3a5b340fab3f09" result: int32
2.078125
2
datumaro/datumaro/cli/create_command.py
godlikejay/cvat
2
48744
# Copyright (C) 2019 Intel Corporation # # SPDX-License-Identifier: MIT import argparse from . import project as project_module def build_parser(parser=argparse.ArgumentParser()): project_module.build_create_parser(parser) \ .set_defaults(command=project_module.create_command) return parser def m...
2.40625
2
aula3.py
rafaelmbsouza/python_twitch
0
48745
#REQUESTS -> FAZER REQUISIÇÕES HTTP (URLLIB3) #HTTP = Hypertext Transfer Protocol #BEAUTIFULSOUP -> HTML ou XML -> Organiza-lo de maneira a ler no python #PANDAS -> pegar esses objetos e tranformar em EXCEL #USAR REQUESTS E ENTENDER COMO FUNCIONA. import requests as req url = 'https://g1.globo.com' r = req.get(url)...
3.65625
4
config/includes.chroot/usr/share/tkmenu/tekamenu/tools.py
ddarksmith/S0lar0S
0
48746
#!/usr/bin/env python # -*- coding:Utf-8 -*- import sys import os from collections import OrderedDict from time import time if sys.version_info >= (3, 0): import configparser else: import ConfigParser as configparser from subprocess import Popen from tekamenu.const import * def help(): print("usage : ") ...
2.359375
2
zonemanager/utils.py
justinkinney/zonemanager
1
48747
import ConfigParser import logging import os import sys import yaml log = logging.getLogger() def load_yaml(filename): with open(filename, 'r') as stream: return yaml.load(stream) def set_env_aws_creds(account='default'): """ Parse ~/.aws/credentials for credentials Allow OS environment var...
2.609375
3
setup.py
murillotadeo/discsocket
0
48748
from setuptools import setup import setuptools readme = '' with open('README.md') as f: readme = f.read() setup( name="discsocket", author="<NAME>", url="https://github.com/murillotadeo/discsocket", project_urls={ "Issue tracker": "https://github.com/murillotadeo/discsocket/issues", ...
1.375
1
setup.py
kain88-de/numkit
0
48749
<reponame>kain88-de/numkit #! /usr/bin/python """Setuptools-based setup script for numkit. For a basic installation just type the command:: python setup.py install """ from setuptools import setup, find_packages setup(name='numkit', version='1.1.0-dev', description='numerical first aid kit', au...
2.265625
2
dpfinder/algorithms/algorithms.py
barryZZJ/dp-finder
0
48750
# ==BEGIN LICENSE== # # MIT License # # Copyright (c) 2018 SRI Lab, ETH Zurich # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the right...
1.96875
2
Proj029Pipelines/PipelineMetaomics.py
CGATOxford/proj029
3
48751
#################################################### #################################################### # functions and classes used in conjunction with # pipeline_metaomics.py #################################################### #################################################### # import libraries import sys impo...
2.25
2
src/dlg_windows.py
seung-lab/SBEMimage
0
48752
<gh_stars>0 # -*- coding: utf-8 -*- # ============================================================================== # SBEMimage, ver. 2.0 # Acquisition control software for serial block-face electron microscopy # (c) 2018-2019 <NAME> Institute for Biomedical Research, Basel. # This software is licensed under ...
1.601563
2
src/telliot_core/queries/snapshot.py
tellor-io/telliot-core
9
48753
<gh_stars>1-10 import logging from dataclasses import dataclass from telliot_core.dtypes.value_type import ValueType from telliot_core.queries.abi_query import AbiQuery logger = logging.getLogger(__name__) @dataclass class Snapshot(AbiQuery): """Returns the result for a given option ID (a specific proposal) on ...
2.484375
2
src/data/label.py
nutcrtnk/PGRA
3
48754
<gh_stars>1-10 import random from operator import itemgetter import config import numpy as np import hashlib from data.graph import Graph from collections import Iterable import copy from inspect import signature import networkx as nx class Label: modes = ['all', 'train', 'val', 'test'] default_code = '' ...
2.21875
2
ls/joyous/tests/test_weeks.py
tjwalch/ls.joyous
72
48755
# ------------------------------------------------------------------------------ # Test Formatting weeks # ------------------------------------------------------------------------------ import sys import datetime as dt from django.test import TestCase, override_settings import ls.joyous.utils.weeks from ls.joyous.utils...
2.53125
3
godot-stex-to-png.py
audrey-dogman/godot-stex-to-png
2
48756
# godot-stex-to-png.py # https://github.com/ClementineAccount/godot-stex-to-png import sys if len(sys.argv) > 1: filename = sys.argv[1] inputFile = open(filename, 'rb') outputFile = open(filename + '-output.png', 'wb') # 32 bits is based off the .stex header which are trimmed for png inputFile.see...
3.015625
3
mnistwebsite/models.py
4322vipul/mnist_digit_classifier_website
1
48757
<gh_stars>1-10 from django.db import models # Create your models here. class given_image(models.Model): image_given=models.ImageField(max_length=64) class image_name(models.Model): name_of_image=models.CharField(max_length=64) def __str__(self): return self.name_of_image ...
2.59375
3
utils/shell/pseudo_shell.py
adolabsnet/HatSploit
2
48758
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
1.984375
2
maskrcnn_benchmark/nas/rl/genotypes.py
DominickZhang/NAS-FCOS
187
48759
from collections import namedtuple Genotype = namedtuple('Genotype', 'backbone rpn') OP_NAMES = [ 'sep_conv_3x3', 'sep_conv_3x3_dil3', 'sep_conv_5x5_dil6', 'skip_connect', 'def_conv_3x3', ] AGG_NAMES = [ 'psum', 'cat' ] HEAD_OP_NAMES = [ 'conv1x1', 'conv3x3', 'sep_conv_3x3', ...
1.929688
2
pkgcheck/tests/test_pkgcheck.py
pombredanne/github.com-FFY00-pkgcheck
4
48760
<gh_stars>1-10 # 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, software # dist...
2.28125
2
tgcli/commands/get/app.py
frankfka/TigerGraphCLI
2
48761
<gh_stars>1-10 from typing import List import typer from tgcli.commands.etc.help_text import GRAPH_ARG_HELP, CONFIG_ARG_HELP from tgcli.commands.util import get_initialized_tg_connection, resolve_multiple_args, preprocess_list_query from tgcli.util import cli get_app = typer.Typer(help="Get resources from your Tiger...
2.71875
3
rally/plugins/openstack/scenarios/zaqar/utils.py
varuntiwari27/rally
1
48762
# Copyright (c) 2014 Red Hat, 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
2.03125
2
ping_utility.py
yogeshsuryawanshi497/ApplicationStatusTracker
0
48763
# -*- coding: utf-8 -*- ''' Script Name: ping_Utility.py Path: \IPS_DecisionFabric\Exception Handling\ Description: This script is considered as a module for the Application level Exception handling in DF framework. Author: <NAME> Version: 1.0 Revision History: ---------------------------------------------...
1.492188
1
api/users/models.py
mcauto/japronto-example
3
48764
<filename>api/users/models.py # coding=utf-8 import datetime from sqlalchemy import Column, Integer, String, DateTime from Database import Base, Session from werkzeug import generate_password_hash, check_password_hash class User(Base): __tablename__ = 'users' __table_args__ = {'mysql_collate': 'utf8_general...
2.953125
3
setup.py
breathe/NotebookScripter
23
48765
from setuptools import setup setup( name='NotebookScripter', version='6.0.0', packages=('NotebookScripter',), url='https://github.com/breathe/NotebookScripter', license='MIT', author='<NAME>', author_email='<EMAIL>', install_requires=( "ipython", "nbformat" ), te...
1.289063
1
settings.py
lmason98/PyGraph
0
48766
""" File: settings.py Author: <NAME> Description: Main application development settings file """ SCREEN_WIDTH = 1920 SCREEN_HEIGHT = 1080 WIDTH = 800 HEIGHT = 900 PAD = 15 APP_NAME = 'PyGraph' # Str of app name for window title DEBUG = 1 # Puts the app in debug mode (extra logging to console). LOG = 1 # Puts the...
1.367188
1
thejoker/distributions.py
adrn/thejoker
22
48767
# Third-party import astropy.units as u import numpy as np import pymc3 as pm from pymc3.distributions import generate_samples import aesara_theano_fallback.tensor as tt import exoplanet.units as xu __all__ = ['UniformLog', 'FixedCompanionMass'] class UniformLog(pm.Continuous): def __init__(self, a, b, **kwargs...
2.171875
2
pythonUtils/reptile/produce_name.py
MarcWong/matlabTools
0
48768
#usage: python produce_name.py yourpath file_type #coding=utf8 import sys reload(sys) sys.setdefaultencoding('utf8') import os import shutil def md5(str): import hashlib m = hashlib.md5() m.update(str) return m.hexdigest() if __name__ == '__main__': fp_write = open('index.txt','w') file_path = sys.argv[1...
2.859375
3
ExerciciosPythonMundo2/Aula12/Ex038.py
JamesonSantos/Curso-Python-Exercicios-Praticados
0
48769
'''Escreva um programa que leia dois numeros inteiros e compare-os, mostrando na tela uma mensagem: -0 primeiro valor é maior. -0 segundo valor é maior. -Não existe valor maior, os dois são iguais.''' numero1 = int(input('Primeiro número: ')) numero2 = int(input('Segundo número: ')) if numero1 > numero2: print('O p...
3.90625
4
demo/cheeseboard/app.py
dw/acid
15
48770
<reponame>dw/acid # # Copyright 2013, <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 required by applicable law or agreed...
2.0625
2
tests/pricehunt_test.py
adipid/pricehunt-py
0
48771
import json import os import unittest import price_checker from product import Product def load_json(filename): with open(filename) as json_file: imported_file = json.load(json_file) return imported_file cwd = os.path.dirname(os.path.realpath(__file__)) products_data = load_json(r"" + cwd + "/t...
2.875
3
SuperSafety/Utils/utils.py
BDEvan5/SuperSafety
0
48772
<reponame>BDEvan5/SuperSafety import yaml import csv import os from argparse import Namespace import shutil import numpy as np from numba import njit # Admin functions def save_conf_dict(dictionary, save_name=None): if save_name is None: save_name = dictionary["agent_name"] path = dictionary["vehic...
2.328125
2
tests/test_json_schema.py
riddopic/opta
595
48773
<filename>tests/test_json_schema.py<gh_stars>100-1000 from opta.json_schema import check_schemas def test_returns_without_error() -> None: check_schemas()
1.289063
1
server.py
Arrisio/dvmn-async-06-filter-news
0
48774
<filename>server.py import json from dataclasses import asdict from aiohttp import web from process_articles import process_articles_from_urls from settings import MAX_URL_PER_REQUEST routes = web.RouteTableDef() @routes.get("/") async def get_articles_scores(request): try: urls = request.query["urls"]...
2.765625
3
automation/delete_duplicate_lines.py
elyor0529/Awesome-Full-Stack-Web-Developer
12
48775
<gh_stars>10-100 # @Author: <NAME> <AnasAboureada> # @Date: Thu, 6th Oct 2016, T 10:38 +02:00 # @Email: <EMAIL> # @Project: awesome-full-stack-web-developer # @Filename: delete_duplicate_lines.py # @Last modified by: AnasAboureada # @Last modified time: Sat, 11th Mar 2017, T 14:26 +01:00 # @License: MIT License # ...
3.03125
3
class_lib/solid_objects.py
Tomas-Tamantini/py-cgi
0
48776
<gh_stars>0 from abc import ABC, abstractmethod from class_lib.color import * from math import log, exp class Material: """Material optical specifications""" def __init__(self, ambient_light_reflectivity=None, diffuse_light_reflectivity=GRAPE, specular_multiplier=.0, specular_coefficient=20...
2.96875
3
aadcUser/frAIburg_ThriftFacenet/python/gen-py/ExtIf/ttypes.py
PhilJd/frAIburg
10
48777
<gh_stars>1-10 # # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryProtoco...
1.90625
2
hwtHls/netlist/dumpStreamNodes.py
Nic30/hwtHls
8
48778
<filename>hwtHls/netlist/dumpStreamNodes.py from io import StringIO from hwtHls.netlist.transformations.rtlNetlistPass import RtlNetlistPass from hwtHls.allocator.allocator import ConnectionsOfStage class RtlNetlistPassDumpStreamNodes(RtlNetlistPass): def __init__(self, out: StringIO, close=False): self....
2.28125
2
tool/pcdet/version.py
jcuic5/CUDA-PointPillars
1
48779
__version__ = "0.3.0+d563e17"
1.03125
1
m2py/thermo/__init__.py
caiorss/m2py
13
48780
<gh_stars>10-100 """ Thermodynamic function collection * Steam tables - module steam """ import os import sys this = os.path.dirname(os.path.abspath(__file__)) path_dir = os.path.join(this, "..") sys.path.append(path_dir) from . import xsteam from . import gas
1.414063
1
images/monitor1_cron/src/main.py
diegofps/ngd_docker_images
0
48781
#!/usr/bin/env python3 from parquet_digester import ParquetFileDigester, ParquetFaceDigester, ParquetLicensePlateDigester from csv_digester import CSVFileDigester, CSVFaceDigester, CSVLicensePlateDigester from pymongo import MongoClient, ASCENDING, DESCENDING import datetime import time import json import pika import...
2.15625
2
pandas_excel_limitedrows/main.py
ibolorino/pandas-excel-limitedrows
5
48782
from pandas import ExcelFile from pandas._typing import StorageOptions from pandas_excel_limitedrows.engines._openpyxl import OpenpyxlLimitedReader from pandas_excel_limitedrows.engines._pyxlsb import PyxlsbLimitedReader from pandas_excel_limitedrows.engines._xlrd import XlrdLimitedReader # TODO: Implementar parâmetr...
3.03125
3
fireant/tests/slicer/mocks.py
vladaspasic/fireant
0
48783
from collections import ( OrderedDict, ) from unittest.mock import Mock import pandas as pd from datetime import ( datetime, ) from fireant import * from fireant.slicer.references import ReferenceType from fireant.slicer.totals import get_totals_marker_for_dtype from fireant.utils import ( format_dimensio...
2.109375
2
app/datascience/api/etl.py
PlatziMasterSound/MasterSound-DataScience
0
48784
import requests from datetime import timedelta from app.spotify_api import get_auth_header def get_albums(data): result = [] for item in data: skip = False header = get_auth_header() songs_r = requests.get(f'https://api.spotify.com/v1/albums/{item["id"]}/tracks', headers=header) ...
3.078125
3
sites/mysites/models.py
cmwaura/Final_Red_Scrap
0
48785
<filename>sites/mysites/models.py from __future__ import unicode_literals from django.db import models from django.db.models.signals import pre_delete from scrapy_djangoitem import DjangoItem from dynamic_scraper.models import Scraper, SchedulerRuntime from django.dispatch import receiver # Create your models here. ...
2.703125
3
coreUI/image_description_dialog.py
HoldenB/dejavu-ir
1
48786
import cv2 import numpy as np from PyQt5.QtGui import QIntValidator from PyQt5.QtWidgets import QDialog from PyQt5.uic import loadUi from utils import processing_utils as utils IMAGE_DESCRIPT_DIALOG_UI = 'coreUI/image_description_dialog.ui' class ImageDescriptionDialog(QDialog): """Image Description Dialog Windo...
2.671875
3
tests/boardfarm_plugins/boardfarm_prplmesh/tests/nbapi_bss.py
SWRT-dev/easymesh
0
48787
<filename>tests/boardfarm_plugins/boardfarm_prplmesh/tests/nbapi_bss.py<gh_stars>0 # SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-FileCopyrightText: 2021 the prplMesh contributors (see AUTHORS.md) # This code is subject to the terms of the BSD+Patent license. # See LICENSE file for more details. from .prplmesh...
2.3125
2
basisgen/containers.py
jccriado/basisgen
7
48788
<reponame>jccriado/basisgen import collections class MultivaluedMap(collections.defaultdict): def __init__(self, *args, **kwargs): return super().__init__(set, *args, **kwargs) @staticmethod def from_pairs(pairs): mapping = MultivaluedMap() for key, value in pairs: map...
2.75
3
text_detector_craft/text_detector_wrapper.py
sandro-felicioni/CRAFT-pytorch
0
48789
<reponame>sandro-felicioni/CRAFT-pytorch """ Copyright (c) 2019-present NAVER Corp. MIT License """ # -*- coding: utf-8 -*- import sys import os import time import argparse import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.autograd import Variable from PIL import Image import cv2 fr...
1.796875
2
tf-import-examples/src/main/resources/Imdb/imdb_tf.py
shiv4nsh/dl4j-examples
2
48790
import tensorflow as tf from tensorflow import keras import numpy as np imdb = keras.datasets.imdb (train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000) # A dictionary mapping words to an integer index word_index = imdb.get_word_index() # The first indices are reserved word_index =...
3.09375
3
src/__init__.py
ukc-co663/dependency-solver-2019-ds576
1
48791
<filename>src/__init__.py<gh_stars>1-10 __all__ = [ 'cyclic', 'dep_expander', 'dep_manager', 'logger', 'package_filter', 'package', 'parse_input', 'sat_solver_satispy', 'topo_packages', 'util' ]
1.164063
1
tags-to-csv.py
just-trees/ec2-tags-to-csv
9
48792
#!/usr/bin/env python import boto3 import botocore import argparse import csv # parse command line argumetns def parse_args(): parser = argparse.ArgumentParser(prog='tags-to-csv', description='Get instance tags in CSV format.') # required parser.add_argument('-o', '--out', required=True, action='store', d...
2.78125
3
active_campaign/ecommerce/__init__.py
jlorencelim/active-campaign
0
48793
<gh_stars>0 from active_campaign.ecommerce.connection import * from active_campaign.ecommerce.customer import * from active_campaign.ecommerce.order import *
1.101563
1
onlinejudge_template/generator/hook.py
beet-aizu/template-generator
42
48794
<gh_stars>10-100 import shlex import subprocess import sys import traceback from logging import getLogger from typing import * logger = getLogger(__name__) def _prepare_hook(*, data: Dict[str, Any]) -> None: data['hook'] = [] def register_filter_command(command: List[str], *, data: Dict[str, Any]) -> None: ...
2.359375
2
extractor/pdf/json_read.py
srinidhi005/Angular-latest
0
48795
<reponame>srinidhi005/Angular-latest<filename>extractor/pdf/json_read.py import json import openpyxl import requests import sys def write_to_excel(data): """ Writes to excel :param statement_data: :return: """ template_file = sys.argv[1] + "/1ExtractionGSheet_Template.xlsx" company = "Nike...
2.703125
3
tests/test_util.py
LivingTrades83/fast_arrow
143
48796
import vcr from fast_arrow import Client def gen_vcr(): return vcr.VCR( cassette_library_dir='tests/fixtures_vcr', record_mode='none', match_on=['method', 'scheme', 'host', 'port', 'path', 'query'], ) def gen_client(): auth_data = gen_auth_data() client = Client(auth_data) ...
2.015625
2
Chapter08/lecture02.py
ee06b056/IntoToProgramInPython
0
48797
import datetime class Person(object): def __init__(self, name): self.name = name try: lastBlank = name.rindex(' ') self.lastName = name[lastBlank+1:] except: self.lastName = name self.birthday = None def getName(self): return sel...
3.609375
4
demo/movielens/offline/tuner/.ipynb_checkpoints/swing_tuner-checkpoint.py
meta-soul/MetaSpore
32
48798
# # Copyright 2022 DMetaSoul # # 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, ...
1.953125
2
RSA-Encryption.py
aleyna-nur/RSA-Encryption
1
48799
#<NAME> tarafından yazılmıştır. print("""********************** RSA Şifreleme **********************""") def aralarında_asal(n,fi): if (n % fi != 0 and n % fi != 0 ): print("{} ile {} aralarında asaldır." .format(n,fi)) return True else: return False de...
3.8125
4