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
src/client/__init__.py
kyehyukahn/scp-prototype
1
13600
<gh_stars>1-10 from .client import send_message, MessageInfo # noqa
1.007813
1
src/comparing_scoring_seasons.py
davgav123/Mining_NBA
0
13601
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- from pathlib import Path import pandas as pd from numpy import around if __name__ == "__main__": # Harden's PPG is from 2018-19 season # Bryant's PPG is from 2005-06 season # Jordan's PPG is from 1986-87 season per_game_df = pd.read_csv(Path('../data/com...
2.875
3
modules/citymap.py
sebastianbernasek/dataincubator
0
13602
<gh_stars>0 from os.path import join import numpy as np import geopandas as gpd import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.colors import Normalize from matplotlib.colorbar import ColorbarBase from matplotlib.dates import YearLocator, DateFormatter from matplotlib.animation ...
2.234375
2
w1data/metadata.py
swork/w1-datalogger
0
13603
<reponame>swork/w1-datalogger import logging, sys logger = logging.getLogger(__name__) def measurement_for_skey(sensor_key, metadata): # logger.debug("sensor_key:{} metadata:{}".format(sensor_key, metadata)) return metadata['collector']['sensors'][sensor_key]['name']
2.328125
2
easyvista/setup.py
GreyNoise-Intelligence/insightconnect-plugins
0
13604
# GENERATED BY KOMAND SDK - DO NOT EDIT from setuptools import setup, find_packages setup(name="easyvista-rapid7-plugin", version="1.0.0", description="EasyVista Service Manager platform supports even the most complex requirements, while bringing a new level of simplicity, agility, and mobility required t...
1.414063
1
dbms/tests/integration/helpers/test_tools.py
qqiangwu/ClickHouse
4
13605
<filename>dbms/tests/integration/helpers/test_tools.py import difflib import time class TSV: """Helper to get pretty diffs between expected and actual tab-separated value files""" def __init__(self, contents): raw_lines = contents.readlines() if isinstance(contents, file) else contents.splitlines(True...
2.234375
2
env/Lib/site-packages/Algorithmia/acl.py
Vivek-Kamboj/Sargam
142
13606
class Acl(object): def __init__(self, read_acl): self.read_acl = read_acl @staticmethod def from_acl_response(acl_response): '''Takes JSON response from API and converts to ACL object''' if 'read' in acl_response: read_acl = AclType.from_acl_response(acl_response['read']...
2.890625
3
nlp/name_extractor.py
Karthik-Venkatesh/ATOM
1
13607
<reponame>Karthik-Venkatesh/ATOM # # name_extractor.py # ATOM # # Created by <NAME>. # Updated copyright on 16/1/19 5:54 PM. # # Copyright © 2019 <NAME>. All rights reserved. # # Reference # Question link: https://stackoverflow.com/questions/20290870/improving-the-extraction-of-human-names-with-nltk # Answer link...
3.171875
3
tfx/dsl/components/base/node_registry.py
johnPertoft/tfx
0
13608
# Copyright 2021 Google LLC. 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 law or a...
2.34375
2
tests/unit/api/test_api.py
Mattlk13/datadogpy
0
13609
# stdlib from copy import deepcopy from functools import wraps import os import tempfile from time import time # 3p import mock # datadog from datadog import initialize, api, util from datadog.api import ( Distribution, Metric, ServiceCheck ) from datadog.api.exceptions import ApiError, ApiNotInitialized ...
1.984375
2
keras_train.py
jmeisele/mlflow_demo
0
13610
<gh_stars>0 """ Author: <NAME> Email: <EMAIL> Date: August 1, 2020 """ import argparse import keras import tensorflow as tf import cloudpickle parser = argparse.ArgumentParser( description='Train a Keras feed-forward network for MNIST classification') parser.add_argument('--batch-size', '-b', type=int, default=128) ...
2.5625
3
4USCityEmotion/get_flickr_photos.py
HCH2CHO/EmotionMap
3
13611
<filename>4USCityEmotion/get_flickr_photos.py<gh_stars>1-10 # coding:utf-8 # version:python3.5.1 # author:kyh import flickrapi import datetime import psycopg2 import time # flickr照片类 class flickr_photo(object): def __init__(self, photo_id, photo_city, photo_url): self.id = photo_id self.city = ph...
2.84375
3
Lianjia/LianjiaErShouFang.py
Detailscool/YHSpider
1
13612
<reponame>Detailscool/YHSpider # -*- coding:utf-8 -*- import requests from bs4 import BeautifulSoup import sys import csv reload(sys) sys.setdefaultencoding('utf-8') def not_empty(str): return str and str.strip() if __name__ == '__main__': url_main = 'http://gz.lianjia.com' f = open(u'广州二手房.csv', 'wb...
2.828125
3
test/test_main.py
bluesheeptoken/PyGolf
7
13613
<reponame>bluesheeptoken/PyGolf<gh_stars>1-10 import argparse import tempfile import unittest from pygolf.__main__ import get_arguments_warning, read_input_code, shorten class TestMain(unittest.TestCase): def test_reduce(self): self.assertEqual(shorten("print( 1 + 2 )"), "print(1+2)") self.assert...
3.078125
3
Session_01/koch.py
UP-RS-ESP/GEW-DAP05-2018
2
13614
<gh_stars>1-10 import sys import numpy as np from matplotlib import pyplot as pl def koch(x0, y0, rho, phi, order): global xr, yr x1, y1 = x0 + rho * np.cos(phi), y0 + rho * np.sin(phi) if order: x, y = x0, y0 for angle in [0, np.pi/3, 5*np.pi/3, 0]: x, y = koch(x, y, rho / 3.0...
2.59375
3
core/views.py
xuhang57/atmosphere
0
13615
# -*- coding: utf-8 -*- """ Core views to provide custom operations """ import uuid from datetime import datetime from django.http import HttpResponseRedirect from threepio import logger from atmosphere import settings from django_cyverse_auth.decorators import atmo_login_required from django_cyverse_auth.models imp...
2.109375
2
indico/util/serializer.py
jgrigera/indico
1
13616
<gh_stars>1-10 # This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from enum import Enum from indico.core.errors import IndicoError from indico.core.logger i...
2.296875
2
step/lambdas/get_image_status.py
mbeacom/cloudendure-python
7
13617
#!/usr/bin/env python # -*- coding: utf-8 -*- """Check the state of an AWS AMI.""" from __future__ import annotations import json from typing import Any, Dict import boto3 print("Loading function get_image_status") ec2_client = boto3.client("ec2") # { # "instance_id": "i-identifier", # "kms_id": "KMS ID", # ...
2.4375
2
starfish/types.py
kne42/starfish
0
13618
# constants from starfish.core.types import ( # noqa: F401 Axes, Clip, Coordinates, CORE_DEPENDENCIES, Features, LOG, OverlapStrategy, PHYSICAL_COORDINATE_DIMENSION, PhysicalCoordinateTypes, STARFISH_EXTRAS_KEY, TransformType, ) from starfish.core.types import CoordinateValu...
1.046875
1
python/alertsActor/rules/dangerKey.py
sdss/twistedAlertsActor
0
13619
<gh_stars>0 #!/usr/bin/env python # encoding: utf-8 # # dangerKey.py # # Created by <NAME> on 10 April 2019 import re, time from yaml import YAMLObject from alertsActor import log class diskCheck(YAMLObject): """evaluate a disk keyword """ def __init__(self): pass def __call__(self, keyStat...
2.515625
3
jsonsubschema/old/_jsonschema.py
lukeenterprise/json-subschema
1
13620
''' Created on June 24, 2019 @author: <NAME> ''' import copy import json import sys import math import numbers import intervals as I from abc import ABC, abstractmethod from greenery.lego import parse from intervals import inf as infinity import config import _constants from canoncalization import canoncalize_object...
2.25
2
eruditio/shared_apps/django_community/utils.py
genghisu/eruditio
0
13621
""" Various utilities functions used by django_community and other apps to perform authentication related tasks. """ import hashlib, re import django.forms as forms from django.core.exceptions import ObjectDoesNotExist from django.forms import ValidationError import django.http as http from django.conf import setting...
2.4375
2
launch/test_motion.launch.py
RoboJackets/robocup-software
200
13622
import os from pathlib import Path from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription, SetEnvironmentVariable, Shutdown from launch.launch_description_sources import PythonLaunchDescriptionSource from launch_ros.a...
2.234375
2
demo.py
nikp29/eDensiometer
2
13623
# A Rapid Proof of Concept for the eDensiometer # Copyright 2018, <NAME>. All Rights Reserved. Created with contributions from <NAME>. # Imports from PIL import Image from pprint import pprint import numpy as np import time as time_ def millis(): # from https://stackoverflow.com/questions/5998245/get-current-time-in-...
2.75
3
chart/script/provenance_ycsb_thruput.py
RUAN0007/nusthesis
0
13624
<reponame>RUAN0007/nusthesis import sys import os import matplotlib.pyplot as plt from matplotlib.pyplot import figure import matplotlib as mpl import config def main(): if 1 < len(sys.argv) : diagram_path = sys.argv[1] else: diagram_path = "" curDir = os.path.dirname(os.path.realpath...
2.59375
3
core/handlers/filters_chat.py
Smashulica/nebula8
0
13625
from core.utilities.functions import delete_message from core.utilities.message import message from core.database.repository.group import GroupRepository """ This function allows you to terminate the type of file that contains a message on telegram and filter it """ def init(update, context): apk = 'application/vnd...
2.734375
3
mipsplusplus/parser.py
alexsocha/mipsplusplus
1
13626
<reponame>alexsocha/mipsplusplus from mipsplusplus import utils from mipsplusplus import operations OPERATOR_ORDERING = [ ['addressof', 'not', 'neg'], ['*', '/', '%'], ['+', '-'], ['<<', '>>', '<<<', '>>>'], ['<', '>', '<=', '>='], ['==', '!='], ['and', 'or', 'xor', 'nor'], ['as'] ] EXPR_OPERATORS = s...
2.828125
3
learn-to-code-with-python/10-Lists-Iteration/iterate-in-reverse-with-the-reversed-function.py
MaciejZurek/python_practicing
0
13627
the_simpsons = ["Homer", "Marge", "Bart", "Lisa", "Maggie"] print(the_simpsons[::-1]) for char in the_simpsons[::-1]: print(f"{char} has a total of {len(char)} characters.") print(reversed(the_simpsons)) print(type(reversed(the_simpsons))) # generator object for char in reversed(the_simpsons): # laduje za kazda...
4.28125
4
ghiaseddin/scripts/download-dataset-lfw10.py
yassersouri/ghiaseddin
44
13628
<filename>ghiaseddin/scripts/download-dataset-lfw10.py<gh_stars>10-100 from subprocess import call import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) import settings data_zip_path = os.path.join(settings.lfw10_root, "LFW10.zip") data_url = "http://cvit.iiit.ac.i...
2.5
2
hops/dist_allreduce.py
Limmen/hops-util-py
0
13629
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import pydoop.hdfs import subprocess import os import stat import sys import threading import t...
2.40625
2
api/migrations/versions/e956985ff509_.py
SnSation/Pokemart
0
13630
<gh_stars>0 """empty message Revision ID: e956985ff509 Revises: 4b471bbc<PASSWORD> Create Date: 2020-12-02 22:47:08.536332 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e956985ff509' down_revision = '4<PASSWORD>1<PASSWORD>' branch_labels = None depends_on = ...
1.257813
1
tests/features/steps/ahk_steps.py
epth/ahk
1
13631
from behave.matchers import RegexMatcher from ahk import AHK from behave_classy import step_impl_base Base = step_impl_base() class AHKSteps(AHK, Base): @Base.given(u'the mouse position is ({xpos:d}, {ypos:d})') def given_mouse_move(self, xpos, ypos): self.mouse_move(x=xpos, y=ypos) @Base.when(u...
2.375
2
snakewm/apps/games/pong/bat.py
sigmaister/snakeware_os
1,621
13632
<filename>snakewm/apps/games/pong/bat.py import pygame from pygame.locals import * class ControlScheme: def __init__(self): self.up = K_UP self.down = K_DOWN class Bat: def __init__(self, start_pos, control_scheme, court_size): self.control_scheme = control_scheme self.move_u...
2.890625
3
mimic/model/rackspace_image_store.py
ksheedlo/mimic
141
13633
<filename>mimic/model/rackspace_image_store.py """ An image store representing Rackspace specific images """ from __future__ import absolute_import, division, unicode_literals import attr from six import iteritems from mimic.model.rackspace_images import (RackspaceWindowsImage, ...
2.296875
2
samples/noxfile_config.py
ikuleshov/python-analytics-admin
0
13634
TEST_CONFIG_OVERRIDE = { # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. "gcloud_project_env": "BUILD_SPECIFIC_GCLOUD_...
1.460938
1
exercises/fr/test_01_09.py
tuanducdesign/spacy-course
0
13635
<gh_stars>0 def test(): assert "for ent in doc.ents" in __solution__, "Itères-tu sur les entités ?" assert x_pro.text == "X Pro", "Es-tu certain que x_pro contient les bons tokens ?" __msg__.good( "Parfait ! Bien sur, tu n'as pas besoin de faire cela manuellement à chaque fois." "Dans le pr...
2.421875
2
settings/channel_archiver/NIH.pressure_downstream_settings.py
bopopescu/Lauecollect
0
13636
filename = '//mx340hs/data/anfinrud_1903/Archive/NIH.pressure_downstream.txt'
0.96875
1
sfepy/terms/terms_navier_stokes.py
vondrejc/sfepy
0
13637
import numpy as nm from sfepy.linalg import dot_sequences from sfepy.terms.terms import Term, terms class DivGradTerm(Term): r""" Diffusion term. :Definition: .. math:: \int_{\Omega} \nu\ \nabla \ul{v} : \nabla \ul{u} \mbox{ , } \int_{\Omega} \nu\ \nabla \ul{u} : \nabla \ul{w} \\ ...
2.5
2
saleor/unurshop/crawler/migrations/0013_auto_20210921_0452.py
nlkhagva/saleor
0
13638
# Generated by Django 3.1.1 on 2021-09-21 04:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('crawler', '0012_auto_20210921_0451'), ] operations = [ migrations.AlterField( model_name='crawlerline', name='ustatu...
1.390625
1
src/cli/examples/oss-fuzz-target.py
gdhuper/onefuzz
1
13639
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import logging import os import sys import tempfile from subprocess import PIPE, CalledProcessError, check_call # nosec from typing import List, Optional from onefuzztypes.models import NotificationConfig from onefuzzty...
2.25
2
stubs/workspaces.py
claytonbrown/troposphere
0
13640
<reponame>claytonbrown/troposphere from . import AWSObject, AWSProperty from .validators import * from .constants import * # ------------------------------------------- class WorkSpacesWorkspace(AWSObject): """# AWS::WorkSpaces::Workspace - CloudFormationResourceSpecification version: 1.4.0 { "Documenta...
1.796875
2
hystrix/command.py
grofers/hystrix-py
93
13641
<gh_stars>10-100 """ Used to wrap code that will execute potentially risky functionality (typically meaning a service call over the network) with fault and latency tolerance, statistics and performance metrics capture, circuit breaker and bulkhead functionality. """ from __future__ import absolute_import import logging...
2.15625
2
glue/viewers/table/qt/data_viewer.py
HPLegion/glue
550
13642
<gh_stars>100-1000 import os from functools import lru_cache import numpy as np from qtpy.QtCore import Qt from qtpy import QtCore, QtGui, QtWidgets from matplotlib.colors import ColorConverter from glue.utils.qt import get_qapp from glue.config import viewer_tool from glue.core import BaseData, Data from glue.utils...
1.765625
2
azure-servicefabric/azure/servicefabric/models/restore_partition_description.py
JonathanGailliez/azure-sdk-for-python
1
13643
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
1.976563
2
psq/queue.py
Tomesco/bookshelf-demo-project
210
13644
<gh_stars>100-1000 # Copyright 2015 Google 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 agr...
1.914063
2
mac/google-cloud-sdk/lib/surface/access_context_manager/levels/update.py
bopopescu/cndw
0
13645
<filename>mac/google-cloud-sdk/lib/surface/access_context_manager/levels/update.py # -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. 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...
2.046875
2
convert.py
lordcodingsound/autodj
0
13646
<filename>convert.py<gh_stars>0 import wave import struct import subprocess import os import opusenc import base64 import zlib import sys tmp = sys.argv[1] + ".wav" subprocess.Popen(["ffmpeg", "-i", sys.argv[1], "-ar", "48000", "-ac", "2", "-y", tmp], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait() ...
2.359375
2
polliwog/tri/__init__.py
lace/polliwog
18
13647
<filename>polliwog/tri/__init__.py from . import functions as _functions from .functions import * # noqa: F401,F403 from .quad_faces import quads_to_tris __all__ = _functions.__all__ + ["quads_to_tris"]
1.289063
1
packages/pegasus-api/src/Pegasus/api/replica_catalog.py
spxiwh/pegasus
0
13648
<reponame>spxiwh/pegasus from collections import OrderedDict from pathlib import Path from typing import Dict, Optional, Set, Union from ._utils import _chained from .errors import DuplicateError from .mixins import MetadataMixin from .writable import Writable, _filter_out_nones PEGASUS_VERSION = "5.0" __all__ = ["F...
2.265625
2
importanize/groups.py
xiachufang/importanize
0
13649
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import itertools import operator from collections import OrderedDict, defaultdict from functools import reduce import six from .formatters import DEFAULT_FORMATTER, DEFAULT_LENGTH from .utils import is_site_package, is_st...
2.21875
2
NLP4CCB/migrations/0005_auto_20170415_2236.py
rossmechanic/know_your_nyms
1
13650
<filename>NLP4CCB/migrations/0005_auto_20170415_2236.py # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-04-15 22:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("NLP4CCB", "0004_auto_20170330_0255")] operations = [ migrations.RenameF...
1.648438
2
synchCams/start_server.py
ateshkoul/synchCams
0
13651
<reponame>ateshkoul/synchCams<gh_stars>0 import socket import json import pdb import copy def dict_to_bytes(the_dict): string = json.dumps(the_dict).encode('utf-8') return(string) def bytes_to_dict(string): the_dict = json.loads(string.decode('utf-8')) return(the_dict) class server_con(): def __...
2.640625
3
9.part2.py
elp2/advent_of_code_2020
1
13652
<gh_stars>1-10 from collections import defaultdict def return_default(): return 0 def dd(): return defaultdict(return_default) CHALLENGE_DAY = "9" REAL = open(CHALLENGE_DAY + ".txt").read() assert len(REAL) > 1 SAMPLE = open(CHALLENGE_DAY + ".sample.txt").read() SAMPLE_EXPECTED = 127 # SAMPLE_...
3.265625
3
exif_address_finder/ExifAddressFinderManager.py
jonathanlurie/ExifAddressFinder
0
13653
<reponame>jonathanlurie/ExifAddressFinder #!/usr/bin/env python ''' Author : <NAME> Email : <EMAIL> Version : 0.1 Licence : MIT description : The entry point to the library. ''' import GeoToolbox import exifread import piexif from IFD_KEYS_REFERENCE import * import exifWriter import os class Exi...
2.265625
2
src/anaplan_api/Model.py
jeswils-ap/anaplan-api
2
13654
<filename>src/anaplan_api/Model.py import json import logging import requests from typing import List from requests.exceptions import HTTPError, ConnectionError, SSLError, Timeout, ConnectTimeout, ReadTimeout from .User import User from .ModelDetails import ModelDetails logger = logging.getLogger(__name__) class Mod...
2.5
2
reproduction/Summarization/BertSum/model.py
KuNyaa/fastNLP
1
13655
<filename>reproduction/Summarization/BertSum/model.py import torch from torch import nn from torch.nn import init from fastNLP.modules.encoder.bert import BertModel class Classifier(nn.Module): def __init__(self, hidden_size): super(Classifier, self).__init__() self.linear = nn.Linear(hidden_size...
2.421875
2
p4p2p/dht/constants.py
ntoll/p4p2p
8
13656
<filename>p4p2p/dht/constants.py # -*- coding: utf-8 -*- """ Defines constants used by P4P2P. Usually these are based upon concepts from the Kademlia DHT and where possible naming is derived from the original Kademlia paper as are the suggested default values. """ #: Represents the degree of parallelism in network cal...
2.015625
2
turtle-crossing/car_manager.py
twbm/Git-Learning-Thingy
1
13657
<reponame>twbm/Git-Learning-Thingy from turtle import Turtle import random COLORS = ["red", "orange", "yellow", "green", "blue", "purple"] STARTING_MOVE_DISTANCE = 5 MOVE_INCREMENT = 10 class CarManager(Turtle): def __del__(self): print(f"Deleted: {self}") def __init__(self): super().__i...
3.609375
4
manabi/apps/flashcards/permissions.py
aehlke/manabi
14
13658
<reponame>aehlke/manabi from django.shortcuts import get_object_or_404 from rest_framework import permissions from manabi.apps.flashcards.models import Deck WRITE_ACTIONS = ['create', 'update', 'partial_update', 'delete'] class DeckSynchronizationPermission(permissions.BasePermission): message = "You don't hav...
2.140625
2
Scripts/create_phone_number.py
yogeshwaran01/Mini-Projects
4
13659
""" Function convert lists of 10 elements into in the format of phone number Example, (123) 456-789 """ def create_phone_number(n: list) -> str: """ >>> create_phone_number([1,2,3,4,5,6,7,8,9,0]) '(123) 456-7890' """ return "({}{}{}) {}{}{}-{}{}{}{}".format(*n) if __name__ == "__main__...
3.671875
4
pointscan/scan.py
gtfierro/point_label_sharing
5
13660
<gh_stars>1-10 import click import logging import pandas as pd from pathlib import Path @click.group() def main(): pass @main.command(help="Scan for BACnet devices on your network") @click.option("--ip", help="source IP to use (interface)") @click.option("--dest", default=".", help="destination of scraped point...
2.578125
3
var/spack/repos/builtin/packages/py-jdatetime/package.py
adrianjhpc/spack
1
13661
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJdatetime(PythonPackage): """jdatetime is Jalali implementation of Python's datetime mod...
1.5625
2
interview/leet/147_Insertion_Sort_List_Challenge.py
eroicaleo/LearningPython
1
13662
#!/usr/bin/env python from linklist import * class Solution: def insertionSortList(self, head): dumm = head while head: val, head, prev = head.val, head.next, dumm while val >= prev.val: prev = prev.next while prev != head: prev.v...
3.796875
4
robocrm/migrations/0020_auto_20141027_0145.py
CMU-Robotics-Club/roboticsclub.org
0
13663
<reponame>CMU-Robotics-Club/roboticsclub.org<filename>robocrm/migrations/0020_auto_20141027_0145.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('robocrm', '0019_auto_20141021_1157'), ...
1.851563
2
src/tests/flow.py
SeleSchaefer/super_resolution
5
13664
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cv2 import imageio import numpy as np from tar.miscellaneous import convert_flow_to_color prev = imageio.imread("ressources/1_1.png") prev = cv2.cvtColor(prev, cv2.COLOR_RGB2GRAY) curr = imageio.imread("ressources/1_2.png") curr = cv2.cvtColor(curr, cv2.COLOR_RGB...
2.703125
3
assignment4/utils.py
nicedi/ML_course_projects
0
13665
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt def plot_loss(model, n_iter): plt.figure() plt.plot(model.trainloss, 'b-', model.validloss, 'r-') plt.xlim(0, n_iter) plt.xlabel('iteration') plt.ylabel('loss') plt.title('learning curve') plt.legend(['training loss...
3.484375
3
post/migrations/0009_auto_20171207_2320.py
silvareal/personal-blog
2
13666
<filename>post/migrations/0009_auto_20171207_2320.py # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-12-07 22:20 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('post', '0008_auto_20171207_2256'), ] ...
1.625
2
tests/test_utils_project.py
FingerCrunch/scrapy
41,267
13667
<gh_stars>1000+ import unittest import os import tempfile import shutil import contextlib from pytest import warns from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.utils.project import data_path, get_project_settings @contextlib.contextmanager def inside_a_project(): prev_dir = os.getcwd() ...
2.15625
2
trainer/__init__.py
Greeser/gate-decorator-pruning
192
13668
from trainer.normal import NormalTrainer from config import cfg def get_trainer(): pair = { 'normal': NormalTrainer } assert (cfg.train.trainer in pair) return pair[cfg.train.trainer]()
2.453125
2
Tasks/Community/ts_scriptExamples/pythonLogging.py
nneul/Velocity-assets
4
13669
#!/usr/bin/python import logging # create logger logger = logging.getLogger() logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # create file handler which and set level to debug fh = logging.FileHandler('pythonLogging.log') fh.setLev...
3.25
3
google/datalab/commands/_datalab.py
freyrsae/pydatalab
198
13670
# Copyright 2017 Google Inc. 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 law or agre...
2.203125
2
src/server/__main__.py
ENDERZOMBI102/chatapp
1
13671
from sys import argv from server.AServer import AServer if '--old' in argv: from server.server import Server Server() else: AServer( websocket='--websocket' in argv ).Start()
2.015625
2
testing/tests/registers.py
Wynjones1/gbvhdl
0
13672
#!/usr/bin/env python2.7 from common import * from random import randint, choice registers = {\ "a" : int("0000", 2), "f" : int("0001", 2), "b" : int("0010", 2), "c" : int("0011", 2), "d" : int("0100", 2), "e" : int("0101", 2), "h" : int("0110", 2), "l" : int("0111", 2), "af" : int("1000", 2), "bc" : int("1001...
2.9375
3
DiscordRPC/__init__.py
EterNomm/discord-rpc
4
13673
<filename>DiscordRPC/__init__.py from .presence import * from .button import button from .exceptions import * #from .get_current_app import GCAR (Disabling due to a bug) __title__ = "Discord-RPC" __version__ = "3.5" __authors__ = "LyQuid" __license__ = "Apache License 2.0" __copyright__ = "Copyright 2021-present LyQui...
1.40625
1
brax/training/ars.py
benelot/brax
1
13674
<reponame>benelot/brax # Copyright 2021 The Brax 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 # # Unless required by applicable ...
1.78125
2
docs/api/conf.py
kagemeka/selext
1
13675
import os import sys def find_docs_root() -> str: filepath = os.path.abspath(__file__) path_chunks = filepath.split(os.path.sep) while path_chunks[-1] != "docs": path_chunks.pop() return os.path.sep.join(path_chunks) sys.path.append(find_docs_root()) from _rtd_conf import * from _sphinx_conf...
2.328125
2
src/graph/cli/server.py
clayman-micro/graph
0
13676
import socket import click import uvicorn # type: ignore def get_address(default: str = "127.0.0.1") -> str: try: ip_address = socket.gethostbyname(socket.gethostname()) except socket.gaierror: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: s.connect(("8.8.8.8"...
2.546875
3
settings/libs.py
skylifewww/pangolinreact
0
13677
# grappelli GRAPPELLI_ADMIN_TITLE = 'pangolin - Administration panel' # rest framework # REST_FRAMEWORK = { # 'PAGINATE_BY_PARAM': 'limit', # 'SEARCH_PARAM': 'q' # }
1.03125
1
kubespawner/clients.py
moskiGithub/spawner_test
0
13678
<reponame>moskiGithub/spawner_test """Shared clients for kubernetes avoids creating multiple kubernetes client objects, each of which spawns an unused max-size thread pool """ from unittest.mock import Mock import weakref import kubernetes.client from kubernetes.client import api_client # FIXME: remove ...
2.296875
2
src/syncgitlab2msproject/gitlab_issues.py
lcv3/SyncGitlab2MSProject
0
13679
<reponame>lcv3/SyncGitlab2MSProject<gh_stars>0 import dateutil.parser from datetime import datetime from functools import lru_cache from gitlab import Gitlab from gitlab.v4.objects import Project from logging import getLogger from typing import Dict, List, Optional, Union from .custom_types import GitlabIssue, GitlabU...
2.1875
2
pytest/track_test.py
Sergej91/TheiaSfM
0
13680
import pytheia as pt import os import numpy as np def test_track_set_descriptor_read_write(): recon = pt.sfm.Reconstruction() view_id1 = recon.AddView("0",0.0) m_view1 = recon.MutableView(view_id1) m_view1.IsEstimated = True view_id2 = recon.AddView("1",1.0) m_view2 = recon.MutableView(view_id2...
2.15625
2
jayk/util.py
alekratz/jayk
1
13681
<reponame>alekratz/jayk """Common utilities used through this codebase.""" import logging import logging.config class LogMixin: """ A logging mixin class, which provides methods for writing log messages. """ def __init__(self, logger_name: str): """ Creates the logger with the specif...
2.703125
3
experimentation/trap/statistics_calculator.py
GruppoPBDMNG-10/AIExam
0
13682
<filename>experimentation/trap/statistics_calculator.py import experimentation.statistics.statistics as statistics intersection = statistics.find_matches_from_file('result/experimentation/hmm/anomalous.json', 'result/experimentation/rnn/anomalous.json') print(len(intersection))
2.328125
2
objects/CSCG/_3d/exact_solutions/status/incompressible_Navier_Stokes/Sin_Cos.py
mathischeap/mifem
1
13683
# -*- coding: utf-8 -*- """ @author: <NAME>. Department of Aerodynamics Faculty of Aerospace Engineering TU Delft, Delft, Netherlands """ from numpy import sin, cos, pi from objects.CSCG._3d.exact_solutions.status.incompressible_Navier_Stokes.base import incompressible_NavierStokes_Base fro...
2.75
3
aaem_summaries/components/transmission/__init__.py
gina-alaska/alaska_affordable_energy_model
1
13684
<reponame>gina-alaska/alaska_affordable_energy_model<gh_stars>1-10 """ __init__.py summary for Transmission Line in a community """ from summary import *
0.859375
1
setup.py
doconce/preprocess
5
13685
<reponame>doconce/preprocess #!/usr/bin/env python # Copyright (c) 2002-2005 ActiveState Software Ltd. """preprocess: a multi-language preprocessor There are millions of templating systems out there (most of them developed for the web). This isn't one of those, though it does share some basics: a markup syntax for te...
1.84375
2
bubblebbs/config.py
kawa-kokosowa/bubblebbs
7
13686
import os BEHIND_REVERSE_PROXY = bool(os.environ.get('BBBS_BEHIND_REVERSE_PROXY', False)) POSTS_PER_PAGE = 25 TEMPLATES_AUTO_RELOAD = True RECAPTCHA_ENABLED = os.environ.get('BBBS_RECAPTCHA_ENABLED', False) RECAPTCHA_SITE_KEY = os.environ.get('BBBS_RECAPTCHA_SITE_KEY', 'CHANGEGME') RECAPTCHA_SECRET_KEY = os.environ...
1.804688
2
sim_user/mailLib.py
silicom-hub/IS_simulator
4
13687
import os import wget import time import glob import getpass import tarfile import subprocess import email.mime.multipart import email.mime.text import email.mime.image import email.mime.audio from datetime import datetime from pprint import pprint from colorama import Style, Fore from smtplib import SMTP, SMTP_SSL fro...
2.515625
3
setup.py
vishnumenon/pyims
1
13688
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup(name="pyims", version='0.1.2', description='A python wrapper for the IMS Word Sense Disambiguation tool (Zhong and Ng, 2010)', url='http://github.com/vishnumenon/pyims', author="<NAME>", author_em...
1.429688
1
hass_apps/schedy/actor/__init__.py
weese/hass-apps
0
13689
""" This package contains the various actor implementations. """ import typing as T from .base import ActorBase from .custom import CustomActor from .generic import GenericActor from .switch import SwitchActor from .thermostat import ThermostatActor __all__ = [ "ActorBase", "CustomActor", "GenericActor"...
2.890625
3
triggmine_sdk/tests/test_client.py
TriggMineAdmin/TriggMine-Python-SDK
0
13690
# UnitTests of all triggmine events import unittest import datetime from client import Client class ClientTest(unittest.TestCase): def setUp(self): self.client = Client('YOUR API_URL', 'YOUR API_KEY') # Registration event def test_registration_success(self): response = self.client.regist...
2.3125
2
lib/python2.7/site-packages/mpl_toolkits/tests/test_axes_grid.py
wfehrnstrom/harmonize
1
13691
<gh_stars>1-10 from matplotlib.testing.decorators import image_comparison from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np import matplotlib.pyplot as plt @image_comparison(baseline_images=['imagegrid_cbar_mode'], extensions=['png'], remove_text=True) def test_imag...
2.046875
2
src/resources/lib/listitem.py
ffoxin/kodi.kino.pub
59
13692
# -*- coding: utf-8 -*- from xbmcgui import ListItem class ExtendedListItem(ListItem): def __new__(cls, name, label2="", path="", **kwargs): return super(ExtendedListItem, cls).__new__(cls, name, label2, path) def __init__( self, name, label2="", iconImage="", ...
2.25
2
static/firespread.py
thabat12/TetraNet
0
13693
<reponame>thabat12/TetraNet<gh_stars>0 import numpy as np import imageio import tensorflow as tf from keras.models import load_model from PIL import Image, ImageOps import numpy as np from numpy import asarray from matplotlib import pyplot as plt from keras.utils import normalize import os import random import azure_ge...
2.09375
2
streamlitfront/tests/dummy_app.py
i2mint/streamlitfront
0
13694
<filename>streamlitfront/tests/dummy_app.py from streamlitfront.base import get_pages_specs, get_func_args_specs, BasePageFunc import streamlit as st from pydantic import BaseModel import streamlit_pydantic as sp def multiple(x: int, word: str) -> str: return str(x) + word class Input(BaseModel): x: int ...
2.59375
3
app/build.py
dhost-project/build-microservice
0
13695
from flask_restful import Resource, reqparse parser = reqparse.RequestParser() parser.add_argument('command', required=True) parser.add_argument('docker', required=True) class Build(Resource): def get(self): return {'status': 'building'} def post(self): args = parser.parse_args() pr...
2.484375
2
src/unicon/plugins/windows/__init__.py
nielsvanhooy/unicon.plugins
18
13696
<reponame>nielsvanhooy/unicon.plugins __copyright__ = "# Copyright (c) 2018 by cisco Systems, Inc. All rights reserved." __author__ = "dwapstra" from unicon.plugins.generic import GenericSingleRpConnection, service_implementation as svc from unicon.plugins.generic.connection_provider import GenericSingleRpConnectionPr...
1.804688
2
sera/commands/symlink.py
bretth/sera
0
13697
from pathlib import Path from shutil import which from subprocess import run, PIPE import click from .main import main, lprint @main.command() @click.pass_context @click.argument('watcher') def symlink(ctx, watcher): """Locally install a symlink to sera""" if ctx.parent.params['watcher']: click.echo...
2.40625
2
self-attention.py
dhkim2810/MaskedDatasetCondensation
0
13698
<reponame>dhkim2810/MaskedDatasetCondensation<gh_stars>0 import torch from torch import nn import torch.nn.functional as F from torch.utils.data import DataLoader from torchvision import transforms from torchvision.models import resnet18 from torchvision.datasets import CIFAR10 from tqdm import tqdm from torchvision.ut...
2.125
2
src/libraries/maimai_plate.py
Blitz-Raynor/Kiba
4
13699
from typing import Optional, Dict, List import aiohttp plate_to_version = { '真1': 'maimai', '真2': 'maimai PLUS', '超': 'maimai GreeN', '檄': 'maimai GreeN PLUS', '橙': 'maimai ORANGE', '暁': 'maimai ORANGE PLUS', '晓': 'maimai ORANGE PLUS', '桃': 'maimai PiNK'...
2.671875
3