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 | fartbagxp/certspotter-api | 1 | 12786751 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.command.install import install
VERSION = "1.0.12"
def readme():
"""print long description"""
with open('README.md') as f:
return f.read()
setup(name='certspotter',
version=VERSION,
... | 1.65625 | 2 |
services/schema.py | antti-mikael/open-city-profile | 0 | 12786752 | <reponame>antti-mikael/open-city-profile
import graphene
from django.db.utils import IntegrityError
from django.utils.translation import ugettext_lazy as _
from graphene_django.types import DjangoObjectType
from graphql import GraphQLError
from graphql_jwt.decorators import login_required
from .consts import SERVICE_T... | 2.234375 | 2 |
search/views.py | isi-metaphor/propstore-gui | 0 | 12786753 | <filename>search/views.py
# coding: utf-8
# Copyright (C) University of Southern California (http://usc.edu)
# Author: <NAME> <<EMAIL>>
# URL: <http://nlg.isi.edu/>
# For more information, see README.md
# For license information, see LICENSE
import json
import logging
import microidx
import traceback
from microidx i... | 1.914063 | 2 |
coursera/course1-diving-in-python/week5/examples/socket_client.py | akrisanov/python_notebook | 3 | 12786754 | <filename>coursera/course1-diving-in-python/week5/examples/socket_client.py
import socket
sock = socket.socket()
sock.connect(("127.0.0.1", 9000))
# ^ one-liner: sock = socket.create_connection(("127.0.0.1", 9000))
sock.sendall("ping".encode("utf8"))
sock.close()
| 3.703125 | 4 |
airflow/upgrade/rules/chain_between_dag_and_operator_not_allowed_rule.py | shrutimantri/airflow | 0 | 12786755 | <reponame>shrutimantri/airflow
# 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
# to you under the Apache License, Version 2.0 (... | 1.976563 | 2 |
pdfs_evolution_graphs.py | aherrera3/thesis | 0 | 12786756 | """
Script for the evolution gif of the pdfs obtained with qcdnum.
The pdfs obtained by the DGLAP evolution equations, using qcdnum, are stored in files, containing each one a fixed q2 energy scale.
The output files with the pdfs and x values are stored in the directory named output, inside qcdnum.
Those output files ... | 2.703125 | 3 |
WindmillProject/models/K-means.py | Nienkedn/Nieuwsanalyse8 | 0 | 12786757 | <filename>WindmillProject/models/K-means.py<gh_stars>0
from sklearn.feature_extraction.text import TfidfVectorizer
from stop_words import get_stop_words
from sklearn.cluster import KMeans
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import adjusted_rand_score
from collections import Counter
... | 3.34375 | 3 |
Project Euler/general.py | pybae/etc | 0 | 12786758 | <reponame>pybae/etc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# A general purpose file including several blanket functions to simplify Project
# Euler code
import numpy
import math
import cProfile
import pstats
import StringIO
def prime(n):
return filter(lambda num: (num % \
numpy.arange(2, 1+int(math... | 2.421875 | 2 |
ghostwriter/rolodex/migrations/0013_projectsubtask_marked_complete.py | bbhunter/Ghostwriter | 601 | 12786759 | # Generated by Django 3.0.10 on 2021-02-11 21:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rolodex', '0012_auto_20210211_1853'),
]
operations = [
migrations.AddField(
model_name='projectsubtask',
name='mark... | 1.492188 | 1 |
resources/drive.py | MujyKun/IreneAPI | 1 | 12786760 | <reponame>MujyKun/IreneAPI<gh_stars>1-10
from __future__ import print_function
import pickle
import os.path
import io
# noinspection PyPackageRequirements
from googleapiclient.http import MediaIoBaseDownload
# noinspection PyPackageRequirements
from googleapiclient.discovery import build
from google_auth_oauthlib.flow ... | 2.734375 | 3 |
mqtt/ping.py | Laged/test-python-ping-mqtt | 0 | 12786761 | <gh_stars>0
import socket
from time import sleep
import paho.mqtt.client as mqtt
hostname = socket.gethostname()
broker = 'broker.hivemq.com'
port = 1883
default_user = hostname
default_pw = None
default_topic = '/ping-mqtt/' + hostname
default_msg = 'ping'
default_qos = 0
ping_interval =... | 2.59375 | 3 |
dwh/indicator_lib.py | LaudateCorpus1/openmrs-fhir-analytics | 0 | 12786762 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 2.546875 | 3 |
chapter11/code/pickle_safe_chroot.py | gabrielmahia/ushuhudAI | 74 | 12786763 | import os
import pickle
from contextlib import contextmanager
class ShellSystemChroot(object):
def __reduce__(self):
# this will list contents of root / folder
return (os.system, ('ls /',))
@contextmanager
def system_chroot():
""" A simple chroot """
os.chroot('/')
yield
def serialize():
with system_chroo... | 2.78125 | 3 |
Heatmap.py | Ruhen-Bhuiyan/Logistic-regression-vs-SVM-vs-Decision-Tree-vs-Random-Forest | 0 | 12786764 | <filename>Heatmap.py
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.metrics import confusion_matrix
from sklearn import svm
import itertools
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import seaborn
get_ipython().run_line_magic('matplotlib', 'inline')
data = ... | 3.125 | 3 |
Project Euler #1: Multiples of 3 and 5/Python.py | gitvy/Project-Euler | 0 | 12786765 | for i in range(int(input())):
n = int(input()) -1
l1 = n - n%3
l2 = n - n%5
l3 = n - n%15
s1 = ((l1)*(3+l1))//6
s2 = ((l2)*(5+l2))//10
s3 = ((l3)*(15+l3))//30
print(s1+s2-s3)
| 3.171875 | 3 |
carim/configuration/mods/vanilla_plus_plus_map/model.py | schana/dayz-server-carim | 3 | 12786766 | <reponame>schana/dayz-server-carim<filename>carim/configuration/mods/vanilla_plus_plus_map/model.py<gh_stars>1-10
from collections import namedtuple
from carim.global_resources import locations
def get_markers():
return [Marker(
name=m[0],
icon=Icon.DEFAULT,
color=WHITE,
position=... | 1.945313 | 2 |
src/test_import.py | usdot-its-jpo-data-portal/canary-lambda | 0 | 12786767 | <gh_stars>0
import unittest
import os
class TestImports(unittest.TestCase):
def test_imports(self):
print('Temporary dummy import test for coverage config.')
import main | 1.679688 | 2 |
huobi/model/pricedepthevent.py | Wing-Lo/huobi_Python | 0 | 12786768 | <gh_stars>0
from huobi.model import *
class PriceDepthEvent:
"""
The price depth received by subscription of price depth.
:member
symbol: The symbol you subscribed.
timestamp: The UNIX formatted timestamp generated by server in UTC.
data: The price depth.
"""
def __init_... | 2.375 | 2 |
src/filters.py | git2samus/xpost-bot | 16 | 12786769 | class SubmissionFilter(object):
""" methods to determine whether a submission is relevant for reposting """
def __init__(self, settings):
""" store settings """
self.settings = settings
def _is_valid_submitter(self, submission):
""" returns True when the submission isn't from an ig... | 3.34375 | 3 |
tests/test_mock_audio.py | CameronJRAllan/eTree-Browser | 1 | 12786770 | <reponame>CameronJRAllan/eTree-Browser
from unittest import TestCase
import os
import mock
import pytest
from PyQt5 import QtWidgets
import application
import audio
class TestApplication():
@pytest.fixture(scope="function", autouse=True)
def setup(self, qtbot):
# Create dialog to show this instance
self.d... | 2.25 | 2 |
public-engines/iris-h2o-automl/marvin_iris_h2o_automl/training/metrics_evaluator.py | guialba/incubator-marvin | 101 | 12786771 | #!/usr/bin/env python
# coding=utf-8
"""MetricsEvaluator engine action.
Use this module to add the project main code.
"""
from .._compatibility import six
from .._logging import get_logger
from marvin_python_toolbox.engine_base import EngineBaseTraining
from ..model_serializer import ModelSerializer
__all__ = ['Me... | 2.28125 | 2 |
bettertexts/migrations/0001_initial.py | citizenline/citizenline | 0 | 12786772 | # Generated by Django 2.2.3 on 2019-09-26 19:42
import bettertexts.models
import ckeditor.fields
from decimal import Decimal
from django.conf import settings
import django.contrib.sites.managers
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensi... | 1.742188 | 2 |
SLpackage/private/pacbio/pythonpkgs/pbsmrtpipe/lib/python2.7/site-packages/pbsmrtpipe/__init__.py | fanglab/6mASCOPE | 5 | 12786773 | <filename>SLpackage/private/pacbio/pythonpkgs/pbsmrtpipe/lib/python2.7/site-packages/pbsmrtpipe/__init__.py<gh_stars>1-10
from __future__ import absolute_import, division, print_function
VERSION = '1.4.0'
def get_version():
return VERSION
__version__ = get_version()
def get_changelist():
# Legacy from the... | 1.421875 | 1 |
cspace/main/appletserver.py | jmcvetta/cspace | 28 | 12786774 | <filename>cspace/main/appletserver.py
import os, sys, threading
from string import Template
from ncrypt.rand import bytes as rand_bytes
from ncrypt.rsa import RSAKey, RSAError
from nitro.selectreactor import SelectReactor
from nitro.tcp import tcpListen, TCPStream
from nitro.ssl import sslAbort
from nitro.linest... | 2.046875 | 2 |
trading_gym/envs/portfolio_gym/data_generator.py | zhaoshiying97/trading_gym | 32 | 12786775 | <reponame>zhaoshiying97/trading_gym<filename>trading_gym/envs/portfolio_gym/data_generator.py
import numpy as np
import pandas as pd
import pdb
class DataGeneratorDF(object):
"""input is a DataFrame with MultiIndex, considering Panal data structure is depreciated after pandas=0.24"""
def __init__(self, da... | 2.921875 | 3 |
dsaii/views.py | khushi0205/DSAII | 0 | 12786776 | from django.shortcuts import render
from django.views import View
from django.views.generic import ListView, DetailView, CreateView
from django.http import HttpResponseRedirect
from .models import Post, Comments, Event, EveComm
from django.urls import reverse_lazy, reverse
from django.core.mail import send_mail
from dj... | 2.09375 | 2 |
mud/admin.py | lambda-mud-cs18/backend | 1 | 12786777 | <reponame>lambda-mud-cs18/backend<filename>mud/admin.py<gh_stars>1-10
from django.contrib import admin
from .models import Player, PlayerInventory, Item, Team, Map, Room
# Register your models here.
admin.site.register(Player)
admin.site.register(PlayerInventory)
admin.site.register(Item)
admin.site.register(Team)
admi... | 1.601563 | 2 |
TranskribusDU/tasks/performCVLLA.py | Transkribus/TranskribusDU | 20 | 12786778 | # -*- coding: utf-8 -*-
"""
performCVLLA.py
create profile for nomacs (CVL LA toolkit)
<NAME>
copyright Xerox 2017
READ project
Developed for the EU project READ. The READ project has received funding
from the European Union's Horizon 2020 research and innovation progr... | 1.625 | 2 |
tests/pert_test.py | EnricaBelfiore/sandy | 30 | 12786779 | import pytest
from io import StringIO
import numpy as np
import pandas as pd
import sandy
__author__ = "<NAME>"
#####################
# Test initialization
#####################
def test_from_file_1_column():
vals = '1\n5\n9'
file = StringIO(vals)
with pytest.raises(Exception):
... | 2.140625 | 2 |
sect/core/trapezoidal/edge.py | lycantropos/sect | 17 | 12786780 | from ground.base import (Context,
Orientation)
from ground.hints import Point
from reprit.base import generate_repr
class Edge:
@classmethod
def from_endpoints(cls,
left: Point,
right: Point,
interior_to_left: bool,
... | 3.234375 | 3 |
asset_app/urls.py | jameskomo/asset-management-system | 3 | 12786781 | <gh_stars>1-10
from django.urls import path
from django.conf.urls import url
from .views import (
AssetsListView,
AssetsDetailView,
AssetsCreateView,
AssetsUpdateView,
AssetsDeleteView,
)
from . import views
urlpatterns = [
path('', AssetsListView.as_view(), name='assets_app_home'),
path('a... | 1.851563 | 2 |
src/areas_determination.py | joeyzhong90595/Robotic_Poker_Dealer | 2 | 12786782 | <filename>src/areas_determination.py<gh_stars>1-10
#!/usr/bin/env python
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import pcl
from sensor_msgs.msg import PointCloud
# Extra points from point cloud according to indices
def extra_pc(pc, indices):
coord = []
for index ... | 2.328125 | 2 |
18f/prac2/aah.py | willzhang05/icpc-practice | 0 | 12786783 | <filename>18f/prac2/aah.py
a = input()
b = input()
print("go" if len(b) <= len(a) else "no")
| 3.21875 | 3 |
nodenet/python/nodenet/trainingsessions/__init__.py | NOOXY-research/NodeNet | 2 | 12786784 | <gh_stars>1-10
# Create alias
from nodenet.trainingsessions.batch import *
from nodenet.trainingsessions.online import *
| 0.957031 | 1 |
broker/plugins/spark_sahara/plugin.py | alessandroliafook/bigsea-manager | 3 | 12786785 | <reponame>alessandroliafook/bigsea-manager<filename>broker/plugins/spark_sahara/plugin.py
# Copyright (c) 2017 UFCG-LSD.
#
# 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.apac... | 1.6875 | 2 |
pump_script.py | hulsed/FFERMAT | 1 | 12786786 | <reponame>hulsed/FFERMAT<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
File name: pump_script.py
Author: <NAME>
Created: October 2019
Description: A simple example of I/O using faultprop.py and the pump model in ex_pump.py
"""
#Using the model that was set up, we can now perform a few different operations
#First, import ... | 2.46875 | 2 |
main.py | Kiritow/PHDownloader | 1 | 12786787 | from mtdownloader import MTDownloader
from mtdownloader import readable as readableSize
from phuburl import resolver as PageResolver
import requests
import json
import time
def readableTime(s):
s=int(s)
if(s<60):
return '{}s'.format(s)
elif(s<3600):
return '{}m{}s'.format(s//60,s%60)
el... | 2.53125 | 3 |
pyscf/x2c/test/test_x2c_grad.py | robert-anderson/pyscf | 501 | 12786788 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 2.375 | 2 |
WordModel1.py | MengZhang0904/Learn_New_World | 0 | 12786789 | <filename>WordModel1.py<gh_stars>0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
import seaborn as sns
from gensim.models import Word2Vec
def find_pct(word,age):
df = pd.read_csv('word_acq_pct1.csv')
row = df[df.definition2 == word]
... | 2.8125 | 3 |
tests/featuresInPortuguese/steps/contact_steps.py | Schveitzer/selenium-python-bdd-behave-example | 0 | 12786790 | <gh_stars>0
from behave import step
from nose.tools import assert_equal
from constants import system_messages, system_label
@step("eu clico no botão contato para abrir a página de contato")
def step_impl(context):
context.contact_page.contact_link().click()
context.helper.wait_for_element_is_visible(context.... | 2.28125 | 2 |
tests/tests_verbs/test_order_by.py | fredzett/datastack | 0 | 12786791 | from datastack import DataTable, DataColumn, label, col, desc
import pytest
import numpy as np
def test_one():
tbl = (DataTable(a=(1,2,1,2,3,1), b=(4,5,6,3,2,1),c=(6,7,8,1,2,3))
.order_by(desc(label("b")))
)
exp = DataTable(a=(1,2,1,2,3,1), b=(6,5,4,3,2,1), c=(8,7,6,1,2,3))
assert tbl... | 2.546875 | 3 |
python/fire_rs/demo_front_interpolation.py | arthur-bit-monnot/fire-rs-saop | 13 | 12786792 | <reponame>arthur-bit-monnot/fire-rs-saop
"""Test fire front interpolation"""
# Copyright (c) 2019, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source c... | 1.203125 | 1 |
back_end/mlh/apps/headlines/serializers.py | 22014471/malonghui_Django | 1 | 12786793 | <gh_stars>1-10
import logging
from rest_framework import serializers
from activity.models import Activity
from headlines.models import HeadlinesCategory, HeadlinesNews, NewsComment, UserAttention, NewsCollection
from questions.models import Question, Tag
from talks.models import Talks
from users.models import User
c... | 2.40625 | 2 |
paralleldomain/utilities/lazy_load_cache.py | parallel-domain/pd-sdk | 10 | 12786794 | import collections
import logging
import os
import re
from sys import getsizeof
from threading import Event, RLock
from typing import Any, Callable, Dict, Hashable, Tuple, TypeVar, Union
import numpy as np
from cachetools import Cache
from humanize import naturalsize
CachedItemType = TypeVar("CachedItemType")
logger... | 2.125 | 2 |
fmojinja/awk/makefile/pdb_reformer.py | Taro-Imahiro/fmojinja | 0 | 12786795 | from ...mixin import TemplateRendererMixin
from ...__version__ import get_version
from argparse import ArgumentParser
class PdbReformer(TemplateRendererMixin):
@classmethod
def template(cls) -> str:
return f"# Generated by fmojinja version {get_version()}" + """
PREFIX := {{ prefix }}
PDB :={% for pa... | 2.25 | 2 |
services/api/__init__.py | flaviohenriqu/chemical-image-generation | 0 | 12786796 | <gh_stars>0
# services/__init__.py
import os
import connexion
import logging
def create_app(script_info=None):
# instantiate the app
con_app = connexion.FlaskApp(__name__, specification_dir='docs/')
con_app.add_api('api.yaml', options={'swagger_url': '/docs'})
# set config
app_settings = os.get... | 1.945313 | 2 |
viz/all-crossrefs-idb.py | cloakware-ctf/idascripts | 11 | 12786797 | <gh_stars>10-100
# Copyright 2016-2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 1.867188 | 2 |
tests/test_files_process_save.py | efratkohen/Project | 1 | 12786798 | <reponame>efratkohen/Project<filename>tests/test_files_process_save.py
from files_process_save import *
import clean_data_svi as cds
import pathlib
import pytest
def test_valid_input():
fname = pathlib.Path(__file__)
q = check_file(fname)
assert fname == q
def test_str_input():
q = check_file(__fil... | 2.46875 | 2 |
address/models.py | wendell1101/EcommerceProject---Django | 0 | 12786799 | <gh_stars>0
from django.db import models
from customer_profiles.models import CustomerProfile
from django_countries.fields import CountryField
class BillingAddress(models.Model):
customer_profile = models.ForeignKey(CustomerProfile, on_delete=models.CASCADE)
house_number = models.CharField(max_length=120)
... | 2.203125 | 2 |
src/bot/gameobservers/tests/test_game_end_observers.py | malmgrens4/TwIOTch | 0 | 12786800 | import pytest
from unittest import mock
from unittest.mock import AsyncMock, MagicMock
from src.bot.gameobservers.WinGameChatObserver import WinGameChatObserver
class TestNumberGameObservers:
@pytest.mark.asyncio
async def test_win_chat_announce_winners(self):
"""tests winning messages are called whe... | 2.59375 | 3 |
vdb/extensions/arm.py | wisdark/vivisect | 716 | 12786801 | <reponame>wisdark/vivisect<gh_stars>100-1000
import envi
import envi.cli as e_cli
import envi.common as e_common
import envi.archs.arm.regs as e_arm_regs
import envi.archs.thumb16.disasm as e_thumb
def armdis(db, line):
'''
Disassemble arm instructions from the given address.
Usage: armdis <addr_exp>
... | 2.390625 | 2 |
LeetCode/Python3/TwoPointers/86. Partition List.py | WatsonWangZh/CodingPractice | 11 | 12786802 | <gh_stars>10-100
# Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
# You should preserve the original relative order of the nodes in each of the two partitions.
# Example:
# Input: head = 1->4->3->2->5->2, x = 3
# Output: 1->2->2->4->3->5
#... | 3.625 | 4 |
src/Filler.py | DjamelALI/covid-19-database | 0 | 12786803 | from . import Config, DIR_NAME
from .csv_tool import *
from .print_func import print_head
from .TemplateDir import TemplateDir, TEMPLATES_DIR
DIR_INSERT = TEMPLATES_DIR / "insert"
class Filler:
def __init__(self, config: Config):
self.config = config
self.template_dir = TemplateDir(DIR_INSERT)
... | 2.65625 | 3 |
xmodaler/engine/rl_trainer.py | YehLi/xmodaler | 830 | 12786804 | # Copyright 2021 JD.com, Inc., JD AI
"""
@author: <NAME>
@contact: <EMAIL>
"""
import time
import copy
import torch
from .defaults import DefaultTrainer
from xmodaler.scorer import build_scorer
from xmodaler.config import kfg
from xmodaler.losses import build_rl_losses
import xmodaler.utils.comm as comm
fr... | 1.914063 | 2 |
utils/acs_utils.py | stephanballer/deepedgebench | 1 | 12786805 | <filename>utils/acs_utils.py
#!/usr/bin/python3
""" Circuit:
____________
| |
Uin _______________________| ACS712 5A |________ Uin device
| |____________|
_|_ | |
... | 2.640625 | 3 |
pyPLANES/fem/elements/surfacic_elements.py | matael/pyPLANES | 0 | 12786806 | <reponame>matael/pyPLANES
#! /usr/bin/env python
# -*- coding:utf8 -*-
#
# surfacic_elements.py
#
# This file is part of pyplanes, a software distributed under the MIT license.
# For any question, please contact one of the authors cited below.
#
# Copyright (c) 2020
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# ... | 2.171875 | 2 |
QuantitativeEditing/audio_rendering.py | wjs018/QuantitativeEditing | 21 | 12786807 | <reponame>wjs018/QuantitativeEditing
import librosa
import matplotlib.pyplot as plt
import numpy as np
from moviepy.editor import *
from librosa.display import waveplot
from moviepy.video.io.bindings import mplfig_to_npimage
last_t = 0
tempgraph = []
def animate_audio(video, audio, output):
"""
Renders a w... | 3.328125 | 3 |
tests/test_duplicated_link.py | mhbl3/matlabdomain | 38 | 12786808 | <reponame>mhbl3/matlabdomain<filename>tests/test_duplicated_link.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
test_package_links.py
~~~~~~~~~~~~
Test the autodoc extension.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future_... | 1.820313 | 2 |
numpy/doc/dispatch.py | Soniyanayak51/numpy | 1 | 12786809 | <reponame>Soniyanayak51/numpy
""".. _dispatch_mechanism:
Numpy's dispatch mechanism, introduced in numpy version v1.16 is the
recommended approach for writing custom N-dimensional array containers that are
compatible with the numpy API and provide custom implementations of numpy
functionality. Applications include `da... | 3.09375 | 3 |
5/005_smallest_divisible_by_1_through_20.py | the-gigi/project-euler | 7 | 12786810 | <filename>5/005_smallest_divisible_by_1_through_20.py
"""Smallest Multiple - https://projecteuler.net/problem=5
2520 is the smallest number that can be divided by each of the numbers from
1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the
numbers from 1 to 20?
"... | 3.921875 | 4 |
tests/segment.py | soootaleb/spare | 1 | 12786811 | import unittest, random
from models.point import Point
from models.segment import Segment
import numpy as np
class TestSegmentMethods(unittest.TestCase):
def test_new(self):
with self.assertRaises(ValueError) as context:
Segment([])
def test_extremums(self):
a = Point(random.ran... | 3.171875 | 3 |
EfficientNet-Transfer-Learning-Boiler-Plate/model_retrain_remove_layer.py | ntedgi/deep-learning-data-preparation-tools | 0 | 12786812 | import efficientnet.keras as efn
import os
from keras.layers import *
from keras.models import Model
from keras.preprocessing.image import ImageDataGenerator
# load checkpoint
def get_efficentnet_check_point(argument):
check_points = {
0: efn.EfficientNetB0(weights='imagenet'),
1: efn.EfficientNet... | 2.53125 | 3 |
tests/test_exception.py | AustinScola/illud | 1 | 12786813 | <filename>tests/test_exception.py<gh_stars>1-10
"""Test illud.exception."""
from illud.exception import IlludException
def test_inheritance() -> None:
"""Test illud.exception.IlludException inheritance."""
assert issubclass(IlludException, Exception)
| 1.914063 | 2 |
slugifile/slugifile.py | codehutlabs/slugifile | 0 | 12786814 | # -*- coding: utf-8 -*-
from slugify import slugify
import os
"""Main module."""
def ascii_safe_filename(filename: str) -> dict:
file = os.path.splitext(filename)
slug = slugify(file[0], separator="_")
ext = file[1]
return {"f_in": filename, "f_out": "{}{}".format(slug, ext)}
def slugifile_direc... | 3.015625 | 3 |
dps/admin.py | takeflight/django-dps | 0 | 12786815 | <reponame>takeflight/django-dps<filename>dps/admin.py
from django.contrib.admin import SimpleListFilter
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import Transaction
class ContentTypeFilter(SimpleListFilter):
title = 'purchase type'
parame... | 2.09375 | 2 |
ldb/export.py | bramvankooten/dienst2 | 1 | 12786816 | <gh_stars>1-10
import csv
import operator
import re
from functools import reduce
from io import StringIO
from django.db.models import Q
from django.utils.encoding import smart_str
from rest_framework import renderers, status
from rest_framework.renderers import TemplateHTMLRenderer
from rest_framework.response import ... | 2.0625 | 2 |
filemon/files.py | asvetlov/filemon | 0 | 12786817 | import os
import sys
import subprocess
from PySide import QtGui, QtCore
class FileSystemModel(QtGui.QFileSystemModel):
filter_reset = QtCore.Signal()
root_index_changed = QtCore.Signal(QtCore.QModelIndex)
status_changed = QtCore.Signal(int, int)
STORAGE_NAME = '.filemon.dat'
def __init__(self):... | 2.375 | 2 |
08-recursive-and-backtracking/leetcode_22.py | xiaolinzi-xl/Algorithm-Interview-Study | 1 | 12786818 | ans = []
def rebot(l, r, n, res):
if l == n and r == n:
ans.append(res)
return
if l > r:
if l < n:
rebot(l + 1, r, n, res + '(')
rebot(l, r + 1, n, res + ')')
elif l == r:
rebot(l + 1, r, n, res + '(')
class Solution:
def generateParenthesis(self, ... | 3.359375 | 3 |
manifold_flow/flows/flow.py | selflein/manifold-flow | 199 | 12786819 | <reponame>selflein/manifold-flow
import logging
from manifold_flow.utils.various import product
from manifold_flow import distributions
from manifold_flow.flows import BaseFlow
logger = logging.getLogger(__name__)
class Flow(BaseFlow):
""" Ambient normalizing flow (AF) """
def __init__(self, data_dim, tran... | 2.46875 | 2 |
InvoiceSystem-python/paymentCharged.py | gvensan/ep-design-workshop | 0 | 12786820 | <reponame>gvensan/ep-design-workshop
from enum import Enum
from typing import Sequence
from entity import Entity
class PaymentCharged(Entity):
class Driver(Entity):
def __init__(
self,
driverId: int,
rating: int,
lastName: str,
... | 2.984375 | 3 |
plugins/zeterpreter/multi/trolling/say.py | CrackerCat/ZetaSploit | 3 | 12786821 | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020 EntySec
#
# 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,... | 1.90625 | 2 |
storage/baidu_cloud.py | wangkaibiao/SettlersFinancialData3 | 0 | 12786822 | <reponame>wangkaibiao/SettlersFinancialData3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
bypy,第一次运行时需要授权,只需跑任何一个命令(比如 bypy info)然后跟着说明(登陆等)来授权即可。
授权只需一次,一旦成功,以后不会再出现授权提示.
更详细的了解某一个命令:bypy help <command>
显示在云盘(程序的)根目录下文件列表:bypy list
把当前目录同步到云盘:bypy syncup or bypy upload
把云盘内容同步到本地来:bypy syncdown or by... | 1.84375 | 2 |
kbsbot/channel_handler/services.py | astandre/cb-channel-handler-ms | 0 | 12786823 | <reponame>astandre/cb-channel-handler-ms
from requests import Session
import requests
import os
COMPOSE_ENGINE = os.environ.get('COMPOSE_ENGINE')
# COMPOSE_ENGINE = "http://127.0.0.1:5000"
session = Session()
session.trust_env = False
session.verify = False
session.headers["Accept"] = "application/json"
session.heade... | 2.71875 | 3 |
callables.py | StanLivitski/python-runtime | 0 | 12786824 | # vim:fileencoding=UTF-8
#
# Copyright © 2016, 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 with modifications,
# (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://raw.githubusercontent.com/StanLivitski/... | 2.25 | 2 |
jes/jes-v4.3-linux/Sources/JESRunnable.py | utv-teaching/foundations-computer-science | 0 | 12786825 | <reponame>utv-teaching/foundations-computer-science
#JES- Jython Environment for Students
#Copyright (C) 2002 <NAME>, <NAME>, <NAME>, <NAME>
#See JESCopyright.txt for full licensing information
from java.lang import Runnable
from javax.swing import JOptionPane
#######################################################... | 3.15625 | 3 |
app/waterQual/30yr/CC/wrtds_WCC_err.py | fkwai/geolearn | 0 | 12786826 | <gh_stars>0
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality
from hydroDL import kPath, utils
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs
from hydroDL.post import axplot, figplot
import torch
import os
import json
import pandas as pd
import numpy as np... | 1.984375 | 2 |
blog.py | the-it-dude/the-it-dude | 0 | 12786827 | <gh_stars>0
import logging
from jinja2 import Environment, FileSystemLoader, select_autoescape
import yaml
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
CONFIG_FILE = 'blog.yml'
class Blog(object):
def __init__(self, config):
self.env = Environment(
loader=FileSystemL... | 2.6875 | 3 |
app/stratified.py | CMUSTRUDEL/flask-browser | 1 | 12786828 | high_perspective = ['<KEY>',
'<KEY>',
'<KEY>',
'<KEY>',
'5eadd270bd354374a770a538',
'<KEY>',
'<KEY>',
'5e9fa678bd35436be69b2a5e',
'<KEY>',
'<KEY>',
'5eeb0729bd35431ff8d3fadc',
'<KEY>',
'<KEY>',
'<KEY>',
'5e7da4b1bd3543638522a940',
'<KEY>',
'<KEY>',
'5e498c9ebd3543364e1aea31',
'5e40af8bac8db7c63592a473',
'<KEY>',
'<KEY>... | 1.234375 | 1 |
core/models/program_availability.py | themightychris/prevention-point | 1 | 12786829 | <filename>core/models/program_availability.py
from django.db import models
from core.models import Program
class ProgramAvailability(models.Model):
program = models.ForeignKey(Program, on_delete=models.CASCADE)
day_of_week = models.CharField(max_length = 10)
start_time = models.TimeField()
end_time = m... | 1.9375 | 2 |
Basic/Realtimeinfo.py | JHP4911/Quantum-Computing-UK | 51 | 12786830 | print('\nDevice Monitor')
print('----------------')
from qiskit import IBMQ
from qiskit.tools.monitor import backend_overview
IBMQ.enable_account('Insert API token here') # Insert your API token in to here
provider = IBMQ.get_provider(hub='ibm-q')
backend_overview() # Function to get all information back about each ... | 2.265625 | 2 |
Battery_Testing_Software/labphew/controller/blink_controller.py | sjoerdsein/FAIR-Battery | 2 | 12786831 | <reponame>sjoerdsein/FAIR-Battery<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
================
Blink controller
================
This is an example of a controller with a fake (invented) device. It should help to guide
developers to create new controllers for real devices.
Example usage can be found at the bottom of th... | 3.21875 | 3 |
glue/algorithms/square.py | glensc/glue | 514 | 12786832 | import copy
class SquareAlgorithmNode(object):
def __init__(self, x=0, y=0, width=0, height=0, used=False,
down=None, right=None):
"""Node constructor.
:param x: X coordinate.
:param y: Y coordinate.
:param width: Image width.
:param height: Image height.... | 3.515625 | 4 |
apps/page/views.py | v02202/portal20 | 0 | 12786833 | import re
import csv
import codecs
import json
import os
import environ
from django.shortcuts import render, get_object_or_404
from django.http import (
HttpResponse,
HttpResponseNotFound,
)
from django.db.models import (
Q,
F,
Count,
Sum
)
from django.conf import settings
from apps.data.model... | 1.890625 | 2 |
bundestagger/account/views.py | stefanw/Bundestagger | 3 | 12786834 | # -*- coding: utf-8 -*-
from django.http import Http404, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed
from django.shortcuts import redirect
from django.contrib import messages
from bundestagger.helper.utils import is_post
from bundestagger.account.auth import logged_in
from bundestagger.accoun... | 1.976563 | 2 |
sdk/python/pulumi_linode/config/vars.py | displague/pulumi-linode | 1 | 12786835 | <reponame>displague/pulumi-linode
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
__c... | 0.933594 | 1 |
audlib/nn/util.py | RaphaelOlivier/pyaudlib | 26 | 12786836 | """Utility functions for neural networks."""
import numpy as np
import torch
def detach(states):
"""Truncate backpropagation (usually used in RNN)."""
return [state.detach() for state in states]
def hasnan(m):
"""Check if torch.tensor m have NaNs in it."""
return np.any(np.isnan(m.cpu().data.numpy()... | 3.25 | 3 |
application/KitchenMagician/kitchen_magician/users/db/dummy_data.py | AsuPaul19/Kitchen-Magician | 0 | 12786837 | <reponame>AsuPaul19/Kitchen-Magician
from django.contrib.auth.models import User
from users.models import Profile
from groups.models import Group
from groups.models import GroupUser
import random
class DummyData():
def __init__(self, user_num=1):
self.user_num = user_num
self.users = self.create_du... | 2.84375 | 3 |
slingen/src/algogen/core/algebraic_manipulation.py | danielesgit/slingen | 23 | 12786838 | <filename>slingen/src/algogen/core/algebraic_manipulation.py
from core.expression import Symbol, Matrix, Vector, \
Equal, Plus, Minus, Times, Transpose, Inverse, \
BlockedExpression, Sequence, Predicate, \
PatternDot
from core.propertie... | 1.75 | 2 |
6_google_trace/VMFuzzyPrediction/experiments/ExperimentFuzzyBPNNM.py | nguyenthieu95/machine_learning | 1 | 12786839 | <filename>6_google_trace/VMFuzzyPrediction/experiments/ExperimentFuzzyBPNNM.py
from io_utils.NumLoad import *
from sklearn.cross_validation import train_test_split
from estimators.FuzzyFlow import FuzzyFlow
from utils.TrainingTestMaker import TrainingTestMaker
from scaling.ProactiveSLA import ProactiveSLA
from __init__... | 2.078125 | 2 |
ziken03/models.py | ihakiwamu/Experiment_Ryakugo | 0 | 12786840 | <filename>ziken03/models.py<gh_stars>0
# coding UTF-8
import matplotlib.pyplot as plt
from input import read_file, conv_str_to_kana, conv_kana_to_vec, conv_vec_to_kana, calc_accuracy
from sklearn import svm
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklea... | 2.609375 | 3 |
main/lib/idds/tests/core_tests.py | HSF/iDDS | 0 | 12786841 | <gh_stars>0
import sys
import datetime
from idds.common.utils import json_dumps # noqa F401
from idds.common.constants import ContentStatus, ContentType, ContentRelationType, ContentLocking # noqa F401
from idds.core.requests import get_requests # noqa F401
from idds.core.messages... | 1.695313 | 2 |
tests/test_config.py | contourpy/contourpy | 14 | 12786842 | from image_comparison import compare_images
import pytest
import util_config
import util_test
@pytest.mark.parametrize("name", util_test.all_names())
def test_config_filled(name):
config = util_config.ConfigFilled(name)
image_buffer = config.save_to_buffer()
compare_images(image_buffer, "config_filled.png... | 2.15625 | 2 |
src/sentry/web/frontend/organization_avatar.py | AlexWayfer/sentry | 4 | 12786843 | <gh_stars>1-10
from __future__ import absolute_import
from sentry.models import OrganizationAvatar
from sentry.web.frontend.base import AvatarPhotoView
class OrganizationAvatarPhotoView(AvatarPhotoView):
model = OrganizationAvatar
| 1.390625 | 1 |
dronedirector/tests/test_aerial.py | avmarchenko/dronedirector | 0 | 12786844 | # -*- coding: utf-8 -*-
# Copyright 2018 <NAME>
# Distributed under the terms of the Apache License 2.0
"""
Test Aerial Objects
#####################
"""
import six
import json
import uuid
import numpy as np
from itertools import cycle
from dronedirector.aerial import AerialObject, Drone, SinusoidalDrone
class CaliRe... | 2.8125 | 3 |
tests/factories/base.py | korostil/invest | 0 | 12786845 | import asyncio
import inspect
import factory
class AsyncFactory(factory.Factory):
"""
Copied from
https://github.com/FactoryBoy/factory_boy/issues/679#issuecomment-673960170
"""
class Meta:
abstract = True
@classmethod
def _create(cls, model_class, *args, **kwargs):
asyn... | 2.984375 | 3 |
ML_Module_src/try_merge.py | Logi-Meichu/Eduction_anywhere | 0 | 12786846 | import os
import cv2
import time
import imutils
import pyrebase
import numpy as np
from utils import *
import sys
import dlib
from skimage import io
#################### Initialize ####################
print("Start initializing")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
emotion_dict = {0: "Angry", 1: "Disgusted", ... | 2.1875 | 2 |
client/tools/buildtool/chameleon_tool/chameleon_copyr.py | uclouddotcn/chameleon | 4 | 12786847 | <reponame>uclouddotcn/chameleon
import os, shutil, sys, codecs
def isNewerThan(a, b):
return os.path.getmtime(a) > os.path.getmtime(b)
def genRFileForPkgName(genPath, pkgName, newPkgName):
s = pkgName.split('.')
d = os.path.join(*([genPath] + s))
src = os.path.join(d, 'R.java')
targetD = os.path.j... | 2.265625 | 2 |
flask_mrest/SupportUser.py | cindy-zimmerman/vmb-mrest | 0 | 12786848 | import os
import base64
from flask.ext.login import UserMixin
from flask.ext.login import AnonymousUserMixin as AnonymousUser
from flask.ext.bcrypt import Bcrypt, generate_password_hash
class User(UserMixin):
# proxy for a database of users
user_database = {"JohnDoe": ("JohnDoe", "John"),
"Jane... | 2.796875 | 3 |
test/input/099.py | EliRibble/pyfmt | 0 | 12786849 | <filename>test/input/099.py
def some_really_long_function_name(i):
return i ** i
print([(
some_really_long_function_name(i),
some_really_long_function_name(i+1),
some_really_long_function_name(i+3),
) for i in range(10)])
| 2.671875 | 3 |
laser_path_utils.py | mattvalentine/LaserAssistant | 2 | 12786850 | # laser_path_utils.py
"""Utility functions for working with paths for laser cutting"""
import numpy as np
import svgpathtools.svgpathtools as SVGPT
# it's imporatant to clone and install the repo manually. The pip/pypi version is outdated
from laser_svg_utils import tree_to_tempfile
from laser_clipper import point_o... | 2.90625 | 3 |