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/RIOT/tests/pkg_tensorflow-lite/mnist/mnist_mlp.py | ARte-team/ARte | 2 | 12800 | <reponame>ARte-team/ARte<gh_stars>1-10
#!/usr/bin/env python3
import os
# imports for array-handling
import numpy as np
import tensorflow as tf
# keras imports for the dataset and building our neural network
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.k... | 2.8125 | 3 |
lang/Python/random-numbers-1.py | ethansaxenian/RosettaDecode | 0 | 12801 | <filename>lang/Python/random-numbers-1.py
import random
values = [random.gauss(1, .5) for i in range(1000)]
| 2.796875 | 3 |
src/display.py | thebruce87/Photobooth | 0 | 12802 | <gh_stars>0
class Display():
def __init__(self, width, height):
self.width = width
self.height = height
def getSize(self):
return (self.width, self.height)
| 2.75 | 3 |
stock_api_handler.py | Sergix/analyst-server | 2 | 12803 | # This python script handles stock api request from yfinance
# Last Updated: 4/7/2020
# Credits:nóto
#Import yfinance api lib
import yfinance as yf
#Import pandas lib
import pandas as pd
#Import json to manipulate api data
import json
#Import math
import math
class StockApi():
def __init__(self):
self.pan... | 3.234375 | 3 |
hth/shows/tests/factories.py | roperi/myband | 1 | 12804 | from datetime import date
from random import randrange
import factory
import factory.fuzzy
from hth.core.tests.utils import from_today
class VenueFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'shows.Venue'
name = factory.Sequence(lambda n: 'Venue %d' % n)
city = factory.Sequ... | 2.359375 | 2 |
homeassistant/components/eight_sleep/binary_sensor.py | andersop91/core | 22,481 | 12805 | <reponame>andersop91/core
"""Support for Eight Sleep binary sensors."""
from __future__ import annotations
import logging
from pyeight.eight import EightSleep
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.core import HomeAssistant
from ... | 2.328125 | 2 |
tensorbay/opendataset/FLIC/loader.py | rexzheng324-c/tensorbay-python-sdk | 0 | 12806 | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
# pylint: disable=missing-module-docstring
import os
from typing import Any, Dict, Iterator, Tuple
from tensorbay.dataset import Data, Dataset
from tensorbay.exception import ModuleImportError
from tensorba... | 2.3125 | 2 |
my_answers/homework/OOP/athlete.py | eyalle/python_course | 0 | 12807 | <filename>my_answers/homework/OOP/athlete.py
def get_time(time_in_seconds):
import datetime
time_str = str(datetime.timedelta(time_in_seconds))
time_fractions = time_str.split(":")
time_fractions[0] = time_fractions[0].replace(",","")
time_fractions[-1] += 's'
time_fractions[-2] += 'm'
time... | 3.984375 | 4 |
osisoft/pidevclub/piwebapi/models/pi_data_server_license.py | jugillar/PI-Web-API-Client-Python | 30 | 12808 | # coding: utf-8
"""
Copyright 2018 OSIsoft, 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 t... | 1.710938 | 2 |
bot.py | JavierOramas/scholar_standing_bot | 0 | 12809 | <gh_stars>0
#! /root/anaconda3/bin/python
import os
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from pyrogram import Client, filters
from read_config import read_config
import json
import requests
import schedule
import time
def get_value_usd(sum):
price = requests.get('https://api.coingecko.com/ap... | 2.34375 | 2 |
skdecide/discrete_optimization/rcpsp_multiskill/parser/rcpsp_multiskill_parser.py | emilienDespres/scikit-decide | 27 | 12810 | # Copyright (c) AIRBUS and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
from typing import Dict, Tuple
from skdecide.discrete_optimization.rcpsp_multiskill.rcpsp_multiskill import (
E... | 1.757813 | 2 |
pipe_anchorages/logging_monkeypatch.py | GlobalFishingWatch/anchorages_pipeline | 3 | 12811 | import logging
# monkey patch to suppress the annoying warning you get when you import apache_beam
#
# No handlers could be found for logger "oauth2client.contrib.multistore_file"
#
# This warning is harmless, but annooying when you are using beam from a command line app
# see: https://issues.apache.org/jira/browse/BE... | 1.835938 | 2 |
core/managers.py | Bilal815/ecommerce_storee | 95 | 12812 | from django.db import models
class SoftDeleteManager(models.Manager):
def save_soft_delete(self):
self.is_deleted = True
self.save()
return True
def get_soft_delete(self):
return self.filter(is_deleted=True)
def get_unsoft_delete(self):
return self.filter(is_delet... | 2.15625 | 2 |
mizani/breaks.py | stillmatic/mizani | 0 | 12813 | <reponame>stillmatic/mizani<filename>mizani/breaks.py
"""
All scales have a means by which the values that are mapped
onto the scale are interpreted. Numeric digital scales put
out numbers for direct interpretation, but most scales
cannot do this. What they offer is named markers/ticks that
aid in assessing the values ... | 3.03125 | 3 |
examples/04_sweep_wind_directions.py | ElieKadoche/floris | 0 | 12814 | # Copyright 2022 NREL
# 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, software
# distri... | 2.6875 | 3 |
1.main.py | learning-nn/nn_from_scratch | 0 | 12815 | <reponame>learning-nn/nn_from_scratch
import numpy
import numpy as np
# converting to a layer with 4 input and 3 neuron
inputs = [[1.2, 2.1, 3.4, 1.2],
[1.2, 2.1, 3.4, 1.2],
[1.2, 2.1, 3.4, 1.2]]
print(numpy.shape(inputs))
weights = [[4.1, -4.5, 3.1, 2.3],
[-4.1, 4.5, 2.1, 2.3],
... | 3.515625 | 4 |
backend/grant/task/__init__.py | DSBUGAY2/zcash-grant-system | 8 | 12816 | <filename>backend/grant/task/__init__.py
from . import models
from . import views
from . import commands
from . import jobs | 1.195313 | 1 |
DjangoTry/venv/Lib/site-packages/django_select2/__init__.py | PavelKoksharov/QR-BOOK | 0 | 12817 | <filename>DjangoTry/venv/Lib/site-packages/django_select2/__init__.py
"""
This is a Django_ integration of Select2_.
The application includes Select2 driven Django Widgets and Form Fields.
.. _Django: https://www.djangoproject.com/
.. _Select2: https://select2.org/
"""
from django import get_version
if get_version(... | 1.71875 | 2 |
Sorting/bubble.py | Krylovsentry/Algorithms | 1 | 12818 | # O(n ** 2)
def bubble_sort(slist, asc=True):
need_exchanges = False
for iteration in range(len(slist))[:: -1]:
for j in range(iteration):
if asc:
if slist[j] > slist[j + 1]:
need_exchanges = True
slist[j], slist[j + 1] = slist[j + 1], ... | 3.765625 | 4 |
chapter_13/pymail.py | bimri/programming_python | 0 | 12819 | "A Console-Based Email Client"
#!/usr/local/bin/python
"""
##########################################################################
pymail - a simple console email interface client in Python; uses Python
poplib module to view POP email messages, smtplib to send new mails, and
the email package to extract mail header... | 2.859375 | 3 |
dependencyinjection/internal/param_type_resolver.py | Cologler/dependencyinjection-python | 0 | 12820 | <reponame>Cologler/dependencyinjection-python<filename>dependencyinjection/internal/param_type_resolver.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017~2999 - cologler <<EMAIL>>
# ----------
#
# ----------
import typing
import inspect
from .errors import ParameterTypeResolveError
cl... | 2.296875 | 2 |
rest-api/server.py | phenomax/resnet50-miml-rest | 1 | 12821 | import io
import os
from flask import Flask, request, jsonify
from PIL import Image
from resnet_model import MyResnetModel
app = Flask(__name__)
# max filesize 2mb
app.config['MAX_CONTENT_LENGTH'] = 2 * 1024 * 1024
# setup resnet model
model = MyResnetModel(os.path.dirname(os.path.abspath(__file__)))
@app.route("/... | 2.703125 | 3 |
authors/apps/profiles/tests/test_follow.py | KabohaJeanMark/ah-backend-invictus | 7 | 12822 | from django.urls import reverse
from rest_framework import status
from .base import BaseTestCase
class FollowTestCase(BaseTestCase):
"""Testcases for following a user."""
def test_follow_user_post(self):
"""Test start following a user."""
url = reverse('follow', kwargs={'username': 'test2'})
... | 2.625 | 3 |
OpenPNM/Phases/__GenericPhase__.py | thirtywang/OpenPNM | 0 | 12823 | <filename>OpenPNM/Phases/__GenericPhase__.py
# -*- coding: utf-8 -*-
"""
===============================================================================
module __GenericPhase__: Base class for building Phase objects
===============================================================================
"""
from OpenPNM.Networ... | 2.390625 | 2 |
rqt_mypkg/src/rqt_mypkg/statistics.py | mounteverset/moveit_path_visualizer | 0 | 12824 | <reponame>mounteverset/moveit_path_visualizer<gh_stars>0
#!/usr/bin/env python3
import sys
import copy
from moveit_commander import move_group
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from math import pi, sqrt, pow
from std_msgs.msg import String
import io
import shutil
imp... | 2.296875 | 2 |
apps/sendmail/admin.py | CasualGaming/studlan | 9 | 12825 | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Mail
class MailAdmin(admin.ModelAdmin):
list_display = ['subject', 'sent_time', 'recipients_total', 'successful_mails', 'failed_mails', 'done_sending']
ordering = ['-sent_time']
# Prevent creation
def has_add_permission(s... | 2.078125 | 2 |
event/test_event.py | Web-Team-IITI-Gymkhana/gymkhana_server | 0 | 12826 | from uuid import uuid4
from fastapi.testclient import TestClient
from ..main import app
client = TestClient(app)
class Test_Event:
record = {
"name": "<NAME>",
"description": "It is a coding event held in the month of Decemeber by Programming Club",
"created_on": "2022-01-28T21:33:50.79... | 2.71875 | 3 |
zigzag_conversion.py | cheng10/leetcode | 0 | 12827 | <filename>zigzag_conversion.py
class Solution(object):
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
cycle = 2*(numRows-1)
if numRows == 1: cycle = 1
map = []
for i in range(numRows):
map.append(... | 3.46875 | 3 |
src/tests/ftest/soak/soak.py | cdurf1/daos | 0 | 12828 | <reponame>cdurf1/daos
#!/usr/bin/python
"""
(C) Copyright 2019 Intel Corporation.
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 appl... | 1.960938 | 2 |
aoc/year_2020/day_06/solver.py | logan-connolly/AoC | 2 | 12829 | <filename>aoc/year_2020/day_06/solver.py<gh_stars>1-10
"""This is the Solution for Year 2020 Day 06"""
import re
from aoc.abstracts.solver import Answers, StrLines
class Solver:
def __init__(self, data: str) -> None:
self.data = data
def _preprocess(self) -> StrLines:
delim = "\n\n"
... | 3.109375 | 3 |
setup.py | kuzxnia/typer | 0 | 12830 | <gh_stars>0
from setuptools import find_packages, setup
setup(
name="typer", packages=find_packages(),
)
| 1.101563 | 1 |
speedup.py | hjdeheer/malpaca | 0 | 12831 | <gh_stars>0
import numpy as np
from numba import jit, prange
from scipy.stats import mode
from sklearn.metrics import accuracy_score
__all__ = ['dtw_distance', 'KnnDTW']
@jit(nopython=True, fastmath=True)
def cosine_distance(u:np.ndarray, v:np.ndarray):
assert(u.shape[0] == v.shape[0])
uv = 0
uu = 0
... | 2.5625 | 3 |
setup.py | colineRamee/UAM_simulator_scitech2021 | 1 | 12832 | from setuptools import setup
setup(
name='uam_simulator',
version='1.0',
description='A tool to simulate different architectures for UAM traffic management',
author='<NAME>',
author_email='<EMAIL>',
packages=['uam_simulator'],
install_requires=['numpy', 'scikit-learn', 'gurobipy']
)
# If in... | 1.210938 | 1 |
DFS/Leetcode1239.py | Rylie-W/LeetRecord | 0 | 12833 | class Solution:
def maxLength(self, arr) -> int:
def helper(word):
temp=[]
temp[:0]=word
res=set()
for w in temp:
if w not in res:
res.add(w)
else:
return None
return res
... | 3.375 | 3 |
apps/addresses/migrations/0002_address_picture.py | skyride/python-docker-compose | 0 | 12834 | <reponame>skyride/python-docker-compose<gh_stars>0
# Generated by Django 3.0.6 on 2020-05-25 22:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('addresses', '0001_initial'),
]
operations = [
migrations.AddField(
model_name... | 1.554688 | 2 |
liberapay/payin/common.py | Panquesito7/liberapay.com | 1 | 12835 | <reponame>Panquesito7/liberapay.com<gh_stars>1-10
from collections import namedtuple
from datetime import timedelta
import itertools
from operator import attrgetter
from pando.utils import utcnow
from psycopg2.extras import execute_batch
from ..constants import SEPA
from ..exceptions import (
AccountSuspended, Mi... | 2.234375 | 2 |
vendor/func_lib/assert_handle.py | diudiu/featurefactory | 0 | 12836 | # -*- coding:utf-8 -*-
from vendor.errors.feature import FeatureProcessError
"""
此目录下所有功能函数均为:
按一定条件检查传入参数合法性
**若不合法, 将抛出异常**
"""
def f_assert_not_null(seq):
"""检测值是否非空或值得列表是否存在非空元素"""
if seq in (None, '', [], {}, ()):
raise FeatureProcessError("value: %s f_assert_not_null Error... | 2.671875 | 3 |
main.py | Potapov-AA/CaesarCipherWithKeyword | 0 | 12837 | import time
from os import system, walk
from config import CONFIG
from encry import ENCRY
from decry import DECRY
# Функция настройки конфигурации
def conf_setting():
system('CLS')
print("Enter key elements: ")
# Выбор алфавита
alphabet = input("Select the used alphabet [EN]GLISH | [RU]SSIAN: ")
#... | 3.21875 | 3 |
frappe/email/doctype/email_queue_recipient/email_queue_recipient.py | oryxsolutions/frappe | 0 | 12838 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
from frappe.model.document import Document
class EmailQueueRecipient(Document):
DOCTYPE = "Email Queue Recipient"
def is_mail_to_be_sent(self):
return self.status == "Not Sent"
def is_m... | 2.28125 | 2 |
tests/groups/family/test_pseudo_dojo.py | mbercx/aiida-pseudo | 0 | 12839 | # -*- coding: utf-8 -*-
# pylint: disable=unused-argument,pointless-statement
"""Tests for the `PseudoDojoFamily` class."""
import pytest
from aiida_pseudo.data.pseudo import UpfData, Psp8Data, PsmlData, JthXmlData
from aiida_pseudo.groups.family import PseudoDojoConfiguration, PseudoDojoFamily
def test_type_string(... | 2.09375 | 2 |
converter.py | Poudingue/Max2Mitsuba | 4 | 12840 | <filename>converter.py
import sys
import os
if sys.version_info[0] != 3 :
print("Running in python "+sys.version_info[0]+", should be python 3.")
print("Please install python 3.7 from the official site python.org")
print("Exiting now.")
exit()
import shutil
import argparse
import fbx2tree
import builder_fromfbx
... | 2.5 | 2 |
run.py | snandasena/disaster-response-pipeline | 0 | 12841 | import sys
import json
import plotly
from flask import Flask
from flask import render_template, request
from plotly.graph_objects import Heatmap, Bar
from sklearn.externals import joblib
from sqlalchemy import create_engine
sys.path.append("common")
from common.nlp_common_utils import *
if len(sys.argv) == 1:
s... | 2.84375 | 3 |
process.py | s-xie/processing | 0 | 12842 | <reponame>s-xie/processing
import re
import sys
from nltk.tokenize import word_tokenize
from unidecode import unidecode
from nltk.tokenize import sent_tokenize
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('fin')
parser.add_argument('fout')
args = parser.parse_args()
textproc = TextProc()
tok... | 2.515625 | 3 |
Aula 14 - Estrutura de repetição while/desafio058-jogo-da-adivinhação.py | josue-rosa/Python---Curso-em-Video | 3 | 12843 | <reponame>josue-rosa/Python---Curso-em-Video<filename>Aula 14 - Estrutura de repetição while/desafio058-jogo-da-adivinhação.py
"""
Melhore o jogo do DESAFIO 028 onde o computador vai "pensar" em um numero entre 0 e 10.
Só que agora o jogador vai tentar adivinhar até acertar, mostrando no final
quantos palpites foram ne... | 3.953125 | 4 |
plugins/googlefight.py | serpis/pynik | 4 | 12844 | # coding: utf-8
import re
import utility
from commands import Command
def google_pages(string):
url = 'http://www.google.se/search?q=' + utility.escape(string) + '&ie=UTF-8&oe=UTF-8'
response = utility.read_url(url)
data = response["data"]
search = re.search('swrnum=(\d+)">', data)
if search:
result = searc... | 2.890625 | 3 |
was/lib/tuning/actions/ThreadPool.py | rocksun/ucmd | 2 | 12845 | import os
min=512
max=512
def app_server_tuning(server_confid):
server_name=AdminConfig.showAttribute(server_confid, "name")
threadpool_list=AdminConfig.list('ThreadPool',server_confid).split("\n")
for tp in threadpool_list:
if tp.count('WebContainer')==1:
print "Modify Server '%s' Web... | 2.671875 | 3 |
app/api/v2/resources/saleorders.py | calebrotich10/store-manager-api-v2 | 0 | 12846 | <filename>app/api/v2/resources/saleorders.py
"""This module contains objects for saleorders endpoints"""
from flask import Flask, jsonify, request, abort, make_response
from flask_restful import Resource
from flask_jwt_extended import get_jwt_identity, jwt_required
from . import common_functions
from ..models import ... | 2.8125 | 3 |
nautobot/circuits/__init__.py | psmware-ltd/nautobot | 384 | 12847 | <reponame>psmware-ltd/nautobot
default_app_config = "nautobot.circuits.apps.CircuitsConfig"
| 0.96875 | 1 |
autogalaxy/profiles/mass_profiles/stellar_mass_profiles.py | Jammy2211/PyAutoModel | 4 | 12848 | import copy
import numpy as np
from scipy.special import wofz
from scipy.integrate import quad
from typing import List, Tuple
import autoarray as aa
from autogalaxy.profiles.mass_profiles import MassProfile
from autogalaxy.profiles.mass_profiles.mass_profiles import (
MassProfileMGE,
MassProfileCSE... | 2.625 | 3 |
installer/core/terraform/resources/variable.py | Diffblue-benchmarks/pacbot | 1,165 | 12849 | from core.terraform.resources import BaseTerraformVariable
class TerraformVariable(BaseTerraformVariable):
"""
Base resource class for Terraform tfvar variable
Attributes:
variable_dict_input (dict/none): Var dict values
available_args (dict): Instance configurations
variable_type... | 2.640625 | 3 |
bfs.py | mpHarm88/Algorithms-and-Data-Structures-In-Python | 0 | 12850 | <reponame>mpHarm88/Algorithms-and-Data-Structures-In-Python
class Node(object):
def __init__(self, name):
self.name = name;
self.adjacencyList = [];
self.visited = False;
self.predecessor = None;
class BreadthFirstSearch(object):
def bfs(self, startNode):
queue = [];
queue.append(sta... | 4.09375 | 4 |
supervisor/dbus/network/connection.py | peddamat/home-assistant-supervisor-test | 1 | 12851 | """Connection object for Network Manager."""
from ipaddress import ip_address, ip_interface
from typing import Optional
from ...const import ATTR_ADDRESS, ATTR_PREFIX
from ...utils.gdbus import DBus
from ..const import (
DBUS_ATTR_ADDRESS_DATA,
DBUS_ATTR_CONNECTION,
DBUS_ATTR_GATEWAY,
DBUS_ATTR_ID,
... | 2.609375 | 3 |
quark/databricks.py | mistsys/quark | 2 | 12852 | from __future__ import print_function, absolute_import
from .beats import Beat
from StringIO import StringIO
import sys
import os
import json
import urllib
import webbrowser
try:
import pycurl
except:
print("Need pycurl dependency to use qubole as the deployment platform. Run pip install pycurl in your virtuale... | 2.21875 | 2 |
appimagebuilder/builder/deploy/apt/venv.py | mssalvatore/appimage-builder | 0 | 12853 | <filename>appimagebuilder/builder/deploy/apt/venv.py<gh_stars>0
# Copyright 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limit... | 2 | 2 |
tests/test_assertion_method.py | katakumpo/nicepy | 0 | 12854 | # -*- coding: utf-8 *-*
import logging
from unittest import TestCase
from nicepy import assert_equal_struct, multi_assert_equal_struct, pretty_repr, permuteflat
log = logging.getLogger(__name__)
class Foo(object):
def __init__(self, **kwargs):
for k, v in kwargs.iteritems():
self[k] = v
... | 2.65625 | 3 |
usaspending_api/awards/migrations/0074_auto_20170320_1607.py | toolness/usaspending-api | 1 | 12855 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-03-20 16:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0073_auto_20170320_1455'),
]
operations = [
migrations.AlterField... | 1.671875 | 2 |
COVIDSafepassage/passsystem/apps.py | VICS-CORE/safepassage_server | 0 | 12856 | from django.apps import AppConfig
class PasssystemConfig(AppConfig):
name = 'passsystem'
| 1.023438 | 1 |
src/intervals/once.py | Eagerod/tasker | 0 | 12857 | from base_interval import BaseInterval
class OnceInterval(BaseInterval):
@staticmethod
def next_interval(start_date):
return start_date
@staticmethod
def approximate_period():
return 0
| 2.421875 | 2 |
env/Lib/site-packages/azure/mgmt/storage/storagemanagement.py | Ammar12/simplebanking | 0 | 12858 | <reponame>Ammar12/simplebanking<filename>env/Lib/site-packages/azure/mgmt/storage/storagemanagement.py
#
# Copyright (c) Microsoft and contributors. 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 ... | 1.882813 | 2 |
src/nucleotide/component/linux/gcc/atom/rtl.py | dmilos/nucleotide | 1 | 12859 | <filename>src/nucleotide/component/linux/gcc/atom/rtl.py
#!/usr/bin/env python2
# Copyright 2015 <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.o... | 2.15625 | 2 |
notebooks/denerator_tests/actions/config.py | Collen-Roller/Rasa-Denerator | 11 | 12860 | <filename>notebooks/denerator_tests/actions/config.py
import os
policy_model_dir = os.environ.get("POLICY_MODEL_DIR", "models/dialogue/")
rasa_nlu_config = os.environ.get("RASA_NLU_CONFIG", "nlu_config.yml")
account_sid = os.environ.get("ACCOUNT_SID", "")
auth_token = os.environ.get("AUTH_TOKEN", "")
twilio_number... | 1.851563 | 2 |
python/moderation_text_token_demo.py | huaweicloud/huaweicloud-sdk-moderation | 8 | 12861 | <filename>python/moderation_text_token_demo.py
# -*- coding:utf-8 -*-
from moderation_sdk.gettoken import get_token
from moderation_sdk.moderation_text import moderation_text
from moderation_sdk.utils import init_global_env
if __name__ == '__main__':
# Services currently support North China-Beijing(cn-north-4),Chi... | 2.484375 | 2 |
tests/system/action/test_general.py | FinnStutzenstein/openslides-backend | 0 | 12862 | from .base import BaseActionTestCase
class GeneralActionWSGITester(BaseActionTestCase):
"""
Tests the action WSGI application in general.
"""
def test_request_wrong_method(self) -> None:
response = self.client.get("/")
self.assert_status_code(response, 405)
def test_request_wrong... | 2.3125 | 2 |
src/thead/cls/amsart.py | jakub-oprsal/thead | 0 | 12863 | from .common import *
HEADER = r'''\usepackage{tikz}
\definecolor{purple}{cmyk}{0.55,1,0,0.15}
\definecolor{darkblue}{cmyk}{1,0.58,0,0.21}
\usepackage[colorlinks,
linkcolor=black,
urlcolor=darkblue,
citecolor=purple]{hyperref}
\urlstyle{same}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{L... | 2.3125 | 2 |
Workflow/packages/__init__.py | MATS64664-2021-Group-2/Hydride-Connect-Group-2 | 0 | 12864 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 15 11:31:06 2021
@author: a77510jm
"""
| 1.007813 | 1 |
in_progress/GiRaFFEfood_NRPy/GiRaFFEfood_NRPy_Aligned_Rotator.py | fedelopezar/nrpytutorial | 1 | 12865 | #!/usr/bin/env python
# coding: utf-8
# <a id='top'></a>
#
#
# # $\texttt{GiRaFFEfood}$: Initial data for $\texttt{GiRaFFE}$
#
# ## Aligned Rotator
#
# $$\label{top}$$
#
# This module provides another initial data option for $\texttt{GiRaFFE}$. This is a flat-spacetime test with initial data $$A_{\phi} = \frac{\mu \va... | 2.6875 | 3 |
deploys/call_httpx.py | vic9527/ViClassifier | 1 | 12866 | """
比requests更强大python库,让你的爬虫效率提高一倍
https://mp.weixin.qq.com/s/jqGx-4t4ytDDnXxDkzbPqw
HTTPX 基础教程
https://zhuanlan.zhihu.com/p/103824900
"""
def interface(url, data):
import httpx
head = {"Content-Type": "application/json; charset=UTF-8"}
return httpx.request('POST', url, json=data, headers=head)
if __... | 3.8125 | 4 |
src/rgt/THOR/THOR.py | mguo123/pan_omics | 0 | 12867 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
THOR detects differential peaks in multiple ChIP-seq profiles associated
with two distinct biological conditions.
Copyright (C) 2014-2016 <NAME> (<EMAIL>)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public... | 2.09375 | 2 |
web/api/classroom.py | bbougon/crm-pilates | 0 | 12868 | from http import HTTPStatus
from typing import Tuple
from uuid import UUID
from fastapi import status, APIRouter, Response, Depends, HTTPException
from command.command_handler import Status
from domain.classroom.classroom_creation_command_handler import ClassroomCreated
from domain.classroom.classroom_type import Cla... | 2.265625 | 2 |
community_codebook/eda.py | etstieber/ledatascifi-2022 | 0 | 12869 | <reponame>etstieber/ledatascifi-2022
###############################################################
#
# This function is... INSUFFICIENT. It was developed as an
# illustration of EDA lessons in the 2021 class. It's quick and
# works well.
#
# Want a higher grade version of me? Then try pandas-profiling:
# https:... | 3.234375 | 3 |
angr/codenode.py | mariusmue/angr | 2 | 12870 | import logging
l = logging.getLogger("angr.codenode")
class CodeNode(object):
__slots__ = ['addr', 'size', '_graph', 'thumb']
def __init__(self, addr, size, graph=None, thumb=False):
self.addr = addr
self.size = size
self.thumb = thumb
self._graph = graph
def __len__(sel... | 2.9375 | 3 |
第12章/program/Requester/Launcher.py | kingname/SourceCodeOfBook | 274 | 12871 | import os
scrapy_project_path = '/Users/kingname/book/chapter_12/DeploySpider'
os.chdir(scrapy_project_path) #切换工作区,进入爬虫工程根目录执行命令
os.system('scrapyd-deploy')
import json
import time
import requests
start_url = 'http://45.76.110.210:6800/schedule.json'
start_data = {'project': 'DeploySpider',
'spider':... | 2.4375 | 2 |
unittest_example/mathfunc.py | RobinCPC/experiment_code | 0 | 12872 | """
Simple math operating functions for unit test
"""
def add(a, b):
"""
Adding to parameters and return result
:param a:
:param b:
:return:
"""
return a + b
def minus(a, b):
"""
subtraction
:param a:
:param b:
:return:
"""
return a - b
def multi(a, b):
... | 3.625 | 4 |
test/test_parameters.py | HubukiNinten/imgaug | 1 | 12873 | from __future__ import print_function, division, absolute_import
import itertools
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in 2.7 (though unittest2 might cont... | 2.515625 | 3 |
ml_snek/datasets/jsnek_dataset.py | joram/ml-snek | 0 | 12874 | """
jsnek_saved_games_dataset that returns flat (vectorized) data
"""
from .jsnek_base_dataset import JSnekBaseDataset
from .. import utils
class JSnekDataset(JSnekBaseDataset):
"""Represents a board state in the following way:
board_state: `torch.Tensor`
Board state in torch.Tensor format. Board st... | 3.015625 | 3 |
src/posts/migrations/0007_recipe_preface.py | eduardkh/matkonim2 | 0 | 12875 | <reponame>eduardkh/matkonim2
# Generated by Django 3.2.7 on 2021-09-15 15:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0006_auto_20210914_0910'),
]
operations = [
migrations.AddField(
model_name='recipe',
... | 1.640625 | 2 |
app/database/db.py | flych3r/spotify-tracker | 2 | 12876 | import os
import databases
import sqlalchemy
DB_CONNECTOR = os.getenv('APP_DB_CONNECTOR')
DB_USERNAME = os.getenv('APP_DB_USERNAME')
DB_PASSWORD = os.getenv('APP_DB_PASSWORD')
DB_HOST = os.getenv('APP_DB_HOST')
DB_PORT = os.getenv('APP_DB_PORT')
DB_DATABASE = os.getenv('APP_DB_DATABASE')
DB_URL = f'{DB_CONNECTOR}://... | 2.25 | 2 |
examples/stl10/main_info.py | hehaodele/align_uniform | 0 | 12877 | import os
import time
import argparse
import torchvision
import torch
import torch.nn as nn
from util import AverageMeter, TwoAugUnsupervisedDataset
from encoder import SmallAlexNet
from align_uniform import align_loss, uniform_loss
import json
def parse_option():
parser = argparse.ArgumentParser('STL-10 Repres... | 2.375 | 2 |
app/__init__.py | nic-mon/IAIOLab | 0 | 12878 | <gh_stars>0
from flask import Flask
""" 1. Creating a flask application instance, the name argument is passed to flask
application constructor. It's used to determine the root path"""
app = Flask(__name__)
app.config.from_object('config')
from app import views, models
| 2.75 | 3 |
ptf/tests/linerate/qos_metrics.py | dariusgrassi/upf-epc | 0 | 12879 | # SPDX-License-Identifier: Apache-2.0
# Copyright(c) 2021 Open Networking Foundation
import time
from ipaddress import IPv4Address
from pprint import pprint
from trex_test import TrexTest
from grpc_test import *
from trex_stl_lib.api import (
STLVM,
STLPktBuilder,
STLStream,
STLTXCont,
)
import ptf.t... | 2.046875 | 2 |
archives_app/documents_serializers.py | DITGO/2021.1-PC-GO1-Archives | 1 | 12880 | <reponame>DITGO/2021.1-PC-GO1-Archives
from rest_framework import serializers
from archives_app.documents_models import (FrequencyRelation, BoxArchiving,
AdministrativeProcess, OriginBox,
FrequencySheet, DocumentTypes)
class Frequen... | 2.015625 | 2 |
src/fparser/common/tests/test_base_classes.py | sturmianseq/fparser | 33 | 12881 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (c) 2017 Science and Technology Facilities Council
#
# All rights reserved.
#
# Modifications made as part of the fparser project are distributed
# under the following license:
#
# Redistribution and use i... | 1.109375 | 1 |
pyvecorg/__main__.py | torsava/pyvec.org | 3 | 12882 | <filename>pyvecorg/__main__.py
from elsa import cli
from pyvecorg import app
cli(app, base_url='http://pyvec.org')
| 1.289063 | 1 |
ppython/input_handler.py | paberr/ppython | 1 | 12883 | import curtsies.events as ev
import sys
DELIMITERS = ' .'
WHITESPACE = ' '
def print_console(txt, npadding=0, newline=False, flush=True):
"""
Prints txt without newline, cursor positioned at the end.
:param txt: The text to print
:param length: The txt will be padded with spaces to fit this length
... | 3.515625 | 4 |
pycon_graphql/events/tests/test_models.py | CarlosMart626/graphql-workshop-pycon.co2019 | 1 | 12884 | <filename>pycon_graphql/events/tests/test_models.py
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.test import TestCase
from events.models import Event, Invitee
from users.tests.factories import UserFactory
from users.models import get_sentinel_user
class EventModelTe... | 2.171875 | 2 |
cryptos.py | pogoetic/tricero | 0 | 12885 | <filename>cryptos.py
cryptolist = ['ETH','BTC','XRP','EOS','ADA','NEO','STEEM',
'BTS','ZEC','XMR','XVG','XEM','OMG','MIOTA','XTZ','SC',
'CVC','BAT','XLM','ZRX','VEN'] | 1.914063 | 2 |
python/test/utils/test_sliced_data_iterator.py | kodavatimahendra/nnabla | 0 | 12886 | <filename>python/test/utils/test_sliced_data_iterator.py
# Copyright (c) 2017 Sony Corporation. 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.... | 2.390625 | 2 |
python/leetcode/646.py | ParkinWu/leetcode | 0 | 12887 | # 给出 n 个数对。 在每一个数对中,第一个数字总是比第二个数字小。
#
# 现在,我们定义一种跟随关系,当且仅当 b < c 时,数对(c, d) 才可以跟在 (a, b) 后面。我们用这种形式来构造一个数对链。
#
# 给定一个对数集合,找出能够形成的最长数对链的长度。你不需要用到所有的数对,你可以以任何顺序选择其中的一些数对来构造。
#
# 示例 :
#
# 输入: [[1,2], [2,3], [3,4]]
# 输出: 2
# 解释: 最长的数对链是 [1,2] -> [3,4]
# 注意:
#
# 给出数对的个数在 [1, 1000] 范围内。
#
# 来源:力扣(LeetCode)
# 链接:https://leetc... | 3.6875 | 4 |
FactorTestMain.py | WeiYouyi/FactorTest | 0 | 12888 | from FactorTest.FactorTestPara import *
from FactorTest.FactorTestBox import *
class FactorTest():
def __init__(self):
self.startdate=20000101
self.enddate=21000101
self.factorlist=[]
self.FactorDataBase={'v':pd.DataFrame(columns=['time','code'])}
self.filterStock... | 2.515625 | 3 |
src/qm/terachem/terachem.py | hkimaf/unixmd | 0 | 12889 | <reponame>hkimaf/unixmd
from __future__ import division
from qm.qm_calculator import QM_calculator
from misc import call_name
import os
class TeraChem(QM_calculator):
""" Class for common parts of TeraChem
:param string basis_set: Basis set information
:param string functional: Exchange-correlatio... | 2.296875 | 2 |
tests/unit/modules/test_reg_win.py | l2ol33rt/salt | 0 | 12890 | # -*- coding: utf-8 -*-
'''
:synopsis: Unit Tests for Windows Registry Module 'module.reg'
:platform: Windows
:maturity: develop
:codeauthor: <NAME> <https://github.com/damon-atkins>
versionadded:: 2016.11.0
'''
# Import Python future libs
from __future__ import absolute_import
from __future__ impor... | 2.234375 | 2 |
glacier/glacierexception.py | JeffAlyanak/amazon-glacier-cmd-interface | 166 | 12891 | import traceback
import re
import sys
import logging
"""
**********
Note by wvmarle:
This file contains the complete code from chained_exception.py plus the
error handling code from GlacierWrapper.py, allowing it to be used in other
modules like glaciercorecalls as well.
**********
"""
class GlacierException(Except... | 2.234375 | 2 |
modes/import_corpus.py | freingruber/JavaScript-Raider | 91 | 12892 | <reponame>freingruber/JavaScript-Raider<filename>modes/import_corpus.py<gh_stars>10-100
# Copyright 2022 @ReneFreingruber
#
# 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
#
# https://www.apach... | 1.992188 | 2 |
crazyflie_demo/scripts/mapping/mapper.py | wydmynd/crazyflie_tom | 0 | 12893 | <filename>crazyflie_demo/scripts/mapping/mapper.py
#!/usr/bin/env python
""" Simple occupancy-grid-based mapping without localization.
Subscribed topics:
/scan
Published topics:
/map
/map_metadata
Author: <NAME>
Version: 2/13/14
"""
import rospy
from nav_msgs.msg import OccupancyGrid, MapMetaData
from geometry_ms... | 2.8125 | 3 |
flags.py | oaxiom/glbase3 | 8 | 12894 | """
flags.py
. should be renamed helpers...
. This file is scheduled for deletion
"""
"""
valid accessory tags:
"any_tag": {"code": "code_insert_as_string"} # execute arbitrary code to construct this key.
"dialect": csv.excel_tab # dialect of the file, default = csv, set this to use tsv. or sniffer
"skip_lines": num... | 2.03125 | 2 |
packages/jet_bridge/jet_bridge/app.py | goncalomi/jet-bridge | 2 | 12895 | <gh_stars>1-10
import os
import tornado.ioloop
import tornado.web
from jet_bridge.handlers.temporary_redirect import TemporaryRedirectHandler
from jet_bridge_base import settings as base_settings
from jet_bridge_base.views.api import ApiView
from jet_bridge_base.views.image_resize import ImageResizeView
from jet_brid... | 1.960938 | 2 |
openslides_backend/services/media/adapter.py | FinnStutzenstein/openslides-backend | 0 | 12896 | <reponame>FinnStutzenstein/openslides-backend
import requests
from ...shared.exceptions import MediaServiceException
from ...shared.interfaces.logging import LoggingModule
from .interface import MediaService
class MediaServiceAdapter(MediaService):
"""
Adapter to connect to media service.
"""
def __... | 2.515625 | 3 |
Lib/async/test/test_echoupper.py | pyparallel/pyparallel | 652 | 12897 | <reponame>pyparallel/pyparallel
import async
from async.services import EchoUpperData
server = async.server('10.211.55.3', 20007)
async.register(transport=server, protocol=EchoUpperData)
async.run()
| 1.804688 | 2 |
alerter/src/alerter/alert_code/node/evm_alert_code.py | SimplyVC/panic | 41 | 12898 | from ..alert_code import AlertCode
class EVMNodeAlertCode(AlertCode):
NoChangeInBlockHeight = 'evm_node_alert_1'
BlockHeightUpdatedAlert = 'evm_node_alert_2'
BlockHeightDifferenceIncreasedAboveThresholdAlert = 'evm_node_alert_3'
BlockHeightDifferenceDecreasedBelowThresholdAlert = 'evm_node_alert_4'
... | 1.648438 | 2 |
blaze/compute/tests/test_pmap.py | jdmcbr/blaze | 1 | 12899 | from blaze import compute, resource, symbol, discover
from blaze.utils import example
flag = [False]
def mymap(func, *args):
flag[0] = True
return map(func, *args)
def test_map_called_on_resource_star():
r = resource(example('accounts_*.csv'))
s = symbol('s', discover(r))
flag[0] = False
a ... | 2.390625 | 2 |