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
pysimpleframe/interface/display/tables/NavigationTable.py
OriDevTeam/PySimpleFrame
0
32500
<reponame>OriDevTeam/PySimpleFrame #!/usr/bin/env python # -*- coding: utf-8 -*- """ Name: TOFILL\n Description: TOFILL """ """PySimpleFrame Author: <NAME> License: Check LICENSE file """ ## System imports ## ## Library imports ## import termtables from colorama import Fore, Back, Style ## Application ...
3.046875
3
setup.py
Julian/giraffe
1
32501
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup( name="giraffe", version="0.1", package_dir={"giraffe" : ""}, packages=["giraffe"], cmdclass = {'build_ext': build_ext}, ext_modules = [ Exten...
1.40625
1
library/github/tests/Issue494.py
Sangraha/Github-to-S3
0
32502
<reponame>Sangraha/Github-to-S3 # -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2016 <NAME> <<EMAIL>> # # Copyright 2018 sfdye <<EMAIL>> ...
1.679688
2
modules/report6.py
Seyon7/report
0
32503
import click from modules.processor import build_report, print_report @click.group(invoke_without_command=True) @click.option('--files', '-f', required=True, type=str, prompt="Provide the path to data files") @click.pass_context def cli_root(ctx, files): ctx.meta['files'] = files @cli_root.command() @click.argu...
2.25
2
backend/search_algorithms/search_result.py
akashmunjial/CS520
1
32504
class SearchResult(object): """Class representing a return object for a search query. Attributes: path: An array representing the path from a start node to the end node, empty if there is no path. path_len: The length of the path represented by path, 0 if path is empty. ele_gain: The cu...
3.3125
3
tech_project/lib/python2.7/site-packages/djangocms_picture/cms_plugins.py
priyamshah112/Project-Descripton-Blog
0
32505
<reponame>priyamshah112/Project-Descripton-Blog<filename>tech_project/lib/python2.7/site-packages/djangocms_picture/cms_plugins.py # -*- coding: utf-8 -*- from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.conf import settings from django.utils.translation import ugettext_lazy...
1.90625
2
Blatt1/src/script.py
lewis206/Computational_Physics
0
32506
import numpy as np import matplotlib.pyplot as plt import matplotlib # Set fontsize larger for latex plots matplotlib.rcParams.update({'font.size': 20}) # Generate data from file x, y = np.genfromtxt("bin/python_Aufgabe2.txt", unpack=True) m, n = x[-1], y[-1] # Plotting plt.figure(figsize=(12,7)) plt.grid() plt.xla...
2.921875
3
editregions/migrations/0001_initial.py
kezabelle/django-editregions
1
32507
<filename>editregions/migrations/0001_initial.py<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import editregions.utils.regions class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0001_initial'), ] op...
1.78125
2
histVarPng.py
AineNicD/pands-project
0
32508
<filename>histVarPng.py #Saves a historgram of each variable to png files import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns #read data data = pd.read_csv("irisDataSet.csv") #names of variables names = ['sepal_length', 'sepal_width', 'petal_length', 'petal_widt...
3.546875
4
build.py
LagoLunatic/GCFT
38
32509
<filename>build.py from zipfile import ZipFile import os from version import VERSION base_name = "GameCube File Tools" base_name_with_version = base_name + " " + VERSION import struct if (struct.calcsize("P") * 8) == 64: base_name_with_version += "_64bit" base_zip_name = base_name_with_version else: base_name...
2.34375
2
Settings/RobotData.py
xzhang-wr/DAnTE_V2
0
32510
<gh_stars>0 #!usr/bin/env python __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2020 Westwood Robotics Corp." __date__ = "Feb 14, 2020" __version__ = "0.1.0" __status__ = "Beta" from Settings.Constants_DAnTE import * import math import numpy as np class FingerDataStructure(object): def _...
2.5625
3
src/main/resources/servicenow/OpenTicket.py
xdanw/xld-servicenow-incidentlog
0
32511
<gh_stars>0 import json import requests import requests.utils # Fixes some issues with TLS import os os.environ['REQUESTS_CA_BUNDLE'] = 'ca.pem'; # --- Debug Purposes Only, Server Config Is Hard Coded --- # # # print "Debug ... " + deployed.ResultUri; # response = requests.get('https://webhook.site/062e2ea7-5a36-4...
2.140625
2
code/joint_pca.py
craig-willis/SOMOSPIE
0
32512
#!/usr/bin/env python3 # This script assumes that the non-numerical column headers # in train and predi files are identical. # Thus the sm header(s) in the train file must be numeric (day/month/year). import sys import numpy as np import pandas as pd from sklearn.decomposition import PCA #TruncatedSVD as SVD from skl...
3
3
algoanim/stats.py
Gaming32/Python-AlgoAnim
0
32513
<reponame>Gaming32/Python-AlgoAnim<filename>algoanim/stats.py class Stats: writes: int reads: int accesses: int def __init__(self) -> None: self.reset() def reset(self) -> None: self.writes = 0 self.reads = 0 self.accesses = 0 def add_reads(self, count: int = 1...
2.40625
2
models/__init__.py
MartinPernus/MaskFaceGAN
11
32514
<gh_stars>10-100 from .attribute_classifier import BranchedTinyAttr from .face_parser import FaceParser from .stylegan2 import Generator
1.070313
1
tests/utils_tests.py
djt5019/queries
0
32515
<reponame>djt5019/queries<gh_stars>0 """ Tests for functionality in the utils module """ import mock try: import unittest2 as unittest except ImportError: import unittest from queries import utils class GetCurrentUserTests(unittest.TestCase): @mock.patch('pwd.getpwuid') def test_get_current_user(se...
2.921875
3
Core/Stealer/FileZilla.py
HugoMskn/Telegram-RAT
375
32516
# Import modules import os from xml.dom import minidom from base64 import b64decode # Fetch servers from FileZilla FileZilla = os.getenv('AppData') + '\\FileZilla\\' def StealFileZilla(): if not os.path.exists(FileZilla): return [] RecentServersPath = FileZilla + 'recentservers.xml' SiteManag...
2.515625
3
oldcontrib/tools/gallery/urls.py
servee/django-servee-oldcontrib
0
32517
from django.conf.urls.defaults import * urlpatterns = patterns('oldcontrib.tools.gallery.views', url(r'^add_to_gallery/$', view='add_to_gallery', name='add_to_gallery'), url(r'^remove_from_gallery/$', view='remove_from_gallery', name='remove_from_gallery'), url(r'^create_gallery/$', view='create_gallery', ...
1.421875
1
server/app/mod_api/endpoints.py
meyersj/TamaleNow
0
32518
# Copyright (C) 2015 <NAME> # # This program is released under the "MIT License". # Please see the file COPYING in this distribution for # license terms. import datetime from flask import Blueprint, request, jsonify from webargs import Arg from webargs.flaskparser import use_args import geoalchemy2.functions as func...
2.40625
2
src/spn/structure/leaves/conditional/MLE.py
kripa-experiments/SPFlow
0
32519
''' Created on April 15, 2018 @author: <NAME> ''' import numpy as np import warnings from scipy.stats import gamma, lognorm from sklearn.linear_model import ElasticNet from spn.structure.leaves.conditional.Conditional import Conditional_Gaussian, Conditional_Poisson, \ Conditional_Bernoulli import statsmodels.api...
1.929688
2
src/fparser/two/tests/fortran2003/test_control_edit_descriptor_r1011.py
sturmianseq/fparser
33
32520
# Copyright (c) 2019 Science and Technology Facilities Council # All rights reserved. # Modifications made as part of the fparser project are distributed # under the following license: # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condi...
1.1875
1
PSPNet/utils.py
keyme/deep_learning
12
32521
<filename>PSPNet/utils.py """ This module contains utility functions used in the conversion of the downloaded data to TFrecords as well as functions used by the model/training script. Semantic segmenation evaluations methods were taken from https://github.com/martinkersner/py_img_seg_eval """ import os import fnmatch...
2.5625
3
NumPyNet/layers/activation_layer.py
Nico-Curti/NumPyNet
28
32522
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from NumPyNet.activations import Activations from NumPyNet.utils import _check_activation from NumPyNet.utils import check_is_fitted import numpy as np from NumPyNet.layers.base import BaseLayer __aut...
2.65625
3
anymesh/tests/reactortester.py
AnyMesh/anyMesh-Python
39
32523
<reponame>AnyMesh/anyMesh-Python<filename>anymesh/tests/reactortester.py import unittest from twisted.internet import reactor, task class ReactorTestCase(unittest.TestCase): def __init__(self, *args, **kwargs): super(ReactorTestCase, self).__init__(*args, **kwargs) self.done = False def timeOu...
2.671875
3
old/accurate_landing.py
domnantas/landing-system
1
32524
from oled import TrackerOled from color_tracker import ColorTracker import cv2 from threading import Thread tracker_oled = TrackerOled() color_tracker = ColorTracker() def write_fps(): tracker_oled.writeTextCenter("FPS: {:.2f}".format(color_tracker.fps.fps())) tracker_oled.writeTextCenter("READY") while True: ...
2.765625
3
lightconfig/lightconfig.py
daassh/LightConfig
2
32525
<reponame>daassh/LightConfig #!/usr/bin/env python # coding=utf-8 # get a easy way to edit config file """ >>> from lightconfig import LightConfig >>> cfg = LightConfig("config.ini") >>> cfg.section1.option1 = "value1" >>> print(cfg.section1.option1) value1 >>> "section1" in cfg True >>> "option1" in cfg.section1 True ...
2.640625
3
assets/scikit-learn_linear_regression.py
tbienias/blog
6
32526
""" This script shows the usage of scikit-learns linear regression functionality. """ # %% [markdown] # # Linear Regression using Scikit-Learn # # %% [markdown] # ## Ice Cream Dataset ## # | Temperature C° | Ice Cream Sales | # |:--------------:|:---------------:| # | 15 | 34 | # | 24 ...
3.625
4
RNN.py
AuckeBos/Speaker-count-estimation-with-single-speakers
0
32527
<gh_stars>0 from datetime import datetime import numpy as np import tensorflow as tf import tensorflow.keras.backend as K import tensorflow_probability as tfp from sklearn.metrics import mean_absolute_error from tensorflow.python.keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint from tensorflow....
2.09375
2
src/run-shoutcloud/run-shoutcloud-aws.py
kpwbo/comparing-FaaS
0
32528
from locust import HttpLocust, TaskSet, task class WebsiteTasks(TaskSet): @task def bcrypt(self): headers = { "Content-type": "application/json" } payload = '{"message":"hello world"}' self.client.post("/SHOUTCLOUD", payload, headers = headers) class WebsiteUser(HttpLocust): ...
2.28125
2
02_sequences/0201_listcomp/020103_cartesian/__main__.py
forseti/py-workout-01
0
32529
<filename>02_sequences/0201_listcomp/020103_cartesian/__main__.py colors = ['black', 'white'] sizes = ['S', 'M', 'L'] tshirts = [ (color, size) for color in colors for size in sizes ] print(f"Cartesian products from {colors} and {sizes}: {tshirts}")
3.625
4
software/pawsc/pawsc_blocks/PAWSC_REST_API_RICHARD_II/django/base/src/urls.py
vthakur7f/OpenCellular
1
32530
# create this file # rerouting all requests that have ‘api’ in the url to the <code>apps.core.urls from django.conf.urls import url from django.urls import path from rest_framework import routers from base.src import views from base.src.views import InitViewSet #from base.src.views import UploadFileForm #upload stuf...
2.09375
2
res/test_Rainbow_pen.py
nomissbowling/gcc_Springhead
0
32531
#!/usr/local/bin/python # -*- coding: utf-8 -*- '''test_Rainbow_pen ''' import sys, os import numpy as np from matplotlib import pyplot as plt from PIL import Image FN_OUT = 'rainbow_pen_320x240.png' def mk_col(w, h, x, y): a = 255 i = int(7 * y / h) if i == 0: c, u, v = (192, 0, 0), (32, 0, 0), (0, 32, 0) # R...
2.78125
3
kaggle_tutorial_mod.py
DistrictDataLabs/02-seefish
0
32532
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Fri Jan 16 17:31:42 2015 This is adapted from the kaggle tutorial for the National Data Science Bowl at https://www.kaggle.com/c/datasciencebowl/details/tutorial Any code section lifted from the tutorial will start with # In tutorial [n]. My adaption will start with # ...
2.5
2
src/k3d.py
maiki/k3x
188
32533
# k3d.py # # Copyright 2020 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in ...
1.867188
2
locale/pot/api/utilities/_autosummary/pyvista-Disc-1.py
tkoyama010/pyvista-doc-translations
4
32534
<reponame>tkoyama010/pyvista-doc-translations # Create a disc with 50 points in the circumferential direction. # import pyvista mesh = pyvista.Disc(c_res=50) mesh.plot(show_edges=True, line_width=5)
2.75
3
gamemaster.py
josephko91/checkers-ai
0
32535
import os from utility import write_to_output, print_board, color_is_black, board_to_list, print_results from board import Board import time from algorithm import minimax, minimax_alpha_beta, minimax_alpha_beta_final, minimax_alpha_beta_rand from math import sqrt, floor start = time.time() # parse input file with ope...
3.546875
4
api/v2/views/image_version_license.py
xuhang57/atmosphere
0
32536
<filename>api/v2/views/image_version_license.py from django.db.models import Q import django_filters from core.models import ApplicationVersionLicense as ImageVersionLicense from api.v2.serializers.details import ImageVersionLicenseSerializer from api.v2.views.base import AuthModelViewSet class VersionFilter(django_...
2.109375
2
osvolbackup/verbose.py
CCSGroupInternational/osvolbackup
1
32537
from __future__ import print_function from os import getenv from datetime import datetime def vprint(*a, **k): if not getenv('VERBOSE'): return print(datetime.now(), ' ', end='') print(*a, **k)
2.65625
3
pypybox2d/joints/__init__.py
the-mba/Progra-Super-Mario
0
32538
<filename>pypybox2d/joints/__init__.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # C++ version Copyright (c) 2006-2011 <NAME> http://www.box2d.org # Python port by <NAME> / http://pybox2d.googlecode.com # # This software is provided 'as-is', without any express or implied # warranty. In no event will the...
1.828125
2
LDPC-library/encode.py
sz3/ProtographLDPC
22
32539
<reponame>sz3/ProtographLDPC import subprocess import os import argparse import tempfile def get_parser(): # argument parser parser = argparse.ArgumentParser(description='Input') parser.add_argument('--pchk-file', '-p', action='store', dest='pchk_file', ...
2.984375
3
survivethevoid/utils/math_func.py
LMikeH/SurviveTheVoid
0
32540
<gh_stars>0 import numpy as np def R(angle): rad_angle = (angle)*np.pi/180 return np.array([[np.cos(rad_angle), -np.sin(rad_angle)], [np.sin(rad_angle), np.cos(rad_angle)]]) if __name__ == "__main__": a = np.array([0, 1]) print(np.dot(R(180), a))
3
3
app/__init__.py
lwalter/flask-angular-starter
13
32541
<reponame>lwalter/flask-angular-starter from app.factory import create_app
1.148438
1
lang/tags/data_null.py
ghouston/knausj_talon
5
32542
from talon import Context, Module ctx = Context() mod = Module() mod.tag("code_data_null", desc="Tag for enabling commands relating to null") @mod.action_class class Actions: def code_insert_null(): """Inserts null""" def code_insert_is_null(): """Inserts check for null""" def code_ins...
2.109375
2
epidemiology_model.py
sei-international/epidemic-macro-model
4
32543
from numpy import array as np_array, zeros as np_zeros, sum as np_sum, empty as np_empty, \ amax as np_amax, interp as np_interp, ones as np_ones, tile as np_tile, isnan as np_isnan import yaml from seir_model import SEIR_matrix from common import Window, get_datetime, timesteps_between_dates, get_datetime_arra...
2.1875
2
body/tests/test_medicine.py
dylanjboyd/bodytastic
0
32544
from body.tests.login_test_case import LoginTestCase from body.tests.model_helpers import create_ledger_entry, create_medicine from freezegun import freeze_time from django.utils.timezone import make_aware, datetime @freeze_time(make_aware(datetime(2022, 3, 1))) class MedicineTests(LoginTestCase): def test_ledger...
2.375
2
src/apps/users/forms/__init__.py
sanderland/katago-server
27
32545
<reponame>sanderland/katago-server from .user_change import UserChangeForm from .user_creation import UserCreationForm
1.125
1
bqskit/utils/test/types.py
BQSKit/bqskit
13
32546
"""This module contains functions to generate strategies from annotations.""" from __future__ import annotations import collections import inspect import sys from itertools import chain from itertools import combinations from typing import Any from typing import Callable from typing import Iterable from typing import ...
2.703125
3
reframechecks/mpip/mpip.py
reframe-hpc/hpctools
3
32547
# Copyright 2019-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # HPCTools Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import sys import reframe as rfm import reframe.utility.sanity as sn sys.path.append(os.path.abspath(os.path.join(o...
1.726563
2
Forward_Warp/python/forward_warp_python.py
hologerry/Forward-Warp
81
32548
import torch from torch.nn import Module, Parameter from torch.autograd import Function class Forward_Warp_Python: @staticmethod def forward(im0, flow, interpolation_mode): im1 = torch.zeros_like(im0) B = im0.shape[0] H = im0.shape[2] W = im0.shape[3] if interpolation_m...
2.34375
2
slingen/src/algogen/Algorithm.py
danielesgit/slingen
23
32549
import itertools import Partitioning class Algorithm( object ): def __init__( self, linv, variant, init, repart, contwith, before, after, updates ): self.linv = linv self.variant = variant if init: #assert( len(init) == 1 ) self.init = init[0] else: ...
3.359375
3
NbSe2/PBE-0.01/5-epw/epc_plot.py
sinansevim/EBT617E
1
32550
import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt import matplotlib.gridspec as gs import sys data = np.loadtxt('NbSe2.freq.gp') symmetryfile = 'plotband.out' lbd = np.loadtxt("lambda.dat") lbd_val = np.where(lbd<1 , lbd, 1) def Symmetries(fstring): f = open(fstring, 'r') x = np....
2.421875
2
pydeconz/group.py
Lokaltog/deconz
0
32551
"""Python library to connect deCONZ and Home Assistant to work together.""" import logging from .light import DeconzLightBase _LOGGER = logging.getLogger(__name__) class DeconzGroup(DeconzLightBase): """deCONZ light group representation. Dresden Elektroniks documentation of light groups in deCONZ http...
2.0625
2
nocolon_main.py
paradoxxxzero/nocolon
73
32552
<reponame>paradoxxxzero/nocolon # Import the encoding import nocolon # Now you can import files with the nocolon encoding: from nocolon_test import nocolon_function nocolon_function(4)
1.117188
1
yarlp/tests/agent_tests/test_ddqn.py
btaba/yarlp
12
32553
""" Regression tests for the REINFORCE agent on OpenAI gym environments """ import pytest import numpy as np import shutil from yarlp.utils.env_utils import NormalizedGymEnv from yarlp.agent.ddqn_agent import DDQNAgent env = NormalizedGymEnv( 'PongNoFrameskip-v4', is_atari=True ) def test_ddqn(): a...
2.296875
2
arbeitsplan/migrations/0009_mitglied_arbeitslast.py
hkarl/svpb
3
32554
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('arbeitsplan', '0008_auto_20141208_1906'), ] operations = [ migrations.AddField( model_name='mitglied', ...
1.5625
2
fedireads/activitypub/__init__.py
johnbartholomew/bookwyrm
0
32555
''' bring activitypub functions into the namespace ''' from .actor import get_actor from .book import get_book, get_author, get_shelf from .create import get_create, get_update from .follow import get_following, get_followers from .follow import get_follow_request, get_unfollow, get_accept, get_reject from .outbox impo...
1.289063
1
generated-libraries/python/netapp/ems/eventseverity.py
radekg/netapp-ontap-lib-get
2
32556
class Eventseverity(basestring): """ EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFORMATIONAL|DEBUG Possible values: <ul> <li> "emergency" - System is unusable, <li> "alert" - Action must be taken immediately, <li> "critical" - Critical condition, <li> "error" ...
2.453125
2
example.py
DesmondTMB/i3pyblocks
15
32557
<reponame>DesmondTMB/i3pyblocks<gh_stars>10-100 #!/usr/bin/env python3 import asyncio import logging import signal from pathlib import Path import psutil from i3pyblocks import Runner, types, utils from i3pyblocks.blocks import ( # shell, datetime, dbus, http, i3ipc, inotify, ps, pulse, ...
2.21875
2
context_nmt/pipelines/context_indicators_generator.py
jesa7955/context-translation
2
32558
import collections import logging import json import os import luigi import gokart import tqdm import torch import sentencepiece as spm import sacrebleu import MeCab from fairseq.models.transformer import TransformerModel from fairseq.data import LanguagePairDataset from context_nmt.pipelines.conversation_dataset_mer...
2.03125
2
log_task_id.py
Sendhub/flashk_util
0
32559
<filename>log_task_id.py import logging from celery._state import get_current_task class TaskIDFilter(logging.Filter): """ Adds celery contextual information to a log record, if appropriate. https://docs.python.org/2/howto/logging-cookbook.html #using-filters-to-impart-contextual-information """ ...
2.671875
3
e/mail-relay/web/apps/localized_mail/models.py
zhouli121018/nodejsgm
0
32560
#coding=utf-8 import os from django.db import models from django.contrib.auth.models import User from django.conf import settings from apps.core.models import Customer CHECK_RESULT = ( ('', '--'), ('high_risk', u'高危邮件'), ('sender_blacklist', u'发件黑'), ('keyword_blacklist', u'内容黑'), ('subject_blackl...
1.890625
2
src/softfab/pages/InspectDone.py
boxingbeetle/softfab
20
32561
<reponame>boxingbeetle/softfab<filename>src/softfab/pages/InspectDone.py # SPDX-License-Identifier: BSD-3-Clause from typing import ClassVar, Mapping, cast from softfab.ControlPage import ControlPage from softfab.Page import InvalidRequest, PageProcessor from softfab.pageargs import DictArg, EnumArg, StrArg from soft...
1.96875
2
src/uwds3_core/estimation/dense_optical_flow_estimator.py
underworlds-robot/uwds3_core
1
32562
<reponame>underworlds-robot/uwds3_core<gh_stars>1-10 import cv2 class DenseOpticalFlowEstimator(object): def __init__(self): self.previous_frame = None def estimate(self, frame): if first_frame is None: return None gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) flo...
2.5
2
2020/day-22/day-22.py
mrMetalWood/advent-of-code
1
32563
import os from copy import deepcopy with open(os.path.join(os.path.dirname(__file__), "input.txt"), "r") as file: lines = [l.strip() for l in file.readlines()] p1 = list(reversed([int(i) for i in lines[1:26]])) p2 = list(reversed([int(i) for i in lines[28:]])) def part1(player1, player2): while playe...
3.484375
3
Exercise05/5-30.py
ywyz/IntroducingToProgrammingUsingPython
0
32564
''' @Date: 2019-11-02 09:19:19 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-11-02 10:13:44 ''' year = eval(input("Enter the year: ")) day = eval(input("Enter the day of the week: ")) for months in range(1, 13): if months == 1: month = "January"...
4.0625
4
insights_messaging/downloaders/s3.py
dpensi/insights-core-messaging
6
32565
import shutil from contextlib import contextmanager from tempfile import NamedTemporaryFile from s3fs import S3FileSystem class S3Downloader: def __init__(self, tmp_dir=None, chunk_size=16 * 1024, **kwargs): self.tmp_dir = tmp_dir self.chunk_size = chunk_size self.fs = S3FileSystem(**kwa...
2.40625
2
Code/hypers.py
taoqi98/KIM
7
32566
<reponame>taoqi98/KIM MAX_SENTENCE = 30 MAX_ALL = 50 MAX_SENT_LENGTH=MAX_SENTENCE MAX_SENTS=MAX_ALL max_entity_num = 10 num = 100 num1 = 200 num2 = 100 npratio=4
1.023438
1
ai-control/mirror.py
futurice/maximum-aittack
0
32567
<reponame>futurice/maximum-aittack import os, json from PIL import Image import numpy as np from skimage import io basePath = './log/log_joku/' json_files = [pos_json for pos_json in os.listdir(basePath) if pos_json.endswith('.json')] for file in json_files: if file != 'meta.json': #print(file) wi...
2.1875
2
portfolios/trader/__init__.py
ahwkuepper/portfolio
4
32568
<reponame>ahwkuepper/portfolio __all__ = ["orders"]
1
1
gym_holdem/holdem/player.py
pokeraigym/PokerAI
0
32569
<gh_stars>0 from gym_holdem.holdem.bet_round import BetRound from gym_holdem.holdem.poker_rule_violation_exception import PokerRuleViolationException from pokereval_cactus import Card class Player: def __init__(self, stakes, table=None, name=None): self.table = table self.name = name self...
3.125
3
app.py
abdur75648/ai-image-generator
0
32570
<reponame>abdur75648/ai-image-generator from flask import Flask, request, send_from_directory, redirect, send_file, render_template import os,cv2 import neuralStyleProcess app = Flask(__name__) APP_ROOT = os.path.dirname(os.path.abspath(__file__)) @app.route("/") def index(): return render_template("upload.html") @...
2.90625
3
src/mappings_validator.py
center-for-threat-informed-defense/attack_to_veris
35
32571
# Copyright (c) 2021, MITRE Engenuity. Approved for public release. # See LICENSE for complete terms. import argparse import json import pathlib import numpy import requests from src.create_mappings import get_sheets, get_sheet_by_name def get_argparse(): desc = "ATT&CK to VERIS Mappings Validator" argpars...
2.28125
2
cases/config_d1_tno_art.py
micstein89/cosmo-emission-processing
0
32572
<gh_stars>0 # "constant" paths and values for TNO, regular lat/lon # for MeteoTest Swiss inventory, use calculated regular domain in the code import os import time from emiproc.grids import COSMOGrid, TNOGrid # inventory inventory = 'TNO' # model either "cosmo-art" or "cosmo-ghg" (affects the output units) model = ...
2.375
2
spytest/apis/system/ztp.py
shubav/sonic-mgmt
132
32573
# This file contains the list of API's for operations on ZTP # @author : <NAME> (<EMAIL>) from spytest import st import apis.system.basic as basic_obj import utilities.utils as utils_obj import apis.system.switch_configuration as switch_conf_obj import apis.system.interface as intf_obj import apis.routing.ip as ip_obj ...
2.140625
2
pisces/algid.py
danieljohnlewis/pisces
1
32574
"""Handle for X.509 AlgorithmIdentifier objects This module understands a minimal number of OIDS, just enough X.509 stuff needed for PKCS 1 & 7. """ import types from pisces import asn1 oid_dsa = asn1.OID((1, 2, 840, 10040, 4, 1)) oid_dsa_sha1 = asn1.OID((1, 2, 840, 10040, 4, 3)) oid_rsa = asn1.OID((1, 2, 840, 1135...
2.21875
2
exercicios/Lista3/Q31.py
AlexandrePeBrito/CursoUdemyPython
0
32575
<reponame>AlexandrePeBrito/CursoUdemyPython<gh_stars>0 #Faça um programa que calcule e escreva o valor de S # S=1/1+3/2+5/3+7/4...99/50 u=1 valores=[] for c in range(1,100): if(c%2==1): valores.append(round(c/u,2)) u+=1 print(valores) print(f"S = {sum(valores)}")
3.328125
3
examples/for_debug.py
gottadiveintopython/kivyx.uix.drawer
0
32576
from kivy.app import runTouchApp from kivy.properties import StringProperty from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.lang import Builder from kivyx.uix.drawer import KXDrawer class Numpad(GridLayout): def on_kv_post(self, *ar...
2.421875
2
nlppcfg.py
mrlongzhang/classicnlp
0
32577
# -*- coding: utf-8 -*- """ A Probabiltics Context Free Grammer (PCFG) Parser using Python. This code implemented a weighted graph search @author: <NAME> """ import codecs from collections import defaultdict import math f_grammer=".\\test\\08-grammar.txt" nonterm=[] preterm=defaultdict(list) grammer_f...
3.09375
3
generator.py
elieahd/data-analytics-kmeans
2
32578
# spark-submit generator.py out 9 3 2 10 # imports import sys import random import numpy from pyspark import SparkContext from pyspark.mllib.random import RandomRDDs # constants MIN_MEAN_VALUE = 0 MAX_MEAN_VALUE = 100 STEPS = 0.1 # methods def point_values(means_value, normal_value, std, cluster, dimension): val...
3.34375
3
testtool.py
andreasscherbaum/pg_commitfest_testtool
1
32579
#!/usr/bin/env python # # test tool for PostgreSQL Commitfest website # # written by: <NAME> <<EMAIL>> # import re import os import sys import logging import tempfile import atexit import shutil import time import subprocess from subprocess import Popen import socket import sqlite3 import datetime from time import gmt...
1.914063
2
coronavirus/common/user_agent.py
StevenHuang2020/WebSpider
0
32580
import random from fake_useragent import UserAgent agent_list = '''Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50 Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50 Mozilla/5.0 (com...
2.765625
3
line.py
jurlaub/jubilant-fedora
0
32581
<gh_stars>0 import numpy as np from collections import deque QLEN = 8 class Line(object): """ from #2.Tips and Tricks for the Project """ def __init__(self, yp=None, xp=None): self.ym_per_pix = yp self.xm_per_pix = xp # self.frame_shape = fs # was the line detected in the la...
2.625
3
ex2_graph/tut2_infer_sigma.py
trungnt13/uef_bay1_2018
0
32582
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import seaborn as sns import numpy as np import tensorflow as tf tf.enable_eager_execution() import tensorflow_probability as tfp from tensorflow_proba...
2.78125
3
torch_geometric_temporal/nn/convolutional/astgcn.py
LFrancesco/pytorch_geometric_temporal
0
32583
<filename>torch_geometric_temporal/nn/convolutional/astgcn.py import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.transforms import LaplacianLambdaMax from torch_geometric.data import Data from .chebconvatt import ChebConvAtt class Spatial_Attention_layer(nn.Module): ''' com...
2.625
3
project1/src/utils/preprocessing.py
armand33/deep_learning_epfl
0
32584
""" File defining the classes Normalize and Standardize used respectively to normalize and standardize the data set. """ class Normalize(object): """ Data pre-processing class to normalize data so the values are in the range [new_min, new_max]. """ def __init__(self, min_, max_, new_min=0, new_max=1)...
4.1875
4
coalaip/plugin.py
bigchaindb/pycoalaip
20
32585
<gh_stars>10-100 from abc import ABC, abstractmethod, abstractproperty class AbstractPlugin(ABC): """Abstract interface for all persistence layer plugins. Expects the following to be defined by the subclass: - :attr:`type` (as a read-only property) - :func:`generate_user` - :func:`get...
2.96875
3
benchmarks/chexpert/chexpert.py
paaatcha/my-thesis
5
32586
<reponame>paaatcha/my-thesis<filename>benchmarks/chexpert/chexpert.py # -*- coding: utf-8 -*- """ Autor: <NAME> Email: <EMAIL> """ import sys sys.path.insert(0,'../../') # including the path to deep-tasks folder sys.path.insert(0,'../../my_models') # including the path to my_models folder from constants import RAUG_P...
1.859375
2
python-benchmarking-tools/haste/benchmarking/messaging.py
HASTE-project/benchmarking-tools
0
32587
<gh_stars>0 import random import string from itertools import repeat import time RANDOM_1KB = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(1000)) RANDOM_100MB = bytearray(''.join(list(repeat(RANDOM_1KB, 100 * 1024))), 'utf-8') NEWLINE = byt...
2.375
2
async_mgun/mgun.py
maximdanilchenko/async-mgun
0
32588
<reponame>maximdanilchenko/async-mgun import json from collections import namedtuple import aiohttp METHOD_GET = aiohttp.hdrs.METH_GET METHOD_DELETE = aiohttp.hdrs.METH_DELETE METHOD_POST = aiohttp.hdrs.METH_POST METHOD_PUT = aiohttp.hdrs.METH_PUT METHOD_PATCH = aiohttp.hdrs.METH_PATCH CONTENT_TYPE = aiohttp.hdrs.CON...
2.265625
2
python/testData/postfix/not/and_after.py
jnthn/intellij-community
2
32589
def f(): return True and not False<caret>
1.460938
1
10/10.py
andleb/aoc18
1
32590
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Sun Dec 9 23:12:30 2018 @author: <NAME> """ import itertools as it import functools as ft import collections as coll import sortedcontainers as sc from blist import blist import re import numpy as np import scipy.signal import scipy.sparse i...
2.8125
3
__init__.py
rookiepeng/radarsimpy
42
32591
# distutils: language = c++ # cython: language_level=3 # ---------- # RadarSimPy - A Radar Simulator Built with Python # Copyright (C) 2018 - PRESENT <NAME> # E-mail: <EMAIL> # Website: https://zpeng.me # ` ` # -:. -#: # -//:. -###: # -////:. -#####: # -/:....
1.296875
1
setup.py
tfahey/python-sample-app
0
32592
<gh_stars>0 from setuptools import setup # Used in pypi.org as the README description of your package with open("README.md", 'r') as f: long_description = f.read() # Remove this whole block from here... setup( name='python-sample-app', version='1.0', description='python-sample-app is a sta...
1.398438
1
create_playlist_by_artistlist.py
sanzgiri/saregma_spotify
1
32593
import sys import re import spotipy import spotipy.util as util ''' shows the albums and tracks for a given artist. ''' def get_artist_urn(name): results = sp.search(q='artist:' + name, type='artist') items = results['artists']['items'] if len(items) > 0: return items[0]['uri'] else: r...
2.828125
3
Lib/site-packages/py2exe/samples/pywin32/com_typelib/pre_gen/wscript/show_info.py
Aakash10399/simple-health-glucheck
35
32594
# Print some simple information using the WScript.Network object. import sys from win32com.client.gencache import EnsureDispatch ob = EnsureDispatch('WScript.Network') # For the sake of ensuring the correct module is used... mod = sys.modules[ob.__module__] print "The module hosting the object is", mod # Now use the...
2.25
2
BOMFinder/helpers.py
ProrokWielki/BOM_Finder
0
32595
<filename>BOMFinder/helpers.py import BOMFinder.UI.UI as UI def to_prompt_sequence(part): prompt_sequence = [] for key, value in part.properties.items(): if isinstance(key, str): if isinstance(value, str): prompt_sequence.append(UI.ValuePrompt(key)) elif isinst...
2.546875
3
src/dash/pages/page1/layout/piecases.py
NjekTt/iris-python-dashboards
0
32596
<reponame>NjekTt/iris-python-dashboards<filename>src/dash/pages/page1/layout/piecases.py import dash_bootstrap_components as dbc from dash import dcc import plotly.graph_objects as go import iris query = ("""SELECT location, CAST(total_cases AS int) as total_cases, CAST(total_deaths as int) as total_death...
2.84375
3
edb/server/main.py
rongfengliang/edgedb-pg-expose
0
32597
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
1.625
2
processing.py
BeDaBio/Topspin_Automatisation
1
32598
# -*- coding: utf-8 -*- from TopCmds import * import quality_check import data_management as dat Qualitytest = quality_check.Qualitytest left_boundary=float(dat.get_globalParameter("left_boundary")) right_boundary=float(dat.get_globalParameter("right_boundary")) def Check_180turn(leftboundary,rightboundary):...
2.390625
2
accounts/migrations/0007_rename_protected_authtoggle_is_protected.py
abubakarA-Dot/tarot_juicer
4
32599
<filename>accounts/migrations/0007_rename_protected_authtoggle_is_protected.py # Generated by Django 3.2.4 on 2021-11-02 08:05 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0006_rename_on_authtoggle_protected'), ] operations = [ m...
1.804688
2