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 |
|---|---|---|---|---|---|---|
setup.py | huonw/strawberry | 0 | 12790451 | <reponame>huonw/strawberry<gh_stars>0
#!/usr/bin/env python
# we use poetry for our build, but this file seems to be required
# in order to get GitHub dependencies graph to work
import setuptools
if __name__ == "__main__":
setuptools.setup(name="strawberry-graphql")
| 0.820313 | 1 |
vivarium/library/wrappers.py | vivarium-collective/vivarium-core | 13 | 12790452 | <reponame>vivarium-collective/vivarium-core<filename>vivarium/library/wrappers.py
from typing import Union
from vivarium.core.process import Process
from vivarium.core.types import Schema, State, Update
from vivarium.composites.toys import ToyProcess
def make_logging_process(
process_class,
... | 2.25 | 2 |
tests/unittest/batchify/test_batchify_embedding.py | bkktimber/gluon-nlp | 0 | 12790453 | <filename>tests/unittest/batchify/test_batchify_embedding.py
# coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
#... | 2.28125 | 2 |
setup.py | dbbs-lab/ndsb | 0 | 12790454 | #!/usr/bin/env python3
import os, sys
import setuptools
# Get text from README.txt
with open("README.md", "r") as fp:
readme_text = fp.read()
# Get __version__ without importing
with open(os.path.join(os.path.dirname(__file__),"ndsb", "__init__.py"), "r") as f:
for line in f:
if line.startswith("__ver... | 1.585938 | 2 |
pylegoclassifier.py | fieryWalrus1002/pylegoclassifier | 1 | 12790455 |
# import the needed packages
import pickle
from sklearn import preprocessing
import time
from os import listdir
from os.path import isfile, join
from random import randint, uniform
import numpy as np
from matplotlib import pyplot as plt
import cv2 as cv
from scipy import ndimage
from skimage import morphol... | 2.8125 | 3 |
mountwizzard3/modeling/model_points.py | fcbarclo/MountWizzard3 | 1 | 12790456 | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # ####
# ## ## # ## # #
# # # # # # # # # ###
# # ## # ## ## #
# # # # # # ####
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 ... | 2.03125 | 2 |
Working/Raycasting/vf.py | mm-wang/metashape | 4 | 12790457 | import rhinoscriptsyntax as rs
import Rhino as rc
import scriptcontext as sc
#import ghpythonlib as gh
import Grasshopper as gh
""" Calculate View Factor
"""
class ViewFactor(object):
def __init__(self):
self.sphere_nested = []
self.cpt = []
self.bound_nested = []
self.bld_num = No... | 2.296875 | 2 |
example_app/tutorial/urls.py | mr-aliraza/django-rest-swagger | 0 | 12790458 | <filename>example_app/tutorial/urls.py
from django.urls import re_path, include
from rest_framework.routers import DefaultRouter
from rest_framework_swagger.views import get_swagger_view
from snippets import views
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', v... | 2.0625 | 2 |
mozart/music/netease.py | kushao1267/MusicAPI | 0 | 12790459 | <filename>mozart/music/netease.py
import re
import requests
import json
import binascii
from Crypto.Cipher import AES
from .base import Music
from mozart import config
from .exception import MusicDoesnotExists
__all__ = ["Netease"]
def encode_netease_data(data) -> str:
data = json.dumps(data)
key = binascii.... | 2.6875 | 3 |
monte_carlo.py | WillSkywalker/2048_monte_carlo | 1 | 12790460 | """Algorithm for simulating a 2048 game using Monte-Carlo method."""
import random, _2048
SIMULATE_TIMES = 100000
DIRECTIONS = ('UP', 'DOWN', 'LEFT', 'RIGHT')
def simulate_to_end(game):
while game.get_state():
dircts = list(DIRECTIONS)
for i in xrange(3):
c = random.choice(dircts)
... | 4.0625 | 4 |
model/LsBlk.py | keithCollins77093/hardInfo | 0 | 12790461 | # Project: hardInfo
# Author: <NAME>
# Date Started: March 18, 2022
# Copyright: (c) Copyright 2022 <NAME>
# Module: model/LsBlk.py
# Date Started: March 23, 2022
# Purpose: Store and provide API for Linux lsblk command.
# Development:
# Arguments to include ... | 2.53125 | 3 |
1-lab/simple_replacement.py | osovv/miet-security | 0 | 12790462 | import argparse
def encrypt(message: str, key: dict[int, int]) -> str:
encrypted = map(lambda char: key[char], message)
return encrypted
def decrypt(message: str, key: dict[int, int]) -> str:
decrypted = map(lambda char: key[char], message)
return decrypted
def main():
parser = argparse.ArgumentParser()
... | 3.78125 | 4 |
ObitSystem/Obit/python/OPlot.py | sarrvesh/Obit | 5 | 12790463 | """
Obit Plotting class
Create a plot object using newOPlot which allows specifying the output
and background color. If no output is specified this information
will be prompted.
Next, the plotting region must be specified using either PSetPlot,
one of the XY plotting routines (PXYPlot, PXYOver, or PXYErr)
PGrayScal... | 2.59375 | 3 |
code.py | VinayDhurwe/python-mini-challenges | 0 | 12790464 | # --------------
#Code starts here
import sys
def palindrome(num):
numstr = str(num)
for i in range(num+1,sys.maxsize):
if str(i)== str(i)[::-1]:
return i
palindrome(123)
# --------------
#Code starts here
from collections import Counter
def a_scramble(str_1,str_2):
list_str1 = Counter(st... | 3.546875 | 4 |
Longest_Absolute_File_Path.py | thydeyx/LeetCode-Python | 1 | 12790465 | # -*- coding:utf-8 -*-
#
# Author : TangHanYi
# E-mail : <EMAIL>
# Create Date : 2017-01-06 07:09:38 PM
# Last modified : 2017-01-06 07:34:29 PM
# File Name : Longest_Absolute_File_Path.py
# Desc :
class Solution(object):
def lengthLongestPath(self, inp):
tmp = ''
stac... | 3.28125 | 3 |
project/workspace.py | felixsteinke/Motion-Planner | 0 | 12790466 | from utils import open_image, open_greyscale_bmp
from workspace_calc import WorkspaceCalculator
from workspace_view import WorkspaceView
class Workspace:
def __init__(self, app_page, room_name, robot_name):
room_bmp = open_greyscale_bmp(room_name)
robot_bmp = open_greyscale_bmp(robot_name)
... | 2.421875 | 2 |
DjangoFiles/Customers/migrations/0002_create_tenant_public.py | Nasjoe/Django-Tenant-Example | 0 | 12790467 | # Generated by Django 2.2.13 on 2021-06-08 10:08
import os
from django.db import migrations
def create_premier_tenant(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
Client = apps.get_model('Custom... | 2.125 | 2 |
common/test_input_validation.py | lbozarth/exercise-toes | 4 | 12790468 | from common.input_validation import (
extract_phone_number,
)
def test_extract_phone_number():
assert extract_phone_number('510501622') == None
assert extract_phone_number('5105016227') == '15105016227'
assert extract_phone_number('15105016227') == '15105016227'
assert extract_phone_number('+15105... | 2.6875 | 3 |
evaluation/datasets/test_datasets.py | hsiehkl/pdffigures2 | 296 | 12790469 | import unittest
import math
import datasets
from pdffigures_utils import get_num_pages_in_pdf
class TestDataset(unittest.TestCase):
def test_pages_annotated_consistency(self):
for dataset in datasets.DATASETS.values():
dataset = dataset()
pages_annotated = dataset.get_annotated_pa... | 2.75 | 3 |
Lib/fontParts/fontshell/groups.py | sanjaymsh/fontParts | 66 | 12790470 | import defcon
from fontParts.base import BaseGroups
from fontParts.fontshell.base import RBaseObject
class RGroups(RBaseObject, BaseGroups):
wrapClass = defcon.Groups
def _get_side1KerningGroups(self):
return self.naked().getRepresentation("defcon.groups.kerningSide1Groups")
def _get_side2Kerni... | 2.359375 | 2 |
sample.py | hondasports/awsSample | 0 | 12790471 | # -*- coding: utf-8 -*-
import botocore
import boto3
import io
from datetime import datetime
import s3Uploader
# Refs : https://boto3.readthedocs.io/en/latest/reference/services/s3.html
s3 = boto3.client('s3')
def main():
# [追加する時]
# バケットがなければ作成
# あればそれを使う。
# ファイルの重複チェック
# 重複していれば、削除し更新
# 重... | 2.359375 | 2 |
majority_judgment/tests.py | roipoussiere/moje | 7 | 12790472 | from django.test import TestCase
from majority_judgment.tools import get_ranking, get_ratings, majority_grade
class MajorityJudgmentTestCase(TestCase):
fixtures = ['election.json']
# def setUp(self):
def test_ranking(self):
election_id = 2
ranking = get_ranking(election_id)
ranki... | 2.65625 | 3 |
mmdet/core/anchor/__init__.py | MinliangLin/TSD | 454 | 12790473 | from .anchor_generator import AnchorGenerator
from .anchor_target import anchor_inside_flags, anchor_target, images_to_levels, unmap
from .guided_anchor_target import ga_loc_target, ga_shape_target
from .point_generator import PointGenerator
from .point_target import point_target
__all__ = [
"AnchorGenerator",
... | 1.304688 | 1 |
MWDF Project/MasterworkDwarfFortress/Utilities/Quickfort/src/qfconvert/xlsx.py | ML-SolInvictus/modified-MWDF | 25 | 12790474 | <reponame>ML-SolInvictus/modified-MWDF
"""Reading and parsing .xlsx format blueprints."""
import re
import zipfile
from xml2obj import xml2obj
from errors import FileError
def read_xlsx_file(filename, sheetid):
"""
Read contents of specified sheet in Excel 2007 (.xlsx) workbook file.
.xlsx... | 2.671875 | 3 |
simphas/play.py | DaDaCheng/mutiagent | 0 | 12790475 | <filename>simphas/play.py
#!/usr/bin/env python3
import logging
import click
import numpy as np
from os.path import abspath, dirname, join
from gym.spaces import Tuple
from mujoco_py import const, MjViewer
from mae_envs.viewer.env_viewer import EnvViewer
from mae_envs.wrappers.multi_agent import JoinMultiAgentActions
f... | 2.203125 | 2 |
tests/test_davidlebovitz.py | gloriousDan/recipe-scrapers | 0 | 12790476 | <gh_stars>0
from recipe_scrapers.davidlebovitz import DavidLebovitz
from tests import ScraperTest
class TestDavidLebovivtzScraper(ScraperTest):
scraper_class = DavidLebovitz
def test_host(self):
self.assertEqual("davidlebovitz.com", self.harvester_class.host())
def test_author(self):
se... | 2.78125 | 3 |
zvt/factors/technical_factor.py | manstiilin/zvt | 1 | 12790477 | from typing import List, Union
import pandas as pd
from zvdata import IntervalLevel
from zvt.api.common import get_kdata_schema
from zvt.factors.algorithm import MacdTransformer, MaTransformer
from zvt.factors.factor import Factor, Transformer, Accumulator
class TechnicalFactor(Factor):
def __init__(self,
... | 2.0625 | 2 |
backend/api/services/throttling.py | ferdn4ndo/infotrem | 0 | 12790478 | from django.contrib.auth.models import AnonymousUser
from rest_framework.throttling import SimpleRateThrottle
class BaseRateThrottle(SimpleRateThrottle):
scope = 'baseThrottle'
class Meta:
abstract = True
def get_cache_key(self, request, view):
return self.cache_format % {
's... | 2.015625 | 2 |
a3/clean_data.py | WendyH1108/IntSys-Education | 0 | 12790479 | <gh_stars>0
import pickle
import numpy as np
from PIL import Image, ExifTags,ImageOps
def load_pickle_file(path_to_file):
"""
Loads the data from a pickle file and returns that object
"""
## Look up: https://docs.python.org/3/library/pickle.html
## The code should look something like this:
# ... | 3.65625 | 4 |
kevin/tests/leet/test_is_anagram.py | kalyons11/kevin | 1 | 12790480 | <reponame>kalyons11/kevin<filename>kevin/tests/leet/test_is_anagram.py
"""
https://leetcode.com/explore/challenge/card/february-leetcoding-challenge-2021/585/week-2-february-8th-february-14th/3636/
"""
from unittest import TestCase
from kevin.leet.is_anagram import Solution
class TestIsAnagram(TestCase):
def _b... | 3.328125 | 3 |
PartSongSet/__init__.py | jcksnvllxr80/MidiController | 1 | 12790481 | <reponame>jcksnvllxr80/MidiController
from PartSongSet import *
| 1.023438 | 1 |
MMMaker/app/memes/migrations/0002_auto_20200616_1314.py | C4Ution/MMMaker | 9 | 12790482 | # Generated by Django 2.2.12 on 2020-06-16 13:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('memes', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='task',
... | 1.601563 | 2 |
ubb/fop/BusCompani_exam/app_coordinator.py | AlexanderChristian/private_courses | 0 | 12790483 | <gh_stars>0
from tester.tester import Tester
from ui.application import Application
from controller.controller import Controller
from repository.repository import Repository
with open("database.txt", "r") as f:
t = Tester()
repo = Repository()
controller = Controller(repo, f)
app = Application(con... | 1.8125 | 2 |
tinder_scraper.py | lhandal/tinder-bot | 1 | 12790484 | <filename>tinder_scraper.py
# MIT License
#
# Copyright (c) 2020 <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.234375 | 2 |
backend/custom_models/migrations/0004_auto_20190529_0846.py | code-for-canada/django-nginx-reactjs-docker | 3 | 12790485 | <reponame>code-for-canada/django-nginx-reactjs-docker
# Generated by Django 2.1.7 on 2019-05-29 12:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('custom_models', '0003_auto_20190528_1156'),
]
operations = [
migrations.AlterField(
... | 1.164063 | 1 |
app/api/v1/models/__init__.py | lprichar/electionguard-api-python | 19 | 12790486 | from .auth import *
from .ballot import *
from .base import *
from .decrypt import *
from .encrypt import *
from .election import *
from .guardian import *
from .key_ceremony import *
from .key_guardian import *
from .manifest import *
from .tally import *
from .tally_decrypt import *
from .user import *
| 1.070313 | 1 |
demos/instance_occlsegm/examples/instance_occlsegm/panoptic_occlusion_segmentation/view_dataset.py | pazeshun/jsk_apc | 0 | 12790487 | <reponame>pazeshun/jsk_apc
#!/usr/bin/env python
import argparse
from instance_occlsegm_lib.contrib import instance_occlsegm
if __name__ == '__main__':
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
'--split',
choi... | 2 | 2 |
simulation/topology.py | uzum/cran-simulator | 0 | 12790488 | from entities.remote_radio_head import RemoteRadioHead
from entities.hypervisor import Hypervisor
from entities.baseband_unit import BasebandUnit
from entities.switch import Switch
from forwarding.forwarding import Forwarding
class StatHistory(object):
history = {}
def get(key, current):
if (key in St... | 2.34375 | 2 |
tools/nightly-e2e-tests/src/lint.py | buranmert/dd-sdk-ios | 1 | 12790489 | <gh_stars>1-10
# -----------------------------------------------------------
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-2020 Datadog, Inc.
# ----... | 2 | 2 |
accessify/gui/utils.py | jscholes/accessify-prototype | 0 | 12790490 | <gh_stars>0
import functools
import threading
import wx
def find_last_child(widget):
children = widget.GetChildren()
if not children:
return widget
else:
last = children[len(children) - 1]
return find_last_child(last)
def show_error(parent, message):
if not wx.IsMainTh... | 2.359375 | 2 |
include/utils.py | cns-iu/myaura | 0 | 12790491 | # coding=utf-8
# Author: <NAME> & <NAME>
# Date: Jan 06, 2021
#
# Description: Utility functions
#
import os
import re
import functools
import pickle
import numpy as np
#
# Functions to handle Twitter text
#
re_all_after_retweet = re.compile(r"rt @[a-zA-Z0-9_]+.+", re.IGNORECASE | re.UNICODE)
def removeAllAfterRetwe... | 3.25 | 3 |
gravtr/__init__.py | gfabricio/gravtr | 6 | 12790492 | import hashlib
import sys
if sys.version_info[0] < 3:
import urllib
else:
import urllib.parse as urllib
class Gravtr(object):
GRAVATAR_URL = 'https://www.gravatar.com/avatar/'
GRAVATAR_URL_UNSECURE = 'http://www.gravatar.com/avatar/'
class ratingType(object):
G = 'g'
PG = 'pg'
... | 2.734375 | 3 |
MuseParse/tests/testUsingXML/testArpegGliss.py | Godley/MusIc-Parser | 5 | 12790493 | import os
import unittest
from MuseParse.tests.testUsingXML.xmlSet import xmlSet, parsePiece
from MuseParse.classes.ObjectHierarchy.TreeClasses.BaseTree import Search, FindByIndex
from MuseParse.classes.ObjectHierarchy.TreeClasses.NoteNode import NoteNode
from MuseParse.classes.ObjectHierarchy.TreeClasses.MeasureNode ... | 2.203125 | 2 |
packages/pegasus-python/src/Pegasus/json.py | ryantanaka/pegasus | 0 | 12790494 | <filename>packages/pegasus-python/src/Pegasus/json.py<gh_stars>0
"""
Abstract :mod:`json` with Pegasus specific defaults.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import io
import json as _json
import logging
import uuid
from enum import Enum
from functools import partial
from pathlib import Path
from typing import Ite... | 2.578125 | 3 |
chemicalExamination.py | goowell/DrAdvice | 0 | 12790495 | <reponame>goowell/DrAdvice
from datetime import datetime
from logger import logger
from os import listdir, path
from db import chemical_source, DuplicateKeyError,chemical_splited,paients_info
def chemical_examination_parse(file_root):
chemical_source.drop()
dir_list = listdir(file_root)
file_list=[path.jo... | 2.78125 | 3 |
ps3api/tmapi.py | iMoD1998/PS3API | 8 | 12790496 | import os
import pathlib
from ctypes import *
from ctypes import _SimpleCData
from ctypes import _Pointer
from .common import CEnum
class SNResult(CEnum):
SN_S_OK = (0)
SN_S_PENDING = (1)
SN_S_NO_MSG = (3)
SN_S_TM_VERSION = (4)
SN_S_REPLACED = (5)
SN_S_NO_ACTION = (6)
SN_S_CONNECTED = SN_S... | 2.265625 | 2 |
tests/unit/test_process.py | tholom/pake | 3 | 12790497 | import sys
import unittest
import os
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, os.path.abspath(
os.path.join(script_dir, os.path.join('..', '..'))))
from pake import process
import pake.program
import pake
class ProcessTest(unittest.TestCase):
def test_call(self):
... | 2.578125 | 3 |
research/cv/metric_learn/train.py | leelige/mindspore | 77 | 12790498 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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.585938 | 2 |
src/intranet3/intranet3/utils/mail_fetcher.py | tmodrzynski/intranet-open | 0 | 12790499 | <reponame>tmodrzynski/intranet-open
# -*- coding: utf-8 -*-
"""
Sending emails
"""
import re
import email
import quopri
import datetime
import time
import poplib
from base64 import b64decode
from pprint import pformat
from email.header import decode_header
from email.utils import parsedate
import transaction
from intr... | 1.914063 | 2 |
fitnick/activity/models/calories.py | kcinnick/fitnick | 1 | 12790500 | <filename>fitnick/activity/models/calories.py
from sqlalchemy import MetaData, Table, Column, UniqueConstraint, Numeric, Date, Integer
from sqlalchemy.ext.declarative import declarative_base
meta = MetaData()
Base = declarative_base()
class Calories(Base):
__tablename__ = 'calories'
date = Column('date', Dat... | 2.703125 | 3 |
ia870/iaero.py | rdenadai/ia870p3 | 5 | 12790501 | <gh_stars>1-10
# -*- encoding: utf-8 -*-
# Module iaero
def iaero(f, b=None):
from ia870 import ianeg,iadil,iasereflect,iasecross
if b is None: b = iasecross()
y = ianeg( iadil( ianeg(f),iasereflect(b)))
return y
| 2.40625 | 2 |
_includes/code/02_parallel_jobs/print_hostname_and_time.py | bkmgit/hpc-parallel-novice | 32 | 12790502 | <gh_stars>10-100
#/usr/bin/env python3
from mpi4py import MPI
from datetime import datetime
def print_hostname():
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
hname = MPI.Get_processor_name()
tod = datetime.now().isoformat(' ')
print("this is rank = %2i (total: %2i) r... | 2.609375 | 3 |
setup.py | parenthetical-e/clouds_are_fun | 0 | 12790503 | <gh_stars>0
from setuptools import setup
setup(
name='clouds_are_fun',
version='0.0.1',
description="Clouds are (as stated) fun!",
author='<NAME>',
author_email='<EMAIL>',
license='',
packages=['clouds_are_fun'],
zip_safe=False)
| 1.023438 | 1 |
dockit/views/edit.py | zbyte64/django-dockit | 5 | 12790504 | <filename>dockit/views/edit.py
from django.core.exceptions import ImproperlyConfigured
from django.views.generic import edit as editview
from detail import SingleObjectMixin, SingleObjectTemplateResponseMixin, BaseDetailView
from dockit.forms import DocumentForm
class DocumentFormMixin(editview.FormMixin, SingleObje... | 2.109375 | 2 |
main/views/admin/resource/resource_form.py | tiberiucorbu/av-website | 0 | 12790505 | <filename>main/views/admin/resource/resource_form.py
import urllib
from flask.ext import wtf
from google.appengine.ext import blobstore
import flask
import wtforms
import auth
import config
import model
import util
from main import app
from views import ListField
class ResourceForm(wtf.Form):
name = wtforms.Tex... | 2.25 | 2 |
evidence/data_sources/__init__.py | cancervariants/evidence-normalization | 0 | 12790506 | <filename>evidence/data_sources/__init__.py
"""Import data sources"""
from .gnomad import GnomAD
from .cbioportal import CBioPortal
from .cancer_hotspots import CancerHotspots
| 1.273438 | 1 |
src/fts3/cli/jobshower.py | Jar-win/fts-rest | 1 | 12790507 | <filename>src/fts3/cli/jobshower.py<gh_stars>1-10
# Copyright notice:
# Copyright Members of the EMI Collaboration, 2013.
#
# See www.eu-emi.eu for details on the copyright holders
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | 1.960938 | 2 |
pcep/mod5_moddigit.py | gliverm/devnet-study-group | 1 | 12790508 | bday = input("Enter your birthday [YYYYMMDD or YYYYDDMM or MMDDYYYY]:")
if len(bday) != 8 or not date.isdigit():
print("Birthday dat must be 8 digits in length")
else:
while len(bday) != 1:
lst = list(bday)
sum = 0
for num in lst:
sum += int(num)
bday = str(sum)
pri... | 4.1875 | 4 |
Array/4.Modifying-items.py | manish1822510059/Python-1000-program | 1 | 12790509 | <filename>Array/4.Modifying-items.py
import array as arr
numarr = arr.array('i',[10,20,30,40,50,60,70,80])
print("Array items:")
print(numarr)
#changing index 3 value
numarr[3] = 44
print('\n Array items (after modifing):')
print(numarr)
#changing 1st to 5th index values
numarr[1:5] = arr.array('i',[-8,-5,-6,-... | 3.96875 | 4 |
src/nnets/utils.py | Zaharid/nnets | 0 | 12790510 | <reponame>Zaharid/nnets
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 24 12:05:09 2014
@author: zah
"""
import numpy as np
from sympy.printing.lambdarepr import LambdaPrinter
import numba
#more nonsensical code...
@numba.jit('void(f8[:],f8[:],u2)', nopython=True)
def memcopy(dest, src, size):
"""Copy the first `... | 2.46875 | 2 |
CursoemVideo/ex019.py | arthxvr/coding--python | 0 | 12790511 | <gh_stars>0
from random import choice
n1 = str(input('Primeiro aluno: '))
n2 = str(input('Segundo aluno: '))
n3 = str(input('Terceiro aluno: '))
n4 = str(input('Quarto aluno: '))
escolhido = choice([n1, n2, n3, n4])
print(f'Aluno escolhido: {escolhido}')
| 3.40625 | 3 |
Trajectory_Mining/Bag_of_Words/test/test_sklearn.py | AdamCoscia/eve-trajectory-mining | 0 | 12790512 | # -*- coding: utf-8 -*-
"""testing script"""
import os
import sys
from functools import reduce
import numpy as np
import pandas as pd
import nltk # Natural Language Tool Kit
from fuzzywuzzy import fuzz, process # Fuzzy String Matching
import jellyfish # Distance metrics
from sklearn.feature_extraction.text import T... | 2.421875 | 2 |
Packages/Dead/help/Lib/RebuildSearch.py | xylar/cdat | 62 | 12790513 | <gh_stars>10-100
#############################################################################
#############################################################################
# File: RebuildSearch.py #
# Date: 04-Dec-2007 ... | 2.640625 | 3 |
dashboard/migrations/0002_auto_20190523_1231.py | favefan/sams | 0 | 12790514 | # Generated by Django 2.2 on 2019-05-23 12:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='entrylist',
name='awards',
... | 1.554688 | 2 |
cell.py | cdated/conway-curses | 0 | 12790515 | #!/usr/bin/env python
class Cell():
# postion(X, Y)
def __init__(self, alive=False, position=(0,0), bounds=(0, 5)):
# position(x, y)
self.position = position
self.alive = alive
self.next_state = False
# bounds(min, max)
self.bounds = bounds
self.neighbo... | 3.609375 | 4 |
src/api-examples/slowpairs.py | cern-fts/fts-monitoring | 1 | 12790516 | <reponame>cern-fts/fts-monitoring
#!/usr/bin/env python2
import json
from common import get_url
from optparse import OptionParser
def get_slow_pairs(threshold = 1, vo = None):
content = get_url('https://fts3-pilot.cern.ch:8449/fts3/ftsmon/overview', vo = vo, page = 'all')
pairs = json.loads(content)
s... | 2.84375 | 3 |
language_acts/cms/management/commands/wt_update_index.py | kingsdigitallab/language-acts-docker | 0 | 12790517 | from wagtail.search.management.commands import update_index
class Command(update_index.Command):
pass
| 1.078125 | 1 |
viewformer/cli.py | jkulhanek/viewformer | 87 | 12790518 | from aparse import click
from viewformer.utils.click import LazyGroup
@click.group(cls=LazyGroup)
def main():
pass
@main.group(cls=LazyGroup)
def dataset():
pass
@main.group(cls=LazyGroup)
def visualize():
pass
@main.group(cls=LazyGroup)
def model():
pass
@main.group(cls=LazyGroup)
def evaluat... | 2.140625 | 2 |
webui_alternative/server/app.py | mlz000/Tok | 0 | 12790519 | <gh_stars>0
# Copyright 2017 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 2.234375 | 2 |
openGaussBase/testcase/SQL/DML/set/Opengauss_Function_DML_Set_Case0032.py | opengauss-mirror/Yat | 0 | 12790520 | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 1.890625 | 2 |
scphylo/tl/__init__.py | faridrashidi/scphylo-tools | 0 | 12790521 | <reponame>faridrashidi/scphylo-tools
"""Tools Module."""
from scphylo.tl.cna import infercna
from scphylo.tl.consensus import consensus, consensus_day
from scphylo.tl.fitch import fitch
from scphylo.tl.partition_function import partition_function
from scphylo.tl.score import ad, caset, cc, disc, dl, gs, mltd, mp3, rf,... | 1.210938 | 1 |
Day-110/list_comprehension.py | arvimal/100DaysofCode-Python | 1 | 12790522 | #!/usr/bin/env python3
# Return a list
# The element at the index should be multiplied by 2
# Rest of the elements should be the same.
def double_index(lst, index):
if index > len(lst):
return lst
else:
return([n for n in lst[:index]] + [2 * lst[index]] + [n for n in lst[index + 1:]])
print(double_inde... | 4.0625 | 4 |
core/textRender.py | chiluf/visvis.dev | 0 | 12790523 | <reponame>chiluf/visvis.dev
# -*- coding: utf-8 -*-
# Copyright (C) 2012, <NAME>
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
""" Module textRender
For rendering text in visvis.
Defines a wibject and a wobject: Label and Text,
which are both a... | 2.109375 | 2 |
migrations/versions/59564f63b0ae_.py | RaihanStark/raven-raffles-web | 0 | 12790524 | <filename>migrations/versions/59564f63b0ae_.py
"""empty message
Revision ID: 59564f63b0ae
Revises: c2<PASSWORD>ee965a5
Create Date: 2020-06-10 23:03:10.493772
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = 'c2889ee965a5'
branch_labels =... | 1.203125 | 1 |
SZR/apps/groups/tests/test_view.py | Alek96/SZR | 1 | 12790525 | from GitLabApi import objects
from core.tests.test_view import LoginMethods
from core.tests.test_view import SimpleUrlsTestsCases
from django.db.models import QuerySet
from django.urls import reverse
from groups import models
from groups.sidebar import GroupSidebar, FutureGroupSidebar
from groups.tests import test_form... | 2.09375 | 2 |
gist/repo.py | thisisibrahimd/gist | 0 | 12790526 | <reponame>thisisibrahimd/gist<filename>gist/repo.py
import logging
from sqlalchemy import create_engine, select, func, funcfilter
from sqlalchemy.orm import sessionmaker, lazyload, joinedload, subqueryload
from gist.entities import EligibilityCriterion, Person, ConditionOccurrence, DrugExposure, Measurement, Observatio... | 2.234375 | 2 |
api/service/listing_service.py | build-week-optimal-pricing/Data-science | 0 | 12790527 | #!/usr/bin/env python3
from api import DB
from api.models.listing import Listing
def get_all_queries():
"""
Returns all stored listing queries.
"""
return list(Listing.query.all())
| 2.15625 | 2 |
oops/#009.py | krishankansal/PythonPrograms | 0 | 12790528 | <filename>oops/#009.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 18:15:37 2020
@author: krishan
"""
class ContactList(list):
def search(self, name):
'''Return all contacts that contain the search value
in their name.'''
matching_contacts = []
for ... | 3.96875 | 4 |
src/benzak_etl/load.py | tgrx/benzak-etl | 0 | 12790529 | import asyncio
import json
from datetime import date
from decimal import Decimal
from typing import Dict
from aiohttp import ClientResponse
from dynaconf import settings
_PRICE_HISTORY_API = f"{settings.BENZAK_API_URL}/price-history/"
async def load_price(logger, session, price: Dict):
logger.debug(
f"c... | 2.6875 | 3 |
src/embeds.py | ayman2598/GabbyGums | 2 | 12790530 | <reponame>ayman2598/GabbyGums<filename>src/embeds.py
"""
"""
import discord
from discord.ext import commands
from datetime import datetime
from typing import Optional, Dict, Union
from db import StoredInvite, CachedMessage
import logging
from utils.moreColors import gabby_gums_dark_green, gabby_gums_light_green, gab... | 2.71875 | 3 |
get_inventory_from_awx.py | jonnymccullagh/get_inventory_from_awx | 0 | 12790531 | <filename>get_inventory_from_awx.py
#!/usr/bin/env python3
"""
Creates a local inventory file from an inventory in AWX
Usage:
python ../get_inventory_from_awx.py \
--url https://awx.domain.com \
-u admin \
-p "topsecret" \
"my-ec2-dev-inventory"
"""
import argparse
import sys
import requests
parser = argpars... | 3.25 | 3 |
playnetmano_rm/objects/base.py | rickyhai11/playnetmano_rm | 0 | 12790532 | """playnetmano_rm common internal object model"""
from oslo_utils import versionutils
from oslo_versionedobjects import base
from playnetmano_rm import objects
VersionedObjectDictCompat = base.VersionedObjectDictCompat
class Playnetmano_rmObject(base.VersionedObject):
"""Base class for playnetmano_rm objects.
... | 2.4375 | 2 |
scrubadub/filth/date_of_birth.py | datascopeanalytics/scrubadub | 190 | 12790533 | import random
import datetime
import dateparser
from faker import Faker
from .base import Filth
class DateOfBirthFilth(Filth):
type = 'date_of_birth'
min_age_years = 18
max_age_years = 100
@staticmethod
def generate(faker: Faker) -> str:
"""Generates an example of this ``Filth`` type, us... | 3.703125 | 4 |
problem/01000~09999/01598/1598.py3.py | njw1204/BOJ-AC | 1 | 12790534 | A,B=map(int,input().split())
print(abs((A-1)%4-(B-1)%4)+abs((A-1)//4-(B-1)//4)) | 2.46875 | 2 |
aiomongodb/__init__.py | jdavidls/aiomongodb | 0 | 12790535 | <reponame>jdavidls/aiomongodb<gh_stars>0
'''
HighLevel -> LowLevel (protocol) classes
'''
#cybson
import collections, asyncio, bson, random
from .connection import Connection
MappingProxy = type(type.__dict__)
class AttributeKeyError(AttributeError, KeyError):
pass
class odict(collections.OrderedDict):
__geta... | 2.1875 | 2 |
scripts/generateSE.py | tijsmaas/TrafficPrediction | 17 | 12790536 | <filename>scripts/generateSE.py
import argparse
import os
import scripts
import numpy as np
import networkx as nx
from gensim.models import Word2Vec
def write_edgelist(adj_file, edgelist_file):
adj = np.load(adj_file, allow_pickle=True)[2]
with open(edgelist_file, 'w') as f:
n_nodes = adj.shape[0]
... | 2.671875 | 3 |
src/utils/db.py | Dimwest/iot-garden-backend | 0 | 12790537 | import psycopg2
from psycopg2.extensions import connection, cursor
from psycopg2.extras import DictCursor
from typing import Dict
from src.log.logger import logger
from contextlib import contextmanager
@contextmanager
def get_connection(params: Dict[str, str]) -> connection:
"""
Get a connection using a cont... | 3.109375 | 3 |
scheduler/tests/scheduler_factories.py | annalee/alienplan | 5 | 12790538 | <gh_stars>1-10
import factory
import random
import datetime
from django.template.defaultfilters import slugify
from scheduler.models import Conference, Room, Track, Panelist, Panel, Day
class ConferenceFactory(factory.django.DjangoModelFactory):
class Meta:
model = Conference
name = factory.Sequence(... | 2.140625 | 2 |
0012-tables_format/test_formats.py | villoro/villoro_posts | 0 | 12790539 | <filename>0012-tables_format/test_formats.py
"""
Test different file formats for storing tables.
There are 3 files with different sizes:
small: bike_sharing_daily (64 KB)
medium: cbg_patterns (233 MB)
big: checkouts-by-title (6,62 GB)
"""
import os
from time import time
import yam... | 2.578125 | 3 |
images/core/context/free5gc/lib/nextepc/nas/support/cache/nas_msg_92.py | my5G/OPlaceRAN | 1 | 12790540 | ies = []
ies.append({ "iei" : "", "value" : "EMM cause", "type" : "EMM cause", "reference" : "9.9.3.9", "presence" : "M", "format" : "V", "length" : "1"})
ies.append({ "iei" : "30", "value" : "Authentication failure parameter", "type" : "Authentication failure parameter", "reference" : "9.9.3.1", "presence" : "O", "for... | 1.9375 | 2 |
uploads/core/forms.py | joshua-taylor/dataIntegrator | 0 | 12790541 | <filename>uploads/core/forms.py
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AuthenticationForm
from uploads.core.models import CustomUser
from uploads.core.models import Document
class DocumentForm(forms.ModelForm):
class Meta:
model = Document
... | 2.34375 | 2 |
python/test/test02.py | andreluizdsantos/Curso_ADS | 1 | 12790542 | import unittest
from test.test01 import soma
class TesteSoma(unittest.TestCase):
def test_retorno_soma_10_10(self):
self .assertEqual(soma(10, 10), 20)
| 2.515625 | 3 |
ewsonprem_consts.py | splunk-soar-connectors/ewsonprem | 0 | 12790543 | <filename>ewsonprem_consts.py
# File: ewsonprem_consts.py
#
# Copyright (c) 2016-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/licenses/LICENS... | 1.351563 | 1 |
tests/test_heap.py | ZachElkins/PythonDataStructures | 1 | 12790544 | import pytest
from data_structures.heap import Heap
@pytest.fixture
def base_heap():
heap = Heap()
heap.push(1)
heap.push(2)
heap.push(3)
heap.push(4)
heap.push(5)
return heap
def test_heap_init():
basic_heap = Heap()
init_list_heap = Heap([9, 8, 7, 5, 1, 2])
assert isinstanc... | 3.015625 | 3 |
scripts/kopf/example.py | victoriouscoder/oreilly-kubernetes | 323 | 12790545 | <gh_stars>100-1000
import kopf
@kopf.on.create('oreilly.com', 'v1alpha1', 'book')
def create_fn(spec, **kwargs):
print(f"And here we are! Creating: {spec}")
return {'message': 'hello world'} # will be the new status
<EMAIL>('<EMAIL>', 'v1alpha1', 'book')
#def update_fn(old, new, diff, **kwargs):
# print(... | 2 | 2 |
src/lambda/vault/getVaultItem/getVaultItem.py | VasudhaJha/PasswordManager | 0 | 12790546 | import os
import json
import boto3
from botocore.exceptions import ClientError
from cryptography.fernet import Fernet
dynamodb = boto3.resource('dynamodb')
s3 = boto3.resource('s3')
vault_table = dynamodb.Table(os.environ.get('VAULT_TABLE_NAME'))
vault_table_partition_key = os.environ.get('VAULT_TABLE_KEY')
vault_tabl... | 2.03125 | 2 |
pypadre/pod/repository/local/file/code_repository.py | padre-lab-eu/pypadre | 3 | 12790547 | import errno
import glob
import os
import re
import shutil
from pypadre.core.model.code.code_mixin import CodeMixin, PythonPackage, PythonFile, GenericCall, \
GitIdentifier, RepositoryIdentifier, PipIdentifier, Function
from pypadre.pod.backend.i_padre_backend import IPadreBackend
from pypadre.pod.repository.i_rep... | 2 | 2 |
perfkitbenchmarker/providers/azure/azure_disk.py | xiaolihope/PerfKitBenchmarker-1.7.0 | 0 | 12790548 | <gh_stars>0
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 1.734375 | 2 |
Chapter10/clean_sample.py | fbitti/Bioinformatics-with-Python-Cookbook-Second-Edition | 244 | 12790549 | <reponame>fbitti/Bioinformatics-with-Python-Cookbook-Second-Edition<gh_stars>100-1000
import sys
sys.stdout.write('ID_1 ID_2 missing\n0 0 0 \n')
for line in sys.stdin:
ind = line.rstrip()
sys.stdout.write('%s %s 0\n' % (ind, ind))
| 2.296875 | 2 |
karaoke.py | andrealpezr/ptavi-p3 | 0 | 12790550 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 8 20:54:26 2018
@author: andrea
"""
import sys
import json
from xml.sax import make_parser
from urllib.request import urlretrieve
from smallsmilhandler import SmallSMILHandler
class KaraokeLocal(SmallSMILHandler):
def __init__(self, fichero):
... | 2.734375 | 3 |