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
Misc/CZip/dictzip.py
linxiaohui/CodeRepoPy
0
12763951
<filename>Misc/CZip/dictzip.py # -*- coding:UTF-8 -*- ''' C 2009 ''' """ Functions that provide transparent read-only access to dictzipped files """ import struct, sys import zlib import __builtin__ FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16 READ, WRITE = 1, 2 def write32(output, value)...
2.75
3
boards/Pynq-Z1/mqttsn/mqttsn.py
stephenneuendorffer/PYNQ-Networking
40
12763952
# Copyright (c) 2017, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
1.125
1
venv/Lib/site-packages/pandas/tests/extension/arrow/test_string.py
OliviaNabbosa89/Disaster_Responses
1
12763953
import pytest import pandas as pd pytest.importorskip("pyarrow", minversion="0.13.0") from .arrays import ArrowStringDtype # isort:skip def test_constructor_from_list(): # GH 27673 result = pd.Series(["E"], dtype=ArrowStringDtype()) assert isinstance(result.dtype, ArrowStringDtype)
2.34375
2
Plotjuros.py
Prosantosgui/plotJuros
0
12763954
import matplotlib.pyplot as plt montante_inicial = float(input('Montante inicial igual a: ')) rendimento_periodo = float(input('Rendimento por período igual a(%): ')) valor_aporte = float(input('Valor do aporte igual a: ')) total_periodos = int(input('Total de períodos: ')) def calcular_juros_compostos(montante_...
3.546875
4
demo_cumtd_gmaps/py/compute.py
intrepiduiuc/cs-205
0
12763955
<reponame>intrepiduiuc/cs-205 # Import the libraries we will use in this file import urllib.request import urllib.parse import json import datetime
1.507813
2
bytejection/core.py
NaleRaphael/bytejection
0
12763956
import dis import re import sys from types import CodeType, FunctionType, ModuleType __all__ = [ 'update_function', 'COManipulator', 'inject_function' ] i2b = lambda x: x.to_bytes(1, byteorder=sys.byteorder) b2i = lambda x: int.from_bytes(x, byteorder=sys.byteorder) OPMAP = dis.opmap IOPMAP = {v: k for k, v ...
1.984375
2
conanfile.py
fogo/conan-opus
0
12763957
# -*- coding: utf-8 -*- from __future__ import print_function from conans import AutoToolsBuildEnvironment, ConanFile, tools, VisualStudioBuildEnvironment from conans.util import files import os class OpusConan(ConanFile): name = "opus" version = "1.2.1" ZIP_FOLDER_NAME = "opus-{}".format(version) gen...
1.835938
2
tools/db_cli.py
fabric-testbed/ControlFramework
0
12763958
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2020 FABRIC Testbed # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to ...
1.757813
2
meal_planner/logging_configs/local.py
darth-dodo/meal-helper
2
12763959
import logging.config import os from django.utils.log import DEFAULT_LOGGING def local_logging_config(**options): log_root = options.get('LOG_ROOT') log_level = options.get('LOG_LEVEL') file_log_level = options.get('FILE_LOG_LEVEL') sentry_log_level = options.get('SENTRY_LOG_LEVEL') return loggi...
1.914063
2
src/articles/migrations/0006_auto_20210426_1356.py
NotSirius-A/School-website
1
12763960
<filename>src/articles/migrations/0006_auto_20210426_1356.py<gh_stars>1-10 # Generated by Django 3.1.7 on 2021-04-26 11:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('articles', '0005_auto_20210423_1603'), ] operations = [ migration...
1.703125
2
barcodes/dxfwrite/dxfwrite/base.py
sbarton272/AcousticBarcodes-Explorations
0
12763961
#!/usr/bin/env python #coding:utf-8 # Purpose: base types # module belongs to package dxfwrite # Created: 09.02.2010 # Copyright (C) 2010, <NAME> # License: MIT License __author__ = "mozman <<EMAIL>>" from dxfwrite.util import izip, PYTHON3, to_string, is_string, iterflatlist if PYTHON3: xrange = range from dxfw...
2.5
2
pymicropel/helper/__init__.py
vkorecky/pymicropel
0
12763962
"""Helper classes."""
1.15625
1
kit_tree_test.py
obedtandadjaja/dynamic_testing
0
12763963
import unittest import json from kit_test_helper import TestHelper from bit_extension import BitExtension # selenium stuff from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ...
2.328125
2
test/test_score.py
tinylinux/m1platformer
9
12763964
# Roll 'n' Jump # Written in 2020, 2021 by <NAME>, <NAME>, # <NAME>, <NAME> # To the extent possible under law, the author(s) have dedicated all # copyright and related and neighboring rights to this software to the # public domain worldwide. This software is distributed without any warranty. # You should have received...
2.671875
3
main.py
nikitt-code/py-auth-encrypt
0
12763965
<reponame>nikitt-code/py-auth-encrypt<filename>main.py import PACrypt pac = PACrypt.Init() print(pac.password("<PASSWORD>", 5)) # 444157154256036112436072587541693624076755672895177551428225360594572972299194330109409163709150304140202440078016 print(pac.phone(77778187276)) # 4319497528477571353237713124486853003085...
2.015625
2
download_harbor.py
akshatvg/roadgain
1
12763966
<reponame>akshatvg/roadgain import osmnx as ox import folium import pickle G = ox.graph_from_address('Inner Harbor, Baltimore, Maryland, USA', network_type='drive') pickle.dump(G, open('harbor.pkl', 'wb')) graph_map = ox.plot_graph_folium(G, popup_attribute='name', edge_width=2) graph_map.save('harbor.html')
2.3125
2
tests/utilities/test_sha3.py
Arachnid/web3.py
4
12763967
<gh_stars>1-10 from __future__ import unicode_literals import pytest @pytest.mark.parametrize( 'value,expected,encoding', ( ( '', '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', None, ), ( 'test123', '0x...
2.046875
2
venvBlog/Lib/site-packages/enchant/__init__.py
msidargo/msidargo_blog
0
12763968
# pyenchant # # Copyright (C) 2004-2011, <NAME> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libr...
2.046875
2
ssk/helpers/__init__.py
jobliz/solid-state-kinetics
2
12763969
from api import * from excel import *
1.015625
1
base_automation/sql_capabilities/my_sql_server.py
Yossira/base-automation
0
12763970
<gh_stars>0 import mysql.connector from base_automation import report class MySqlServer: @report.utils.step("initiate my sql_capabilities server connection") def __init__(self, user='root', password='password', host='127.0.0.1', database='sys'): self._connection = mysql.connector.connect(user=user, p...
2.46875
2
maza/modules/generic/bluetooth/btle_write.py
ArturSpirin/maza
2
12763971
from maza.core.exploit import * from maza.core.bluetooth.btle_client import BTLEClient class Exploit(BTLEClient): __info__ = { "name": "Bluetooth LE Write", "description": "Writes data to target Bluetooth Low Energy device to given " "characteristic.", "authors": ( ...
2.84375
3
dword/utils.py
deepword18/dword
3
12763972
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_utils.ipynb (unless otherwise specified). __all__ = ['to_hhmmss', 'to_secs', 'display_video', 'check_resolution', 'check_fps', 'play_audio', 'change_audio_format', 'trim_audio', 'change_volume', 'loop_audio', 'concat_audios'] # Internal Cell from collections i...
1.773438
2
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/DefectReporterCommon/jira_integration.py
CJoriginal/cjlumberyard
2
12763973
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
1.804688
2
remotelogin/devices/base_db_named.py
filintod/pyremotelogin
1
12763974
from remotelogin.devices.base import DeviceWithEncryptionSettings from fdutils import db class TableNamedDevice(DeviceWithEncryptionSettings, db.DeclarativeBaseWithTableName): __abstract__ = True
1.671875
2
python/experiment.py
caus-am/sigmasep
8
12763975
# Copyright (c) 2018 <NAME>, <NAME> # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import mSCM import sys import numpy as np from numpy.random import choice from numpy.random import seed import random nbr = int(sys.argv[1]) random.seed(nbr...
2.09375
2
pinakes/main/migrations/0020_auto_20211208_2019.py
hsong-rh/pinakes
0
12763976
<gh_stars>0 # Generated by Django 3.2.8 on 2021-12-08 20:19 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("main", "0019...
1.65625
2
smtk/model/testing/python/modelAttributes.py
jcfr/SMTK
40
12763977
<reponame>jcfr/SMTK # ============================================================================= # # Copyright (c) Kitware, Inc. # All rights reserved. # See LICENSE.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PA...
1.976563
2
Swish_Function.py
Ali-Sahili/Background-Subtraction-Unsupervised-Learning
5
12763978
import torch import torch.nn as nn class Swish(nn.Module): def __init__(self): super().__init__() def forward(self, x): return x * torch.sigmoid(x) """ class Swish(nn.Module): def forward(self, input): return (input * torch.sigmoid(input)) def __repr__(self): return self._...
2.96875
3
bot/cogs/socket_comm.py
fwizpy/Tortoise-BOT
64
12763979
import os import json import socket import logging import asyncio from typing import List from discord import Forbidden from discord.ext import commands from bot import constants from bot.utils.embed_handler import info, thumbnail, success from bot.utils.members import get_member_activity, get_member_status from bot....
2.390625
2
read.py
SnailPJW/pyEcg
1
12763980
# 引入 sqlite 套件 import sqlite3 import numpy as np import matplotlib.pyplot as plt # %matplotlib inline #定義資料庫位置 conn = sqlite3.connect('database.db') db_connection = conn.cursor() List_Ecg_Signal = [] ## 空列表 #t查詢數據 rows = db_connection.execute("SELECT serialno,time,length,date,ecg,qrs,beat,feature,measuremen...
3.078125
3
tests/integration/cryptonia/test_cryptonia_main.py
magnublo/msc-darkweb-scraping
0
12763981
<reponame>magnublo/msc-darkweb-scraping from unittest import TestCase, skip from unittest.mock import patch, Mock import src.main from definitions import ROOT_DIR from tests.integration.mocks.mocked_dynamic_config import MOCKED_WEBSITES_TO_BE_SCRAPED_CRYPTONIA, \ mocked_get_logger_config from tests.integration.moc...
2.265625
2
services/activities/update/send_update_servicer.py
CPSSD/rabble
3
12763982
<filename>services/activities/update/send_update_servicer.py import os import sys from services.proto import database_pb2 as dbpb from services.proto import update_pb2 as upb from utils.articles import get_article, convert_to_tags_string, md_to_html HOSTNAME_ENV = 'HOST_NAME' class SendUpdateServicer: def __ini...
2.34375
2
soulsgym/core/memory_manipulator.py
amacati/SoulsGym
0
12763983
<reponame>amacati/SoulsGym """The ``memory_manipulator`` module is a wrapper around ``pymem`` for memory read and write access. It implements some of the basic CheatEngine functionalities in Python. The game is controlled by changing the values of ingame properties in the process memory. We cannot write to static memo...
2.921875
3
Lib/test/test_code.py
sireliah/polish-python
1
12763984
"""This module includes tests of the code object representation. >>> def f(x): ... def g(y): ... zwróć x + y ... zwróć g ... >>> dump(f.__code__) name: f argcount: 1 kwonlyargcount: 0 names: () varnames: ('x', 'g') cellvars: ('x',) freevars: () nlocals: 2 flags: 3 consts: ('Nic', '<code object g>', "'...
2.890625
3
threedod/benchmark_scripts/utils/tenFpsDataLoader.py
Levintsky/ARKitScenes
237
12763985
import copy import cv2 import glob import json import numpy as np import os from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size from .rotation import convert_angle_axis_to_matrix3 from .taxonomy import class_names, ARKitDatasetConfig def TrajStringToMatrix(traj_str): """ convert traj_str into tr...
2.90625
3
sync/local/apps/src/cockpit.py
TrueDoctor/sdn-cockpit
21
12763986
# Basic imports for Ryu from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls import ryu.ofproto.ofproto_v1_3_parser as parser import ryu.ofproto.ofproto_v1_3 as ofproto from ryu.lib.packe...
2.34375
2
{{cookiecutter.project_name}}/apps/users/filters.py
letusgoing/cookiecutter-django-drf
0
12763987
#!/usr/bin/env python # coding:utf-8 """ @Time : 2021/10/15 17:29 @Author : harvey @File : filters.py @Software: PyCharm @Desc: @Module """ import uuid import datetime from django.contrib.auth.models import AbstractUser from django.conf import settings from django.db import models from django.utils import timezone...
2.15625
2
simim/visuals.py
nismod/sim
7
12763988
<gh_stars>1-10 """ visuals.py """ import numpy as np from geopandas.plotting import plot_polygon_collection import matplotlib.pyplot as plt # https://matplotlib.org/examples/color/colormaps_reference.html class Visual: def __init__(self, rows, cols, panel_x=5, panel_y=5): self.rows = rows self.cols = cols ...
2.828125
3
Aula55_0403_TDD/par/calcula_se_um_numero_eh_par.py
Renanrbsc/PadawanPython
0
12763989
<gh_stars>0 def calcula_se_um_numero_eh_par(numero): if type(numero) == int: if numero % 2 == 0: return True return False
2.828125
3
huaweicloud-sdk-kms/huaweicloudsdkkms/v1/kms_client.py
Adek06/huaweicloud-sdk-python-v3
0
12763990
# coding: utf-8 from __future__ import absolute_import import datetime import re import importlib import six from huaweicloudsdkcore.client import Client, ClientBuilder from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcore.utils import http_utils from huaweicloudsdkcore.sdk_stream_request imp...
2.15625
2
aiostomp/errors.py
gajdy/aiostomp
0
12763991
<gh_stars>0 class StompError(Exception): def __init__(self, message, detail): super(StompError, self).__init__(message) self.detail = detail class StompDisconnectedError(Exception): pass class ExceededRetryCount(Exception): pass
2.390625
2
test/http_client.py
kenshinx/rps
6
12763992
<filename>test/http_client.py<gh_stars>1-10 #! /usr/bin/env python import re import socket import optparse HTTP_PROXY_HOST = "dev1" HTTP_PROXY_PORT = 8889 HTTP_PROXY_HOST = "localhost" HTTP_PROXY_PORT = 9891 HTTP_PROXY_UNAME = "rps" HTTP_PROXY_PASSWD = "<PASSWORD>" class HTTPTunnelPorxy(object): pattern = re.c...
2.953125
3
scripts/2013/clock-convert.py
iBurnApp/iBurn-Data
7
12763993
<filename>scripts/2013/clock-convert.py import json import math earthRadius = 20890700.0 class clockCoordinate: def __init__(self,hour,minute,distance): self.hour=int(hour or 0) self.minute=int(minute or 0) self.distance=float(distance or 0) class geoCoordinate: def __init__(self,lat,lon): self.lat = floa...
3.421875
3
regionator/parse_object_db.py
lubber-de/neohabitat
181
12763994
''' Parse the MC_object database from the Habitat Stratus backup. There are still lots of unknowns: * Many objects have container 0x20202020. They appear to be unused, but it's unclear why. * Some address strings have unprintable characters. It's unclear if this was intentional or garbage data. * Matchbook (class...
2.25
2
ax/wrapper/opencv.py
axxiao/toby
0
12763995
<gh_stars>0 """ The Camera caputre images __author__ = "<NAME> <http://www.alexxiao.me/>" __date__ = "2018-04-07" __version__ = "0.1" Version: 0.1 (07/04/2017): implemented basic version Classes: Camera - the main class """ import cv2 import time from threading import Thread from ax.log import get_l...
2.765625
3
eyesore/symbolic_tracer.py
twizmwazin/hacrs
2
12763996
<gh_stars>1-10 import json import os import select import sys import time from collections import defaultdict import angr import claripy import gc import ipdb import psutil import simuvex from simuvex.procedures.cgc.receive import receive from input_characteristics import extract_input_characteristics from json_helpe...
1.726563
2
for.py
praveenpmin/Python
0
12763997
<gh_stars>0 s = "Hello World" for i in s : print (i)
2.25
2
client/python/lib/tests/tfs_compat_grpc/config.py
BrightTux/model_server
0
12763998
# # Copyright (c) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
1.757813
2
hassio-google-drive-backup/dev/base_server.py
voxipbx/hassio-addons
1
12763999
<reponame>voxipbx/hassio-addons import random import re import io from aiohttp.web import HTTPBadRequest, Request, Response from typing import Any rangePattern = re.compile("bytes=\\d+-\\d+") bytesPattern = re.compile("^bytes \\d+-\\d+/\\d+$") intPattern = re.compile("\\d+") class BaseServer: def generateId(self...
2.515625
3
uberAPI/uberpricing.py
Pkrish15/Uber-Surge
0
12764000
from uber_rides.session import Session from uber_rides.client import UberRidesClient #Add the token session = Session(server_token='') def getPriceEstimate(start_lat,start_long,end_lat,end_long): client = UberRidesClient(session) p=client.get_price_estimates(start_lat,start_long,end_lat,end_long) key=str(start_l...
2.71875
3
data-generator/json-app/load-data.py
kramik1/elk-docker-compose
2
12764001
import json import logging import random import time import configparser import logging.handlers from datetime import datetime, timezone sample_data = { "timestamp": "", # ISO Zulu date format "equip_name": "X-Machine", "feed_rate": 0.0, "shaft_speed": 0, "oil_temperature": 0.0, "voltage": 0 } ...
2.84375
3
pywindow/utilities.py
ImperialCollegeLondon/pyWINDOW
12
12764002
""" Module containing all general purpose functions shared by other modules. This module is not intended for the direct use by a User. Therefore, I will only docstring functions if I see fit to do so. LOG --- 11/07/18 Changed the way vector path is analysed. Now, the initial analysis is done with the geometri...
1.976563
2
Algorithms/Graph/Python/KrustalAlgorithm.py
nipun2000/algorithms-in-C-Cplusplus-Java-Python-JavaScript
30
12764003
"""Krustal's algorithm for MST: KRUSKAL(G): 1 A = ∅ 2 foreach v ∈ G.V: 3 MAKE-SET(v) 4 foreach (u, v) in G.E ordered by weight(u, v), increasing: 5 if FIND-SET(u) ≠ FIND-SET(v): 6 A = A ∪ {(u, v)} 7 UNION(u, v) 8 return A """ from collections import defaultdict class Graph: def __init__(sel...
3.515625
4
setup.py
Giphy/crowdflower
0
12764004
<filename>setup.py import codecs from setuptools import setup, find_packages with codecs.open('README.rst', encoding='utf-8-sig') as f: LONG_DESCRIPTION = f.read() setup( name='crowdflower', version='0.0.5', author='<NAME>', author_email='<EMAIL>', url='https://github.com/chbrown/crowdflow...
1.320313
1
refer360annotation/.TRASH/0004_auto_20190305_1545.py
volkancirik/refer360_backend
0
12764005
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2019-03-05 15:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0003_merge_20190305_1545'), ] operations = [ migrations.AlterFie...
1.5
2
ngraph/transformers/hetr/rpc_client.py
NervanaSystems/ngraph-python
18
12764006
import grpc from six import iteritems from . import hetr_pb2 from . import hetr_pb2_grpc from ngraph.op_graph.serde.serde import op_to_protobuf, tensor_to_protobuf,\ pb_to_tensor, is_scalar_type, assign_scalar, protobuf_scalar_to_python import logging _TIMEOUT_SECONDS = 600 logger = logging.getLogger(__name__) ...
2
2
src/recursion/binode.py
seahrh/coding-interview
0
12764007
<gh_stars>0 """ BiNode: Consider a simple data structure called BiNode, which has pointers to two other nodes. The data structure BiNode could be used to represent both a binary tree (where nodel is the left node and node2 is the right node) or a doubly linked list (where nodel is the previous node and node2 is the...
4.125
4
democratic.py
rihp/boteki
1
12764008
def count_votes(reactions): """ takes in a string with reactions from discord parses it and return a tuple of the toal votes on each alternative """ positive_vote = "👍" negative_vote = "👎" alternatives = [positive_vote, negative_vote] results={} for a in alternatives: posi...
3.703125
4
src/neon/frontend/callbacks.py
MUTTERSCHIFF/ngraph-neon
13
12764009
<reponame>MUTTERSCHIFF/ngraph-neon<filename>src/neon/frontend/callbacks.py # ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
1.960938
2
FWCore/GuiBrowsers/python/Vispa/Share/ParticleDataAccessor.py
NTrevisani/cmssw
3
12764010
class ParticleDataAccessor(object): """ This class provides access to the underlying data model. """ LINE_STYLE_SOLID = 0 LINE_STYLE_DASH = 1 LINE_STYLE_WAVE = 2 LINE_STYLE_SPIRAL = 3 LINE_VERTEX = 4 def id(self, object): """ Returns an id to identify given object. ...
3.203125
3
nicos_ess/estia/setups/special/collector.py
jkrueger1/nicos
0
12764011
<gh_stars>0 description = 'setup for the NICOS collector' group = 'special' devices = dict( CacheKafka=device( 'nicos_ess.devices.cache_kafka_forwarder.CacheKafkaForwarder', dev_ignore=['space', 'sample'], brokers=configdata('config.KAFKA_BROKERS'), output_topic="nicos_cache", ...
1.414063
1
raysect/core/math/tests/test_random.py
vsnever/raysect-source
2
12764012
<reponame>vsnever/raysect-source<gh_stars>1-10 # Copyright (c) 2014-2020, Dr <NAME>, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must ...
1.03125
1
setup.py
gelo-zhukov/yandex-maps
0
12764013
<reponame>gelo-zhukov/yandex-maps #!/usr/bin/env python from distutils.core import setup version='0.7' setup( name = 'yandex-maps', version = version, author = '<NAME>', author_email = '<EMAIL>', url = 'https://bitbucket.org/kmike/yandex-maps/', description = 'Yandex.Maps API python wrapper w...
1.1875
1
ast/test_NodeVisitor.py
MaxTurchin/pycopy-lib
126
12764014
import sys import ast import io class Visitor(ast.NodeVisitor): def __init__(self, f): self.f = f def generic_visit(self, node): self.f.write(ast.dump(node)) self.f.write("\n") super().generic_visit(node) def visit_Assign(self, node): for n in node.targets: ...
2.671875
3
parameters.py
Abhishek-Aditya-bs/Anime-Face-Generation-Pytorch
0
12764015
<reponame>Abhishek-Aditya-bs/Anime-Face-Generation-Pytorch<filename>parameters.py<gh_stars>0 from utils import get_default_device lr = 0.0002 epochs = 25 image_size = 64 batch_size = 128 latent_size = 128 stats = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5) DATA_DIR = './animefacedataset' sample_dir = 'generated' device = get_def...
1.453125
1
Easy/check_if_all_1s_are_at_least_k_length_places_apart.py
BrynjarGeir/LeetCode
0
12764016
class Solution: def kLengthApart(self, nums: List[int], k: int) -> bool: if 1 not in nums: return True start, end = nums.index(1), nums.index(1)+1 while end < len(nums): if nums[start] == 1 and nums[end] == 1 and end - start <= k: return False elif num...
3.234375
3
src/lib/SocketServer.py
DTenore/skulpt
2,671
12764017
import _sk_fail; _sk_fail._("SocketServer")
1.117188
1
apns_python/notification.py
mr-ping/apns-python
4
12764018
""" This module contains all notification payload objects.""" class BaseMsg(dict): """The BaseClass of all objects in notification payload.""" apns_keys = [] def __init__(self, custom_fields={}, **apn_args): super(BaseMsg, self).__init__(custom_fields, **apn_args) if custom_fields: ...
2.53125
3
da/sim.py
edgarsit/distalgo
76
12764019
<reponame>edgarsit/distalgo # Copyright (c) 2010-2017 <NAME> # Copyright (c) 2010-2017 <NAME> # Copyright (c) 2010-2017 Stony Brook University # Copyright (c) 2010-2017 The Research Foundation of SUNY # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated docu...
1.53125
2
Module-02-Comprehensions/01_list_comprehensions_01.py
CodingGearsCourses/Python-Advanced-Concepts
0
12764020
<filename>Module-02-Comprehensions/01_list_comprehensions_01.py # Copyright https://www.globaletraining.com/ # List comprehensions provide a concise way to create lists. my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def main(): final_list = [] for n in my_list: final_list.append(n + 10) print(final_...
4.1875
4
ggb/utils/image.py
reshalfahsi/GGB
1
12764021
<filename>ggb/utils/image.py from ggb.utils.constant import ColorSpace, CVLib from ggb.utils.error import ComputerVisionLibraryError import numpy as np class GGBImage(object): """Image handler for GGB. :param image: image source either from path or variable :param backend: computer vision library which ...
3.015625
3
train_beam_search.py
kasnerz/neuralmonkey-ctc-decoder
0
12764022
#!/usr/bin/env python3 from typing import List import numpy as np import copy import pprint as pp from scipy.misc import logsumexp from scipy.stats import beta from neuralmonkey.vocabulary import Vocabulary from n_gram_model import NGramModel from hypothesis import Hypothesis, ExpandFunction from beam_search import...
2.25
2
architectures/abel_tune_svm_with_embeddings.py
jimmycallin/master-thesis
2
12764023
<reponame>jimmycallin/master-thesis<filename>architectures/abel_tune_svm_with_embeddings.py<gh_stars>1-10 from subprocess import call from word_embedding_paths import word_embeddings from os.path import exists from os import mkdir for c in [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]: name = "svmrbf-c" + str(c...
2
2
VRP_final.py
Jayanth07/Vehicle-Routing-Problem
0
12764024
from __future__ import print_function from six.moves import xrange from ortools.constraint_solver import pywrapcp from ortools.constraint_solver import routing_enums_pb2 import googlemaps gmaps = googlemaps.Client(key='******API_Key******') # Replace with the Google Distance Matrix API Key... class DataProbl...
2.953125
3
data/urls.py
tblxdezhu/STP
0
12764025
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/10/18 1:13 PM # @Author : <NAME> # @File : urls.py # @Software: Pycharm professional from django.conf.urls import include, url from data import views urlpatterns = [ url(r'^large$', views.large_data), url(r'^mini$', views.mini_data), url(...
1.609375
2
parser_methods.py
splunk-soar-connectors/parser
0
12764026
<reponame>splunk-soar-connectors/parser # File: parser_methods.py # # Copyright (c) 2017-2022 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
1.796875
2
tests/commands/test_sorted_set.py
dynalz/coredis
0
12764027
<reponame>dynalz/coredis<gh_stars>0 import pytest from coredis import DataError from coredis.utils import b from tests.conftest import targets @targets("redis_basic", "redis_cluster") @pytest.mark.asyncio() class TestSortedSet: async def test_zadd(self, client): await client.zadd("a{foo}", a1=1, a2=2, a3...
2.234375
2
DAE/print_collada_info.py
fovtran/PyGame_samples
0
12764028
<reponame>fovtran/PyGame_samples<gh_stars>0 #!/usr/bin/env python import collada import numpy import sys def inspectController(controller): """Display contents of a controller object found in the scene.""" print (' Controller (id=%s) (type=%s)' % (controller.skin.id, type(controller).__name__)) print ('...
2.828125
3
DataExploration.py
lingcheng99/Kaggle-what-is-cooking
0
12764029
<reponame>lingcheng99/Kaggle-what-is-cooking #For data exploration, examine most-used ingredients in each cuisine import numpy as np import pandas as pd import matplotlib.pyplot as plt import re from nltk.stem import WordNetLemmatizer wnl=WordNetLemmatizer() train=pd.read_json('train.json') train.columns Out[2]: Inde...
3.375
3
exploratory_data_analysis.py
MananSoni42/fantasy-predictions
0
12764030
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os dir = 'plots' if not os.path.exists(dir): os.mkdir(dir) df = pd.read_csv('final_data/final-data.csv', index_col='player-name') df =df.replace(-1,np.nan) # describe print('--- Description ---') print(df.describe...
2.46875
2
code/examples/scraping_example.py
periode/practical-code-2018
0
12764031
# these three lines tell python that we would like to use these libraries # we've installed these libraries by running `pip install requests` and `pip install beautifulsoup4` in the terminal import requests from bs4 import BeautifulSoup import json # this line uses the request library to get a specific HTML page # in ...
4.0625
4
#1 Mundo/#9/25.py
Henrique-Navarro/phyton
0
12764032
nome= str(input('Digite um nome: ')) print(nome.upper().find('SILVA')) print('seu nome tem silva? {}' .format('silva' in nome.lower()))
4.125
4
controllers/apiv3/api_district_controller.py
enterstudio/the-blue-alliance
0
12764033
import json from google.appengine.ext import ndb from controllers.apiv3.api_base_controller import ApiBaseController from controllers.apiv3.model_properties import filter_event_properties, filter_team_properties from database.district_query import DistrictListQuery from database.event_query import DistrictEventsQuery...
1.984375
2
main.py
ericknudson/som-course-generator
0
12764034
<filename>main.py from flask import Flask, render_template, Response, request, redirect, url_for import numpy as np from numpy import random import csv app = Flask(__name__) #import data nums = [] with open('static/nums.csv') as csv_file: csv_reader = csv.reader(x.replace('\0', '') for x in csv_file) for row ...
3.015625
3
Problems/towersOfHanoi.py
HKuz/Test_Code
1
12764035
<gh_stars>1-10 #!/usr/local/bin/python3 def main(): for i in range(1, 8): print("============================") print("Towers of Hanoi: {} Disks".format(i)) towers_of_hanoi(i) print("Number of moves: {}".format(2**i - 1)) print("============================") return 0 ...
4.0625
4
Ejercicios de guia/ej27.py
FdelMazo/7540rw-Algo1
1
12764036
def domino(): """Imprime todas las fichas de domino""" a = 0 b = 0 for k in range (0,7): a = k for i in range (a, 7): b = i print (a, b)
3.453125
3
dckrclstrpanic/info.py
minskmaz/dckrclstrpanic
0
12764037
<filename>dckrclstrpanic/info.py # -*- coding: utf-8 -*- """PACKAGE INFO This module provides some basic information about the package. """ # Set the package release version version_info = (0, 0, 0) __version__ = '.'.join(str(c) for c in version_info) # Set the package details __author__ = '<NAME>' __email__ = '<E...
1.8125
2
tests/sys/host_sim_test.py
south-coast-science/scs_host_cpc
0
12764038
#!/usr/bin/env python3 """ Created on 24 Mar 2021 @author: <NAME> (<EMAIL>) """ from scs_host.sys.host import Host # -------------------------------------------------------------------------------------------------------------------- sim = Host.sim() print(sim)
1.84375
2
tests/tests.py
belprofbiz/-tapi-yandex-direct
0
12764039
<filename>tests/tests.py<gh_stars>0 # coding: utf-8 import datetime as dt import logging import yaml from tapi_yandex_direct import YandexDirect, GetTokenYandexDirect logging.basicConfig(level=logging.DEBUG) with open("../config.yml", "r") as stream: data_loaded = yaml.safe_load(stream) ACCESS_TOKEN = data_loa...
2.203125
2
MultipleGUIs.py
dpetrovykh/FIAR
0
12764040
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 16 13:18:29 2021 @author: dpetrovykh """ from PyQt5 import QtCore, QtWidgets, QtWidgets class MainWindow(QtWidgets.QMainWindow): def __init__(self, parent=None): # Run Initialization of parent class super(MainWindow, self).__in...
2.9375
3
automod/plugins/AutomodPlugin.py
Salvi0/AutoMod
3
12764041
<gh_stars>1-10 from typing import Union import discord from discord.ext import commands import re from .PluginBlueprint import PluginBlueprint from .Automod.sub.CheckMessage import checkMessage from .Automod.sub.ShouldPerformAutomod import shouldPerformAutomod from .Types import Duration, Embed valid_actions = [ ...
2.1875
2
Instrumentos/Codigos/mining_script/mining_script_issues.py
carlavieira/study-HDI-influence
0
12764042
<reponame>carlavieira/study-HDI-influence import os import json from time import sleep import requests import pandas as pd import random from datetime import datetime from dotenv import load_dotenv from pathlib import Path load_dotenv() def get_project_root() -> Path: return Path(__file__).parent.parent def save...
2.4375
2
example_1/Batuhan/workspace/build/meturone_egitim/cmake/meturone_egitim-genmsg-context.py
tekmen0/ROS-intro
3
12764043
<reponame>tekmen0/ROS-intro # generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/tekmen0/meturone_egitim/src/meturone_egitim/msg/Dummy.msg;/home/tekmen0/meturone_egitim/src/meturone_egitim/msg/answer.msg" services_str = "" pkg_name = "meturone_egitim" dependencies_str = "std_msgs" langs = "gencpp;...
1.351563
1
discord/html/parser.py
FrostiiWeeb/discord.html
2
12764044
<reponame>FrostiiWeeb/discord.html # std libraries import typing import asyncio from enum import Enum from inspect import Parameter, _ParameterKind # third party import discord import tempfile from bs4 import BeautifulSoup from discord.ext import commands from discord.ext.commands.errors import ClientException, Miss...
2.4375
2
tests/data/x-test_pot.py
fKunstner/pytest-optional-tests
1
12764045
import pytest def test_no_mark(): pass @pytest.mark.opt1 def test_opt1(): pass @pytest.mark.opt1 @pytest.mark.opt2 def test_opt12(): pass @pytest.mark.opt2 def test_opt2(): pass @pytest.mark.opt3 def test_opt3(): pass @pytest.mark.other def test_other(): pass
1.578125
2
grab/util/module.py
subeax/grab
0
12764046
<gh_stars>0 """ The source code of `reraise` and `import_string` was copied from https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/utils.py """ import logging import sys from grab.spider.base import Spider from grab.spider.error import SpiderInternalError from grab.util.misc import camel_case_to_underscore fr...
2.03125
2
linear_eval/model.py
DAVEISHAN/TCLR
4
12764047
<gh_stars>1-10 import numpy as np import torch.nn as nn import torch import torchvision from r3d_classifier import r3d_18_classifier # from r2p1d import r2plus1d_18, embedder # from classifier_r2p1d import r2plus1d_18_classifier # # from try1_model import r2plus1d_18_changed # # from dilated_r2plus1d import r2plus1d...
1.976563
2
src/Sastrawi/Stemmer/Filter/TextNormalizer.py
ZenaNugraha/PySastrawi
282
12764048
import re def normalize_text(text): result = text.lower() #lower the text even unicode given result = re.sub(r'[^a-z0-9 -]', ' ', result, flags = re.IGNORECASE|re.MULTILINE) result = re.sub(r'( +)', ' ', result, flags = re.IGNORECASE|re.MULTILINE) return result.strip()
3.6875
4
vis_fit.py
motoHiraga/pyMBEANN
0
12764049
<filename>vis_fit.py ''' Example for visualizing the fitness transition throughout the evolutionary process. ''' import os import pickle import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.colors import Normalize path = os.path.join(os.path.dirname(__file__...
2.875
3
Hand_in_pset1/main_K_smith_bis2.py
SkanderGar/QuantMacro
0
12764050
<reponame>SkanderGar/QuantMacro import numpy as np import os os.chdir('C:/Users/DELL/Desktop/Luis/Pset1') import matplotlib.pyplot as plt import K_smith as ks #####best fit Beta = np.loadtxt('parameter.txt') ks1 = ks.K_S(Guess = Beta, N_k = 100, N_K=40) V_int, gk_int = ks1.Start_VFI() ks2 = ks.K_S(N_k =...
1.953125
2