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
atlas/foundations_rest_api/src/foundations_rest_api/versioning.py
DeepLearnI/atlas
296
12775651
from pkg_resources import get_distribution, DistributionNotFound try: __version__ = get_distribution('foundations_rest_api').version except DistributionNotFound: __version__ = None
1.507813
2
ImageAnalysis/ImageAnalysis/python/references/bead-designer-test/gui/designer.py
mikebourbeauart/PerlerPrinter
0
12775652
<reponame>mikebourbeauart/PerlerPrinter """ designer.py """ import warnings warnings.filterwarnings("ignore") import os import sys import wx import wx import beadgui #Some constants #BEAD_RADIUS = 1.75*mm #BEAD_THICKNESS = 1*mm #BOARD_SPACING = 4.85*mm #BOARD_BORDER = 4*mm #Some notes #A4 60x43 = 2580 #A3 86x60 = 516...
2.046875
2
proxystore/test/test_utils.py
gpauloski/ProxyStore
2
12775653
<reponame>gpauloski/ProxyStore """Utils Unit Tests""" from proxystore import utils from proxystore.factory import SimpleFactory def test_create_key() -> None: """Test create_key()""" assert isinstance(utils.create_key(42), str) def test_fullname() -> None: """Test fullname()""" assert utils.fullname...
2.28125
2
tests/watson/dev/test_middleware.py
watsonpy/watson-dev
0
12775654
<filename>tests/watson/dev/test_middleware.py<gh_stars>0 # -*- coding: utf-8 -*- import os from watson.dev.middleware import StaticFileMiddleware from tests.watson.dev.support import sample_app, sample_environ, sample_start_response class TestStaticFileMiddleware(object): def test_create(self): mw = Stat...
2.296875
2
arangodol/__init__.py
i2mint/arangodol
1
12775655
<reponame>i2mint/arangodol """ arango with a simple (dict-like or list-like) interface """ from dol.base import Persister from pyArango.connection import Connection from pyArango.theExceptions import DocumentNotFoundError class ArangoDbPersister(Persister): """ A basic ArangoDB persister. >>> from py2sto...
2.578125
3
aztk/spark/client/cluster/helpers/run.py
atg-abhishek/aztk
0
12775656
<gh_stars>0 import azure.batch.models.batch_error as batch_error from aztk import error from aztk.utils import helpers def cluster_run(core_cluster_operations, cluster_id: str, command: str, host=False, internal: bool = False, timeout=No...
2.296875
2
integration_tests/integrations/jinja/build.py
dxw/ukti_template
2
12775657
<gh_stars>1-10 from jinja2 import Environment, FileSystemLoader env = Environment(loader=FileSystemLoader([ 'vendor/jinja_ukti_template/views/layouts', 'templates' ])) template = env.get_template('test_template.html') content = template.render({ "html_lang": "rb", "skip_link_message": "Custom skip link...
2.21875
2
allennlp_models/tagging/predictors/sentence_tagger.py
matt-peters/allennlp-models
402
12775658
from allennlp.predictors.sentence_tagger import SentenceTaggerPredictor # noqa: F401 # This component lives in the main repo because we need it there for tests.
1.210938
1
openstack/tests/unit/load_balancer/test_amphora.py
NeCTAR-RC/openstacksdk
0
12775659
# Copyright 2019 Rackspace, US 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
1.546875
2
run_fetcher.py
pogestudio/coinmarketcap-to-mongodb
0
12775660
# coding: utf-8 from lxml import html import requests import pandas as pd import config # DATABASE THINGS # this one is used by the database import pymongo as pm # connect to the database choosing the correct collection mongo_db_url = config.mongo_db_url mongo_client = pm.MongoClient(mongo_db_url) db = mongo_client[...
2.703125
3
patterns/behavioral/iterator.py
smartlegionlab/python-patterns
2
12775661
<gh_stars>1-10 # -*- coding: utf-8 -*- # -------------------------------------------------------- # Licensed under the terms of the BSD 3-Clause License # (see LICENSE for details). # Copyright © 2018-2021, <NAME> # All rights reserved. # -------------------------------------------------------- class IteratorBase: ...
3.734375
4
data/studio21_generated/introductory/3662/starter_code.py
vijaykumawat256/Prompt-Summarization
0
12775662
def xor(a,b):
1.09375
1
bin/syncwbern52.py
DSOlab/autobern
5
12775663
<gh_stars>1-10 #! /usr/bin/python #-*- coding: utf-8 -*- from __future__ import print_function import sys import os import subprocess import argparse import pybern.products.bernparsers.bloadvar as blvar ## If only the formatter_class could be: ##+ argparse.RawTextHelpFormatter|ArgumentDefaultsHelpFormatter .... ## ...
2.28125
2
infra/asynchttp/requester.py
kokokuo/crawler-TW-hotels
4
12775664
from urllib import parse from typing import Optional from logging import Logger from lxml import etree from aiohttp import ClientSession from tenacity import retry from tenacity import retry_if_exception_type, stop_after_attempt, wait_fixed from infra.excepts.types import ReqSysAbnoramlError from infra.asynchttp.resp i...
2.390625
2
train/2_mnist_2.py
asysbang/tensorflow
0
12775665
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import tensorflow as tf from tensorflow import keras (train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data() train_labels = train_labels[:1000] test_labels = test_labels[:1000] train_images = train_images[:1000].reshape(-1...
2.53125
3
tests/test_bvi_utils_paths.py
brainvisa/brainvisa-installer
0
12775666
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import pytest import os from os.path import relpath from brainvisa.installer.bvi_utils.paths import Paths FULLPATH = os.path.dirname(os.path.abspath(__file__)) ROOTPATH = "/" + relpath(FULLPATH + "/../.", "/") def test_bvi_utils_Pa...
2.015625
2
_cloud/installer.py
pythonista-cloud/cloud
4
12775667
"""Handles the installation of downloaded modules.""" import os import shutil import tempfile import zipfile from _cloud import utils def install(zipfile, metadata): """Install a module once it has been downloaded locally. Takes the GitHub repo zipped up in a BytesIO, as well as all the metadata about t...
2.421875
2
misc/joystick_servo_control.py
HuiminHe/rl-swing
0
12775668
from __future__ import division from __future__ import print_function import sys sys.path.append('..') from joystick import JoyStick from servo import ServoController if __name__ == '__main__': sc = ServoController(angle_range=80) js = JoyStick() while True: # read serial v = js.read() ...
2.65625
3
datumaro/plugins/sly_pointcloud_format/format.py
certiware/posemaro
0
12775669
# Copyright (C) 2021 Intel Corporation # # SPDX-License-Identifier: MIT class PointCloudPath: BASE_DIR = 'ds0' ANNNOTATION_DIR = 'ann' DEFAULT_IMAGE_EXT = '.jpg' POINT_CLOUD_DIR = 'pointcloud' RELATED_IMAGES_DIR = 'related_images' KEY_ID_FILE = 'key_id_map.json' META_FILE = 'meta.json' ...
1.203125
1
setup.py
pmaris/pynextbus
1
12775670
<reponame>pmaris/pynextbus from setuptools import setup, find_packages with open('README.md', 'r') as readme: long_description = readme.read() setup( name='py_nextbus', version='0.1.2', author='<NAME>', description='Minimalistic Python client for the NextBus public API for real-time transit ' \ ...
1.609375
2
dgn/invertible_layers.py
matt-graham/differentiable-generator-networks
1
12775671
<reponame>matt-graham/differentiable-generator-networks<filename>dgn/invertible_layers.py<gh_stars>1-10 # -*- coding: utf-8 -*- """Invertible density network layer definitions.""" __authors__ = '<NAME>' __license__ = 'MIT' import numpy as np import theano as th import theano.tensor as tt import theano.tensor.slinalg ...
2.59375
3
linux/lib/python2.7/dist-packages/samba/provision/common.py
nmercier/linux-cross-gcc
3
12775672
# Unix SMB/CIFS implementation. # utility functions for provisioning a Samba4 server # Copyright (C) <NAME> <<EMAIL>> 2007-2010 # Copyright (C) <NAME> <<EMAIL>> 2008-2009 # Copyright (C) <NAME> <<EMAIL>> 2008-2009 # # Based on the original in EJS: # Copyright (C) <NAME> <<EMAIL>> 2005 # # This program is free softwar...
2.40625
2
lib/file.py
encodingl/skadmin
0
12775673
#! /usr/bin/env python # -*- coding: utf-8 -*- from subprocess import Popen, PIPE, STDOUT, call import os def new_file(file_name,file_content): with open(file_name,"a+") as f: f.write(file_content) def get_ex_link(hosts,dir): script_link_read = os.path.dirname(os.path.dirname(os.path....
2.375
2
sql/admin.insert.py
Jasata/utu-schooner
0
12775674
#!/bin/env python3 # # Schooner - Simple Course Management System # admin.insert.py / Add script owner as an Admin # University of Turku / Faculty of Technology / Department of Computing # <NAME> <<EMAIL>> # # 2021-08-13 Initial version. # # NOTE: Using Psycopg 3 (dev2) 2021-08-13 # import os import pwd import syslog...
2.234375
2
formalchemy/tests/test_fieldset.py
samuelchen/formalchemy
2
12775675
__doc__ = r""" >>> from formalchemy.tests import * >>> FieldSet.default_renderers = original_renderers.copy() # some low-level testing first >>> fs = FieldSet(order1) >>> fs._raw_fields() [AttributeField(id), AttributeField(user_id), AttributeField(quantity), AttributeField(user)] >>> fs.user.name 'user_id' >>> fs ...
2.125
2
MDPN.py
hadisna/Makov-Decision-Process-Neural-Network-For-Global-Optimization
1
12775676
<filename>MDPN.py import numpy as np import math import argparse, random import matplotlib.pyplot as plt def ChangeDomain(temp_e, umax, umin, Size, Codel, n, Po, temp_e3, temp_e2): v_max = math.floor((n * Codel - 1) / Codel) umax1 = np.array([[0.0] for i in range(v_max + 1)]) umin1 = np.array([[0...
1.953125
2
setup.py
wowngasb/pykl
0
12775677
from setuptools import setup, find_packages setup(name='pykl', version='0.1.6', packages=find_packages(), author='pykl', author_email='<EMAIL>', description='kltool for python, toolset for web, http, cache, dht, xml, json and so on', long_description=open('README.rst').read(), ...
1.132813
1
main.py
Karma-design/PyFlickrMining
1
12775678
<filename>main.py<gh_stars>1-10 # -*- coding: utf-8 -*- print(__doc__) # Code source: <NAME> # License: BSD 3 clause #HOW TO USE : # 1.Set the input and output filenames input_filename = 'lyon_cleaned_url_100' ##possible values : 'lyon_cleaned','suburb_cleaned','all_cleaned' output_filename = 'clustering_v2' #Set the...
3.09375
3
src/abaqus/AbaqusCAEDisplayPreferences/CaeGuiPrefs.py
Haiiliin/PyAbaqus
7
12775679
<gh_stars>1-10 from abaqusConstants import * class CaeGuiPrefs: """The CaeGuiPrefs object contains the details of the graphical preferences in a guiPreferences section of the abaqus_2021.gpr file. Attributes ---------- fileName: str A String specifying the path to the preferences file. ...
2.46875
2
src/negotiating_agent/venv/lib/python3.8/site-packages/geniusweb/protocol/session/SessionState.py
HahaBill/CollaborativeAI
1
12775680
<reponame>HahaBill/CollaborativeAI from abc import abstractmethod from typing import List, Optional from geniusweb.actions.Action import Action from geniusweb.inform.Agreements import Agreements from geniusweb.progress.Progress import Progress from geniusweb.protocol.NegoState import NegoState from geniusweb.protocol...
2.125
2
lambda_function.py
tsuyo/LambdaWithTwilio
0
12775681
import re import config from datetime import datetime from urllib2 import urlopen from twilio.rest import TwilioRestClient def validateStatus(site): '''Return False to trigger the canary''' return urlopen(site).getcode() == 200 def validateString(site): p = re.compile(config.CHECK_STR) return p.match(...
2.671875
3
webhook_relay.py
kav2k/friend_computer_webhook
0
12775682
#!/usr/bin/env python3 import time from http.server import HTTPServer, BaseHTTPRequestHandler import requests import json from functools import reduce import re class Server(BaseHTTPRequestHandler): def do_HEAD(self): self.send_json({ 'success': False, 'message': 'Wrong method, PO...
2.59375
3
test.py
harshkothari410/snn-image-segmentation
7
12775683
<reponame>harshkothari410/snn-image-segmentation<filename>test.py import numpy as np import matplotlib.pyplot as plt import nengo from nengo.dists import Uniform model = nengo.Network(label='A Single Neuron') with model: neuron = nengo.Ensemble(1, dimensions=1, # Represent a scalar i...
2.765625
3
hogar/ResponseHandler.py
breyten/politwoops-hogar-bot
1
12775684
# The MIT License (MIT) # # Copyright (c) 2015 <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, copy, modify, me...
1.898438
2
src/gen_embeddings.py
anirban-code-to-live/gat-baseline
0
12775685
import os import argparse parser = argparse.ArgumentParser(description="Run attention2vec generation embeddings suite.") parser.add_argument('--dataset', nargs='?', default='cora', help='Input graph name for saving files') args = parser.parse_args() dataset = args.dataset gamma = [10] R = [0.5] T...
2.765625
3
finlab/finlab_old/data.py
DandyWei/finlab_course_ml
0
12775686
<gh_stars>0 import sqlite3 import pandas as pd import os import datetime class Data(): def __init__(self): # 開啟資料庫 self.conn = sqlite3.connect(os.path.join('data', "data.db")) cursor = self.conn.execute('SELECT name FROM sqlite_master WHERE type = "table"') # 找到所有的table名稱 ...
3.09375
3
src/pyfuzz/string_mutations.py
fabriceyhc/pyfuzz
0
12775687
import random def delete_random_character(s): """Returns s with a random character deleted""" if s == "": return s pos = random.randint(0, len(s) - 1) # print("Deleting", repr(s[pos]), "at", pos) return s[:pos] + s[pos + 1:] def insert_random_character(s): """Returns s with a random c...
3.78125
4
Accountability Report/data_classes.py
ByrdOfAFeather/Catawba-County-ArcGis
0
12775688
<reponame>ByrdOfAFeather/Catawba-County-ArcGis import xlrd from data_transformation_functions import setup_nc_dataframe, setup_dicts, remove_section from sklearn.preprocessing import LabelEncoder, PolynomialFeatures, StandardScaler from sklearn.model_selection import train_test_split class NCDatabase: def __init__(s...
3.1875
3
inbm/cloudadapter-agent/cloudadapter/cloud/client/handlers/echo_handler.py
ahameedx/intel-inb-manageability
5
12775689
<reponame>ahameedx/intel-inb-manageability """ Handler that echoes a message when a message is received. """ from typing import Callable, Optional from ._handler import Handler from ..connections.mqtt_connection import MQTTConnection from ..utilities import Formatter from ....utilities import make_threaded import ...
2.546875
3
apps/fhirproxy/utils.py
thebureaugroup/sharemyhealth
0
12775690
<reponame>thebureaugroup/sharemyhealth import requests import urllib from django.conf import settings def fhir_get_access_token_with_client_credentials(): data = urllib.parse.urlencode({"client_id": settings.BACKEND_FHIR_CLIENT_ID, "client_secret": settings.BACKEND_FHIR_CLIENT_S...
2.125
2
src/common/utils.py
edenbuaa/openpai-runtime
12
12775691
import logging import re import pystache def init_logger(): logging.basicConfig( format= "%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(message)s", level=logging.INFO, ) def _convert_to_dict(obj) -> dict: converted_obj = {} if isinstance(obj, list): for i...
2.3125
2
2020/day-17/process.py
MatthieuMichon/advent-of-code
1
12775692
#!/usr/bin/env python """ Advent of Code 2020: Day 16 """ import copy from collections import defaultdict import math import itertools import signal import sys from types import FrameType from typing import List, Mapping from pathlib import Path DEBUG = False ACTIVE = True INACTIVE = False # Common --------------...
2.9375
3
live_test.py
alanwatts36/attractiveness
11
12775693
<filename>live_test.py import numpy as np import cv2 from tensorflow.keras.models import load_model import helper if __name__ == "__main__": model_name = 'attractiveNet_mnv2' model_path = 'models/' + model_name + '.h5' model = load_model(model_path) cap = cv2.VideoCapture(0) while(True): ...
2.703125
3
python/oracle.py
aeternity/dev-tools
0
12775694
#!/usr/bin/python """ Test oracle client Author: <NAME> Copyright (c) 2018 aeternity developers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWA...
2.09375
2
setup.py
Lyrichu/sopt
40
12775695
#!/usr/bin/env python # coding=utf-8 from setuptools import setup,find_packages setup( name="sopt", version="0.0.6.1", description="sopt:a simple python optimizer library", long_description= ''' sopt is a simple python optimizer library.Currentlly,it includes some stochastic optimization al...
1.664063
2
app/code/data_cleaning.py
tanviwagh/Movies_Analysis
0
12775696
<reponame>tanviwagh/Movies_Analysis import boto3 from pyspark.sql.functions import col, regexp_extract, regexp_replace, explode, split, udf, date_format, to_date from pyspark.sql.types import DoubleType, DateType, IntegerType def process(spark, config): data_folder_name = config['data']['data_folder_name'] p...
2.828125
3
pycoind/blockchain/transaction.py
peerchemist/pycoind
120
12775697
<gh_stars>100-1000 # The MIT License (MIT) # # Copyright (c) 2014 <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 us...
1.609375
2
mayan/apps/mailer/workflow_actions.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
2
12775698
import logging from django.utils.translation import ugettext_lazy as _ from mayan.apps.acls.models import AccessControlList from mayan.apps.document_states.classes import WorkflowAction from .models import UserMailer from .permissions import permission_user_mailer_use __all__ = ('EmailAction',) logger = ...
2.015625
2
Examples/Python/ImageCreateAndSet.py
nathantspencer/SimpleElastix
350
12775699
<reponame>nathantspencer/SimpleElastix #!/usr/bin/env python #========================================================================= # # Copyright NumFOCUS # # 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 cop...
2.421875
2
content/_build/jupyter_execute/11_db_access/02_sqlalchemy_orm.py
aviadr1/learn-python3
0
12775700
#!/usr/bin/env python # coding: utf-8 # # <a href="https://colab.research.google.com/github/aviadr1/learn-advanced-python/blob/master/content/11_db_access/02_sqlalchemy_orm.ipynb" target="_blank"> # <img src="https://colab.research.google.com/assets/colab-badge.svg" # title="Open this file in Google Colab" alt=...
4.1875
4
zeex/core/ui/actions/split_ui.py
zbarge/dbtrix
10
12775701
<reponame>zbarge/dbtrix # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:/Users/Zeke/Google Drive/dev/python/zeex/zeex/core/ui/actions/split.ui' # # Created: Mon Nov 13 22:57:16 2017 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be l...
1.40625
1
src/tests/test_ggf.py
dnf0/kcl-globalgasflaring
1
12775702
<gh_stars>1-10 import unittest import pandas as pd import numpy as np import glob import epr import src.utils as utils from src.ggf.detectors import SLSDetector, ATXDetector class MyTestCase(unittest.TestCase): # ----------------- # unit tests # ----------------- def test_szn_interpolation(self): ...
2.296875
2
wiki/views.py
meredithcat/makewiki_v2
0
12775703
from django.shortcuts import render, redirect from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.views.generic.edit import FormView from django.contrib.auth.models import User from wiki.models import Page from wiki.forms import PageForm class PageListView(Li...
2.21875
2
mirrorkan_generate_feed.py
KSP-CKAN/MirrorKAN
4
12775704
#!/usr/bin/env python import os, sys from distutils.version import LooseVersion from dateutil.parser import parse from datetime import datetime, timedelta import json import operator import pytz import PyRSS2Gen from mirrorkan import parse_ckan_metadata_directory from mirrorkan_conf import * from mirrorkan_util impor...
2.09375
2
blog/urls.py
GuilleJR83/ProyectoInformatorio2021
0
12775705
#from django.conf import settings from django.conf.urls.static import static from django import views from django.contrib import admin from django.shortcuts import redirect from django.urls import path, include from django.utils import decorators from blog import settings #from .settings import local import c...
2.421875
2
youtubesearchpython/base/constants.py
cinemafactory2/youtube-search-python
1
12775706
<gh_stars>1-10 VIDEO_ELEMENT = 'videoRenderer' CHANNEL_ELEMENT = 'channelRenderer' PLAYLIST_ELEMENT = 'playlistRenderer' SHELF_ELEMENT = 'shelfRenderer' class ResultMode: json = 0 dict = 1 class SearchMode: videos = 'EgIQAQ%3D%3D' channels = 'EgIQAg%3D%3D' playlists = 'EgIQAw%3D%3D...
1.640625
2
curators/agents/contextual.py
BellwethrInc/decision_engine
1
12775707
from curators.models.contextual_bandits import ClusterBandit TYPE_MAPPING = { 'cluster': ClusterBandit, } class ContextualAgent: """Coming Soon. """ def __init__(self, n_profiles, n_actions, type='cluster'): raise NotImplementedError def update(self): raise NotImplementedError ...
2.125
2
src/Game/__init__.py
MiguelReuter/Volley-ball-game
4
12775708
<reponame>MiguelReuter/Volley-ball-game<filename>src/Game/__init__.py # encoding : UTF-8 from .ball import Ball from .character import Character, Team import Game.character_states as CharacterStates from .court import Court from .ground import Ground
1.429688
1
train_svm.py
aleaugustoplus/airline_ranker
0
12775709
<gh_stars>0 from pyspark import SparkConf, SparkContext import sys from pyspark.sql import SQLContext from pyspark.ml.feature import Word2Vec import re from pyspark.sql.types import StructType, StructField, StringType, IntegerType, ArrayType from pyspark.mllib.classification import SVMWithSGD, SVMModel from pyspark.mll...
2.40625
2
company/views.py
WillieIlus/jobscorner
2
12775710
from builtins import super from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin # from django.core.checks import messages from django.shortcuts import render, get_object_or_404 from django.urls import reverse_lazy from d...
1.945313
2
foiamachine/local/lib/python2.7/encodings/mac_cyrillic.py
dwillis/foiamachine
3
12775711
/usr/lib/python2.7/encodings/mac_cyrillic.py
1.070313
1
cloudmersive_convert_api_client/models/replace_string_regex_request.py
Cloudmersive/Cloudmersive.APIClient.Python.Convert
3
12775712
# coding: utf-8 """ convertapi Convert API lets you effortlessly convert file formats and types. # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class ReplaceStringRegexRequest(objec...
2.28125
2
DAO/BotDAOFile.py
sebampuero/dummy-discord-bot
0
12775713
<reponame>sebampuero/dummy-discord-bot import json class BotDAOFile(): def get_radios(self): f = open("./config/radio_stations.json", "r") radios = json.loads(f.read()) f.close() return radios def get_users_welcome_audios(self): f = open("./config/users_audio_map.json"...
2.71875
3
aavso/webobs.py
dtouzan/ciboulette
1
12775714
""" WebObs class """ from astropy.table import Table from astropy import units as u from astropy.coordinates import SkyCoord import numpy as np import matplotlib.pyplot as plt from bs4 import BeautifulSoup import os import io import wget import requests class WebObs(object): """ Class for AAVSO web observati...
2.984375
3
Concrete Data Set/normalize_conco.py
s-saitej/Linear-Regression-Problems
0
12775715
# -*- coding: utf-8 -*- """ Created on Fri May 25 13:52:02 2018 @author: sunka """ import pandas as pd dataframe = pd.read_csv('concrete.csv') print(dataframe) df1 = dataframe.iloc[:,1:] df2 = dataframe.iloc[:,:8] from sklearn import preprocessing df1 = preprocessing.normalize(df1) df2 =...
3.0625
3
core/shape_set.py
neodyme60/raypy
1
12775716
from core.differential_geometry import DifferentialGeometry from core.distribution1d import Distribution1D from core.light_sample import LightSample from core.ray import Ray from core.shape import Shape from maths.config import infinity_max_f from maths.normal import Normal from maths.point3d import Point3d fro...
2.28125
2
Chapter 04/ch41a.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
0
12775717
print(27 + 8 * 2 - 6) #37
1.914063
2
src/xsd_members/bulk_select.py
minyiky/xSACdb
2
12775718
from .models import MemberProfile import io import csv TOKEN_NAME = 'names' def get_some_objects(list): return MemberProfile.objects.filter(pk__in=list) def parse_token_data(request_post): f = io.StringIO(request_post[TOKEN_NAME]) reader = csv.reader(f, delimiter=',') user_ids = [] for row in ...
2.421875
2
src/extension/snapshot.py
ytsmiling/lmt
32
12775719
<gh_stars>10-100 import os import chainer from chainer.training import extension class Snapshot(extension.Extension): """Trainer extension that save network parameters to 'snapshot.npz'. """ def __call__(self, trainer): filename = os.path.join(trainer.out, 'snapshot.npz') chainer.serializ...
2.125
2
kid_readout/measurement/acquire.py
danielflanigan/kid_readout
0
12775720
""" Basic framework for acquiring a roach measurement that includes both sweep(s) and stream(s). Acquire -Initialize equipment. -Initialize roach: preload frequencies, if necessary. -Create state dictionary containing state from all equipment, including temperatures, if possible. -Run a coarse sweep, if necessary: cre...
2.5
2
tsx/import_data_source.py
nesp-tsr/tsx
3
12775721
from tsx.db import get_session import logging import sys import argparse import csv from tqdm import tqdm log = logging.getLogger(__name__) def main(): logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)-15s %(name)s %(levelname)-8s %(message)s') parser = argparse.ArgumentParser(descripti...
2.359375
2
mover/_numberbatch.py
StefanJMU/SemEval2022_Task_8
0
12775722
<filename>mover/_numberbatch.py import psycopg2 import numpy as np numberbatch_config = { 'user': 'postgres', 'password': '<PASSWORD>', 'host': 'localhost', 'port' : 5432, 'database': 'Numberbatch' } frequency_config = { 'user': 'postgres', 'password': '<PASSWORD>', 'host': 'localhost', 'port' : 54...
2.375
2
dlpy/model_conversion/write_sas_code.py
aviolante/python-dlpy
1
12775723
<gh_stars>1-10 #!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 # # ...
2.46875
2
python/dgl/nn/pytorch/conv/tagconv.py
Woooosz/dgl
2
12775724
"""Torch Module for Topology Adaptive Graph Convolutional layer""" # pylint: disable= no-member, arguments-differ, invalid-name import torch as th from torch import nn from .... import function as fn class TAGConv(nn.Module): r"""Topology Adaptive Graph Convolutional layer from paper `Topology Adaptive Graph...
2.46875
2
examples/registration/demo.py
mli0603/lietorch
360
12775725
import sys sys.path.append('../core') import argparse import torch import cv2 import numpy as np from viz import sim3_visualization from lietorch import SO3, SE3, Sim3 from networks.sim3_net import Sim3Net def normalize_images(images): images = images[:, :, [2,1,0]] mean = torch.as_tensor([0.485, 0.456, 0.40...
2.390625
2
configs/tutorial/caches.py
DownloadADuck/gem5-experiments
0
12775726
<reponame>DownloadADuck/gem5-experiments<filename>configs/tutorial/caches.py<gh_stars>0 #Caches configuration file #We first import the simObj we are going to extend in this file import m5 from m5.objects import Cache #adding common scipts to our path #m5.util.addToPath('../../') #from common import SimpleOpts #We c...
2.515625
3
libretto/migrations/0042_auto_20190830_2210.py
adrienlachaize/dezede
15
12775727
<filename>libretto/migrations/0042_auto_20190830_2210.py # -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-08-30 20:10 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('libretto', '0041_migrate_files'), ] ...
1.546875
2
testsuite/modulegraph-dir/global_import.py
xoviat/modulegraph2
9
12775728
<reponame>xoviat/modulegraph2 import no_imports def foo(): pass class MyClass: pass
1.070313
1
train.py
tkx68/Resume-NER
0
12775729
<reponame>tkx68/Resume-NER import argparse import numpy as np import torch from transformers import DistilBertForTokenClassification, DistilBertTokenizerFast from torch.utils.data import Dataset, DataLoader, RandomSampler, SequentialSampler from torch.optim import Adam from utils import get_special_tokens, trim_entity...
2.140625
2
modules/spider/spider/spiders/__init__.py
Ladder-Climbers/mayne-code
0
12775730
# This package will contain the spiders of your Scrapy project # # Please refer to the documentation for information on how to create and manage # your spiders. DOUBAN_COOKIE = { "__gads": "ID=2421173a5ca57aed-228b4c29c5c800c1:T=1621494084:RT=1621494084:S=ALNI_MaJlRkH7cibeVPuRhGgoy4NehQdpw", "__utma": "8137958...
1.46875
1
utils/visualization_utils.py
Flipajs/FERDA
1
12775731
import numpy as np import matplotlib.cm as cm import matplotlib.pylab as plt def generate_colors(count): cm = plt.get_cmap('gist_rainbow') return np.array([cm(1. * i / count) for i in range(count)]).astype(float) def get_q_color(id, ant_num): from PyQt4 import QtGui r, g, b = get_color(id, ant_num) ...
2.578125
3
dev_5/mainapp/models.py
Floou/dev-5
0
12775732
from django.db import models class FullName(models.Model): full_name = models.CharField(verbose_name='ФИО', max_length=256) def __str__(self): return self.full_name class Meta: verbose_name = 'ФИО' verbose_name_plural = 'ФИО'
2.171875
2
test/unsupported/03/BibtexObjectTest03.py
wleoncio/cff-converter-python
1
12775733
from cffconvert import BibtexObject import unittest import os import ruamel.yaml as yaml from test.contracts.BibtexObject import Contract class BibtexObjectTest(Contract, unittest.TestCase): def setUp(self): fixture = os.path.join(os.path.dirname(__file__), "CITATION.cff") with open(fixture, "r")...
2.4375
2
TableCreator.py
DanieleFedeli/Wikipedia_missing_links
0
12775734
from nltk.corpus import stopwords import requests import re import nltk nltk.download('stopwords') WIKI_API_URL = "https://en.wikipedia.org/w/api.php" inputTitleRepr = './ShortReprLists' def retrieveCategoryFromJson(pages): categories = [] for k, v in pages.items(): for cat in v['categories']: ...
3.15625
3
pipeline/pipeline.py
iosonofabio/quakelab_containers
1
12775735
<reponame>iosonofabio/quakelab_containers<filename>pipeline/pipeline.py #!/usr/bin/env python # vim: fdm=indent ''' author: <NAME> date: 05/04/17 content: Skeleton pipeline ''' # Modules import argparse # Script if __name__ == '__main__': pa = argparse.ArgumentParser(description='pipeline') prin...
1.554688
2
fixture/record_related_tab.py
Eduard-z/SF_project_pytest
0
12775736
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC class RecordRelatedTab: def __init__(self, app): self.app = app def expand_Show_more_actions_dropdown_on_record_page(self): driv...
2.578125
3
mail/mail.py
TsengWen/Weekly
0
12775737
<reponame>TsengWen/Weekly class Mail: def __init__(self, prot, *argv): self.prot = prot(*argv) def login(self, account, passwd): self.prot.login(account, passwd) def send(self, frm, to, subject, content): self.prot.send(frm, to, subject, content) def quit(self): self.p...
2.484375
2
Assignment 11/task1.py
drewriker/USU-CS-1400
2
12775738
# <NAME> # CS1400 - LW2 XL # Assignment #11 from modules.orbian import Orbian from time import sleep from random import randint from random import shuffle # Hint hint def main(): print("WELCOME TO ORBIAN FAMILY") print() family = [] input("Hit Enter to Create the First Four Orbians") for i in ...
3.640625
4
model.py
rezendi/vortext
14
12775739
<gh_stars>10-100 import datetime, logging from google.appengine.api import memcache from google.appengine.ext import db, ndb import tweepy TWITTER_CONSUMER_KEY = "YOUR_CONSUMER_KEY" TWITTER_CONSUMER_SECRET = "YOUR_CONSUMER_SECRET" STATUS_CREATED = 1 STATUS_FETCH_INITIATED = 10 STATUS_FETCH_COMPLETE = 1...
2.375
2
test/keras-rl/actor.py
showkeyjar/AutoMakeHuman
13
12775740
<reponame>showkeyjar/AutoMakeHuman #操作器 import keras def create_actor_network(self, state_size, action_dim): print("Now we build the model") S = Input(shape=[state_size]) h0 = Dense(HIDDEN1_UNITS, activation='relu')(S) h1 = Dense(HIDDEN2_UNITS, activation='relu')(h0) Steering = Dense(1, activation=...
2.71875
3
src/dbmeta/tuple_store.py
Jon-Burr/dbobj
0
12775741
<gh_stars>0 from .store import Store, SeqStore, AssocStore, MutableSeqStore, MutableAssocStore from .column import read_identity from future.utils import iteritems class TupleStore(Store): """ Store that stores data internally as namedtuples """ def __init__(self, data=None, store_type=None, **kwargs): ...
2.6875
3
scripts/1_1_BengaleseFinch_Sakata_Parsing.py
AvisP/AVGN_Avishek
0
12775742
<filename>scripts/1_1_BengaleseFinch_Sakata_Parsing.py # -*- coding: utf-8 -*- """ Created on Mon Mar 2 17:56:10 2020 @author: AvishekPaul """ ##### SCRIPT 1 from avgn.utils.general import prepare_env prepare_env() import tqdm import pandas as pd pd.options.display.max_columns = None import librosa from datetime i...
2.453125
2
src/CollageImage.py
1alexandra/collage
1
12775743
from PIL import Image from src.utils import int_clamp from PIL import UnidentifiedImageError import tkinter.messagebox as messagebox def safe_open_image(filename, corner_creator): image = None try: if filename is not None and filename != "": image = PILCollageImage(filename, corner_creator...
3.125
3
article/tests/test_urls.py
mohitkhatri611/mumbleapi
1
12775744
from django.test import SimpleTestCase from django.urls import reverse , resolve from article.views import * class TestUrls(SimpleTestCase): def test_articles_url_is_resolved(self): url = reverse('mumbles-api-articles:articles') self.assertEquals(resolve(url).func,articles) def test_artic...
2.484375
2
game/game.py
petia2009/BOT
0
12775745
from game.field import FieldXO from game.player import Player, Bot class Game: __field__: FieldXO = None __status__: bool = False __active_player__: Player def __init__(self, player_x_id: str, player_o_id: str): self.__playerX__ = self.__create_player(player_x_id, 'X') self.__playerO...
3.03125
3
ClusterFind.py
LasTAD/VAST-2017-MC-1
1
12775746
import numpy as np from SOM import SOM data = np.loadtxt('Data/output.txt', delimiter=';', usecols=range(40)) ###SOM som = SOM(10, 10) # initialize the SOM som.fit(data, 10000, decay='hill') # som = SOM(10, 10) # initialize the SOM # som.load('Data/SOM') targets = np.loadtxt('Data/target.txt', dtype='int') targ...
3.421875
3
LAB03/02-S3/backend/cloudalbum/database/model_ddb.py
liks79/moving-to-serverless-renew
6
12775747
<reponame>liks79/moving-to-serverless-renew """ cloudalbum/database/model_ddb.py ~~~~~~~~~~~~~~~~~~~~~~~ Application data model defined here. :description: CloudAlbum is a fully featured sample application for 'Moving to AWS serverless' training course :copyright: © 2019 written by <NAME>, <NAME>. ...
2.171875
2
main.py
AbijahKaj/DONT
20
12775748
''' ##### DO Not Touch your face ver.0.2 ### Medical Imaging & Intelligent Reality Lab (MI2RL) @ Asan Medical Center(AMC) # MI2RL website : https://www.mi2rl.co/ # AMC : http://www.amc.seoul.kr/asan/main.do ### Developer # <NAME> : <EMAIL> # <NAME> : <EMAIL> # <NAME> : <EMAIL> # <NAME> : <EMAIL> # <NAME> : <EMAIL> ...
2
2
tests/test_satellite/test_time.py
JaiWillems/SatPy
6
12775749
<filename>tests/test_satellite/test_time.py """Testing module for the `Time` class.""" from astropy import coordinates, time from celest.satellite.time import Time from unittest import TestCase import julian as jd import unittest import numpy as np class TestTime(TestCase): def setUp(self): """Test fix...
2.8125
3
application.py
JPGarCar/HORS
1
12775750
<filename>application.py #!/usr/bin/python ## Things to improve: # - return redirect(url_for("")) # - database INDEX ids to be faster at searching # DONE - SELECT * FROM users JOIN zipcodes ON users.zipcode = zipcodes.id 59:00 # DONE - use foreign keys to not having reocurring data in a table, the data is in a differe...
2.265625
2