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
pf_flask/pff_utils.py
problemfighter/pf-flask
5
12766351
import os.path import sys from functools import reduce from os.path import exists from werkzeug.utils import ImportStringError def import_from_string(import_name: str, silent: bool = False): import_name = import_name.replace(":", ".") try: try: __import__(import_name) except Import...
2.21875
2
src/connections/_mqqt.py
Freonius/tranquillity
0
12766352
from .__interface import IConnection class Mqqt(IConnection): pass
1.171875
1
src/vulkan.template.py
realitix/pyVulkan
0
12766353
from cffi import * from pkg_resources import * from collections import Iterable from weakref import * import sys ffi = FFI() _weakkey_dict = WeakKeyDictionary() def _castToPtr2(x, _type): if isinstance(x, ffi.CData): if _type.item==ffi.typeof(x): return ffi.addressof(x) return x if isinstance(x, Iterable): ...
2.015625
2
python/oneflow/test/modules/test_add.py
Zhangchangh/oneflow
0
12766354
<filename>python/oneflow/test/modules/test_add.py """ Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LIC...
2.203125
2
build_logs.py
mayscopeland/open_projections
0
12766355
<filename>build_logs.py import pandas as pd import requests import datetime import calendar from pathlib import Path def main(): build_monthly_gamelogs("2021", "10") combine_gamelogs() #build_yearly_gamelogs("2014") #combine_player_logs(670623) def combine_gamelogs(): filepath = Path(__file__).p...
2.9375
3
compute_ht.py
ddocquier/OSeaIce
0
12766356
<reponame>ddocquier/OSeaIce #!/usr/bin/env python ''' GOAL Compute meridional total heat transport PROGRAMMER <NAME> LAST UPDATE 19/11/2020 ''' # Options exp = 'D023' save_var = True # Standard libraries from netCDF4 import Dataset import numpy as np from scipy import integrate import matplotlib.pyplot a...
2.21875
2
hardhat/recipes/mingw64/mingw64_openblas.py
stangelandcl/hardhat
0
12766357
import os import shutil from sys import platform from .base import Mingw64BaseRecipe from hardhat.urls import Urls from hardhat.util import patch class Mingw64OpenBlasRecipe(Mingw64BaseRecipe): def __init__(self, *args, **kwargs): super(Mingw64OpenBlasRecipe, self).__init__(*args, **kwargs) self.s...
2.03125
2
examples/theorem.py
fractaledmind/pandocfilters
1
12766358
#!/usr/bin/env python """ Pandoc filter to convert divs with class="theorem" to LaTeX theorem environments in LaTeX output, and to numbered theorems in HTML output. """ from pandocfilters import toJSONFilter, RawBlock, Div theoremcount = 0 def latex(x): return RawBlock('latex',x) def html(x): return RawBlock('...
3.203125
3
template/tests/test_calc_mass.py
ajmaurais/peptide_analyzer
0
12766359
<filename>template/tests/test_calc_mass.py import unittest from collections import Counter import load_dat import std_functions from molecular_formula import calc_mass class TestCalcMass(unittest.TestCase): def test_calc_mass(self): for i, row in load_dat.dat_std.iterrows(): self.assertAlmos...
2.46875
2
gan/train.py
TIBHannover/formula_gan
6
12766360
<reponame>TIBHannover/formula_gan import sys import os import re import argparse import logging import torch from pytorch_lightning import Trainer import wap_model import formula_model from config import Config def main(): config = Config() print(config.to_args()) print(vars(config.to_flat_args())) ...
2.34375
2
src/satyrus/types/base.py
pedromxavier/Satyrus3
1
12766361
<filename>src/satyrus/types/base.py """ """ # Future Imports from __future__ import annotations # Local from ..satlib import Source, Posiform from ..symbols import T_NOT, T_AND, T_OR, T_XOR, T_IMP, T_IFF, T_RIMP, T_EQ, T_NE, T_LT, T_LE, T_GT, T_GE, T_IDX, T_ADD, T_SUB, T_DIV, T_MUL, T_NEG class MetaSatType(type): ...
2.28125
2
evaluate.py
wmylxmj/Anime-Super-Resolution
120
12766362
# -*- coding: utf-8 -*- """ Created on Tue Apr 30 21:24:36 2019 @author: wmy """ import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from PIL import Image from keras import backend as K from keras.losses import mean_absolute_error, mean_squared_error from keras.models import load_m...
2.3125
2
Gelatin/compiler/Context.py
Etherbay/Gelatin
107
12766363
<filename>Gelatin/compiler/Context.py # Copyright (c) 2010-2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use,...
2.0625
2
MxForum/tools/dec_test.py
mtianyan/TornadoForum
2
12766364
<reponame>mtianyan/TornadoForum # 装饰器是什么样的 # 装饰器加载过程 import functools import time def time_dec(func): print("dec started") @functools.wraps(func) def wrapper(*args, **kwargs): start_time = time.time() func(*args, **kwargs) end_time = time.time() print("last_time:{}".format...
3.328125
3
examples/test_context.py
stephenpardy/scopr
0
12766365
<reponame>stephenpardy/scopr<filename>examples/test_context.py from scopr import scope a = 1 def test(): return "Hello, World!" with scope(): b = 1 a = 2 def test(): return "Goodbye, World!" print(test()) print("a: {}".format(a)) print(test()) print("b: {}".format(b))
2.890625
3
project1.py
chanseeliu/jupyter-notebook
0
12766366
<filename>project1.py<gh_stars>0 numbers = [1,2,3,4,5,6] bignumbers = [a*1000 for a in numbers] bign=[str(item) for item in bignumbers] print (bignumbers) print bign print "\t".join([str(i) for i in bign]) #m="\t".join([str(i) for i in bign]) #print m #mm=[int(p) for p in bign] #print mm
3.0625
3
satstac/item.py
JamesOConnor/sat-stac
1
12766367
import json import logging import os import traceback from string import Formatter, Template from datetime import datetime from dateutil.parser import parse as dateparse from satstac import __version__, STACError, Thing, utils logger = logging.getLogger(__name__) class Item(Thing): def __init__(self, *args, ...
2.375
2
examples/consts/linewidth.py
strakam/PyEasyGraphics
5
12766368
<filename>examples/consts/linewidth.py from easygraphics import * def main(): init_graph(800, 600) line(50, 50, 400, 400) set_line_width(20) line(50, 400, 400, 50) pause() close_graph() easy_run(main)
2.078125
2
tukiogram/migrations/0005_auto_20170319_2103.py
charitymbaka/samaritan-final
0
12766369
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-19 18:03 from __future__ import unicode_literals import django.contrib.gis.db.models.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tukiogram', '0004_auto_20170316_1435'), ] operat...
1.445313
1
excel_dates/__init__.py
AutoActuary/excel-dates
8
12766370
from .convert import *
1.21875
1
webdev/vendas/migrations/0003_auto_20210530_1548.py
h-zanetti/jewelry-manager
0
12766371
# Generated by Django 3.1.5 on 2021-05-30 18:48 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('financeiro', '0021_auto_20210530_1434'), ('vendas', '0002_auto_20210528_1954'), ] operations = [ mi...
1.265625
1
Ago-Dic-2019/Ricardo_Romero_Medina/Practica1/Practica_4-7.py
Arbupa/DAS_Sistemas
41
12766372
<filename>Ago-Dic-2019/Ricardo_Romero_Medina/Practica1/Practica_4-7.py numbers=list(range(3,31,3)) for i in range(len(numbers)): print(numbers[i])
3.78125
4
research/part04_application_to_rl/e01_learn_xy_representations/_util.py
nmichlo/msc-research
1
12766373
<reponame>nmichlo/msc-research<filename>research/part04_application_to_rl/e01_learn_xy_representations/_util.py # ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2022 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy...
1.59375
2
src/QbiPy/tools/AIF_viewer/AIF_viewer_tool.py
michaelberks/madym_python
0
12766374
<gh_stars>0 ''' GUI tool for inspecting auto-detected AIFs as generated by Madym ''' import sys import os import glob from PyQt5.QtWidgets import QApplication, QPushButton, QAction, QMainWindow, QWidget, QMessageBox, QGraphicsScene, QFileDialog from PyQt5.QtCore import QObject, Qt, pyqtSlot from PyQt5.QtGui import QI...
2.140625
2
client.py
starcreep48/HearthStoneBGLite
2
12766375
import os import sys from time import sleep from colors import WOOD, BLACK, WHITE import pygame from renderer import Renderer from renderer.Renderer import eventManager from events import EventEnums Renderer.initializeRenderer() from gui.button import Button import json import glob replays = glob.glob('replays/*') f ...
2.59375
3
tests/acceptance/scenarios/test_multi_reg_file_CRUD.py
aoxiangflysky/onedata
2
12766376
<gh_stars>1-10 """Test suite for CRUD operations on regular files in onedata, in multi-client environment. """ __author__ = "<NAME>" __copyright__ = "Copyright (C) 2015 ACK CYFRONET AGH" __license__ = "This software is released under the MIT license cited in " \ "LICENSE.txt" from tests.acceptance.steps...
2.0625
2
main.py
Budu0101/PythonYoutubeVideoDownloader
1
12766377
from pytube import * # Importing tkinter module from tkinter import * # creating root window for Tkinter root = Tk() # adding root window title and dimension for Tkinter root.title("Python Youtube Video Downloader") root.geometry('350x200') # Passing the url in the pytube function, that is YouTube yt = YouTub...
3.828125
4
src/python/pants/backend/terraform/lint/tffmt/tffmt.py
yoav-orca/pants
1,806
12766378
<filename>src/python/pants/backend/terraform/lint/tffmt/tffmt.py # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import textwrap from pants.backend.terraform.lint.fmt import TerraformFmtRequest from pants.backend.terrafor...
1.992188
2
chemmltoolkit/features/atomFeatures.py
Andy-Wilkinson/ChemMLToolk
1
12766379
<reponame>Andy-Wilkinson/ChemMLToolk from os import path from rdkit.Chem import Mol from chemmltoolkit.features.decorators import tokenizable_feature from rdkit.Chem import Atom from rdkit.Chem import AllChem from rdkit.Chem import ChiralType from rdkit.Chem import HybridizationType from rdkit.Chem import rdCIPLabeler...
2.078125
2
models/trainer/DCGAN_trainer.py
soumith/pytorch_GAN_zoo
6
12766380
import os from ..DCGAN import DCGAN from .gan_trainer import GANTrainer from .standard_configurations.dcgan_config import _C class DCGANTrainer(GANTrainer): r""" A trainer structure for the DCGAN and DCGAN product models """ _defaultConfig = _C def getDefaultConfig(self): return DCGANTr...
2.234375
2
server/server/urls.py
kingbar1990/react-apollo-django-subscriptions-boilerplate
0
12766381
from graphene_django.views import GraphQLView from server.token_auth import TokenAuthMiddleware from server.channels import GraphQLSubscriptionConsumer from channels.routing import ProtocolTypeRouter, URLRouter from channels.http import AsgiHandler from channels.auth import AuthMiddlewareStack from django.conf impor...
1.820313
2
train.py
GT-AcerZhang/PaddlePaddle-OCR
0
12766382
import os import time import numpy as np import paddle.fluid as fluid import config as cfg from nets.attention_model import attention_train_net from nets.crnn_ctc_model import ctc_train_net from utils import data_reader from utils.utility import get_ctc_feeder_data, get_attention_feeder_data def main(): """OCR tr...
2.296875
2
ddht/base_message.py
pipermerriam/ddht
2
12766383
from dataclasses import dataclass from typing import Generic, TypeVar from eth_typing import NodeID from eth_utils import int_to_big_endian import rlp from ddht.endpoint import Endpoint class BaseMessage(rlp.Serializable): # type: ignore message_type: int def to_bytes(self) -> bytes: return b"".jo...
2.265625
2
backend/custom_models/migrations/0013_upload_background_tree_view_info.py
code-for-canada/django-nginx-reactjs-docker
3
12766384
<reponame>code-for-canada/django-nginx-reactjs-docker # Generated by Django 2.1.7 on 2019-05-30 14:07 # Edited by <NAME> to upload the background tree view # content (one in Organizational Structure section and one in Team # Information section) of the image descriptions for the sample test from django.db import migra...
1.765625
2
LAB03/04-Xray/backend/cloudalbum/api/users.py
liks79/moving-to-serverless-renew
6
12766385
""" cloudalbum/api/users.py ~~~~~~~~~~~~~~~~~~~~~~~ REST API for users :description: CloudAlbum is a fully featured sample application for 'Moving to AWS serverless' training course :copyright: © 2019 written by <NAME>, <NAME>. :license: MIT, see LICENSE for more details. """ import hashlib imp...
2.4375
2
homeassistant/external/wink/pywink.py
hemantsangwan/home-assistant
2
12766386
__author__ = 'JOHNMCL' import json import time import requests baseUrl = "https://winkapi.quirky.com" headers = {} class wink_sensor_pod(object): """ represents a wink.py sensor json_obj holds the json stat at init (and if there is a refresh it's updated it's the native format for this objects methods...
2.84375
3
dataParsers/dbImporter/DBImporter.py
JohnsonLu3/Gerrymandering-Analysis
0
12766387
<gh_stars>0 from sqlalchemy import create_engine from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.sql import select from sqlalchemy import text from sqlalchemy.ext.automap import automap_base <<<<<<< HEAD # To test in memory no DB conn required right now connection_string = ...
2.78125
3
resources/lib/tubecast/ssdp.py
pannal/script.tubecast
0
12766388
# -*- coding: utf-8 -*- import contextlib import operator import socket import struct import threading from resources.lib.kodi import kodilogging from resources.lib.kodi.utils import get_setting_as_bool from resources.lib.tubecast.kodicast import Kodicast from resources.lib.tubecast.utils import build_template, str_to...
1.953125
2
tanit/worker/server/server.py
yassineazzouz/kraken
1
12766389
import logging as lg from threading import Thread from thrift.protocol import TBinaryProtocol from thrift.server import TServer from thrift.transport import TSocket from thrift.transport import TTransport from ...thrift.worker.service import WorkerService from .handler import WorkerServiceHandler from .worker import ...
1.960938
2
2016/Day 19 - Python/presentThiefPt2.py
AndreasDL/AdventOfCode
0
12766390
import sys NO_ELVES = 3005290 #1->3 0->2 #2->5 1->4 #4->1 3->0 #2->4 1->3 #2 1 wins elfAtPosition = [ i for i in range(NO_ELVES)] #init currIndex = 0 while len(elfAtPosition) > 1: nextIndex = int(currIndex + len(elfAtPosition)/2) % len(elfAtPosition) currElf = elfAtPosition[currIndex] nextElf = elfAtPositio...
2.9375
3
setup.py
gismaps/PDF_Utils
0
12766391
''' Build script for package's wheel and zip files. Look in the `dist` folder for the output. Usage: Run as follows: >python setup.py sdist --formats=zip bdist_wheel ''' from pathlib import Path import json import os import setuptools import shutil import sys from platform import python_revision def cle...
2.21875
2
omd/versions/1.2.8p15.cre/share/check_mk/web/htdocs/views.py
NCAR/spol-nagios
0
12766392
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
1.453125
1
fakenet/listeners/IRCListener.py
kak-bo-che/flare-fakenet-ng
1
12766393
<reponame>kak-bo-che/flare-fakenet-ng import logging import sys import os import threading import SocketServer import ssl import socket import BannerFactory from . import * RPL_WELCOME = '001' SRV_WELCOME = "Welcome to FakeNet." BANNERS = { 'generic': 'Welcome to IRC - {servername} - %a %b %d %H:%M:%S {tz} %...
1.851563
2
third_party/weston/generate_configs.py
zealoussnow/chromium
14,668
12766394
<gh_stars>1000+ #!/usr/bin/env python # # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Creates config files for building Weston.""" from __future__ import print_function import os import re import shu...
1.757813
2
Others/diverta/diverta2019/d.py
KATO-Hiro/AtCoder
2
12766395
# -*- coding: utf-8 -*- def main(): n = int(input()) ans = 0 for i in range(1, int(n ** 0.5) + 1): if n % i == 0 and (i ** 2) != n: m = n // i - 1 if n // m == n % m: ans += m print(ans) if __name__ == '__main__': main()
3.4375
3
baidupcs_py/commands/upload.py
UVJkiNTQ/BaiduPCS-Py
0
12766396
<gh_stars>0 from typing import Optional, List, Tuple, IO import os import time import functools from io import BytesIO from enum import Enum from pathlib import Path from threading import Semaphore from concurrent.futures import ThreadPoolExecutor, as_completed from baidupcs_py.baidupcs.errors import BaiduPCSError fr...
2
2
cppy/c_types.py
defgsus/cppy
0
12766397
""" Collection of lists and dicts representing types in the python C-API """ """ CPython's function pointers as dict: typename: (return_type, (args,)) """ FUNCTIONS = { "unaryfunc": ("PyObject*", ("PyObject*",)), "binaryfunc": ("PyObject*", ("PyObject*", "PyObject*")), "ternaryfunc...
3.046875
3
AlphabetPy/__init__.py
RayZhao1998/alphabetPy
6
12766398
from .alphabet import start, getAlphabet if __name__ == '__main__': start() getAlphabet()
0.917969
1
posts/news_grabber.py
Shubarin/alice_news_skill
0
12766399
# coding=utf-8 import configparser import datetime as dt import json import sqlite3 import os from telethon.sync import TelegramClient from telethon import connection # для корректного переноса времени сообщений в json from datetime import date, datetime # классы для работы с каналами from telethon.tl.functions.chan...
2.421875
2
pandemic/chat/models.py
RubenBranco/Pandemic
1
12766400
<gh_stars>1-10 from django.db import models from django.contrib.auth.models import User from game.models import Session import uuid class Chat(models.Model): session = models.ForeignKey(Session, on_delete=models.CASCADE) def __str__(self): return f"session={self.session!s}" class Message(models.Model...
2.34375
2
election/__init__.py
ideascf/octopus
6
12766401
# coding=utf-8 from .election import Election
1.078125
1
src/quocspyside2interface/logic/HandleExitBasic.py
Quantum-OCS/QuOCS-pyside2interface
1
12766402
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Copyright 2021- QuOCS Team # # 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://ww...
2.015625
2
models/tree_utils.py
kchro/plato
2
12766403
import re import spacy import torch class Tree: def __init__(self, val=None, formula=None): if val: self.val = val self.children = [] if formula: root = self.parse(formula) self.val = root.val self.children = root.children def parse(s...
2.796875
3
alarm_central_station_receiver/notifications/notifiers/emailer.py
alexp789/alarm-central-station-receiver
25
12766404
""" Copyright (2017) <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
2.0625
2
day10/day10program2.py
ninjaoxygen/AdventOfCode2017Python
0
12766405
<filename>day10/day10program2.py #!/usr/bin/python import csv import operator elements = [] current = 0 skip = 0 def processLine(line, length): global elements global current global skip #print("first", elements) # process each entry in the swap list for i in range(0, len(line)): s...
3.765625
4
bioimageit_core/runners/service_allgo.py
bioimageit/bioimageit_core
2
12766406
# -*- coding: utf-8 -*- """bioimageit_core Allgo process service. This module implements a service to run a process using the AllGo client API (allgo18.inria.fr). Classes ------- ProcessServiceProvider """ import os import ntpath import allgo as ag from bioimageit_core.config import ConfigAccess from bioimageit...
2.328125
2
apps/social/urls.py
louis-pre/NewsBlur
0
12766407
<gh_stars>0 from django.conf.urls import url from apps.social import views urlpatterns = [ url(r'^river_stories/?$', views.load_river_blurblog, name='social-river-blurblog'), url(r'^share_story/?$', views.mark_story_as_shared, name='mark-story-as-shared'), url(r'^unshare_story/?$', views.mark_story_as_unsh...
1.679688
2
concept_extractor/extractor.py
fossabot/grafit
0
12766408
<reponame>fossabot/grafit import abc import csv from textblob import TextBlob as tb import math from pkg_resources import resource_string class ExtractStrategyAbstract(object): """Abstract strategy class for the extract method.""" __metaclass__ = abc.ABCMeta # define as absctract class @abc.abstractmet...
2.765625
3
steadymark/runner.py
gabrielfalcao/steadymark
6
12766409
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # <steadymark - markdown-based test runner for python> # Copyright (C) <2012-2020> <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to ...
2.140625
2
surface_matching.py
minhncedutw/record_segment_match_grasp
0
12766410
<reponame>minhncedutw/record_segment_match_grasp ''' File name: HANDBOOK Author: minhnc Date created(MM/DD/YYYY): 12/10/2018 Last modified(MM/DD/YYYY HH:MM): 12/10/2018 9:45 AM Python Version: 3.6 Other modules: [None] Copyright = Copyright (C) 2017 of <NAME> Credits = [None] # people w...
1.578125
2
setup.py
Muzix1/newpackage
0
12766411
from setuptools import setup, find_packages setup( name='newpackage', version='0.10', packages=find_packages(exclude=['tests*']), license='MIT', description='Another EDSA example python packages', long_description=open('README.md').read(), install_requirements=['numpy'], url='https://gi...
1.179688
1
db.py
Aida2gl/sg
0
12766412
#!/usr/bin/env python import json import sys def validate(input): normalized = normalize_internal(input) if normalized != input: sys.stderr.write("Input is not normalized.\n") sys.exit(1) def normalize_internal(input): db = json.loads(input) string = json.dumps(normalize_db(db), ensur...
2.78125
3
pydeap/feature_extraction/__init__.py
Wlgls/pyDEAP
0
12766413
# -*- encoding: utf-8 -*- ''' @File :__init__.py @Time :2021/03/28 19:18:16 @Author :wlgls @Version :1.0 ''' from ._time_domain_features import statistics from ._time_domain_features import hjorth from ._time_domain_features import higher_order_crossing from ._time_domain_features import sevcik_...
1.171875
1
src/test_detection.py
lhj815/wide-resnet.pytorch
0
12766414
<gh_stars>0 from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import config as cf import torchvision import torchvision.transforms as transforms import os import sys import time import argparse imp...
2.046875
2
convertCaffe.py
AntiAegis/onnx2caffe
1
12766415
<filename>convertCaffe.py #------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ import numpy as np import argparse, sys, caffe, onnx, importlib from caffe.proto import caffe_pb2 caffe.set_mode_cpu() ...
2.078125
2
language/serene/claim_tfds.py
Xtuden-com/language
1,199
12766416
<gh_stars>1000+ # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
2.109375
2
kaldi/steps/dict/apply_lexicon_edits.py
ishine/asv-subtools
370
12766417
#!/usr/bin/env python # Copyright 2016 <NAME> # Apache 2.0. from __future__ import print_function import argparse import sys def GetArgs(): parser = argparse.ArgumentParser(description = "Apply an lexicon edits file (output from subtools/kaldi/steps/dict/select_prons_bayesian.py)to an input lexicon" ...
3
3
core/platform/platform_services.py
ctao5660/oppia-ml
3
12766418
# coding: utf-8 # # Copyright 2017 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
1.921875
2
cellpack/mgl_tools/DejaVu/Tests/test_ColorWheel.py
mesoscope/cellpack
0
12766419
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by # # # $Id: test_ColorWheel.py,v 1.5 2007/12/28 22:50:04 vareille Exp $ # # import Tkinter import numpy import numpy.oldnumeric as Numeric, math import DejaVu.colorTool import DejaVu.Slider from DejaVu.EventHandler import CallbackFunctions import unittest f...
2.203125
2
get_color.py
Stardust2019/color_detection
0
12766420
<gh_stars>0 # -*- coding: utf-8 -*- """Untitled4.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1m75Wo1EiDbx-VZgELdYDgJsanmkE9pQb """ # Commented out IPython magic to ensure Python compatibility. from sklearn.cluster import KMeans import matplotli...
2.859375
3
env.py
ed-chin-git/hacker_nlp
0
12766421
replace this text with actual google credentials
0.949219
1
samples/test_gaussian.py
sergio-marti/ren-qm3
0
12766422
import numpy import qm3 import qm3.engines.gaussian import io import os import sys cwd = os.path.abspath( os.path.dirname( sys.argv[0] ) ) + os.sep mol = qm3.molecule() mol.pdb_read( open( cwd + "charmm.pdb" ) ) mol.psf_read( open( cwd + "charmm.psf" ) ) mol.guess_atomic_numbers() print( mol.anum ) print( mol....
1.820313
2
taboo.py
AdityaPandeyCS/ta13oo-reddit-bot
1
12766423
import praw import re import csv import operator import os def process_comment(comment): try: body = comment.body user = comment.author.name linkID = comment.link_id id = comment.id parent = comment.parent() # !delete if (triggers[2] in body and isinstance(p...
2.890625
3
B03898_02_Codes/B03898_02_02.py
prakharShuklaOfficial/Mastering-Python-for-Finance-source-codes
446
12766424
<reponame>prakharShuklaOfficial/Mastering-Python-for-Finance-source-codes<filename>B03898_02_Codes/B03898_02_02.py """ README ====== This is a Python code. ====== """ """ Least squares regression with statsmodels """ import numpy as np import statsmodels.api as sm # Generate some sample data num_periods = 9 all_value...
2.015625
2
slice_plotter.py
stockmann-lab/ASL_coil
0
12766425
<filename>slice_plotter.py<gh_stars>0 import numpy as np import matplotlib.pyplot as plt class Slice_Plotter: def __init__(self, ax, X, title='', vmin=None, vmax=None, cmap=None, patches=None): self.ax = ax ax.set_title(title) if cmap is None: cmap = plt.get_cmap('rainbow') ...
2.65625
3
pyatdllib/ui/too_big_protobuf_test.py
lisagorewitdecker/immaculater
0
12766426
"""Unittests for module 'immaculater' that cannot live peaceably with immaculater_test. This unittest is separate because once you call SetAllowOversizeProtos(True) you cannot change it. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import pi...
2.265625
2
envisage/core_plugin.py
robmcmullen/envisage
0
12766427
""" The Envisage core plugin. """ # Enthought library imports. from envisage.api import ExtensionPoint, Plugin, ServiceOffer from traits.api import List, Instance, on_trait_change, Str class CorePlugin(Plugin): """ The Envisage core plugin. The core plugin offers facilities that are generally useful when b...
2.015625
2
Contents/scripts/picapicker/scene.py
mochio326/PicaPicker
2
12766428
# -*- coding: utf-8 -*- from .vendor.Qt import QtCore, QtGui, QtWidgets, QtSql from .node import Picker, BgNode, GroupPicker from .line import Line class SaveData(object): PICKER_TABLE_DATA = (('id', 'text PRIMARY KEY'), ('x', 'real'), ('y', 'real'), ...
2.171875
2
tools/scripts/sam-analysis.py
srirampc/ecet
1
12766429
<filename>tools/scripts/sam-analysis.py #!/usr/bin/python import sys import argparse import re import alignment as an import ecutils as eu # # File : sam-analyis.py # Created on December 1, 2011 # Author : <NAME> <<EMAIL>> # # This file is part of Error Correction Review Toolkit. # Error Correction Review Toolkit...
2.296875
2
wrappers/SONATAClient/pishahang.py
CN-UPB/python-mano-wrappers
0
12766430
<filename>wrappers/SONATAClient/pishahang.py<gh_stars>0 import json import requests class Pishahang(): """ Pishahang Related Interfaces """ def __init__(self, host, port=4002, requests_port=32001, policy_port=8899): self._host = host self._port = port self.policy_port = pol...
2.5
2
utils/verify.py
sweeneyngo/swvgio
0
12766431
<filename>utils/verify.py<gh_stars>0 import requests def grab(url, params=None): try: r = requests.get(url, params=params, stream=True) except requests.exceptions.Timeout: # Maybe set up for a retry, or continue in a retry loop print("Timed out...") except requests.exceptions.TooMa...
3.09375
3
orca_driver/launch/pt2_launch.py
tsaoyu/orca2
0
12766432
<reponame>tsaoyu/orca2 import os import math from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch_ros.actions import Node # Launch pool test #2 def generate_launch_description(): # Must match camera name in URDF file camera_name = 'forward_cam...
2.46875
2
back/apps/spiders/models.py
Andrey-Omelyanuk/project-template
0
12766433
from celery import chain from django.db.models import Model, CASCADE, ForeignKey, CharField, TextField, DateTimeField, BooleanField, IntegerField, JSONField from django.db.models.signals import post_save from django.dispatch import receiver from .tasks.run_spider import run_spider from .tasks.load_data_to_db import lo...
2.21875
2
complaint/views.py
kodi-sk/CSI-WIP
0
12766434
<gh_stars>0 from django.shortcuts import render, redirect from django.http import Http404, HttpResponse from django import forms from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import render from complaint.models import Complaint from django.contrib.auth.decorators...
2.078125
2
dashboard_app/tests/models_tests.py
bitlabstudio/django-dashboard-app
10
12766435
"""Tests for the models of the ``django-metrics-dashboard`` app.""" from django.test import TestCase from .. import models from .factories import DashboardWidgetSettingsFactory class DashboardWidgetLastUpdateTestCase(TestCase): """Tests for the ``DashboardWidgetLastUpdate`` model class.""" longMessage = True...
2.375
2
geo_knowledge_hub/modules/frontpage/webpack.py
geo-knowledge-hub/geo-knowledge-hub
12
12766436
# -*- coding: utf-8 -*- # # Copyright (C) 2021 GEO Secretariat. # # geo-knowledge-hub is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. from invenio_assets.webpack import WebpackThemeBundle theme = WebpackThemeBundle( __name__, ...
1.273438
1
policy/rl_policy.py
yangmuzhi/wuziqi
0
12766437
""" ppo rl algo """ from .algo.ppo import PPO from tqdm import tqdm class ppo_agent(object): def __init__(self, dims_obs, dim_act, policy_fn, value_fn, size, ): self.ppo = PPO(rnd=0,dim_obs=None, dim_act=None, policy_fn=None, value_fn=None, ...
2.4375
2
trafficgen/benignGenerator/DataGen/wordpressautonew/poc.py
cyberdeception/deepdig
5
12766438
#! /usr/bin/env python import httplib import sys import threading import subprocess import random def send_request(method, url): try: c = httplib.HTTPConnection('127.0.0.1', 80) c.request(method,url); if "foo" in url: print c.getresponse().read() ...
2.8125
3
tools/python/nuketools/dag.py
cheekynie/nuke-config
0
12766439
<filename>tools/python/nuketools/dag.py<gh_stars>0 import nuke import nukescripts import operator, math, os import string import random # Utilities for enhancing efficiency when interacting with Nuke's Directed Acyclic Graph # Register keyboard shortcuts and menu entries nuke.menu('Nuke').addCommand('Edit/Node/DAG/...
2
2
fython/config/exception.py
nicolasessisbreton/fython
41
12766440
# base class FyException(Exception): def __init__(s, message): s.message = '\n;;;;;\n' s.message += s.__class__.__name__.replace('_', ' ') s.message += '\n' s.message += str(message) def __str__(s): return s.message # exception class a_function_cannot_be_dotted(FyException): pass class cannot_indent_on_...
2.53125
3
Unity Shader/scripts/completions.py
xdegtyarev/SublimeConfig
0
12766441
<filename>Unity Shader/scripts/completions.py<gh_stars>0 import re import os class Record(object): def __init__(self, trigger = "", content = "", shortTrigger = ""): self.trigger = trigger self.content = content self.shortTrigger = shortTrigger def readFile(path): f = open(path, 'r') ...
2.5625
3
test/conftest.py
Thhhza/sqlalchemy
1
12766442
#!/usr/bin/env python """ pytest plugin script. This script is an extension to py.test which installs SQLAlchemy's testing plugin into the local environment. """ import sys from os import path for pth in ['../lib']: sys.path.insert(0, path.join(path.dirname(path.abspath(__file__)), pth)) from sqlalchemy.testing...
1.71875
2
src/models/generator.py
RowitZou/RankAE
23
12766443
import torch import torch.nn as nn from models.neural import aeq from models.neural import gumbel_softmax class Generator(nn.Module): def __init__(self, vocab_size, dec_hidden_size, pad_idx): super(Generator, self).__init__() self.linear = nn.Linear(dec_hidden_size, vocab_size) self.softma...
3.078125
3
mre/helper/__init__.py
CherryKitten/mre
0
12766444
from .Range import Range
1.078125
1
notes/code/zillow/chart.py
akkiittiwari/msan692
0
12766445
<reponame>akkiittiwari/msan692 # REGISTER: https://www.zillow.com/user/Register.htm # API REGISTER: https://www.zillow.com/webservice/Registration.htm # API DOC: http://www.zillow.com/howto/api/APIOverview.htm # Run with args: yourzipid "190 7th St APT 4" "San Francisco, CA" import sys import untangle import urllib2 i...
2.953125
3
tests/check_acl_log.py
shenjiangc/ovn
1
12766446
<reponame>shenjiangc/ovn #!/usr/bin/env python3 import argparse import string def strip(val): """Strip whitespace and quotation marks from val""" return val.strip(f"{string.whitespace}\"'") def parse_acl_log(line): """Convert an ACL log string into a dict""" # First cut off the logging preamble. ...
3.15625
3
antlir/bzl/image/feature/symlink.bzl
facebookincubator/fs_image
9
12766447
<gh_stars>1-10 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. load("//antlir/bzl:shape.bzl", "shape") load("//antlir/bzl:target_helpers.bzl", "antlir_dep") load("//antlir/bzl:target_tagge...
2.03125
2
conanfile.py
memsharded/conan-spdlog
6
12766448
<reponame>memsharded/conan-spdlog from conans import ConanFile class spdlogConan(ConanFile): name = "spdlog" version = "0.13.0" license = "MIT" url = "https://github.com/memsharded/conan-spdlog" options = {"fmt_external": [True, False]} default_options = "fmt_external=False" def requireme...
2.21875
2
src/cdctrain.py
PoCInnovation/VanGaugan
2
12766449
import torch import torch.nn as nn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as transforms import torchvision.utils as utils import matplotlib.pyplot as plt import numpy as np from torch.utils.tensorboard import SummaryWriter from celeba_datase...
2.40625
2
xplane/cli/autopilot.py
tomleese/snakes-on-a-plane
0
12766450
import asyncio import xplane.autopilot import xplane.io class MyProtocol(xplane.io.Protocol, xplane.autopilot.TakeoffMixin): def __init__(self, remote_addr): super().__init__(remote_addr) def got_data_packet(self, packet, address): self.take_off_got_data_packet(packet, address) def mainloo...
2.5625
3