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
server.py
PaulsBecks/fc-reliable-messaging
0
12797851
from http.server import HTTPServer,BaseHTTPRequestHandler import signal import sys class Server(BaseHTTPRequestHandler) : def _set_response(self): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() def do_POST(self): content_length = int(self.headers['Co...
2.859375
3
reseaut/apps/profiles/serializers.py
koladev32/Beta
0
12797852
from rest_framework import serializers from .models import Profile class ProfileSerializer(serializers.ModelSerializer): last_name = serializers.CharField(source='user.last_name') bio = serializers.CharField(allow_blank=True,required=False) #work_domain = serializers.CharField(max_length=50) image = se...
2.328125
2
loldib/getratings/models/NA/na_fiora/na_fiora_mid.py
koliupy/loldib
0
12797853
from getratings.models.ratings import Ratings class NA_Fiora_Mid_Aatrox(Ratings): pass class NA_Fiora_Mid_Ahri(Ratings): pass class NA_Fiora_Mid_Akali(Ratings): pass class NA_Fiora_Mid_Alistar(Ratings): pass class NA_Fiora_Mid_Amumu(Ratings): pass class NA_Fiora_Mid_Anivia(Ratings): pass ...
1.390625
1
ProcessDoc.py
CharlesG12/IndexCompression
0
12797854
import os import Token from xml.dom import minidom class ProcessDoc: def __init__(self, path, lemma, stem): self.collection_dic = {} self.doc_info = [] self.lemma = lemma self.stem = stem self.path = path def run(self): for filename in os.listdir(self.path): ...
2.84375
3
apis/watsonNLUTa.py
amol-m-deshpande/testing-remote
0
12797855
<gh_stars>0 from flask_restful import Resource import json from ibm_watson import NaturalLanguageUnderstandingV1 from ibm_watson import ToneAnalyzerV3 from ibm_watson.natural_language_understanding_v1 \ import Features, EntitiesOptions, KeywordsOptions, \ SyntaxOptions, SyntaxOptionsTokens, CategoriesOptions, C...
2.796875
3
applepushnotification/tests/test_basic.py
xiaohaifxb/applepushnotification
7
12797856
#!/usr/bin/env python from applepushnotification import * from unittest import TestCase from applepushnotification.tests import TestAPNS import struct, time try: import json except ImportError, e: import simplejson as json class TestBasic(TestAPNS): def test_construct_service(self): service = self...
2.5625
3
tests/Unit/AutoML/test_feature_processing.py
nielsuit227/AutoML
2
12797857
<reponame>nielsuit227/AutoML import unittest import numpy as np import pandas as pd from sklearn.datasets import make_classification from sklearn.datasets import make_regression from Amplo.AutoML import FeatureProcesser class TestFeatureProcessing(unittest.TestCase): @classmethod def setUpClass(cls): ...
2.953125
3
eval/read_code_table_and_train_text.py
YangXuepei/ime-eval
0
12797858
<reponame>YangXuepei/ime-eval # -*- coding:utf-8 -*-# import csv def readfile(filename): csvfile = open(filename, 'rb') reader = csv.reader(csvfile) result = {} for item in reader: result[item[0].decode('utf-8')] = item[1] csvfile.close() # print result # return a directory {char...
3.234375
3
src/dash/apps/pca.py
ijmiller2/COVID-19_Multi-Omics
4
12797859
<gh_stars>1-10 import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import datetime from data import get_omics_data, get_biomolecule_names, get_combined_data from plot import biomolecule_bar, boxplot, pca...
2.328125
2
apps/availability/migrations/0001_initial.py
ExpoAshique/ProveBanking__s
0
12797860
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('projects', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] op...
1.664063
2
region_cache/region.py
jheard-tw/region_cache
2
12797861
<reponame>jheard-tw/region_cache import pickle import redis from collections.abc import MutableMapping from datetime import datetime from functools import wraps import blinker import logging from logging import getLogger _logger = getLogger('region_cache') class Region(MutableMapping): """ A bound cache reg...
2.34375
2
tests/test_failure.py
kprzybyla/resultful
0
12797862
<gh_stars>0 import pytest from hypothesis import ( given, strategies as st, ) from resultful import ( unsafe, success, failure, unwrap_failure, Result, NoResult, ) from .conftest import ( st_exceptions, unreachable, ) @given(error=st_exceptions()) def test_special_methods(er...
2.3125
2
data.py
hashmymind/ML-Final
0
12797863
<filename>data.py import pytreebank import pickle import numpy as np dataset = pytreebank.load_sst() def get_sst(cate='5'): train_X = [] train_y = [] for e in dataset['train']: label, sentence = e.to_labeled_lines()[0] if cate == '2' and label == 2: continue if cate == '2': ...
2.8125
3
config.py
Pandinosaurus/pnn.pytorch
1
12797864
# config.py import os import datetime import argparse result_path = "results/" result_path = os.path.join(result_path, datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S/')) parser = argparse.ArgumentParser(description='Your project title goes here') # ======================== Data Setings =========================...
2.421875
2
researchutils/chainer/initializers/__init__.py
keio-ytlab/researchutils
1
12797865
from researchutils.chainer.initializers.normal_with_loc import NormalWithLoc
1.195313
1
exercicios/exercicio087.py
Helton-Rubens/Python-3
0
12797866
matriz = [[], [], []] par = 0 somatre = 0 for c in range(0, 3): for i in range(0, 3): matriz[c].append(int(input(f'Digite um valor para a posição [{c}/{i}]: '))) if matriz[c][i] % 2 == 0: par += matriz[c][i] somatre = somatre + matriz[c][2] print('=+'*28) for c in range(0, 3): pr...
3.65625
4
study/study8.py
tanyong-cq/pythonlearning
0
12797867
<reponame>tanyong-cq/pythonlearning #!/usr/bin/env python # -*- coding: utf-8 -*- ''' dict ''' d1 = {'a':1, 'b':2, 'c':3} print(d1) print(d1.keys()) print(d1.values()) print(str(d1)) print(len(d1)) print(d1['a']) d1['a'] = 10 print(d1['a']) del d1['a'] print(d1) d1.clear() print(d1) print(d1.get('a'))
3.84375
4
openprocurement/tender/cfaselectionua/models/submodels/organizationAndPocuringEntity.py
tarasvaskiv/openprocurement.tender.cfaselectionua
0
12797868
from openprocurement.api.models import Organization as BaseOrganization from openprocurement.tender.cfaselectionua.models.submodels.contactpoint import ContactPoint from schematics.types import StringType from schematics.types.compound import ModelType from openprocurement.api.roles import RolesFromCsv from openprocure...
2.171875
2
src/contrail/vncNetwork.py
madhukar32/contrail-hybrid-cloud
0
12797869
<gh_stars>0 from vnc_api import vnc_api from contrail.util import (readTenant, readNetwork) from hybridLogger import hybridLogger from exception import * import uuid class vncNetwork(hybridLogger): def __init__(self, vnc, domain, tenantName ,logLevel='INFO'): self.log = super(vncNetwork, self).log(le...
2.296875
2
main.py
j4g3/terminal-python
0
12797870
import os import glob files = open('dados.dll') data = files.read() files.close #desktop of user user_info = os.path.expanduser('~') location_default = os.path.expanduser('~\\Desktop') location = os.path.expanduser('~\\Desktop') desktop = os.path.expanduser(f'{location}').replace(f'{user_info}', f'{data}') os.chdir...
2.5
2
src/pactor/nodes_commands.py
kstrempel/pactor
1
12797871
<reponame>kstrempel/pactor from pactor.vm import VM from pactor.node_parent import AstNode from pactor.node_stack_helper import pop_value, pop class WhenNode(AstNode): def run(self, vm: VM): quote = pop(vm) is_true = pop_value(vm) if is_true: vm.run_ast(quote.ast) def __repr__(self): return '...
2.4375
2
GameObject.py
P3D-Space-Tech-Demo/Section2SpaceflightDocking
0
12797872
<gh_stars>0 from panda3d.core import Vec4, Vec3, Vec2, Plane, Point3, BitMask32 from direct.actor.Actor import Actor from panda3d.core import CollisionSphere, CollisionCapsule, CollisionNode, CollisionRay, CollisionSegment, CollisionHandlerQueue from direct.gui.OnscreenText import OnscreenText from direct.gui.OnscreenI...
2.03125
2
synapse/dispatcher.py
mrmuxl/synapse-agent
1
12797873
import sys import time import signal import socket from Queue import Queue from synapse.scheduler import SynSched from synapse.amqp import AmqpSynapse, AmqpAdmin, AmqpError from synapse.config import config from synapse.controller import Controller from synapse.logger import logger from synapse.synapse_exceptions imp...
2.484375
2
explore_data.py
adamw00000/MAK-Datahub
1
12797874
# %% import os import sys # os.chdir("../../..") os.environ['DJANGO_SETTINGS_MODULE'] = 'MAKDataHub.settings' import django django.setup() # %% import math import pickle import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from MAKDataHub.services import Services profile_servi...
1.9375
2
bytefall/_compat/tracing.py
NaleRaphael/bytefall
1
12797875
import sys from pdb import Pdb, getsourcelines from .utils import check_frame from bytefall._modules import sys as py_sys from bytefall._c_api import convert_to_builtin_frame from bytefall.config import EnvConfig __all__ = ['PdbWrapper'] class PdbWrapper(object): @staticmethod @check_frame def set_trac...
2.03125
2
func/model/status_processing.py
leonidasnascimento/sosi_func0007_company_finacial_report
0
12797876
class StatusProcessing(): success: bool message: str err_stack: str def __init__(self, _success: bool, _message: str, _err_stack: str = ""): self.success = _success self.message = _message self.err_stack = _err_stack pass pass
2.390625
2
PathTracking/inverseKinematics/inv_kinematics.py
deeksha777/roboscience
2
12797877
import pylab as plt import numpy as np from math import * N=100 t0 = 0.0 t1 = 2.0 t = np.linspace(t0,t1,N) dt = (t1-t0)/N one = np.ones((N)) xp = np.zeros((N)) yp = np.zeros((N)) th = np.zeros((N)) x = t*t y = t plt.figure() plt.plot(x,y,'g-') plt.legend(['Path'],loc='best') plt.title('Quadratic Path') plt.show() d...
2.875
3
docker/base/installation/source/mpi4py/gatherUpper.py
WCU-EDGE/TinySup
0
12797878
#!/usr/bin/env python # gatherUpper.py import numpy from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() LENGTH = 3 x = None x_local = numpy.linspace(rank*LENGTH,(rank+1)*LENGTH, LENGTH) print(x_local) if rank == 0: x = numpy.zeros(size*LENGTH) print (x) comm.Gather(x_local...
2.34375
2
sort_anagrams.py
carlb15/Python
2
12797879
def sort_anagrams_1(strs): """ :type strs List[str] :rtype List[List[str]] """ map = {} for v in strs: target = ''.join(sorted(v)) print(target) if target not in map: map[target] = [] map[target].append(v) print('building map ', map[target]) result = [] for value in map.valu...
4.0625
4
2_simulate_sdc.py
sztal/sda-model
1
12797880
"""Run simulations for SDC model. Parameters ---------- N_JOBS Number of cores used for parallelization. RANDOM_SEED Seed for the random numbers generator. SPACE Types of social space. Available values: 'uniform', 'lognormal', 'clusters_normal'. N Sizes of networks, NDIM Number of dimensions of...
2.5625
3
lib/piservices/fabops.py
creative-workflow/pi-setup
1
12797881
<reponame>creative-workflow/pi-setup<filename>lib/piservices/fabops.py import os, color from fabric import operations, api from fabric.contrib import files from policies import PiServicePolicies class FabricTaskOperator: def __init__(self, local_path, remote_path): self.remote_path = remote_path self.local_...
2.109375
2
intel/ll_signals.py
YmonOy/lastline_api
2
12797882
<reponame>YmonOy/lastline_api<filename>intel/ll_signals.py<gh_stars>1-10 from django.contrib.auth.signals import user_logged_in from request_provider.signals import get_request import ll_logger from ll_debug import __debugvar__ class SignalHandler: def __init__(self, logger): self.logger = logger # self = se...
2.015625
2
mapping/star/discretized_bath/symmetric_spquad.py
fhoeb/py-mapping
1
12797883
<filename>mapping/star/discretized_bath/symmetric_spquad.py """ Discretized bath for the generation of direct symmetric discretization coefficients, where the integrals for the couplings and energies are evaluated using scipy quad """ import numpy as np from scipy import integrate from mapping.star.discretized_...
2.46875
2
testsuite/pointcloud-fold/run.py
halirutan/OpenShadingLanguage
2
12797884
#!/usr/bin/env python command += testshade("-param radius 1000.0 -param filename data/cloud.geo rdcloud")
1.015625
1
mmrotate/core/bbox/iou_calculators/builder.py
williamcorsel/mmrotate
449
12797885
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.utils import build_from_cfg from mmdet.core.bbox.iou_calculators.builder import IOU_CALCULATORS ROTATED_IOU_CALCULATORS = IOU_CALCULATORS def build_iou_calculator(cfg, default_args=None): """Builder of IoU calculator.""" return build_from_cfg(cfg, ROT...
1.875
2
light_draft/views.py
zerc/django-light-draft
8
12797886
<gh_stars>1-10 # coding: utf-8 from __future__ import unicode_literals from django.http import Http404 from django.views.generic.detail import DetailView from .utils import load_from_shapshot from .exceptions import DraftError class BaseDraftView(DetailView): """ View for loading data from model `snapshot` ...
2.015625
2
DeleteNodeinaLinkedList.py
Bit64L/LeetCode-Python-
0
12797887
<reponame>Bit64L/LeetCode-Python-<filename>DeleteNodeinaLinkedList.py<gh_stars>0 # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def deleteNode(self, node): """ :type node: ListNode :rtype: void Do...
3.671875
4
tests/converter/test_url2netloc.py
Centaurioun/PyFunceble
213
12797888
""" The tool to check the availability or syntax of domain, IP or URL. :: ██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗ ██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝ ██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █...
2.6875
3
ex02-odd_or_even.py
lew18/practicepython.org-mysolutions
0
12797889
<reponame>lew18/practicepython.org-mysolutions<filename>ex02-odd_or_even.py """ https://www.practicepython.org Exercise 2: Odd or Even 1 chile Ask the user for a number. Depending on whether the number is even or odd, print out an appropriate message to the user. Hint: how does an even / odd number react differently w...
4.46875
4
musicrecs/spotify/item/spotify_artist.py
nknaian/album_recs
2
12797890
<filename>musicrecs/spotify/item/spotify_artist.py from .spotify_item import SpotifyItem class SpotifyArtist(SpotifyItem): """Class to hold selected information about a spotify artist""" def __init__(self, spotify_artist): # Initialize base class super().__init__(spotify_artist)
2.546875
3
2020-04-10/test_log.py
feieryouyiji/learningpy
0
12797891
<gh_stars>0 # # err_logging.py # import logging # def foo(s): # return 10 / int(s) # def bar(s): # return foo(s) * 2 # def main(): # try: # bar('0') # except Exception as e: # print("----出错了") # logging.exception(e) class FooError(ValueError): pass def foo(s): n = int(s) ...
3.171875
3
pyigm/cgm/tests/test_galaxy.py
pyigm/pyigm
16
12797892
<filename>pyigm/cgm/tests/test_galaxy.py # Module to run tests on GalaxyCGM from __future__ import print_function, absolute_import, division, unicode_literals # TEST_UNICODE_LITERALS import pytest import numpy as np from pyigm.cgm.galaxy import GalaxyCGM def test_init_light(): mwcgm = GalaxyCGM(load=False) d...
2.140625
2
Contributed/NeoPixelBarometer/Python/tempestbarometer.py
ucl-casa-ce/WindSpeedGauge
4
12797893
import requests import json import time import neopixel import board #Set Colours RED = (255, 0, 0) YELLOW = (255, 150, 0) ORANGE = (100, 64, 0) GREEN = (0, 255, 0) CYAN = (0, 255, 255) BLUE = (0, 0, 255) PURPLE = (180, 0, 255) OFF = (0, 0, 0) #Set NeoPixel Details - Pin/Number Pixels/Brightness etc pixels = neop...
3.265625
3
aiocloudflare/api/zones/amp/sxg/sxg.py
Stewart86/aioCloudflare
2
12797894
from aiocloudflare.commons.auth import Auth class Sxg(Auth): _endpoint1 = "zones" _endpoint2 = "amp/sxg" _endpoint3 = None
1.242188
1
projects/views.py
kylef-archive/django-projects
2
12797895
import cPickle as pickle import datetime from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.http import Http404, HttpResponse from django.core import urlresolvers from unipath import FSPath as Path from projects.models import Project def document(r...
2.15625
2
decrypt_device/main.py
vnszero/Enigma_2.0
0
12797896
CEIL = 122 END_LINE = '\n' FLOOR = 32 FOG_NUM = 1 FOG_POS = 2 ROLLBACK = 90 SECURITY = 'access denied\n' SHIFT = 0 def verify_code(message : str) -> list: i = 0 shift = None fog_num = None fog_pos = None code_message = '' for alpha in message: if i == SHIFT: shift = alpha ...
3.28125
3
spar_python/report_generation/ta1/ta1_section_performance_latency.py
nathanawmk/SPARTA
37
12797897
# ***************************************************************** # Copyright 2013 MIT Lincoln Laboratory # Project: SPAR # Authors: SY # Description: Section class # # # Modifications: # Date Name Modification # ---- ---- ...
1.929688
2
RhyAn/decomposer/medianNMF.py
kaveenr/rhyan
0
12797898
import numpy as np import scipy.signal as sp import scipy.spatial.distance as sp_dist import librosa class MedianNMF: y, sr = None,None n_components = None def __init__(self,y,sr,n_components = 5): self.y, self.sr = y,sr self.n_components = n_components def decompose(self): ...
2.203125
2
M1L10-Mini_Project-OpenAI_Taxi-v2/agent.py
felixrlopezm/Udacity_Deep_Reinforcement_Learning
0
12797899
import numpy as np from collections import defaultdict class Agent: def __init__(self, nA=6): """ Initialize agent. Params ====== - nA: number of actions available to the agent """ self.nA = nA self.Q = defaultdict(lambda: np.zeros(self.nA)) self.ep...
3.046875
3
attendees/persons/models/attending.py
xjlin0/-attendees30
0
12797900
<filename>attendees/persons/models/attending.py from django.db import models from django.core.exceptions import ValidationError from django.urls import reverse from django.contrib.contenttypes.fields import GenericRelation from django.contrib.postgres.fields.jsonb import JSONField from django.contrib.postgres.indexes i...
2.09375
2
tests/ts4/contracts/user_subscription.py
tonred/tonclick
0
12797901
<gh_stars>0 from tonos_ts4 import ts4 class UserSubscription(ts4.BaseContract): def __init__(self, address: ts4.Address): super().__init__('UserSubscription', {}, nickname='UserSubscription', address=address) @property def active(self) -> bool: return self.call_getter('isActive', {'_answ...
1.960938
2
thirdpart/pools.py
by46/geek
0
12797902
<reponame>by46/geek from gevent import socket from geventconnpool import ConnectionPool class MyPool(ConnectionPool): def _new_connection(self): return socket.create_connection(("www.baidu.com", 80)) if __name__ == '__main__': pool = MyPool(20) with pool.get() as conn: conn.s...
2.734375
3
package/niflow/ants/brainextraction/workflows/atropos.py
rciric/poldracklab-antsbrainextraction
0
12797903
<gh_stars>0 from collections import OrderedDict from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu from nipype.interfaces.ants import Atropos, MultiplyImages from ..interfaces.ants import ImageMath ATROPOS_MODELS = { 'T1': OrderedDict([ ('nclasses', 3), ('csf',...
2.171875
2
public/pylib/holdoutgroup.py
shaileshakarte28/SFMC
0
12797904
<filename>public/pylib/holdoutgroup.py import requests import json import xmltodict import datetime from math import ceil import jxmlease import operator import random from operator import itemgetter import time from json import loads, dumps def auth(clientId: str, clientSecret: str, accountId:str ...
2.625
3
python/submit_jobstream_byid.py
WorkloadAutomation/TWSzOS_REST_API_Python_samples
2
12797905
#!/usr/bin/python ############################################################################# # Licensed Materials - Property of HCL* # (C) Copyright HCL Technologies Ltd. 2017, 2018 All rights reserved. # * Trademark of HCL Technologies Limited #######################################################################...
2.15625
2
gans/ops/misc.py
gobrewers14/gans
0
12797906
<reponame>gobrewers14/gans # ============================================================================ # Author: <NAME> # Email: <<EMAIL>> # Date: 2018-09-02 17:13:47 # Brief: # ============================================================================ import tensorflow as tf def attention(x, l=1.0, norm...
2.296875
2
training_dataset_maker1.py
deepakrana47/DT-RAE
1
12797907
<filename>training_dataset_maker1.py import os from utility1 import extract_batchfeature_using_senna, get_parents, get_dep, get_words_id, pdep_2_deporder_dep, dep_2_hid_var from score_calc import get_rae_score_by_wd, get_rae_score_by_wd_dep from dynamic_pooling import get_dynamic_pool from text_process1 import line_pro...
2.15625
2
nemo_benchmark.py
KaySackey/Nemo
9
12797908
<reponame>KaySackey/Nemo<filename>nemo_benchmark.py<gh_stars>1-10 import sys import timeit from nemo.parser import NemoParser from mako.template import Template if len(sys.argv) > 1: filename = sys.argv[1] else: print 'A filename is required' exit() def nemo(str, debug=False): NemoParser(debug=debug)....
2.625
3
main.py
piotrek-szczygiel/orchlang
11
12797909
import argparse import sys import copy from graphviz import Digraph from rply import LexingError, ParsingError from lang.lexer import Lexer from lang.parser import Parser from lang.scope import Scope lexer = Lexer() parser = Parser(lexer.tokens) def execute(scope, source, draw=False, lexer_output=False, opt=False)...
2.609375
3
empty7v2.0.py
elecalle/Note-Taking_App
0
12797910
<filename>empty7v2.0.py #################################################################################### # Version: January 2022 # # Purpose: # This is a note-taking app, useful for people working on several projects at # the same time and who want to be able to update multiple documents at the same # time and f...
3.515625
4
estimators/train_nocs.py
ArvindSoma/HumanEstimation
0
12797911
<reponame>ArvindSoma/HumanEstimation """ Train NOC class """ import os import cv2 from recordclass import recordclass from torchstat import stat from math import log10 from models.networks import * from utils.common import * def visualize(batch, output, writer, name, niter, foreground=False, test=False): output_i...
2.421875
2
function/python/brightics/function/textanalytics/__init__.py
GSByeon/studio
0
12797912
<gh_stars>0 from .ngram import ngram from .lda import lda from .tfidf import tfidf
1.015625
1
src/ghaudit/__main__.py
scality/ghaudit
1
12797913
import logging import os from typing import Literal, Union from ghaudit.cli import cli LOGFILE = os.environ.get("LOGFILE") LOGLEVEL = os.environ.get("LOGLEVEL", "ERROR") # pylint: disable=line-too-long LOG_FORMAT = "{asctime} {levelname:8s} ghaudit <{filename}:{lineno} {module}.{funcName}> {message}" # noqa: E501 ST...
2.375
2
crn_mc/mesh.py
elevien/crn-mc
0
12797914
import numpy as np class Mesh: """ Contains all the information about the spatial domain """ def __init__(self,dimension,topology,geometry): self.Nvoxels = len(topology) self.dimension = dimension self.topology = topology # adjaceny matrix (numpy array), 0 along main diagonal, 1 elsew...
3.171875
3
css-test/launch.py
savithruml/contrail-provisioning-tool
0
12797915
<reponame>savithruml/contrail-provisioning-tool from flask import Flask, flash, redirect, render_template, request, session, abort, Response import os, subprocess from shelljob import proc application = Flask(__name__) @application.route('/provision', methods=['POST', 'GET']) def provision(): target_node_ip = str...
2.1875
2
python/snapy/netsnmp/unittests/test_netsnmp.py
marineam/nagcat
0
12797916
# snapy - a python snmp library # # Copyright (C) 2009 ITA Software, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be ...
2.1875
2
adafruit_rgb_display/rgb.py
caternuson/Adafruit_CircuitPython_RGB_Display
0
12797917
# The MIT License (MIT) # # Copyright (c) 2017 <NAME> and Adafruit Industries # # 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 # ...
1.734375
2
app.py
lmbejaran/sqlalchemy-challenge
0
12797918
import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import datetime as dt from flask import Flask, jsonify engine = create_engine("sqlite:///Resources/hawaii.sqlite") Base = automap_base() Base.prepare(engi...
3.125
3
main.py
marcpinet/maze-generator-and-solver
0
12797919
<reponame>marcpinet/maze-generator-and-solver import maze.maze as m import maze.maze_tools as mt import visual.colors as vc from abc import abstractmethod def ask_for_int(sentence: str) -> int: """ Ask the user for an integer. """ while True: try: return int(input(sentence)) ...
3.859375
4
utils.py
quanhua92/vietnam_investment_fund
0
12797920
<gh_stars>0 import requests import json from datetime import datetime def get_all_products(): url = "https://api.fmarket.vn/res/products/filter" data = {"types":["NEW_FUND","TRADING_FUND"],"issuerIds":[],"page":1,"pageSize":1000,"fundAssetTypes":[],"bondRemainPeriods":[],"searchField":""} headers = {"Conte...
2.6875
3
OpenGLCffi/GL/EXT/NV/half_float.py
cydenix/OpenGLCffi
0
12797921
<gh_stars>0 from OpenGLCffi.GL import params @params(api='gl', prms=['x', 'y']) def glVertex2hNV(x, y): pass @params(api='gl', prms=['v']) def glVertex2hvNV(v): pass @params(api='gl', prms=['x', 'y', 'z']) def glVertex3hNV(x, y, z): pass @params(api='gl', prms=['v']) def glVertex3hvNV(v): pass @params(api='...
2.140625
2
mysite/core/views.py
gopal031119/Decision-tree-using-Gimi-index
0
12797922
from django.shortcuts import render, redirect from django.views.generic import TemplateView, ListView, CreateView from django.core.files.storage import FileSystemStorage from django.urls import reverse_lazy from django.core.files import File from .forms import BookForm from .models import Book # Load libraries import ...
2.3125
2
ostaas.py
yadav19/simple-student-cloud
2
12797923
#!/usr/bin/python36 print("content-type: text/html") print("") import cgi import subprocess as sp form = cgi.FieldStorage() user_name = form.getvalue('user_name') lv_size = form.getvalue('lv_size') print(user_name) print(lv_size) output=sp.getstatusoutput("sudo ansible-playbook ostaas.yml --extra-vars='user_name={...
2.375
2
src/backend/marsha/development/urls.py
insad/marsha
0
12797924
<gh_stars>0 """Marsha Development app URLs configuration.""" from django.urls import path from .views import DevelopmentLTIView app_name = "development" urlpatterns = [ path("development/", DevelopmentLTIView.as_view(), name="lti-development-view"), ]
1.335938
1
Neural Style Transfer/train_TensorFlow.py
Shashi456/Neural-Style
31
12797925
import tensorflow as tf from tensorflow.python.keras.preprocessing import image as kp_image # Keras is only used to load VGG19 model as a high level API to TensorFlow from keras.applications.vgg19 import VGG19 from keras.models import Model from keras import backend as K # pillow is used for loading and saving ima...
2.90625
3
ctwalker/utils/__init__.py
aphearin/ctwalker
0
12797926
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .robust_file_opener import _compression_safe_opener
0.902344
1
tests/test_ml.py
ChuaHanChong/MLOps-Project
0
12797927
<reponame>ChuaHanChong/MLOps-Project """Test for loading ml module.""" import inspect import unittest from pathlib import Path class TestImportModule(unittest.TestCase): """Module testing.""" def test_import_ml(self): """Test ml module.""" import ml self.assertEqual( insp...
2.265625
2
Project 8/DeskNotification.py
ingwant/Python-Programs
0
12797928
<filename>Project 8/DeskNotification.py # pip install plyer from plyer import notification def send_desk_message(title, message): notification.notify( title=title, message=message, app_icon="circle-48.ico", timeout=5 ) send_desk_message("TITLE", "This is a message....")
2.4375
2
src/graphics/panels.py
ukitinu/ttfh
1
12797929
from __future__ import annotations import tkinter as tk from typing import Callable from src.graphics import utils from src.graphics.interfaces import Panel from src.timer import Clock class PanelStyle: """ This class holds the immutable style properties of the TextPanel """ def __init__(self, width: int, ...
3.015625
3
subt/octomap.py
robotika/osgar
12
12797930
<reponame>robotika/osgar<filename>subt/octomap.py """ ROS Binary Octomap parsing and processing """ import struct import math import numpy as np import cv2 from osgar.node import Node from osgar.lib.pplanner import find_path # http://www.arminhornung.de/Research/pub/hornung13auro.pdf # 00: unknown; 01: occupied; 1...
2.5625
3
src/complex_constraints/sushi_net.py
samarthbhargav/symstat
0
12797931
import argparse import sys import numpy as np from sushi_data import SushiData, to_pairwise_comp from compute_mpe import CircuitMPE import tensorflow as tf FLAGS =None def weight_variable(shape): return tf.Variable(tf.truncated_normal(shape, 0.1)) def bias_variable(shape): return tf.Variable(tf.truncated_norm...
2.3125
2
auth-center/App/decorator/role_check_dec.py
Basic-Components/auth-center
1
12797932
<gh_stars>1-10 from functools import wraps from sanic.response import json from App.model import User def role_check(): def decorator(func): @wraps(func) async def handler(request, *args, **kwargs): if (request.app.name not in request.args['auth_roles']): return json({"me...
2.375
2
moire/array.py
speedcell4/moire
2
12797933
import dynet as dy import numpy as np import moire from moire import Expression __all__ = [ 'zeros', 'ones', 'full', 'normal', 'bernoulli', 'uniform', 'gumbel', 'zeros_like', 'ones_like', 'full_like', 'normal_like', 'bernoulli_like', 'uniform_like', 'gumbel_like', 'eye', 'diagonal', 'where', ] def z...
2.125
2
nemo/collections/common/losses/aggregator.py
hamjam/NeMo
4,145
12797934
# Copyright (c) 2020, NVIDIA CORPORATION. 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.25
2
PythonExercicios/ex070.py
Luis-Emanuel/Python
0
12797935
#Crie um programa que leia o nome e o preço de vários produtos. O program ddeverá perguntar se o usuário vai continuar. #No final, mostre: A) Qual é o total gasto na compra B)Quantos produtos custão mais que 1000 C)Qual é o nome do produto mais barato. cont = soma = produto_mais = produtovalor = 0 produto_menos = '' p...
4
4
cinder/backup/drivers/sheepdog.py
AO-AO/cmss-cinder
0
12797936
<gh_stars>0 #coding:utf-8 import time import json import urllib2 from oslo.config import cfg from cinder import exception from oslo_log import log as logging from cinder.backup.driver import BackupDriver LOG = logging.getLogger(__name__) service_opts = [ cfg.StrOpt('cinder_ip', default='172.16.172....
2.125
2
app/common/helpers.py
citizensvs/cvc19backend
1
12797937
<filename>app/common/helpers.py<gh_stars>1-10 from app.common.conf import PHONE_NUMBER_VALIDATOR def phone_number_valid(phone_number): if phone_number.isdigit(): if PHONE_NUMBER_VALIDATOR.match(phone_number): return True raise ValueError def normalize_phone_number(phone): phone = pho...
2.734375
3
sandbox/DS_registration_scripts/register_ap_ds.py
ska-sa/mkat-tango
0
12797938
<reponame>ska-sa/mkat-tango # register_ap_ds.py # -*- coding: utf8 -*- # vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4 # Copyright 2016 National Research Foundation (South African Radio Astronomy Observatory) # BSD license - see LICENSE for details from __future__ import absolute_import, division, print_function from fu...
1.96875
2
src/get_gov.py
cannibalcheeseburger/covid-19-tracker
0
12797939
import urllib.request from bs4 import BeautifulSoup def get_go(): url = "https://www.mohfw.gov.in/" uClient = urllib.request.urlopen(url) page_html = uClient.read() uClient.close() page_soup = BeautifulSoup(page_html,"html.parser") news = page_soup.find_all('div',class_ = 'update-box') ...
3.34375
3
Chap10/hello.py
RiddhiDamani/Python
0
12797940
<filename>Chap10/hello.py #!/usr/bin/env python3 # Copyright 2009-2017 BHG http://bw.org/ # Exceptions are powerful runtime error reporting mechanism commonly used in object oriented systems. # ValueError: is the token i.e. it is the name of the error that is being generated here. # sys has lot of constants in it. im...
4.03125
4
utils_batch.py
gregor8003/text_word_embed
0
12797941
<reponame>gregor8003/text_word_embed<filename>utils_batch.py from bisect import bisect_left import itertools from numpy.lib.npyio import load as npload import numpy as np from utils import ( get_mdsd_csv_cbow_data_input_files_iter, get_mdsd_csv_cbow_data_output_files_iter, grouper, MDSD_MAIN...
2.78125
3
scripts/deploy_stack.py
sfuruya0612/snatch
3
12797942
# -*- coding: utf-8 -*- import glob import os import re import sys import logging from boto3.session import Session from botocore.exceptions import ClientError from argparse import ArgumentParser TEMPLATES = [ "/scripts/ec2.yml", ] logger = logging.getLogger() formatter = '%(levelname)s : %(asctime)s : %(message...
2.078125
2
tartiflette/directive/builtins/non_introspectable.py
alexchamberlain/tartiflette
0
12797943
<reponame>alexchamberlain/tartiflette<gh_stars>0 from typing import Any, Callable, Dict, Optional from tartiflette import Directive class NonIntrospectable: async def on_introspection( self, _directive_args: Dict[str, Any], _next_directive: Callable, _introspected_element: Any, ...
2.078125
2
reading/book/migrations/0003_auto_20180613_1926.py
Family-TreeSY/reading
2
12797944
<reponame>Family-TreeSY/reading<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-06-13 11:26 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('book', '0002_auto_20180613_1914'), ] ...
1.359375
1
TyphoonApi/suncreative/migrations/0008_auto_20210306_0049.py
ZhangDubhe/Tropical-Cyclone-Information-System
9
12797945
<gh_stars>1-10 # Generated by Django 2.2.13 on 2021-03-06 00:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('suncreative', '0007_postrecord_state'), ] operations = [ migrations.CreateModel( ...
1.835938
2
lcms/parse_mzml.py
NetherlandsForensicInstitute/msmatcher
0
12797946
import glob from collections import namedtuple import dateutil.parser import numpy as np import pandas as pd import pymzml import config import lcms.utils as utils def create_spectrum_and_peak_tables(msrun_list, experiment_id): ''' fills the Spectrum table and for each spectrum the Peak table :param ms...
2.390625
2
setup.py
ddolzhenko/dirutil
0
12797947
from setuptools import setup, find_packages ver = "0.4" setup( name = 'dirutil', version = ver, description = 'High level directory utilities', keywords = ['dir', 'directory', 'workdir', 'tempdir'], author = '<NAME>', author_email = '<EMAIL>', packages = fin...
1.34375
1
ingine/examples/eight_queens_puzzle.py
sqarrt/Ingine
0
12797948
<filename>ingine/examples/eight_queens_puzzle.py import random from pyeasyga import pyeasyga from ingine import ga # setup seed data data = [0, 1, 2, 3, 4, 5, 6, 7] # initialise the GA gaa = pyeasyga.GeneticAlgorithm(data, population_size = 200, generati...
2.96875
3
dyn_agent.py
Journerist/PokerJohn
0
12797949
from collections import deque import random import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam class DYNAgent: def __init__(self, state_size, action_size): self.state_size = state_size self.action_...
2.546875
3
tests/test_pandas_marc.py
cmsetzer/pandas-marc
2
12797950
#!/usr/bin/env python3 """Test suite for pandas-marc.""" from pandas_marc import MARCDataFrame def test_instantiate_marcdataframe(dataframe): kwargs = { 'dataframe': dataframe, 'occurrence_delimiter': '|', 'subfield_delimiter': '‡' } mdf = MARCDataFrame(**kwargs) for key, val...
3.078125
3