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
python/paddle/v2/fluid/tests/book/test_understand_sentiment_conv.py
QingshuChen/Paddle
0
20700
<filename>python/paddle/v2/fluid/tests/book/test_understand_sentiment_conv.py import numpy as np import paddle.v2 as paddle import paddle.v2.fluid.core as core import paddle.v2.fluid.evaluator as evaluator import paddle.v2.fluid.framework as framework import paddle.v2.fluid.layers as layers import paddle.v2.fluid.nets ...
2.671875
3
sem.py
sree314/simple-abstract-interpreter
3
20701
<filename>sem.py #!/usr/bin/env python3 # # sem.py # # An implementation of the concrete semantics, including an # interpreter # # Author: <NAME> # # Written for CSC2/455 Spring 2020 # # To the extent possible under law, Sreepathi Pai has waived all # copyright and related or neighboring rights to sem.py. This work # i...
2.78125
3
python_script/neutron.py
namptit307/openstack_upgrade_test
1
20702
import json from requests import ConnectionError from config import * from utils import * from get_auth import TOKEN # Create network create_network_url = "http://{}:9696/v2.0/networks".format(IP) token_headers = { 'X-Auth-Token': TOKEN, 'Content-Type': 'application/json' } # Create router create_router_url ...
2.71875
3
app/view/forms.py
weizy1981/WatsonRobot
0
20703
<gh_stars>0 from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, FileField from wtforms.validators import DataRequired from app.view import errormessage class LoginForm(FlaskForm): username = StringField(label='username', validators=[DataRequired(errormessage.LOGIN002)]) ...
2.59375
3
setup.py
alexweav/nisystemlink-clients-python
0
20704
<gh_stars>0 from setuptools import find_namespace_packages, find_packages, setup # type: ignore from setuptools.command.test import test as TestCommand # type: ignore class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_s...
1.84375
2
shell_ui/__init__.py
conducto/conducto
25
20705
import os import sys import signal import asyncio import json import time import traceback import typing import socket import re import select import websockets if sys.platform != "win32": import termios import tty else: import msvcrt import win32api from .. import api from ..shared import constants, ...
2.0625
2
processing_components/simulation/ionospheric_screen.py
cnwangfeng/algorithm-reference-library
0
20706
""" Functions for ionospheric modelling: see SDP memo 97 """ import astropy.units as u import numpy from astropy.coordinates import SkyCoord from data_models.memory_data_models import BlockVisibility from processing_components.calibration.operations import create_gaintable_from_blockvisibility, \ create_gaintabl...
2.59375
3
build.py
Slaals/narval
0
20707
<gh_stars>0 ''' This file is part of Narval : an opensource and free rights static blog generator. ''' #!/usr/bin/python3 #-*- coding: utf-8 -*- import os, filecmp, random, webbrowser from shutil import copyfile params = __import__('config') helpers = __import__('helpers') tmps = __import__('template') def build(...
2.28125
2
examples/simple/regression/sample_skipped.py
jonwesneski/end2
0
20708
from src import ( RunMode, setup ) __run_mode__ = RunMode.PARALLEL @setup def my_setup(logger): assert False, "FAILING SETUP ON PURPOSE" def test_skipped(logger): assert False, "THIS TEST SHOULD NOT RUN BECAUSE SETUP FAILED"
2
2
structure/DoublyLinkedList.py
Jaidev810/Data-Structures-package
2
20709
class Node: def __init__(self, val: int): self.val = val self.prev = None self.next = None class DoublyLinkedList: def takeinput(self) -> Node: inputlist = [int(x) for x in input().split()] head = None temp = None for curr in inputlist: if c...
3.703125
4
reference_parsing/scripts/reference_script.py
ScholarIndex/LinkedBooks
0
20710
# -*- coding: utf-8 -*- """ USED una tantum to refactor the journal_references collection. Note that the old collection references (monograph reference lists) is discarded: monographs are going to ba parsed again. this script: 1- copies the journal_references collection to another collection: sand, test and production...
2.328125
2
simpysql/Eloquent/SqlServerBuilder.py
wjtxlliubin/simpysql
29
20711
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import collections from simpysql.Util.Expression import expression as expr, Expression from simpysql.Util.Response import Response from .BaseBuilder import BaseBuilder from simpysql.Util.Dynamic import Dynamic class SqlServerBuilder(BaseBuilder): operators = [ ...
2.125
2
openBMC/terminal_cmd.py
kevinkellyspacey/openBMC-rpi
0
20712
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import logging from openBMC.smbpbi import smbpbi_read import smbus from openBMC.fan_control import set_dbus_data,get_dbus_data,pwm_reqest_set,TMP451_7bit_ADDR,GPU0_7bit_ADDR,GPU1_7bit_ADDR import dbus import argparse import socket import sys import os def show(...
2.484375
2
other/wget_files.py
arlewis/galaxy_cutouts
0
20713
<gh_stars>0 from __future__ import print_function import numpy as np import astropy.io.fits import gal_data import config import argparse import os import sys from collections import defaultdict from pdb import set_trace _WORK_DIR = '/Users/lewis.1590/research/galbase' _GALDATA_DIR = '/Users/lewis.1590/python/galbase...
2.21875
2
jessie_bot/help/help.py
KNNCreative/jessie-bot
1
20714
import json import logging from pathlib import Path from hermes.common.lex_utils import success, error logger = logging.getLogger(__name__) script_path = Path.cwd().joinpath('hermes/help/script.json') with script_path.open() as f: script = json.load(f) def handler(event, context): help_text = '\n'.join(script['...
2.234375
2
MyStudy/app/Stateful_Firewall.py
OucMan/ryu
0
20715
<reponame>OucMan/ryu from ryu.base import app_manager from ryu.ofproto import ofproto_v1_3 from ryu.controller import ofp_event from ryu.controller.handler import set_ev_cls, MAIN_DISPATCHER, CONFIG_DISPATCHER from ryu.lib.packet.packet import packet, ether_types from ryu.lib.packet.ethernet import ethernet from ryu.li...
1.984375
2
screenpy/questions/body_of_the_last_response.py
perrygoy/screenpy
39
20716
<filename>screenpy/questions/body_of_the_last_response.py """ Investigate the body of the last API response received by the Actor. """ from json.decoder import JSONDecodeError from typing import Union from screenpy import Actor from screenpy.abilities import MakeAPIRequests from screenpy.exceptions import UnableToAns...
3.34375
3
d3rlpy/algos/torch/td3_impl.py
ningyixue/AIPI530_Final_Project
565
20717
from typing import Optional, Sequence import torch from ...gpu import Device from ...models.encoders import EncoderFactory from ...models.optimizers import OptimizerFactory from ...models.q_functions import QFunctionFactory from ...preprocessing import ActionScaler, RewardScaler, Scaler from ...torch_utility import T...
1.976563
2
mod_modPackInformer/source/mod_modPackInformer.py
stealthz67/spoter-mods-1
0
20718
# -*- coding: utf-8 -*- import json import os import threading import urllib import urllib2 import BigWorld import ResMgr from gui.Scaleform.daapi.view.dialogs import DIALOG_BUTTON_ID, ConfirmDialogButtons, SimpleDialogMeta from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView from gui import DialogsInterface...
1.710938
2
tests/dummypredictor/predictors.py
kiconiaworks/igata
1
20719
from time import sleep from igata.predictors import PredictorBase class DummyPredictorNoInputNoOutput(PredictorBase): def predict(self, inputs, meta): result = {"result": 0.222, "class": "car", "is_valid": True} return result class DummyPredictorNoInputNoOutputVariableOutput(PredictorBase): ...
2.375
2
ML/wrapper.py
NVombat/ReadAssist
5
20720
<gh_stars>1-10 #Encapsulates all models #Caches the models and uses the preexisting model instead of reloading it from .OCR import get_text from .ptt import get_pdf import pytesseract from .question import secondary_pipeline from transformers import pipeline class customwrapper(): def __init__(self): self...
2.71875
3
unicode_urls/cms/__init__.py
Alexx-G/django-unicode-urls
0
20721
<reponame>Alexx-G/django-unicode-urls<filename>unicode_urls/cms/__init__.py from .urlutils import any_path_re def patch_djangocms_urls(): import cms.utils.urlutils as cms_urlutils cms_urlutils.any_path_re = any_path_re
1.453125
1
mailpile/plugins/demos.py
pyarnold/Mailpile
2
20722
# This is a collection of very short demo-plugins to illustrate how # to create and register hooks into the various parts of Mailpile # # To start creating a new plugin, it may make sense to copy this file, # globally search/replace the word "Demo" with your preferred plugin # name and then go delete sections you aren'...
1.929688
2
cqi_cpp/src/wrapper/cqi_test.py
AMR-/Conservative-Q-Improvement
0
20723
<reponame>AMR-/Conservative-Q-Improvement<gh_stars>0 import argparse import gym import math from qtree_wrapper import PyBox as Box from qtree_wrapper import PyDiscrete as Discrete from qtree_wrapper import PyQTree as QTree from qtree_wrapper import PyVector as Vector from train import Train from utils import convert...
2.34375
2
mcu-controller/main.py
KongoPL/lego-rc-car
0
20724
<reponame>KongoPL/lego-rc-car # Yea, there is probably some good framework waiting for me, # but I just want to have fun. Sometimes reinventing the wheel will serve you. # But...don't do that in professional work :) import config import time from Controller import Controller print("Hello!") root = Controller() # tr...
2.828125
3
thread_test.py
mrabedini/playground_threading
0
20725
import concurrent.futures import logging from logging import StreamHandler import time import timeit logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", ) logger = logging.getLogger(__name__) def do_something(wait_time): logger.info("Waiting for %d sec...
3
3
iv/Backtracking/combinations.py
iamsuman/iv
2
20726
class Combo(): def combine(self,n, k): A = list(range(1,n + 1)) res = self.comb(A, k) return res def comb(self, A, n): if n == 0: return [[]] l = [] for i in range(0, len(A)): m = A[i] remLst = A[i + 1:] for p in se...
3.671875
4
urlbrevity/test_urlconf.py
kezabelle/django-urlbrevity
4
20727
<reponame>kezabelle/django-urlbrevity # -*- coding: utf-8 -*- from pytest import raises from django.contrib import admin from django.core.urlresolvers import reverse from django.core.urlresolvers import resolve from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import Resolver404 from dja...
2.4375
2
test/unittest/datafinder_test/persistence/metadata/value_mapping/custom_format_test.py
schlauch/DataFinder
9
20728
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # # 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.8125
2
programmers/kakao2022/kakao2022/grader.py
jiyolla/StudyForCodingTestWithDongbinNa
0
20729
import random from .api import put_change_grade # grades[id] = grade for user #{id}. # grades[0] is not used. Since user id starts from 1. def change_grade_randomshuffle(grades): changed_users_id = set(range(len(grades))) changed_users_id.remove(0) grades = list(range(len(grades))) random.shuffle(g...
3.34375
3
resources/benchmark.py
HPI-SWA-Lab/TargetSpecific-ICOOOLPS
1
20730
import numpy as np import matplotlib.pyplot as plt N = 4 ind = np.arange(N) # the x locations for the groups width = 0.4 # the width of the bars fig, ax = plt.subplots() ax.set_ylim(0,11) # outliers only #ax2.set_ylim(0,35) # most of the data #ax.spines['bottom'].set_visible(False) #ax2.spines['top'].set_vi...
2.65625
3
talktracker/analysis.py
alTeska/talktracker
1
20731
from datetime import timedelta from random import sample, randint import talktracker as tt def time_diff(time1, time2): """calculate the time different""" time1_info = timedelta(hours=time1[0], minutes=time1[1], seconds=time1[2]) time2_info = timedelta(hours=time2[0], minutes=time2[1], seconds=time2[2]) ...
3.359375
3
app/internal/module/video_del/queue.py
penM000/eALPluS-video-api
0
20732
<filename>app/internal/module/video_del/queue.py<gh_stars>0 import asyncio from dataclasses import dataclass, field from typing import Any from .encode import encoder from .database import database from ..logger import logger @dataclass(order=True) class QueueItem: """ キューアイテム """ priority: int ...
2.453125
2
lib/dyson/utils/module.py
luna-test/luna
3
20733
<reponame>luna-test/luna import os from dyson import constants from abc import abstractmethod import sys from dyson.constants import to_boolean class DysonModule: def __init__(self): pass @abstractmethod def run(self, webdriver, params): pass def fail(self, msg): print(msg,...
2.078125
2
misc/texteditor.py
disc0nnctd/myPythonCodesDC
1
20734
"""A simple text editor made in Python 2.7.""" from os import path, chdir workingdir = path.join(path.dirname(__file__), 'texts') chdir(workingdir) from Tkinter import Tk, Text, Button import tkFileDialog root = Tk("Text Editor") text = Text(root) text.grid() def saveas(): """Save file.""" tr...
3.703125
4
21_DivdeConquer/Step05/gamjapark.py
StudyForCoding/BEAKJOON
0
20735
import sys n, k= map(int, sys.stdin.readline().split()) def power(a, b): if b == 0: return 1 if b % 2: return (power(a, b//2) ** 2 * a) % P else: return (power(a, b//2) ** 2) % P P = 1000000007 f = [1 for _ in range(n + 1)] for i in range(2, n + 1): f[i] = (f[i - 1] * i) % P A = f[n] B = (f[n-k]*f[k])%P p...
2.71875
3
quicksilver.py
binaryflesh/quicksilver
1
20736
# Quicksilver.py - Agnostic project analyzer that generates resourceful diagrams. WIP # Copyright (C) 2018 <NAME> - @binaryflesh
0.777344
1
action_controller/scripts/ActionControllerNode.py
FablabHome/The_Essense_of_the_Grey_Region
1
20737
<gh_stars>1-10 #!/usr/bin/env python3 """ MIT License Copyright (c) 2020 rootadminWalker 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 righ...
2
2
model.py
Wentao-Shi/Molecule-RNN
3
20738
<gh_stars>1-10 # Copyright: <NAME>, 2021 import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence from torch.nn.functional import softmax class RNN(torch.nn.Module): def __init__(self, rnn_config): super(RNN, self).__init__() self.embedding_layer = nn.Embedding( ...
2.640625
3
day5.py
GuiltyD/Python_code
0
20739
f = open('./day4.py') for chunk in iter(lambda :f.read(10),''): print(chunk)
2.296875
2
Latest/venv/Lib/site-packages/apptools/io/h5/utils.py
adamcvj/SatelliteTracker
1
20740
from contextlib import contextmanager from .file import H5File @contextmanager def open_h5file(filename, mode='r+', **kwargs): """Context manager for reading an HDF5 file as an H5File object. Parameters ---------- filename : str HDF5 file name. mode : str Mode to open the file: ...
3.421875
3
src/success_backup_check/tests/test_success_backup_check.py
linuxluigi/success-backup-check
0
20741
<reponame>linuxluigi/success-backup-check import pytest import success_backup_check def test_project_defines_author_and_version(): assert hasattr(success_backup_check, '__author__') assert hasattr(success_backup_check, '__version__')
1.90625
2
insighioNode/lib/networking/modem/modem_sequans.py
insighio/insighioNode
5
20742
from modem_base import Modem from network import LTE import logging class ModemSequans(Modem): def __init__(self): self.lte = LTE() def power_on(self): self.lte.init() def power_off(self): self.lte.deinit(dettach=True, reset=True) def init(self): return True def...
2.796875
3
ravendb/tests/jvm_migrated_tests/crud_tests/test_track_entity.py
ravendb/RavenDB-Python-Client
8
20743
from ravendb.exceptions.exceptions import NonUniqueObjectException, InvalidOperationException from ravendb.tests.test_base import UserWithId, TestBase class TestTrackEntity(TestBase): def setUp(self): super(TestTrackEntity, self).setUp() def test_storing_document_with_the_same_id_in_the_same_session_...
2.125
2
PluginSDK/PythonRecon/Python/excel_helper.py
PengJinFa/YAPNew
20
20744
<gh_stars>10-100 from openpyxl import Workbook from openpyxl.utils import get_column_letter import numbers wb = Workbook() def XL_Location(row, column): return get_column_letter(column) + str(row) def Save_Column_Title(file_dir, features, row_index, column_start): ws = wb.active keys = [x[0] for x in f...
2.53125
3
src/semantic_segmentation/utils/image.py
alteia-ai/ICSS
7
20745
<gh_stars>1-10 import colorsys import itertools import numpy as np import torch def sliding_window(top, step=10, window_size=(20, 20)): """ Slide a window_shape window across the image with a stride of step """ for x in range(0, top.shape[1], step): if x + window_size[0] > top.shape[1]: x...
2.796875
3
website/error.py
TWoolhouse/Libraries
1
20746
class WebsiteBaseError(Exception): pass class TreeTraversal(WebsiteBaseError): def __init__(self, tree, request, segment, req=None): super().__init__() self.tree, self.request, self.segment, self.req = tree, request, segment, req def __str__(self) -> str: return f"{self.tree} > {s...
2.9375
3
backend/src/contaxy/operations/deployment.py
ml-tooling/contaxy
3
20747
<filename>backend/src/contaxy/operations/deployment.py from abc import ABC, abstractmethod from datetime import datetime from typing import Any, List, Literal, Optional from contaxy.schema import Job, JobInput, ResourceAction, Service, ServiceInput from contaxy.schema.deployment import DeploymentType # TODO: update_s...
2.484375
2
perfkitbenchmarker/providers/openstack/os_virtual_machine.py
Nowasky/PerfKitBenchmarker
3
20748
<filename>perfkitbenchmarker/providers/openstack/os_virtual_machine.py # Copyright 2015 PerfKitBenchmarker 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 # # ...
1.703125
2
model.py
kevincho840430/CarND-Behavioral-Cloning-P3-master-1
0
20749
<filename>model.py ## Self-driven car project based on nvidia's CNN model ## Package #torch = 0.4.1.post2 #torchvision = 0.2.1 #numpy = 1.15.2 #opencv-python =3.4.3 # -*- coding: utf-8 -*- # Import the Stuff import torch import torch.nn as nn import torch.optim as optim from torch.utils import data from torch.utils....
3
3
setup.py
sankethvedula/flowtorch
29
20750
# Copyright (c) Meta Platforms, Inc import os import sys from setuptools import find_packages, setup REQUIRED_MAJOR = 3 REQUIRED_MINOR = 7 TEST_REQUIRES = ["numpy", "pytest", "pytest-cov", "scipy"] DEV_REQUIRES = TEST_REQUIRES + [ "black", "flake8", "flake8-bugbear", "mypy", "toml", "usort"...
1.632813
2
nn/train.py
julian-carpenter/airynet
8
20751
<filename>nn/train.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import nn import tensorflow as tf from tensorflow.python.client import device_lib from numpy import min, max def model_fn(features, labels, mode, params): """Model function for airyn...
2.75
3
retrobiocat_web/app/db_analysis/__init__.py
ihayhurst/RetroBioCat
9
20752
from flask import Blueprint bp = Blueprint('db_analysis', __name__, template_folder='templates', static_folder='static', static_url_path='/db_analysis/static' ) from retrobiocat_web.app.db_analysis.routes import bioinformatics, ssn
1.53125
2
tasks.py
pycopia/devtest
0
20753
#!/usr/bin/env python3.9 """Tasks file used by the *invoke* command. This simplifies some common development tasks. Run these tasks with the `invoke` tool. """ from __future__ import annotations import sys import os import shutil import getpass from glob import glob from pathlib import Path import keyring import s...
2.046875
2
sandbox/lib/jumpscale/Jumpscale/servers/gedis/tests/3_threebot_redis_registration.py
threefoldtech/threebot_prebuilt
0
20754
from Jumpscale import j from io import BytesIO import binascii def main(self): """ kosmos -p 'j.servers.gedis.test("threebot_redis_registration")' """ ####THREEBOT REGISTRATION phonebook = j.threebot.package.phonebook.client_get() if j.sal.nettools.tcpPortConnectionTest("www.google.com", 44...
2.1875
2
font/gen.py
smaji-org/cjkv_info_sample
0
20755
#!/usr/bin/env python2 # -*- coding:utf-8 -*- import os import argparse import glob from functools import partial import fontforge import psMat import source opt_parser= argparse.ArgumentParser() opt_parser.add_argument("--cjkv_info", type= str, help= u"the path of cjkv_info") opt_parser.add_argument("--region"...
3.015625
3
alarm_control_panel.py
rs1932/homeassistant-ring_alarm_component
4
20756
import logging import pandas as pd from homeassistant.components.alarm_control_panel import ( AlarmControlPanel ) from homeassistant.core import callback from homeassistant.util import convert from .ringalarmdevice import RingAlarmDevice from .constants import * from homeassistant.const import ( STATE_ALARM_...
2.25
2
bot/game.py
thequeenofspades/AlphaGOLADZero
1
20757
from sys import stdin, stdout, stderr import traceback import time from player import Player from field.field import Field class Game: def __init__(self): self.time_per_move = -1 self.timebank = -1 self.last_update = None self.max_rounds = -1 self.round = 0 self.pl...
2.984375
3
config/ConfigSices.py
atosborges00/sereno_bot
0
20758
<filename>config/ConfigSices.py from os import path from config.ConfigPaths import ConfigPaths class ConfigSices: """ Sices platform useful URLs """ LOGIN_URL = 'https://monitoramento.sicessolar.com.br/login' ANALYTICS_PAGE = 'https://monitoramento.sicessolar.com.br/analytics?und={code}' """ Si...
2.15625
2
main.py
leonli/codename-gen
0
20759
import click import random from pyfiglet import Figlet from termcolor import colored, cprint import imagenet @click.command() @click.option("--count", default=10, help="Yield number of codenames.") def codename_gen(count): """Enjoy the codenames 🍺""" imagenet_cls = imagenet.imagenet1000_labels() f = Figle...
3
3
binder/plugins/views/userview.py
asma-oueslati/django-binder
0
20760
import logging import json from abc import ABCMeta, abstractmethod from django.contrib import auth from django.contrib.auth import update_session_auth_hash, password_validation from django.contrib.auth.tokens import default_token_generator from django.core.exceptions import ValidationError, PermissionDenied from djang...
1.859375
2
libra_client/crypto/x25519.py
violas-core/violas-client
0
20761
<reponame>violas-core/violas-client from libra_client.canoser import DelegateT, BytesT # Size of a X25519 private key PRIVATE_KEY_SIZE = 32 # Size of a X25519 public key PUBLIC_KEY_SIZE = 32 # Size of a X25519 shared secret SHARED_SECRET_SIZE = 32 class PrivateKey(DelegateT): delegate_type = BytesT(PRIVATE_KEY_...
1.734375
2
plenum/test/plugin/demo_plugin/main.py
SchwiftyRick/indy-plenum
0
20762
<gh_stars>0 from plenum.common.constants import DOMAIN_LEDGER_ID from plenum.server.client_authn import CoreAuthNr from plenum.test.plugin.demo_plugin import AUCTION_LEDGER_ID from plenum.test.plugin.demo_plugin.batch_handlers.auction_batch_handler import AuctionBatchHandler from plenum.test.plugin.demo_plugin.config i...
1.773438
2
biobakery_workflows/document_templates/quality_control_paired_dna_rna.template.py
shbrief/biobakery_workflows
1
20763
#+ echo=False import numpy from biobakery_workflows import utilities, visualizations, files from anadama2 import PweaveDocument document=PweaveDocument() # get the variables for this document generation task vars = document.get_vars() # determine the document format pdf_format = True if vars["format"] == "pdf" ...
2.25
2
Other_notebooks/Shapefile_Demo.py
gamedaygeorge/datacube-applications-library
0
20764
# Code behind module for Shapefile_Demo.ipynb ################################ ## ## Import Statments ## ################################ # Import standard Python modules import sys import datacube import numpy as np import fiona import xarray as xr from rasterio.features import geometry_mask import shapely from sha...
2.65625
3
Day 02/Day 02.1.py
Mraedis/AoC2021
1
20765
linelist = [line for line in open('Day 02.input').readlines()] hor = 0 dep = 0 for line in linelist: mov, amount = line.split(' ') if mov == 'forward': hor += int(amount) else: dep += int(amount) * (-1 if mov == 'up' else 1) print(hor * dep)
3.171875
3
examples/simple1d/driver.py
michael-a-hansen/jalapeno
1
20766
''' This example provides three examples of a simple plot of 1-D data. 1. a publication-ready single column figure, which is printed to png (600 dpi), pdf, and svg 2. a presentation-ready figure on a black background Four steps are involved in each figure: - load/generate the data - construct a 1d plot (figure, axis,...
3.796875
4
process/1_embed_keep_ge.py
omarmaddouri/GCNCC_1
4
20767
from __future__ import division from __future__ import print_function from pathlib import Path import sys project_path = Path(__file__).resolve().parents[1] sys.path.append(str(project_path)) from keras.layers import Dense, Activation, Dropout from keras.models import Model, Sequential from keras.regularize...
2.15625
2
docs/modelserving/detect/aif/germancredit/simulate_predicts.py
chinhuang007/website
1,146
20768
<reponame>chinhuang007/website import sys import json import time import requests if len(sys.argv) < 3: raise Exception("No endpoint specified. ") endpoint = sys.argv[1] headers = { 'Host': sys.argv[2] } with open('input.json') as file: sample_file = json.load(file) inputs = sample_file["instances"] # Sp...
2.8125
3
sdc/ysdc_dataset_api/utils/serialization.py
sty61010/shifts
156
20769
import io import zlib import numpy as np def maybe_compress(str, compress): return zlib.compress(str) if compress else str def maybe_decompress(str, decompress): return zlib.decompress(str) if decompress else str def serialize_numpy(arr: np.ndarray, compress: bool = False) -> str: """Serializes numpy...
2.6875
3
hubspot/discovery/crm/extensions/videoconferencing/discovery.py
fakepop/hubspot-api-python
117
20770
<filename>hubspot/discovery/crm/extensions/videoconferencing/discovery.py import hubspot.crm.extensions.videoconferencing as api_client from ....discovery_base import DiscoveryBase class Discovery(DiscoveryBase): @property def settings_api(self) -> api_client.SettingsApi: return self._configure_api_cl...
1.742188
2
train_margin.py
youmingdeng/DMLPlayground
1
20771
<reponame>youmingdeng/DMLPlayground from __future__ import division import logging import mxnet as mx import numpy as np from mxnet import autograd as ag, nd from mxnet import gluon from tqdm import tqdm from common.evaluate import evaluate from common.parser import TrainingParser from common.utils import average_re...
1.992188
2
doc/tools/doc_merge.py
N0hbdy/godot
39
20772
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import xml.etree.ElementTree as ET tree = ET.parse(sys.argv[1]) old_doc = tree.getroot() tree = ET.parse(sys.argv[2]) new_doc = tree.getroot() f = file(sys.argv[3], "wb") tab = 0 old_classes = {} def write_string(_f, text, newline=True): for t in rang...
2.734375
3
contentcuration/contentcuration/migrations/0059_merge.py
Tlazypanda/studio
1
20773
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-03-29 19:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('contentcuration', '0058_auto_20170223_1636'), ('contentcuration', '0057_assessmentitem_delete...
1.351563
1
controller/ORCA_CLEAN/execute.py
nestorcalvo/Backend-AudioClean
0
20774
from predict import predict if __name__ == "__main__": # predict() print("A ")
1.132813
1
fperms_iscore/main.py
druids/django-fperms-iscore
1
20775
<reponame>druids/django-fperms-iscore<filename>fperms_iscore/main.py<gh_stars>1-10 from is_core.main import DjangoUiRestCore from fperms_iscore.mixins import PermCoreMixin class PermDjangoUiRestCore(PermCoreMixin, DjangoUiRestCore): abstract = True
1.390625
1
distanceCalc.py
jmoehler/CityDistance
0
20776
<reponame>jmoehler/CityDistance from math import cos, acos, pi, sqrt, sin class City: def __init__(self, name, lat, lon, temp): self.name = name self.lat = lat self.lon = lon self.temp = temp def describe(self): print("Die Koordinaten von %s sind %f Lat und %f Lon. Die T...
3.6875
4
zoo/auditing/apps.py
uliana291/the-zoo
90
20777
<filename>zoo/auditing/apps.py from django.apps import AppConfig class AuditingConfig(AppConfig): name = "zoo.auditing"
1.351563
1
graviteeio_cli/commands/apim/apis/definition.py
Shaker5191/graviteeio-cli
0
20778
import click from .definition_group.apply import apply from .definition_group.diff import diff from .definition_group.generate import generate from .definition_group.create import create # from .definition_group.lint import lint @click.group(short_help="Manage API definition configuration") @click.pass_context def d...
1.804688
2
src/examples/colors.py
schneiderfelipe/kay
14
20779
<gh_stars>10-100 """An example of using colors module.""" import asyncio from typing import Text import cuia class ColorfulExample(cuia.Store): """A store class that shows how to use colors.""" def __str__(self) -> Text: """Show me some colors.""" res = "Colors (backgrounds):\n\n" r...
3.4375
3
app/voxity/channel.py
voxity/vox-ui-api
0
20780
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals from flask import current_app from . import connectors, check_respons, pager_dict from .objects.channel import Channel def get_base_url(): return current_app.config['BASE_URL'] + '/channels/' def create(exten):...
2.203125
2
chapter 2 - linked list/2.7.py
anuraagdjain/cracking_the_coding_interview
0
20781
from linkedlist import LinkedList from node import Node class IRes: def __init__(self, result, node): self.result = result self.node = node def print_nodes(n): while(n != None): print(n.data) n = n.next def tail_and_size(n): ctr = 0 while n.next: ctr += 1 ...
3.890625
4
app_core/api/comments.py
Great-Li-Xin/LiCMS
9
20782
from flask import jsonify, request, g, url_for, current_app from app_core import db from app_core.api import api from app_core.api.decorators import permission_required from app_core.models import Post, Permission, Comment @api.route('/comments/') def get_comments(): page = request.args.get('page', 1, type=int) ...
2.515625
3
ipyhop/state.py
YashBansod/IPyHOP
0
20783
#!/usr/bin/env python """ File Description: File used for definition of State Class. """ # ****************************************** Libraries to be imported ****************************************** # from copy import deepcopy # ****************************************** Class Declaration Start *****...
3.578125
4
ckanext/scheming/logic.py
vrk-kpa/ckanext-scheming
0
20784
from ckantoolkit import get_or_bust, side_effect_free, ObjectNotFound from ckanext.scheming.helpers import ( scheming_dataset_schemas, scheming_get_dataset_schema, scheming_group_schemas, scheming_get_group_schema, scheming_organization_schemas, scheming_get_organization_schema, ) @side_effect_free d...
1.984375
2
omnithinker/api/nytimes.py
stuycs-softdev-fall-2013/proj2-pd6-04-omnithinker
1
20785
#!/usr/bin/python import json from urllib import urlopen # http://api.nytimes.com/svc/search/v2/articlesearch.json?fq=Obama&FACET_FIELD=day_of_week&BEGIN_DATE=19000101 # &API-KEY=<KEY> # The original link is above. What happens is because we don't specify an end date, the panda article, which was # coincidentally publ...
3.046875
3
tests/test_pydantic_integration.py
bsnacks000/yearmonth
0
20786
<gh_stars>0 from typing import List from yearmonth.yearmonth import YearMonth import pydantic class MyModel(pydantic.BaseModel): ym: YearMonth def test_pydantic_validators(): MyModel(ym=(2021, 1)) MyModel(ym='2021-01') MyModel(ym=('2021', '01')) def test_pydantic_schema(): schema = MyMod...
2.84375
3
C_D_Playlist.py
fairoz-ahmed/Casper_Player
0
20787
<gh_stars>0 import tkinter.messagebox from tkinter import * from tkinter import ttk from tkinter import filedialog import threading from pygame import mixer from mutagen.mp3 import MP3 import os import easygui import time import playlist_window as pw import Main as main #from PIL import ImageTk,Image def...
1.890625
2
docker-image/render-template.py
osism/generics
0
20788
import os import sys import jinja2 import yaml with open(".information.yml") as fp: information = yaml.safe_load(fp) loader = jinja2.FileSystemLoader(searchpath="") environment = jinja2.Environment(loader=loader, keep_trailing_newline=True) template = environment.get_template(sys.argv[1]) result = template.rend...
2.453125
2
test/__init__.py
stungkit/tfidf_matcher
13
20789
<gh_stars>10-100 # AUTHOR: <NAME> # DESCRIPTION: Init for Tests.
0.878906
1
isitek.py
will-bainbridge/ISITEK
3
20790
<reponame>will-bainbridge/ISITEK #!/usr/bin/python ################################################################################ import numpy import os import cPickle as pickle import scipy.misc import scipy.sparse import scipy.sparse.linalg import scipy.special import sys import time class Struct: def __init__(...
2.40625
2
holobot/framework/kernel.py
rexor12/holobot
1
20791
<filename>holobot/framework/kernel.py from holobot.framework.lifecycle import LifecycleManagerInterface from holobot.sdk import KernelInterface from holobot.sdk.database import DatabaseManagerInterface from holobot.sdk.integration import IntegrationInterface from holobot.sdk.ioc.decorators import injectable from holobo...
2
2
tests/snmp/test_base.py
zohassadar/netdisc
0
20792
<filename>tests/snmp/test_base.py from netdisc.snmp import snmpbase
0.972656
1
venv/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_svm.py
haind27/test01
37
20793
<gh_stars>10-100 #!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status':...
1.859375
2
prompts/wizard_of_wikipedia.py
andreamad8/FSB
53
20794
<gh_stars>10-100 def convert_sample_to_shot_wow(sample, with_knowledge=True): prefix = "Dialogue:\n" assert len(sample["dialogue"]) == len(sample["meta"]) for turn, meta in zip(sample["dialogue"],sample["meta"]): prefix += f"User: {turn[0]}" +"\n" if with_knowledge: if len(meta)>...
2.453125
2
server/apps/api/notice/migrations/0003_alter_event_priority.py
NikitaGrishchenko/csp-tender-hack-server
0
20795
# Generated by Django 3.2.9 on 2021-11-27 12:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('notice', '0002_auto_20211127_0236'), ] operations = [ migrations.AlterField( model_name='event', name='priority', ...
1.53125
2
gdpr_assist/app_settings.py
mserrano07/django-gdpr-assist
0
20796
<filename>gdpr_assist/app_settings.py """ Settings """ from yaa_settings import AppSettings class PrivacySettings(AppSettings): # Name of the model attribute for a privacy definition GDPR_PRIVACY_CLASS_NAME = "PrivacyMeta" # Name of the model attribute for the privacy definition instance GDPR_PRIVACY...
1.867188
2
config-tests/test_server_details.py
mozilla-services/kinto-integration-tests
2
20797
<reponame>mozilla-services/kinto-integration-tests import pytest import requests def aslist_cronly(value): """ Split the input on lines if it's a valid string type""" if isinstance(value, str): value = filter(None, [x.strip() for x in value.splitlines()]) return list(value) def aslist(value, fla...
2.25
2
tests/db/test_factory.py
albertteoh/data_pipeline
0
20798
<reponame>albertteoh/data_pipeline<gh_stars>0 import pytest import data_pipeline.db.factory as dbfactory import data_pipeline.constants.const as const from data_pipeline.db.exceptions import UnsupportedDbTypeError @pytest.mark.parametrize("dbtype, expect_class", [ (const.ORACLE, "OracleDb"), (const.MSSQL, "Mss...
2.328125
2
etl/data_extraction/scrapers/sozialeinsatz.py
Betadinho/einander-helfen
7
20799
import math import re from data_extraction.scraper import Scraper class SozialeinsatzScraper(Scraper): """Scrapes the website www.sozialeinsatz.de.""" base_url = 'https://www.sozialeinsatz.de' debug = True def parse(self, response, url): """Handles the soupified response of a detail page in...
3.25
3