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/onegov/town6/views/files.py | politbuero-kampagnen/onegov-cloud | 0 | 43500 | <reponame>politbuero-kampagnen/onegov-cloud
from onegov.core.security import Private, Public
from onegov.file import File
from onegov.org.views.files import view_file_details, \
view_get_image_collection, view_upload_general_file, \
view_upload_image_file, view_file_digest, handle_sign,\
view_get_file_colle... | 2 | 2 |
sktracker/ui/mpl/matplotlib_widget.py | bnoi/scikit-tracker | 6 | 43501 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
class MatplotlibWidget(FigureC... | 2.09375 | 2 |
tests/test_ilqr.py | lassepe/pyILQR | 6 | 43502 | <reponame>lassepe/pyILQR<filename>tests/test_ilqr.py
import numpy as np
from pyilqr.costs import QuadraticCost
from pyilqr.example_costs import SetpointTrackingCost
from pyilqr.example_dynamics import UnicycleDynamics, BicycleDynamics
from pyilqr.ocp import OptimalControlProblem
from pyilqr.ilqr import ILQRSolver
from... | 2.21875 | 2 |
xue/cms/middleware/dummylang.py | team-xue/xue | 1 | 43503 | # -*- coding: utf-8 -*-
from cms.utils.i18n import get_default_language
from django.conf import settings
from django.core.urlresolvers import reverse
from django.middleware.locale import LocaleMiddleware
from django.utils import translation
import re
import urllib
class DummyMultilingualURLMiddleware(object):... | 1.914063 | 2 |
rlpyt/agents/classic/pi_agent.py | wingbender/rlpyt | 0 | 43504 | <filename>rlpyt/agents/classic/pi_agent.py
import numpy as np
import torch
from collections import namedtuple
from torch.nn.parallel import DistributedDataParallel as DDP
# from torch.nn.parallel import DistributedDataParallelCPU as DDPC # Deprecated
from rlpyt.agents.base import BaseAgent, AgentStep
from rlpyt.model... | 2.1875 | 2 |
backend_final/apartacho/publications/models.py | cenavia/skylynx | 3 | 43505 | """Publication model."""
# Django
from django.db import models
# Utilities
from apartacho.utils.models import ApartachoModel
from apartacho.properties.models import Property
from apartacho.users.models import User
class Publication(ApartachoModel):
"""Publication model."""
is_published = models.BooleanFiel... | 2.484375 | 2 |
src/web/modules/entrance/migrations/0036_auto_20170426_1205.py | fossabot/SIStema | 5 | 43506 | <reponame>fossabot/SIStema
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-26 07:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modules.entrance.models.checking
class Migration(migrations.Migration):
dependencies = [
... | 1.5625 | 2 |
examples/paint-nd.py | MaksHess/napari | 1,345 | 43507 | <gh_stars>1000+
"""
Display a 4D labels layer and paint only in 3D.
This is useful e.g. when proofreading segmentations within a time series.
"""
import numpy as np
from skimage import data
import napari
blobs = np.stack(
[
data.binary_blobs(
length=128, blob_size_fraction=0.05, n_dim=3, vol... | 2.5625 | 3 |
Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/extern/dexml/__init__.py | ekkipermana/robotframework-test | 11 | 43508 | <reponame>ekkipermana/robotframework-test
"""
dexml: a dead-simple Object-XML mapper for Python
Let's face it: xml is a fact of modern life. I'd even go so far as to say
that it's *good* at what is does. But that doesn't mean it's easy to work
with and it doesn't mean that we have to like it. Most of the time, ... | 2.71875 | 3 |
backend/flask/app/api/database/models/RandomSubscriberChallenge.py | tvdhout/twitchess | 1 | 43509 | from sqlalchemy import Column, String
from app.api.database.models import Base
def make_subscriber_table(name: str) -> type:
"""
Return a new SQLAlchemy Table object representing the lichess - twitch pairs for a certain user.
"""
class Pair(Base):
__tablename__ = name
__table_args__ = ... | 2.953125 | 3 |
nightowlcli/__main__.py | shawnoster/nightowlcli | 0 | 43510 | <reponame>shawnoster/nightowlcli<gh_stars>0
import argparse
from .funky import get_funky
def main():
parser = argparse.ArgumentParser(description='Night Owl CLI')
args = parser.parse_args()
get_funky('white guy at a wedding')
if __name__ == '__main__':
main()
| 2.1875 | 2 |
ProgramacaoFuncional/desafio_mdc.py | VictorMello1993/CursoPythonUdemy | 0 | 43511 | #Desafio MDC
def mdc(numeros):
pass
if __name__ == '__main__':
print(mdc([21, 7])) #7
print(mdc([125, 40])) #5
print(mdc([9, 564, 66, 3])) #3
print(mdc([55, 22])) #11
print(mdc([15, 150])) #15
print(mdc([7, 9])) #1 | 2.421875 | 2 |
rolling/server/zone/websocket.py | coolkat64/rolling | 0 | 43512 | # coding: utf-8
import asyncio
from concurrent.futures._base import CancelledError
import json
import typing
import aiohttp
from aiohttp import web
from aiohttp.web_request import Request
from rolling.exception import DisconnectClient
from rolling.exception import UnableToProcessEvent
from rolling.exception import Un... | 2.15625 | 2 |
tests/grammpy_test/terminal_tests/TerminalHaveTest.py | PatrikValkovic/grammpy | 1 | 43513 | <gh_stars>1-10
#!/usr/bin/env python
"""
:Author <NAME>
:Created 10.03.2019 22:00
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import Grammar
class TempClass:
pass
class TerminalHaveTest(TestCase):
def test_haveTermEmpty(self):
gr = Grammar()
self.assert... | 2.546875 | 3 |
deepconcolic/recviz.py | nberth/DeepConcolic | 102 | 43514 | <gh_stars>100-1000
#!/usr/bin/env python3
from utils_io import *
from utils_args import *
import yaml
def check_record (r):
def chk (k, t):
if k not in r or not isinstance (r[k], t):
raise ValueError (f'missing or wrong `{k}\' entry in record')
chk ('adversarials', list)
chk ('passed_tests', list)
c... | 2.5625 | 3 |
Backend/src/energytransfers/migrations/0002_auto_20200514_1708.py | Valle1806/EnergyCorp | 1 | 43515 | <filename>Backend/src/energytransfers/migrations/0002_auto_20200514_1708.py
# Generated by Django 3.0.3 on 2020-05-14 17:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('energytransfers', '0001_initial'),
]
operations = [
migrations.RenameFie... | 1.359375 | 1 |
pydm/widgets/multi_axis_viewbox.py | jbellister-slac/pydm | 0 | 43516 | <reponame>jbellister-slac/pydm
from pyqtgraph import GraphicsWidget, ViewBox
from qtpy.QtCore import Qt, Signal
class MultiAxisViewBox(ViewBox):
"""
MultiAxisViewBox is a PyQtGraph ViewBox subclass that has support for adding multiple y axes for
PyDM's use cases. Each unique axis will be assigned its own ... | 2.78125 | 3 |
Coursera_HW/Week_1/task_4.py | IsFelix/ML-HLS_python_course_fall21 | 0 | 43517 | N = int(input())
K = int(input())
print(K % N)
| 2.96875 | 3 |
examples/numerical/unsupervised_num.py | stjordanis/QMLT | 117 | 43518 | <reponame>stjordanis/QMLT
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Xanadu Quantum Technologies 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.apa... | 2.046875 | 2 |
backend/unpp_api/apps/partner/migrations/0017_auto_20170920_0639.py | unicef/un-partner-portal | 6 | 43519 | <filename>backend/unpp_api/apps/partner/migrations/0017_auto_20170920_0639.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-20 06:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partner', '001... | 1.40625 | 1 |
tests/test_key_store.py | brickgao/cos-python-sdk | 0 | 43520 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from contentos_sdk.key_store import KeyStore
def test_key_store():
key_store = KeyStore()
key_store.add_key("account1", "key1")
key_store.add_key("account2", "key2")
assert key_store.get_key("account1") == "key1"
assert key_store.get_accounts() == ["... | 2.421875 | 2 |
puft/constants/hints.py | ryzhovalex/omen | 0 | 43521 | from .enums import (
CLIDatabaseEnum, CLIRunEnum, CLIHelperEnum, HTTPMethodEnum, TurboActionEnum
)
CLIModeEnumUnion = CLIDatabaseEnum | CLIRunEnum | CLIHelperEnum
| 1.015625 | 1 |
backend/proxy/api.py | LukasPietzschmann/FitnessApp | 0 | 43522 | '''
Authors: <NAME>, <NAME>, <NAME>
'''
# FIXME Behebe möglichen fehler mit Flask:
# https://github.com/flask-restful/flask-restful/pull/913
# import flask.scaffold
# flask.helpers._endpoint_from_view_func = flask.scaffold._endpoint_from_view_funcfrom flask import Flask, request, make_response
from flask import Flask,... | 2.625 | 3 |
ambientlight/__main__.py | ArnauP/responsive-ambientlight | 0 | 43523 | <gh_stars>0
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QIcon, QFont
from .controllers.simulation_controller import SimulationController
from .controllers.main_controller import MainController
from .utils import utils
def main():
app = QApplication([])
app.setWindowIcon(QIcon(utils.get_... | 1.984375 | 2 |
autobot/config_loader.py | fotini-pan/autobot | 0 | 43524 | <reponame>fotini-pan/autobot<gh_stars>0
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Performs project's configuration loading."... | 2 | 2 |
jupyter_notebooks/3_Controls/2_IntroductionToVehicleControl/plotting.py | miker2/FCND-udacity | 1 | 43525 | from matplotlib import pyplot as plt
def compare_planned_to_actual(z_actual, z_path, t, additional=None):
plt.subplot(211)
plt.plot(t,z_path,linestyle='-',marker='.',color='red')
plt.plot(t,z_actual,linestyle='-',color='blue')
if additional:
plt.plot(t, additional, linestyle="-", color="black")... | 2.65625 | 3 |
torchrs/datasets/whu_rs19.py | isaaccorley/torchrs | 146 | 43526 | import torchvision.transforms as T
from torchvision.datasets import ImageFolder
class WHURS19(ImageFolder):
""" WHU-RS19 dataset from'Structural High-resolution Satellite Image Indexing', Xia at al. (2010)
https://hal.archives-ouvertes.fr/file/index/docid/458685/filename/structural_satellite_indexing_XYDG.pdf... | 2.328125 | 2 |
dev/example/eg_plotly_set_init_range.py | StefanHeng/test_ECG-Signal-Viewer | 0 | 43527 | import numpy as np
import pandas as pd
import plotly.graph_objs as go
# import plotly.plotly as py
dates = pd.date_range('01-Jan-2010', pd.datetime.now().date(), freq='D')
df = pd.DataFrame(100 + np.random.randn(dates.size).cumsum(), dates, columns=['AAPL'])
trace = go.Scatter(x=df.index, y=df.AAPL)
data = [trace]
l... | 2.625 | 3 |
example/servers/example.py | remy/next-http | 14 | 43528 | # Python 3 server example
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import os.path
import socket
import base64
hostName = socket.gethostbyname(socket.gethostname())
serverPort = 8080
reply = b"\x12\01Hi there - from the Python server!\x12\x00\x80"
def recover(a):
# hexdump via https:... | 3.21875 | 3 |
tests/conftest.py | ranhorev/pysmartthings | 0 | 43529 | <gh_stars>0
"""Define test configuration."""
import glob
import re
import pytest
from pysmartthings.api import (
API_APP,
API_APP_OAUTH,
API_APP_OAUTH_GENERATE,
API_APP_SETTINGS,
API_APPS,
API_BASE,
API_DEVICE,
API_DEVICE_COMMAND,
API_DEVICE_HEALTH,
API_DEVICE_S... | 1.867188 | 2 |
src/preprocessing.py | fpaskali/trus-segmentation | 3 | 43530 | <filename>src/preprocessing.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 23 15:42:17 2019
@author: paskali
"""
import os, nrrd, json, argparse
import numpy as np
from scipy import ndimage
class ImageProcessor(object):
def __init__(self, input_folder='data/raw_train',... | 2.671875 | 3 |
src/turtlebot_apps-indigo/turtlebot_actions/scripts/test_fiducial.py | mowtian/Projektarbeit | 59 | 43531 | <gh_stars>10-100
#!/usr/bin/env python
import roslib
roslib.load_manifest('turtlebot_actions')
import rospy
import os
import sys
import time
from turtlebot_actions.msg import *
from actionlib_msgs.msg import *
import actionlib
def main():
rospy.init_node("find_fiducial_pose_test")
# Construct action ac
ro... | 2.375 | 2 |
cube/providers/fluxcom.py | CAB-LAB/cube-config | 4 | 43532 | <gh_stars>1-10
import os
from datetime import timedelta
import numpy
from esdl.cube_provider import NetCDFCubeSourceProvider
from dateutil.relativedelta import relativedelta
from netCDF4 import num2date
all_vars_descr = {'GPPall': {
'gross_primary_productivity': {
'source_name': 'GPPall',
'data_ty... | 1.664063 | 2 |
dicomtrolley/core.py | michelkok/dicomtrolley | 0 | 43533 | <reponame>michelkok/dicomtrolley
"""Provides common base classes that allow different modules to talk to each other."""
from itertools import chain
from typing import Sequence
from pydantic.main import BaseModel
from pydicom.dataset import Dataset
from dicomtrolley.exceptions import DICOMTrolleyException
class DICO... | 2.84375 | 3 |
examples/tutorial/lcu_events.py | TheodorStraube/lcu-driver | 57 | 43534 | from lcu_driver import Connector
connector = Connector()
@connector.ready
async def connect(connection):
print('LCU API is ready to be used.')
@connector.close
async def disconnect(connection):
print('Finished task')
connector.start()
| 2.09375 | 2 |
data/english_tweets/preprocess_tweets.py | dinarosv/fasttext-model | 0 | 43535 | <filename>data/english_tweets/preprocess_tweets.py
import csv
import re
import string
def remove_chars(text):
# remove links
pattern = re.compile(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+')
text = pattern.sub('', text)
# remove tags
text = re.sub(r'\w*@\w*', '... | 3.296875 | 3 |
src/awsCluster/chipSeq/ChipPipelineManager.py | AspirinCode/jupyter-genomics | 2 | 43536 | __author__ = '<NAME><<EMAIL>>'
import os
import YamlFileMaker
from util import DesignFileLoader
from cfnCluster import ConnectionManager
workspace = "/shared/workspace/ChiPSeqPipeline"
data_dir = "/shared/workspace/data_archive/ChiPSeq"
## run all analysis from download, alignment, counting and differential calcula... | 2.1875 | 2 |
tests/common_fixtures.py | KRunchPL/script_args_parser | 0 | 43537 | <filename>tests/common_fixtures.py
"""
Provides fixtures common for different test modules.
"""
import os
from collections.abc import Generator
import pytest
from script_args_parser.arguments import Argument
@pytest.fixture
def arguments_definition_with_env(arguments_definition: list[Argument], env_var_name: str) -... | 2.796875 | 3 |
supermamas/areas/service.py | oasalonen/supermamas | 0 | 43538 | from flask_babel import gettext
from dateutil import rrule, parser
from datetime import datetime, date, timedelta
from supermamas.areas.districts import District
from supermamas.areas.cities import City
class Service:
__instance = None
def __new__(cls, district_repository=None, city_repository=None):
... | 2.578125 | 3 |
gwlfe/MultiUse_Fxns/Erosion/ErosSum.py | mudkipmaster/gwlf-e | 0 | 43539 | <gh_stars>0
from numpy import sum
from numpy import zeros
from gwlfe.Memoization import memoize
from gwlfe.MultiUse_Fxns.Erosion.Erosion_1 import Erosion_1
from gwlfe.MultiUse_Fxns.Erosion.Erosion_1 import Erosion_1_f
@memoize
def ErosSum(NYrs, DaysMonth, Temp, InitSnow_0, Prec, NRur, NUrb, Area, CNI_0,
... | 1.84375 | 2 |
data-science/exercicios/livro-introducao-a-programacao-com-python/capitulo-2/exercicio2-6.py | joaovictor-loureiro/data-science | 0 | 43540 | # Exercício 2.6 - Modifique o programa da listagem 2.11, de forma que ele calcule um
# aumento de 15% para um salário de R$ 750
salario = 750.00
taxa_aumento = 0.15
aumento = salario * taxa_aumento
novo_salario = salario + aumento
print('\nSálario de R$750.00 + aumento de 15' + '% = ' + 'R$%.2f\n' % (novo_salario)) | 2.921875 | 3 |
licensed/Docker-x86_64/build_scripts/set_sparknlp_env.py | DevinTDHa/spark-nlp-starter-scripts | 1 | 43541 | <gh_stars>1-10
import json
import os
import re
import os.path
sparknlp_versions = {"PUBLIC_VERSION": "3.1.0"}
WORKDIR = "/build_scripts"
with open(WORKDIR + "/spark_nlp_for_healthcare.json", "r") as f:
sparknlp_versions.update(json.load(f).items())
with open(WORKDIR + "/spark_ocr.json", "r") as f:
ocr_versi... | 2.234375 | 2 |
application/flask_math/calculation/Expand.py | kouki-0926/Flask-Math | 0 | 43542 | <reponame>kouki-0926/Flask-Math<filename>application/flask_math/calculation/Expand.py
from sympy import expand
from flask import flash
from flask_math.calculation.common.STR import LATEX
def Expand(formula):
try:
A = expand(formula)
anser = LATEX(formula)+"="+LATEX(A)
except:
anser = "... | 2.59375 | 3 |
redispypractice/test_string.py | youaresherlock/flaskRedisNewsApp | 0 | 43543 | # -*- coding: utf-8 -*-
# @Author: Clarence
# @Date: 2018-08-11 17:24:59
# @Last Modified by: Clarence
# @Last Modified time: 2018-08-12 01:16:19
import redis
class TestString(object):
"""
set --设置值
get --获取值
mset --设置多个键值对
mget --获取多个键值对
append --添加字符串
del --删除
incr/decr --增加/减少1
"""
def __init__(self)... | 2.84375 | 3 |
ML-based Predictive Models/Intention/ML_BinaryClass-Intention.py | erfpak7/DeepTake | 4 | 43544 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 15 21:56:08 2020
@author: <NAME>
"""
# STEP1----------------- # Importing the libraries------------
#-------------------------------------------------------------
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import glob
... | 2.5625 | 3 |
core-python-functions-and-functional-programming/closures/__init__.py | hassonor/core-python | 1 | 43545 | """
def
-> Used to define new functions
-> Binds a function object to a name
-> Executed at runtime
"""
| 1.710938 | 2 |
slackforms/conf.py | Albatrous/django-slack-forms | 1 | 43546 | """
Use this file to configure pluggable app settings and resolve defaults
with any overrides set in project settings.
"""
from django.conf import settings as project_settings
class Settings:
pass
Settings.SECRET_KEY = getattr(
project_settings, "SLACKFORMS_SECRET_KEY", "a-bad-secret-key"
)
Settings.SLACK... | 1.625 | 2 |
books/models.py | TareqMonwer/reading-track | 1 | 43547 | <filename>books/models.py
import datetime
from django.db import models
from django.utils import timezone
class Book(models.Model):
STATUS_CHOICES = (
('C', 'Completed'),
('R', 'Reading'),
('W', 'WhishList'),
)
PRIORITY_CHOICES = (
('h', 'high'),
('m', 'mid'),
... | 2.5 | 2 |
mbrl/algorithms/model_train.py | cvoelcker/mbrl-lib | 0 | 43548 | # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# @author: <NAME>
import os
from typing import Dict, Optional, Tuple, cast
import gym
import hydra.utils
from mbrl.env.offline_data import load_dataset_and_env
import numpy as np
import omegacon... | 1.828125 | 2 |
Software/jetson_racer/scripts/joint_state.py | mounteverset/jetracer_ros | 0 | 43549 | #!/usr/bin/env python3
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header, Float32
from geometry_msgs.msg import Twist, TwistStamped
from nav_msgs.msg import Odometry
import math
rear_vel = 0
front_rot = 0
def callback_cmd(cmd):
global front_rot
global rear_vel
rear_ve... | 2.34375 | 2 |
lap_tracker/__init__.py | glyg/lap_tracker | 6 | 43550 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
__version__ = "0.1"
from .lap_tracking import LAPTracker
from .tester import *
import os
import logging
from .utils.color_system import color
... | 1.992188 | 2 |
dashboard/views/containers.py | alefeans/docker_dashboard | 3 | 43551 | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from dashboard.helpers import (list_container,
start_container,
stop_container,
... | 1.976563 | 2 |
File_Path_Operations/test_file_path.py | JoeyDeRosa/code_katas | 0 | 43552 | '''Test file for file_path_operations.py.'''
master = FileMaster('/Users/person1/Pictures/house.png')
test.describe('Description Test Cases')
test.assert_equals(master.extension(), 'png')
test.assert_equals(master.filename(), 'house')
test.assert_equals(master.dirpath(), '/Users/person1/Pictures/') | 2.3125 | 2 |
src/error_handlers/error_reference.py | ryanermita/snaaap-tech-exam | 0 | 43553 | <gh_stars>0
from src.constants.misc import GenericConstants, UserConstants
class GenericError:
@staticmethod
def NOT_FOUND(resource):
return {
'error': f"Resource not found: {resource}"
}
@staticmethod
def INVALID_STRING_LENGTH(data):
return {
'error':... | 2.78125 | 3 |
easy/array/remove_element.py | vladimirf7/leetcode | 0 | 43554 | <gh_stars>0
'''solved, super easy'''
class Solution:
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
i = 0
while i < len(nums):
if nums[i] == val:
del nums[i]
else:
... | 3.46875 | 3 |
test/request/test_module.py | power-guard/solargis-py | 0 | 43555 | import unittest
from solargis.request import Module, ModuleType
class TestModule(unittest.TestCase):
def test_module_element(self):
module = Module(ModuleType.CSI, 0, 0.8, 45, -0.38)
expected = (
'<pv:module type="CSI">'
'<pv:degradation>0</pv:degradation>'
'... | 2.6875 | 3 |
rawdata/dbpedia.org/utils.py | jrnold/acw_battle_data | 15 | 43556 | <reponame>jrnold/acw_battle_data<filename>rawdata/dbpedia.org/utils.py
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 29 20:24:18 2014
@author: jrnold
"""
import json
from os import path
import time
import requests
import rdflib
from SPARQLWrapper import SPARQLWrapper, JSON
def dbpedia_describe(resource, fmt = 'ntri... | 2.359375 | 2 |
mobilenet_v2.py | trex18/cv-models | 0 | 43557 | import torch
import torch.nn as nn
import torchvision
import os
from train import train
from transform import get_transform
# each layer consists of [expansion_ratio, output_channels, repeat_number, stride_of_first_sublayer]
bottleneck_layers_config = [
[1, 16, 1, 1],
[6, 24, 2, 2],
[6, 32, 3, 2... | 2.515625 | 3 |
raposa/langs/gl/stemmer.py | p3sky/PRUEBA1 | 3 | 43558 | from ...core.stemming.rule import Rule
class GLSimpleStemmer():
# Simple Stemmer for Galician
# adapted from:
# http://bvg.udc.es/recursos_lingua/stemming.jsp
# this implementation uses Rules, though
# but the algorithm and rules are the same
def __init__(self):
self.suffixes = []
... | 2.953125 | 3 |
FazCO2Monitor/main/views.py | fazerog02/FazCO2Monitor | 0 | 43559 | from django.shortcuts import render
from api.models import NowPPM
from api.models import PPMData
import datetime
import matplotlib
from matplotlib import pyplot
# Create your views here.
def home(request):
nowppm = NowPPM.objects.get(id=1)
return render(request, 'home.html', {'nowppm': nowppm, })
| 1.867188 | 2 |
ecoregions/functions.py | skybristol/wdbots | 1 | 43560 | <reponame>skybristol/wdbots
import shutil
import urllib.request as request
from contextlib import closing
import zipfile
import os
from pathlib import Path
import copy
import geopandas as gpd
import sys
import pickle
from wikidataintegrator import wdi_helpers, wdi_core
wd_endpoint_url = "https://query.wikidata.org/spa... | 2.546875 | 3 |
captcha_train_radam.py | EpicTrol/SCNU-AiMatch | 1 | 43561 | # -*- coding: UTF-8 -*-
import torch
import torch.nn as nn
from torch.autograd import Variable
import my_dataset
from captcha_VGG16 import *
from captcha_resnet import ResNet18
from captcha_optimizer import RAdam, GradualWarmupScheduler
from captcha_resnet34 import ResNet34
# 断点续训标识
RESUME = True
checkpoint_path = r'.... | 2.484375 | 2 |
timm/loss/ddag_loss.py | KID-7391/CBA-MR | 1 | 43562 | <reponame>KID-7391/CBA-MR
import torch
import torch.nn as nn
import torch.nn.functional as F
from abc import abstractmethod
from .base_loss import BaseLoss
__all__ = ['CR_DDAG', 'PR_DDAG']
class DDAG(BaseLoss):
def __init__(self, num_classes):
super(DDAG, self).__init__(num_classes)
node = [Non... | 2.484375 | 2 |
xerosdk/apis/contacts.py | akshay-codemonk/xero-sdk-py | 0 | 43563 | """
Xero Contacts API
"""
from .api_base import ApiBase
class Contacts(ApiBase):
"""
Class for Contacts API
"""
GET_CONTACTS = "/api.xro/2.0/contacts"
def get_all(self):
"""
Get all contacts
Returns:
List of all contacts
"""
return self._get... | 2.53125 | 3 |
tempest/tests/lib/services/identity/v3/test_protocols_client.py | cityofships/tempest | 254 | 43564 | <filename>tempest/tests/lib/services/identity/v3/test_protocols_client.py<gh_stars>100-1000
# Copyright 2020 Samsung Electronics Co., Ltd
# 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... | 1.882813 | 2 |
LintCode/chapter 43/603. Largest Divisible Subset/.ipynb_checkpoints/solution-checkpoint.py | vincent507cpu/Comprehensive-Algorithm-Solution | 4 | 43565 | <reponame>vincent507cpu/Comprehensive-Algorithm-Solution<filename>LintCode/chapter 43/603. Largest Divisible Subset/.ipynb_checkpoints/solution-checkpoint.py
class Solution:
# @param {int[]} nums a set of distinct positive integers
# @return {int[]} the largest subset
def largestDivisibleSubset(self, nums)... | 3.5625 | 4 |
src/main/resources/project/wsadmin_scripts/create_jdbc_provider.py | electric-cloud/EC-WebSphere | 0 | 43566 | <filename>src/main/resources/project/wsadmin_scripts/create_jdbc_provider.py
#
# Copyright 2016 Electric Cloud, 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.ap... | 2.078125 | 2 |
web/controllers/food/Food.py | yao6891/FlaskOrdering | 1 | 43567 | # -*- coding: utf-8 -*-
from flask import Blueprint,request,jsonify,redirect
from common.libs.Helper import ops_render,get_current_date,i_pagination,get_dict_filter_field
from application import app,db
from common.models.food.Food import Food
from common.models.food.FoodCat import FoodCat
from common.models.food.FoodS... | 2.046875 | 2 |
pymc3/distributions/timeseries.py | vpolisky/pymc3 | 15 | 43568 | import theano.tensor as tt
from theano import scan
from . import multivariate
from . import continuous
from . import distribution
__all__ = [
'AR1',
'GaussianRandomWalk',
'GARCH11',
'EulerMaruyama',
'MvGaussianRandomWalk',
'MvStudentTRandomWalk'
]
class AR1(distribution.Continuous):
"""
... | 2.5625 | 3 |
breadboard/controller.py | mvshmakov/raspberry-boilerplate | 0 | 43569 | <gh_stars>0
#!/usr/bin/python3
from time import sleep
from gpiozero import Button, MotionSensor, LED, LightSensor, DistanceSensor, Servo, MCP3008
class BreadboardController:
"""
Possible GPIO Zero components:
- Button
- DistanceSensor
- LED
- LightSensor
- MotionSe... | 3.40625 | 3 |
google/cloud/monitoring_v3/types/dropped_labels.py | vinbs/python-monitoring | 0 | 43570 | <filename>google/cloud/monitoring_v3/types/dropped_labels.py
# -*- coding: utf-8 -*-
# Copyright 2020 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... | 1.726563 | 2 |
tests/emmet-core/test_thermo.py | acrutt/emmet | 19 | 43571 | import pytest
from monty.serialization import MontyDecoder
from monty.serialization import loadfn
from emmet.core.thermo import ThermoDoc
@pytest.fixture(scope="session")
def Fe3O4_structure(test_dir):
structure = loadfn(test_dir / "thermo/Fe3O4_structure.json")
return structure
@pytest.fixture(scope="sessi... | 1.890625 | 2 |
information_retrieval/question_processing/question_classification.py | Akash-Pateria/Question-Answering-Bot | 0 | 43572 | <filename>information_retrieval/question_processing/question_classification.py
from sklearn.feature_extraction.text import CountVectorizer
from scipy.sparse import hstack
from sklearn.svm import LinearSVC
from practnlptools.tools import Annotator
import cPickle
from fine_class_fullname import read_class
annotator=Ann... | 2.65625 | 3 |
monkey/io.py | ShawnFrueh/mecco_renderMonkey | 0 | 43573 | # python
import json
import os
import random
import re
import traceback
import modo
from . import util
import yaml
from .defaults import get
from .symbols import *
def yaml_save_dialog():
"""
By <NAME> for Mechanical Color
File dialog requesting YAML file destination.
"""
try:
return ... | 2.375 | 2 |
tools/compare_rep.py | Woffee/deformer | 114 | 43574 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
from collections import defaultdict
import numpy as np
from scipy.spatial import distance
from tqdm import tqdm
np.set_printoptions(threshold=np.inf, suppress=True)
def main(args):
num_batches = args.num_batches
bert_data = defaultdic... | 2.3125 | 2 |
forum/markdownext/mdx_auto_linker.py | Stackato-Apps/osqa | 1 | 43575 | import markdown
import re, socket
TLDS = ('gw', 'gu', 'gt', 'gs', 'gr', 'gq', 'gp', 'gy', 'gg', 'gf', 'ge', 'gd', 'ga', 'edu', 'va', 'gn', 'gl', 'gi',
'gh', 'iq', 'lb', 'lc', 'la', 'tv', 'tw', 'tt', 'arpa', 'lk', 'li', 'lv', 'to', 'lt', 'lr', 'ls', 'th', 'tf',
'su', 'td', 'aspx', 'tc', 'ly', 'do', 'coo... | 1.6875 | 2 |
Exercicios/Desafio013.py | victorhugof94/Python | 0 | 43576 | salario = float(input('valor do salario:'))
aumento = salario + (salario* (15/100))
print('voce ganhou um aumento de salario seu salario agora é: R${:.2f}'.format(aumento))
| 3.640625 | 4 |
sdk_samples/scripts/dcgm_example.py | deepio/DCGM | 85 | 43577 | <filename>sdk_samples/scripts/dcgm_example.py<gh_stars>10-100
# Copyright (c) 2021, NVIDIA 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://ww... | 2.359375 | 2 |
navigation/arena_local_planner/learning_based/arena_local_planner_drl/scripts/deployment/run_agent.py | kilinmao/sarl_star | 0 | 43578 | <reponame>kilinmao/sarl_star
import os
import rospy
import rospkg
import json
import numpy as np
import time
from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import SubprocVecEnv, DummyVecEnv, VecNormalize
from task_generator.task_generator.tasks import get_predefined_task
from arena_navigation... | 1.789063 | 2 |
trackers/iou_tracker/mta_track.py | XiaoSanGit/wda_tracker | 24 | 43579 |
from dataclasses import dataclass
from iou_tracker import track_iou
from util_iou import load_mot, save_to_csv
from time import time
import os
from multiprocessing.pool import ThreadPool
import pandas as pd
@dataclass
class Config_mta_tracker:
detections_folder: str
track_output_folder : str
cam_ids: lis... | 2.6875 | 3 |
hmc_inventory.py | power-devops/ansible_hmc_inventory | 1 | 43580 | #!/usr/bin/python3.7
from __future__ import print_function
import argparse
import json
import os
import ssl
import sys
import xml.etree.ElementTree as ET
try:
import requests
except ModuleNotFoundError:
print("requests module is required. Hint: sudo yum -y install python3-requests", file=sys.stderr)
sys.exit(1... | 2.46875 | 2 |
Access_Sentinel6MF_find_file_by_cycle_pass.py | podaac/sentinel6 | 6 | 43581 | <gh_stars>1-10
#!/usr/bin/env python3
# # Access Sentinel-6 MF Data using a script
# This script shows a simple way to maintain a local time series of Sentinel-6 data using the [CMR Search API](https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html). It downloads granules the ingested since the previous run ... | 3.09375 | 3 |
variable_heuristic.py | HoSzyk/Map | 0 | 43582 | <reponame>HoSzyk/Map
from problem import CspProblem
class BaseVariableHeuristic:
def get_variables(self, problem: CspProblem):
return problem.variables
class NeighbourHeuristic(BaseVariableHeuristic):
def get_variables(self, problem: CspProblem):
return sorted(problem.variables, key=lambda x... | 3.171875 | 3 |
Latest/venv/Lib/site-packages/pyface/ui/qt4/splash_screen.py | adamcvj/SatelliteTracker | 1 | 43583 | <filename>Latest/venv/Lib/site-packages/pyface/ui/qt4/splash_screen.py
#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, wh... | 1.742188 | 2 |
src/api/log/__init__.py | fekblom/critic | 216 | 43584 | import rebase
import partition
| 0.96875 | 1 |
tests/test_utils.py | bccho/pass-glm | 0 | 43585 | import os
import numpy.random as npr
from numpy.testing import *
import scipy.sparse as sp
from passglm.utils import *
def test_create_folder_if_not_exist():
try:
print 'Creating test folder...'
create_folder_if_not_exist('test_folder')
assert os.path.exists('test_folder')
print ... | 2.3125 | 2 |
book_catalog/models.py | shayweitzman/MyAutoBook | 1 | 43586 | <gh_stars>1-10
from django.db import models
from django.contrib.auth.models import User
class Book (models.Model):
name = models.CharField(max_length=50)
author_name = models.CharField(max_length=50)
summary = models.TextField(max_length=500)
image = models.ImageField(upload_to='book_catalog/images', d... | 2.28125 | 2 |
backtest/marketdata.py | Christakou/backtest | 0 | 43587 | from functools import cache
import backtest.backtest_config as backtest_config
import requests
import json
import pandas as pd
class APIError(Exception):
pass
class MarketStackBackEnd:
"""
A specific class to handle the particularities of the market stack API, can be swapped out for other classes with
... | 2.8125 | 3 |
src/encoded/types/cell_annotation.py | Lattice-Data/encoded | 0 | 43588 | from snovault import (
calculated_property,
collection,
load_schema,
)
from .base import (
Item,
)
@collection(
name='cell-annotations',
properties={
'title': 'Cell annotations',
'description': 'Listing of cell annotations',
})
class CellAnnotation(Item):
item_type = 'c... | 1.757813 | 2 |
pufferfish/__init__.py | JohnUrban/pufferfish | 1 | 43589 | <reponame>JohnUrban/pufferfish<filename>pufferfish/__init__.py
import os
import sys
import scripts
from version import __version__
| 1.101563 | 1 |
tests/test_pango.py | digitalvirtuoso/manim | 2 | 43590 | <filename>tests/test_pango.py
"""Tests :class:`PangoText` by comparing SVG files created.
"""
import os
import re
import cairocffi
import pangocairocffi
import pangocffi
from manim import START_X, START_Y, PangoText, SVGMobject
RTL_TEXT: str = """صباح الخير
مرحبا جميعا"""
WIDTH: int = 600
HEIGTH: int = 400
folder: s... | 3.03125 | 3 |
cobra/utils/console_log.py | frankenstien-831/cobra | 53 | 43591 | from colorama import Fore, Style
def console_log(text, _type=None, title=None, space=False, space_number=0):
# Checking text instance is string
if isinstance(text, str):
if title is None:
if _type == 'success':
return print(Style.DIM + Fore.GREEN + '[SUCCESS]'
... | 2.59375 | 3 |
python/ray/serve/tests/test_fastapi.py | jimzers/ray | 0 | 43592 | from fastapi import FastAPI
import requests
import pytest
import inspect
from ray import serve
from ray.serve.utils import make_fastapi_class_based_view
def test_fastapi_function(serve_instance):
client = serve_instance
app = FastAPI()
@app.get("/{a}")
def func(a: int):
return {"result": a}
... | 2.21875 | 2 |
App/wizard/prefs/software.py | Wizard-collab/wizard | 0 | 43593 | <reponame>Wizard-collab/wizard
# coding: utf-8
# Defaults Python modules
import os
from wizard.prefs.site import site
# Wizard prefs modules
from wizard.prefs.user import user
# Wizard tools modules
from wizard.tools import log
from wizard.tools import utility as util
# Wizard variables modules
from wizard.vars impor... | 2.625 | 3 |
evaluation/metrics.py | LaudateCorpus1/dm_c19_modelling | 3 | 43594 | # pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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/... | 2.328125 | 2 |
plugins/pelican-jinja2content/__init__.py | mohnjahoney/website_source | 17 | 43595 | <filename>plugins/pelican-jinja2content/__init__.py
from .jinja2content import *
| 1.054688 | 1 |
src/eduid_userdb/tests/test_u2f.py | SUNET/eduid-userdb | 0 | 43596 | <filename>src/eduid_userdb/tests/test_u2f.py
import copy
import datetime
from hashlib import sha256
from unittest import TestCase
import eduid_userdb.element
import eduid_userdb.exceptions
from eduid_userdb.credentials import U2F, CredentialList
__author__ = 'lundberg'
# {'passwords': {
# 'id': password_id,
# ... | 2.609375 | 3 |
models/ECAPA_TDNN.py | hiimmuc/Speaker-verification | 2 | 43597 | <reponame>hiimmuc/Speaker-verification<filename>models/ECAPA_TDNN.py
import torch # noqa: F401
import torch.nn as nn
import torch.nn.functional as F
from models.ECAPA_utils import Conv1d as _Conv1d
from models.ECAPA_utils import BatchNorm1d as _BatchNorm1d
from utils import PreEmphasis
import torchaudio
class... | 2.0625 | 2 |
App/helpers.py | faustotnc/heart-health-interactive | 0 | 43598 | import streamlit as st
def add_space(size, col=None):
"""
Adds vertical space between two sections.
"""
(col if col else st).markdown(
body=f"<div style='margin-top: {size}px'></div>",
unsafe_allow_html=True
)
| 3.125 | 3 |
envs/yumi/goal_vec_env.py | pcchenxi/skew-explore | 3 | 43599 | import numpy as np
from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv
class GaolDummyVecEnv(DummyVecEnv):
"""
extend the original DummyVecEnv class with function set_goals for goal proposing
"""
def __init__(self, env_fns):
super(GaolDummyVecEnv, self).__init__(env_fns)
... | 2.453125 | 2 |