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 |
|---|---|---|---|---|---|---|
application/__init__.py | UniversidadeDeVassouras/labproginter-2020.2-PedroHenriqueVasconcelos-t2 | 0 | 47000 | from flask import Flask
import os
from application.model.entity.aula import Aula
from application.model.entity.disciplina import Disciplina
app = Flask(__name__, static_folder=os.path.abspath("application/view/static"), template_folder=os.path.abspath("application/view/templates"))
aula1 = Aula(1, "Aula 1"... | 2.234375 | 2 |
grouper/fe/routes.py | zorkian/grouper | 0 | 47001 | <gh_stars>0
from . import handlers
from ..constants import NAME_VALIDATION, NAME2_VALIDATION, PERMISSION_VALIDATION
HANDLERS = [
(r"/", handlers.Index),
(r"/audits", handlers.AuditsView),
(r"/audits/(?P<audit_id>[0-9]+)/complete", handlers.AuditsComplete),
(r"/audits/create", handlers.AuditsCreate),
... | 1.695313 | 2 |
src/fuzzingtool/utils/utils.py | NESCAU-UFLA/FuzzingTool | 131 | 47002 | # Copyright (c) 2020 - present <NAME> <https://github.com/VitorOriel>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | 2.234375 | 2 |
hek/defs/sbsp.py | holy-crust/reclaimer | 0 | 47003 | from .coll import *
from .objs.sbsp import SbspTag
from supyr_struct.defs.block_def import BlockDef
cluster_fog_tooltip = (
"Unknown flag is set if negative.\n"
"Add 0x8000 to get fog index."
)
# the order is an array of vertices first, then an array of lightmap vertices.
#
uncompressed_vert... | 2.140625 | 2 |
tractseg/experiments/endings_seg.py | jelleman8/TractSeg | 1 | 47004 | <gh_stars>1-10
from tractseg.experiments.base import Config as BaseConfig
class Config(BaseConfig):
EXPERIMENT_TYPE = "endings_segmentation"
CLASSES = "All_endpoints"
LOSS_WEIGHT = 5
LOSS_WEIGHT_LEN = -1
# BATCH_SIZE = 30 # for all 72 (=144) classes we need smaller batch size because o... | 1.929688 | 2 |
test/test_align.py | ishine/fac-via-ppg | 98 | 47005 | <gh_stars>10-100
# Copyright 2018 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in w... | 2.671875 | 3 |
putput/presets/factory.py | cicorias/putput | 1 | 47006 | from typing import Callable
from putput.presets import displaCy
from putput.presets import iob2
from putput.presets import luis
from putput.presets import stochastic
def get_preset(preset: str) -> Callable:
"""A factory that gets a 'preset' Callable.
Args:
preset: the preset's name.
Returns:
... | 2.578125 | 3 |
profilesapi/serializers.py | farbodgerami/profilerestapi | 0 | 47007 |
from rest_framework import serializers
from .models import UserProfile
from profilesapi import models
class helloserializer(serializers.Serializer):
name = serializers.CharField(max_length=15)
class UserProfileserializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
# fields... | 2.40625 | 2 |
consumers/venv/lib/python3.7/site-packages/faust/types/assignor.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 0 | 47008 | <reponame>spencerpomme/Public-Transit-Status-with-Apache-Kafka<filename>consumers/venv/lib/python3.7/site-packages/faust/types/assignor.py
import abc
import typing
from typing import List, MutableMapping, Set
from mode import ServiceT
from yarl import URL
from .tuples import TP
if typing.TYPE_CHECKING:
from .app... | 2.0625 | 2 |
tests/utils/test_events.py | nox237/CTFd | 3,592 | 47009 | <filename>tests/utils/test_events.py<gh_stars>1000+
from collections import defaultdict
from queue import Queue
from unittest.mock import patch
from redis.exceptions import ConnectionError
from CTFd.config import TestingConfig
from CTFd.utils.events import EventManager, RedisEventManager, ServerSentEvent
from tests.h... | 2.3125 | 2 |
coordination/__init__.py | PhobosXIII/qc | 0 | 47010 | default_app_config = 'coordination.apps.CoordinationConfig' | 1.085938 | 1 |
hqca/hamiltonian/single_qubit.py | damazz/HQCA | 0 | 47011 | from hqca.core import *
import numpy as np
from hqca.tools import *
class SingleQubitHamiltonian(Hamiltonian):
def __init__(self,sq=True,
**kw
):
self._order = 1
self._model = 'sq'
self._qubOp = ''
self.No_tot = 1
self.Ne_tot = 1
self.real = T... | 2.46875 | 2 |
graphene_django_jwt/schema/middleware.py | Speedy1991/graphene-django-jwt | 0 | 47012 | <reponame>Speedy1991/graphene-django-jwt
from django.contrib.auth.models import AnonymousUser
from graphene_django_jwt.blacklist import Blacklist
from graphene_django_jwt.shortcuts import get_user_by_token
from graphene_django_jwt.utils import get_credentials, get_payload
def _load_user(request):
token = get_cre... | 2.265625 | 2 |
cache.py | kirypto/TimelineTrackerCLI | 0 | 47013 | <reponame>kirypto/TimelineTrackerCLI<filename>cache.py
import pickle
from datetime import datetime, timedelta
from pathlib import Path
from re import match
from time import sleep
from typing import Any, TypeVar, Optional, Callable, Dict
from copy import deepcopy
_MILLIS_PER_HOUR = 1000 * 60 * 60
TArg1 = TypeVar("TArg... | 2.53125 | 3 |
main.py | triplet02/LibriSpeech-preprocess | 3 | 47014 | <reponame>triplet02/LibriSpeech-preprocess
import argparse
from utils.functional import ParameterError
from utils.preprocess import preprocess, create_labels, create_script, collect
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='LibriSpeech Dataset Preprocessor')
parser.add_argument('... | 2.484375 | 2 |
src/main.py | RiTUAL-UH/cs_elmo | 4 | 47015 | <gh_stars>1-10
import os
import re
import json
import argparse
import random
import numpy as np
import torch
import experiments.experiment_langid as experiment_lid
import experiments.experiment_ner as experiment_ner
import experiments.experiment_pos as experiment_pos
from types import SimpleNamespace as Namespace
PR... | 2.359375 | 2 |
Data_TAPTC/main_convert_txt2dict.py | adamslab-ub/BiG-MRTA | 1 | 47016 | # Author: <NAME>, <EMAIL>
# Dec 02, 2020
# Copyright 2020 <NAME>
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from scipy.spatial import distance as dist
import scipy.io
import pickle
## TAPTC Dataset
group_list = [1,2]
instance_list = [0, 1, 2]
ratio_deadline_list = [1, 2, 3, 4]
rob... | 2.609375 | 3 |
main.py | zs-liu/GOC-VRPTW-MAA | 11 | 47017 | <gh_stars>10-100
from tools import GlobalMap
from tools import pickle_dump, pickle_load
from PGA import Controller, Nature, Chromo, Route
load = True
save = True # warning: if save set to be true, it may save the 'controller' to save_dir, which is up to 100MB
generation_num = 500 # can set this number very large, ca... | 2.4375 | 2 |
auto-bench.py | cmr/rust-bench | 2 | 47018 | #!/usr/bin/python2
import os
from plumbum import local, FG
from plumbum.cmd import git
# the commits already tested
HISTORY = '/home/cmr/benches/data'
BUILDDIR = '/mnt/rustb'
BENCH_OVERRIDE = '/home/cmr/benches/bench-override.txt'
def run(hash):
local['benchit.py'][hash] & FG
for hash in open(BENCH_OVERRIDE).... | 2.125 | 2 |
CheckWater.py | Artem1199/PlantManager | 1 | 47019 | import RPi.GPIO as GPIO
import time
import datetime
from ReadWriteConfig import *
import Adafruit_ADS1x15
now = datetime.datetime.now()
print("Starting CheckWater.py", str(now))
adc = Adafruit_ADS1x15.ADS1015() # Pick Sensors
GAIN = 0 #import gain for adc reading
SS_COUNT = 0
with open("PlantMgr.xml", "r") as f:
... | 2.78125 | 3 |
util.py | HENRYMARTIN5/Py2Assembler | 0 | 47020 | def str2bool(v):
return str(v).lower() in ("yes", "true", "t", "1") | 2.8125 | 3 |
views.py | Eileen30/Final-Project | 0 | 47021 | from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.views import APIView
from rest_framework.decorators import api_view,permission_classes
from .models im... | 1.875 | 2 |
alipay/aop/api/domain/AlipayOfflineProviderShopactionRecordModel.py | snowxmas/alipay-sdk-python-all | 213 | 47022 | <filename>alipay/aop/api/domain/AlipayOfflineProviderShopactionRecordModel.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OuterShopDO import OuterShopDO
class AlipayOfflineProviderShopactionRecordModel(object):
def __i... | 1.835938 | 2 |
src/pwnbot.py | jtorres-dev/discord_ctfbot | 2 | 47023 | import discord
import ctftime
import os
import random
from discord.ext import commands, tasks
from datetime import datetime
# Token generated from https://discord.com/developers/applications
# Keep this private, if exposed generate new one
TOKEN = ''
# Bot channel ID was grabbed from Settings > Appearance > Developer... | 2.546875 | 3 |
setup.py | monkeython/multipla | 0 | 47024 | import os
import sys
NAME = 'multipla'
PACKAGE = __import__(NAME)
AUTHOR, EMAIL = PACKAGE.__author__.rsplit(' ', 1)
with open('docs/index.rst', 'r') as INDEX:
DESCRIPTION = INDEX.readline()
with open('README.rst', 'r') as README:
LONG_DESCRIPTION = README.read()
URL = 'https://github.com/monkeython/%s' % NA... | 1.703125 | 2 |
src/DB_logger.py | adibarra/Generic-DiscordBot | 0 | 47025 | # Generic-DiscordBot
# author: github/adibarra
# imports
import os
import time
import uuid
import enum
import glob
import traceback
from zipfile import ZipFile
from DB_prefsloader import PreferenceLoader
class Importance(enum.IntEnum):
""" Enum to keep track of logger message importance """
CRIT = 0
WARN... | 2.59375 | 3 |
dbparti/backends/exceptions.py | bsauer/django-db-parti | 0 | 47026 | <reponame>bsauer/django-db-parti
from dbparti import connection
class BasePartitionError(Exception):
"""Base exception class for backend exceptions"""
def __init__(self, message, **kwargs):
self.message = message
self.model = kwargs.get('model', None)
self.current_value = kwargs.get('c... | 2.15625 | 2 |
store/urls.py | hardik1410/ShopEase | 0 | 47027 | from django.urls import path
from django.conf.urls import url
from store import views
from .views import getStore, addStore, updateStore, deleteStore
urlpatterns = [
url(r'getStore/', views.getStore),
url(r'addStore/', views.addStore),
url(r'updateStore/', views.updateStore),
url(r'deleteStore/', views... | 1.78125 | 2 |
pythia/opal/content/KeyboardAttributes.py | willic3/pythia | 1 | 47028 | <filename>pythia/opal/content/KeyboardAttributes.py
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {Lic... | 1.835938 | 2 |
wwwhero/migrations/0006_auto_20210109_1311.py | IharSha/build_a_hero | 0 | 47029 | <filename>wwwhero/migrations/0006_auto_20210109_1311.py
# Generated by Django 3.1.4 on 2021-01-09 13:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wwwhero', '0005_auto_20210106_1308'),
]
operations = [
... | 1.734375 | 2 |
pyexcel_xlsbr/_version.py | chfw/pyexcel-xlsbr | 0 | 47030 | __version__ = "0.5.0-rc1"
__author__ = "C.W."
| 1.046875 | 1 |
tests/test_release.py | andyjessen/great_expectations | 0 | 47031 | <gh_stars>0
import datetime as dt
import json
from typing import Dict, Optional, cast
import dateutil.parser
import pytest
from packaging import version
from great_expectations.data_context.util import file_relative_path
@pytest.fixture
def release_file() -> str:
path: str = file_relative_path(__file__, "../.gi... | 2.421875 | 2 |
src/models/ast_models_2d.py | MichaelLynn1996/ast | 0 | 47032 | <reponame>MichaelLynn1996/ast
# -*- coding: utf-8 -*-
# @Time : 6/10/21 5:04 PM
# @Author : <NAME>
# @Affiliation : Massachusetts Institute of Technology
# @Email : <EMAIL>
# @File : ast_models.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import autocast
import os... | 2.21875 | 2 |
Testing/test_springs.py | geosharma/PyNite | 199 | 47033 | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <NAME>, SE; tamalone1
"""
import unittest
from PyNite import FEModel3D
import sys
from io import StringIO
class Test_Spring_Elements(unittest.TestCase):
''' Tests of spring members.'''
def setUp(self):
# Suppress printed output temporarily
... | 2.390625 | 2 |
2009/scientific-computing/prax3/src/RLPrax2_2.py | rla/old-code | 2 | 47034 | # -*- coding: utf-8 -*-
# <NAME>
# <EMAIL>
import sys
from Taring import Taring
# Abiklass nelja täringuviske mängu simuleerimiseks.
class GameSimulator:
def __init__(self):
# Täringute ettevalmistamine.
self.t1 = Taring()
self.t2 = Taring()
self.t3 = Taring()
self.t4 = Ta... | 3.125 | 3 |
atesa/lmax.py | team-mayes/atesa | 5 | 47035 | """
Likelihood maximization script. This program is designed to be entirely separable from ATESA in that it can be called
manually to perform likelihood maximization to user specifications and with arbitrary input files; however, it is
required by ATESA's aimless shooting information error convergence criterion.
"""
i... | 2.625 | 3 |
backend_getData/get_poptweets_topic.py | ZilinZhou1995/RetweetVis | 0 | 47036 | <filename>backend_getData/get_poptweets_topic.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Downloads all tweets from a given user.
Uses twitter.Api.GetUserTimeline to retreive the last 3,200 tweets from a user.
Twitter doesn't allow retreiving more tweets than this through the API, so we get
as many as possi... | 3.28125 | 3 |
curl_command/bin/curl-command.py | bmacher/splunk-curl-command | 1 | 47037 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Splunk specific dependencies
import sys, os
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators, splunklib_logger as logger
# Command specific dependencies
import requests
from requests.auth import HTTPDigestAuth
import js... | 2.25 | 2 |
fmas/solver/integrating_factor_method.py | nunoedgarhubsoftphotoflow/py-fmas | 4 | 47038 | <reponame>nunoedgarhubsoftphotoflow/py-fmas
"""
Implements integrating factor method (IFM).
.. codeauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
from ..config import W_MAX_FAC
from ..stepper import RungeKutta4
from .solver_base import SolverBaseClass
class IFM(SolverBaseClass):
r"""Fixed stepsize algorithm im... | 1.828125 | 2 |
discordbot/src/commands/url.py | matrix2113/discord-masz | 0 | 47039 | <reponame>matrix2113/discord-masz<gh_stars>0
import os
from discord.ext import commands
@commands.command(help="Displays the URL MASZ is deployed on.")
async def url(ctx):
await ctx.send(f"MASZ is deployed on: {os.getenv('META_SERVICE_BASE_URL', 'URL not set.')}")
| 2.28125 | 2 |
pgmock/selector.py | cwbane/pgmock | 54 | 47040 | <reponame>cwbane/pgmock
"""
pgmock.selector
---------------
Contains the primary functionality for chainable SQL selectors
"""
import pgmock.exceptions
import pgmock.mocker
import pgmock.render
def body():
"""Obtains the body of a selector.
When applicable, this selector returns the body of another selectio... | 2.84375 | 3 |
tests/test_admin.py | douglatornell/randopony-tetra | 1 | 47041 | """Tests for RandoPony admin views and functionality.
"""
from datetime import datetime
import unittest
from unittest.mock import patch
from pyramid import testing
from pyramid_mailer import get_mailer
from sqlalchemy import create_engine
from randopony.models.meta import (
Base,
DBSession,
)
class TestCore... | 2.328125 | 2 |
ptf_nn/ptf_nn_test_eth.py | linarnan/ptf | 113 | 47042 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2013-present Barefoot Networks, 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
#
#... | 2.34375 | 2 |
src/lib/parsers/parseretinac.py | Project-Prismatica/Prism-Shell | 0 | 47043 | <filename>src/lib/parsers/parseretinac.py
#!/usr/bin/python
# parseretinac.py
#
# By <NAME> <EMAIL> | <EMAIL>
# Copyright 2011 Intru-Shun.ca Inc.
# v0.09
# 16 October 2011
#
# The current version of these scripts are at: http://dshield.handers.org/adebeaupre/ossams-parser.tgz
#
# Parses retina community vers... | 1.96875 | 2 |
nunaserver/nunaserver/wsgi.py | UAVCAN/nunaweb | 3 | 47044 | """
WSGI entrypoint.
"""
from nunaserver.server import app
if __name__ == "__main__":
app.run()
| 1.039063 | 1 |
animate.py | manuelnaranjo/pyrealtimecharter | 0 | 47045 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright 2010 Naranjo, <NAME> <<EMAIL>>
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
... | 2.609375 | 3 |
eval_bp.py | tkuri/irradiance_estimation | 1 | 47046 | <gh_stars>1-10
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import csv, os, argparse
def parser():
parser = argparse.ArgumentParser(description='Extract max region from irradiance image')
parser.add_argument('fname', help='Input file name')
parser.add_argume... | 2.453125 | 2 |
Ubiquitous Computing/src/raspberry/JSONFormater.py | Alvarohf/University-work | 0 | 47047 | <reponame>Alvarohf/University-work
import json
import time
from enum import Enum
from math import ceil
import datetime
class DataType(Enum):
FLEX = 'Flex'
TEMPERATURE = 'Temperature'
HUMIDITY = 'Humidity'
NOISE = 'Noise'
LIGHT = 'Light'
WEIGHT = 'Weight'
POSITION = 'Position'
SOUND = 'Sound'
def formatToJson... | 2.921875 | 3 |
midterm/problem5.py | MarcoDSilva/MIT6001x-Introduction-to-Computer-Science-and-Programming-in-Python | 0 | 47048 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 5 16:32:17 2020
Write a Python function that returns a list of keys in aDict that map to
integer values that are unique (i.e. values appear exactly once in aDict).
The list of keys you return should be sorted in increasing order.
(If aDict does not contain any unique v... | 3.8125 | 4 |
testing/unit_tests/test_loader.py | MotionCorrect/ivadomed | 0 | 47049 | import os
import pytest
import csv_diff
import logging
import torch
from unit_tests.t_utils import remove_tmp_dir, create_tmp_dir, __data_testing_dir__, __tmp_dir__
from ivadomed.loader import utils as imed_loader_utils
from ivadomed.loader import loader as imed_loader
logger = logging.getLogger(__name__)
def setup_f... | 2.03125 | 2 |
src/library/__init__.py | smiley-py/mailrobot | 0 | 47050 | <reponame>smiley-py/mailrobot
from .scheduled import CustomScheduled
from .gmail import CustomGmail
from .outlook import CustomOutlook
| 1.03125 | 1 |
slash/utils/__init__.py | kbh2o/slash | 70 | 47051 | <reponame>kbh2o/slash<filename>slash/utils/__init__.py
import functools
from ..ctx import context
from ..core.markers import repeat_marker
from ..core import requirements
from ..exceptions import SkipTest
def skip_test(*args):
"""
Skips the current test execution by raising a :class:`slash.exceptions.SkipTes... | 2.75 | 3 |
tests/document/tei/author_test.py | elifesciences/sciencebeam-parser | 13 | 47052 | <reponame>elifesciences/sciencebeam-parser
import logging
from lxml import etree
from sciencebeam_parser.document.layout_document import (
LayoutBlock
)
from sciencebeam_parser.document.semantic_document import (
SemanticAddressLine,
SemanticAffiliationAddress,
SemanticAuthor,
SemanticCountry,
... | 2.1875 | 2 |
labs/lab-09/checkpoint5.py | AayushSriram/oss-repo | 0 | 47053 | from pymongo import MongoClient
from bson.objectid import ObjectId
from datetime import datetime as dt
import pprint
client = MongoClient()
db = client['mongo_db_lab']
defs = db['definitions']
def random_word_requester():
'''
This function should return a random word and its definition and also
log in the... | 3.015625 | 3 |
server/project/api_v1/migrations/0003_auto_20191020_1229.py | Utree/TRAGRAM | 0 | 47054 | <gh_stars>0
# Generated by Django 2.1.8 on 2019-10-20 03:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v1', '0002_auto_20191020_1005'),
]
operations = [
migrations.AlterField(
model_name='post',
name='ma... | 1.476563 | 1 |
leads/migrations/0012_auto_20190521_0128.py | goplannr-samim/manager-app | 0 | 47055 | # Generated by Django 2.1.7 on 2019-05-20 19:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0011_auto_20190520_1217'),
]
operations = [
migrations.AddField(
model_name='lead',
name='first_name',
... | 1.671875 | 2 |
inference/_archive/pairwise_alignment_without_regularization.py | emitch/SEAMLeSS | 4 | 47056 | import sys
import torch
from args import get_argparser, parse_args, get_aligner, get_bbox
from os.path import join
if __name__ == '__main__':
parser = get_argparser()
parser.add_argument('--align_start',
help='align without vector voting the 2nd & 3rd sections, otherwise copy them', action='store_true')
args... | 2.1875 | 2 |
ansys/dpf/core/operators/math/add_fc.py | jfthuong/pydpf-core | 18 | 47057 | <gh_stars>10-100
"""
add_fc
===============
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecif... | 2.484375 | 2 |
cms_helpers/cms_toolbars.py | jonasundderwolf/django-cms-helpers | 0 | 47058 | from cms.extensions.toolbar import ExtensionToolbar
from cms.utils import get_language_list
from django.utils.encoding import force_text
from django.utils.translation import get_language_info
class TitleExtensionToolbar(ExtensionToolbar):
model = None
insert_after = None
def get_item_position(self, menu)... | 2 | 2 |
astropath/utilities/version.py | AstroPathJHU/AstroPathPipeline | 14 | 47059 | import datetime, os, pkg_resources, re, setuptools_scm
from .. import __name__ as package_name
try:
if int(os.environ.get("_ASTROPATH_VERSION_NO_GIT", 0)):
env_var_no_git = True
raise LookupError
env_var_no_git = False
astropathversion = "v"+setuptools_scm.get_version(root="../..", relative_to=__file__)
... | 2.09375 | 2 |
scripts/gazebo_move_object.py | RCPRG-ros-pkg/rcprg_gazebo_utils | 0 | 47060 | <gh_stars>0
#!/usr/bin/env python
## Provides interactive 6D pose marker and allows moving object in Gazebo.
# @ingroup utilities
# @file gazebo_move_object.py
# @namespace scripts.gazebo_move_object Provides interactive 6D pose marker and allows moving object in Gazebo
# Copyright (c) 2017, Robot Control and Pattern... | 1.8125 | 2 |
MTHMBE/views.py | jvprosser/MTHMBE | 0 | 47061 | <reponame>jvprosser/MTHMBE<gh_stars>0
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from flask import Flask
from flask_apscheduler import APScheduler
from flask_sqlalchemy import SQLAlchemy
from MTHMBE import app
from models import RMStats,Impala_Stats
import core
#import time
from time import mktime,... | 1.90625 | 2 |
02 - Regresor_KNN.py | FelipePepe/Curso_MachineLearning | 1 | 47062 | ###
### Precios de casas en boston
###
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.neighbors import KNeighborsRegressor
boston = load_boston()
# Visualiza el nombre de los valores de los datos.
pri... | 3.640625 | 4 |
docarray/array/storage/elastic/seqlike.py | jina-ai/docarray | 591 | 47063 | <filename>docarray/array/storage/elastic/seqlike.py<gh_stars>100-1000
from typing import Union, Iterable, Dict
from ..base.seqlike import BaseSequenceLikeMixin
from .... import Document
class SequenceLikeMixin(BaseSequenceLikeMixin):
"""Implement sequence-like methods for DocumentArray with Elastic as storage"""... | 2.40625 | 2 |
quantdom/ui.py | HiteshMah-Jan/Quantdom | 578 | 47064 | """Ui."""
import logging
import logging.config
import os.path
from datetime import datetime
from PyQt5 import QtCore, QtGui
from .lib import (
EquityChart,
OptimizatimizedResultsTable,
OptimizationTable,
Portfolio,
QuotesChart,
ResultsTable,
Settings,
Symbol,
TradesTable,
get_... | 2.046875 | 2 |
jacky_python/16_3Sum_Closest.py | jackyyeh5111/leetcode | 0 | 47065 | from typing import List
class Solution:
def threeSumClosest(self, nums: List[int], target: int) -> int:
nums.sort()
res = sum(nums[:3])
for i in range(len(nums)-2):
j = i + 1
k = len(nums) - 1
while j < k:
three_sum = nums[i] + n... | 3.359375 | 3 |
train/manager.py | LiuTed/gym-TD | 0 | 47066 | import os
import shutil
import re
from collections import OrderedDict
import subprocess
import numpy as np
import atexit
class Result:
checkpoint = None
log = None
tarball = None
board = None
if __name__ == '__main__':
results = OrderedDict()
def load_files():
files = os.listdir()
... | 2.421875 | 2 |
api/cueSearch/elasticSearch/elastic_search_indexing.py | cuebook/CueSearch | 3 | 47067 | import os
import time
import logging
from typing import List, Dict
from collections import deque
# from search import app
from elasticsearch import Elasticsearch
from elasticsearch.helpers import parallel_bulk
from datetime import datetime
# from config import ELASTICSEARCH_URL
import threading
from .utils import Uti... | 2.28125 | 2 |
back2back/use_cases/natdiscovery.py | excentis/ByteBlower_python_examples | 2 | 47068 | """
A simple example of NATDiscovery between ByteBlower ports.
To discover the public IP address we will send a single packet
upstream, capture this packet at the WAN side and finally
pick it apart.
This example demonstrates:
* How to transmit a single custom packet.
* How to cap... | 2.875 | 3 |
scripts/plot.py | dfvella/vtol | 0 | 47069 | <reponame>dfvella/vtol
#!/usr/bin/env python3
import sys
import matplotlib.pyplot as plt
try:
filename = sys.argv[1]
except IndexError:
print('error: data file not specified')
exit(1)
#response = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ]
#response = [ 0.2, 0.2, 0.2, 0.2, 0.1, 0.05, 0.02, 0.02... | 2.65625 | 3 |
iv/Leetcode/easy/594_longest_harmonius_subseuence.py | iamsuman/iv | 2 | 47070 | <reponame>iamsuman/iv<gh_stars>1-10
class Solution:
def findLHS(self, nums: list) -> int:
nums.sort()
start_index = 0
l_count = 0
m_count = 0
LHS = 0
for i in range(len(nums)):
if start_index == 0:
l_count = 1
min_num = num... | 2.78125 | 3 |
constants/config.py | daniele21/Financial_Sentiment_Analysis | 0 | 47071 | <reponame>daniele21/Financial_Sentiment_Analysis<filename>constants/config.py
MAX_WORD_SENTENCE = 40
# VECTORIZATIONS
TDIDF_EMBEDDING = 'tdidf'
TOKENIZER = 'tokenizer'
# IMBALANCE
SMOTE_IMBALANCE = 'smote'
# DATASET TYPES
FINANCIAL_DATASET = 'financial_phrases_bank'
MOVIE_DATASET = 'movie_data'
SST_DATASET = 'sst_da... | 1.320313 | 1 |
game/serializers/question_with_answer_serializer.py | dimadk24/english-fight-api | 0 | 47072 | from rest_framework import serializers
from game.serializers.question_serializer import QuestionSerializer
class QuestionWithAnswerSerializer(QuestionSerializer):
correct_answer = serializers.CharField()
| 2.28125 | 2 |
examples/overlapping_gaussians.py | neurodata/honest-forests | 7 | 47073 | <reponame>neurodata/honest-forests
"""A comparison of forest calibration"""
# Authors: <NAME>
# Adopted from: https://github.com/rflperry/ProgLearn/blob/UF/
# License: MIT
# and https://github.com/scikit-learn/scikit-learn/
# License: BSD 3 clause
import numpy as np
from sklearn import datasets
from sklearn.ensemble i... | 2.1875 | 2 |
cwc/models/density_estimators.py | perellonieto/background_check | 4 | 47074 | from sklearn import svm
from ..data_wrappers import reject
import numpy as np
from scipy.stats import multivariate_normal
from sklearn.mixture import GMM
from sklearn.neighbors import KernelDensity
class DensityEstimators(object):
def __init__(self):
self.models = {}
self.unknown = {}
self... | 2.890625 | 3 |
components/homme/scripts_for_paper/dictionaries.py | cjvogl/E3SM | 1 | 47075 | <gh_stars>1-10
from netCDF4 import Dataset
import glob
# This is meant to be an all-inclusive list of possible methods
methodDict = {'KGU35-native': 5,
'ARS232-native': 7,
'KGU35': 21,
'ARS232': 22,
'DBM453': 23,
'ARS222': 24,
'ARS233... | 2.234375 | 2 |
ptt/page.py | rayhzh/pttpost-parser | 1 | 47076 | <filename>ptt/page.py
import re
from .type import Url
from typing import Iterator, List
import urllib.parse as urlpasre
from abc import ABC, abstractmethod
class PageManager(ABC):
def __init__(self, start_url: Url) -> None:
self.start_url = start_url
@abstractmethod
def get_urls(self, search_pag... | 3.03125 | 3 |
regparser/grammar/interpretation_headers.py | cfpb/regulations-parser | 36 | 47077 | from pyparsing import LineEnd, LineStart, SkipTo, Regex
from regparser.grammar import atomic, unified
section = (
atomic.section_marker.copy().leaveWhitespace()
+ unified.part_section
+ SkipTo(LineEnd())
)
par = (
atomic.section.copy().leaveWhitespace()
+ unified.depth1_p
+ SkipTo(LineEnd()... | 3.125 | 3 |
Turbo_I2C/BMP280.py | emwtur/Turbo_Python | 0 | 47078 | <reponame>emwtur/Turbo_Python
# Copyright (c) 2014 Adafruit Industries
import logging
import time
class BMP280(object):
# BMP280 default address.
I2CADDR = 0x76
BME280_CONFIG = 0x60
# Operating Modes
OSAMPLE_1 = 1
OSAMPLE_2 = 2
OSAMPLE_4 = 3
OSAMPLE_8 = 4
OSAMPLE_16 = 5
# BMP280 Registers
REGISTER_D... | 2.15625 | 2 |
classes/perms.py | Geekid812/tournament-master | 1 | 47079 | # Perms Class
# Importing Libraries
import discord
from discord.ext import commands
from classes.channel import Channel
class MissingPermissions(commands.CheckFailure):
pass
class InvalidChannel(commands.CheckFailure):
pass
def authorized(ctx, user=None, level=5, to=False):
"""
Checks if the spec... | 2.609375 | 3 |
music/shape/audio/fourier/coefficient/alpha.py | jedhsu/music | 0 | 47080 | <reponame>jedhsu/music
"""
*Alpha-Coefficient*
The alpha term in the fourier coefficient.
"""
from ._coefficient import FourierCoefficient
class AlphaCoefficient(
FourierCoefficient,
):
pass
| 1.734375 | 2 |
neural_seq/utils.py | Dragon-hxl/LARC | 0 | 47081 | import argparse
def commandLineArgs():
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument("--restrict-types",
dest="restrict_types",
default=False,
action="store_true")
parser.add_argument("--tes... | 2.53125 | 3 |
pypillometry/fakedata.py | wsojka00/pypillometry | 13 | 47082 | """
fakedata.py
====================================
Generate artificial pupil-data.
"""
import numpy as np
import scipy.stats as stats
from .baseline import *
from .pupil import *
def generate_pupil_data(event_onsets, fs=1000, pad=5000, baseline_lowpass=0.2,
evoked_response_perc=0.02, respon... | 2.90625 | 3 |
Day 5/how_about_a_nice_game_of_chess_1.py | Shunderpooch/AdventOfCode2016 | 0 | 47083 | """
<NAME>
Advent of Code Day 5
Challenge 1
"""
import sys
import hashlib
def md5_func(string):
md5result = hashlib.md5()
md5result.update(string.encode('utf-8'))
return md5result.hexdigest()
INTEGER_ID = 0
PASSWORD = ""
if len(sys.argv) < 2:
print("Please pass the puzzle input as a command line arg... | 3.671875 | 4 |
muvimaker/core/sound.py | JannisNe/muvi_maker | 2 | 47084 | <reponame>JannisNe/muvi_maker
import librosa, copy
import numpy as np
from muvimaker import main_logger
logger = main_logger.getChild(__name__)
standard_fmin = 32.7
class SoundError(Exception):
pass
class Sound:
def __init__(self, filename, hop_length, sample_rate=None, fmin=standard_fmin):
logge... | 2.1875 | 2 |
estudiantes/migrations/0008_auto_20180411_2345.py | jlopez0591/SIGIA | 0 | 47085 | <filename>estudiantes/migrations/0008_auto_20180411_2345.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-04-12 04:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
(... | 1.421875 | 1 |
api/migrations/0001_initial.py | backdev96/yamdb_final | 0 | 47086 | # Generated by Django 3.0.5 on 2020-12-07 16:56
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.757813 | 2 |
src/proj/urls.py | Liosha1366/Django_new | 0 | 47087 | """proj URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 2.796875 | 3 |
PythonExercicios/ex005.py | gabjohann/python_3 | 0 | 47088 | # Faça um programa que leia um número inteiro e mostre na tela o seu sucessor e seu antecessor
num = int(input('Digite um número inteiro: '))
ant = num - 1
suc = num + 1
print('O sucessor de {} é {} e seu antecessor é {}'.format(num, suc, ant))
# Resolução com somente uma variável:
# print('O sucessor de {} é {} e se... | 4.1875 | 4 |
modules/audio/settings.py | mlc2307/pyradio | 0 | 47089 | """
Default audio settings.
"""
import numpy as np
from modules.socket.settings import PACKAGE_SIZE
# Number of sound channels.
CHANNELS = 2
# The size of the streaming buffer, that needs to fit into the socket buffer.
CHUNK_SIZE = PACKAGE_SIZE // CHANNELS // np.dtype(np.int16).itemsize
# Sound device frame rate. ... | 2.46875 | 2 |
Config/config.py | Sijiu/Xbill | 14 | 47090 | START_DAY_OF_MONTH = 1
BUDGET_OF_MONTH = 7000
| 0.984375 | 1 |
pybline/__init__.py | arkottke/pybline | 0 | 47091 | <reponame>arkottke/pybline
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""pybline module."""
from pkg_resources import get_distribution
from scipy import constants
# Gravity in cm/sec/sec
# Used by modules of the package
GRAV = constants.g / constants.centi
from . import (
models,
tools
)
__author__ = '<N... | 1.554688 | 2 |
kicker/controllers/kicker.py | OpenTinyFootbal/kicker | 0 | 47092 | import ast
import base64
import jinja2
import logging
import random
import datetime
from functools import reduce
import werkzeug
from odoo import SUPERUSER_ID
from odoo import api, http
from odoo.exceptions import UserError
from odoo.http import request
from odoo.modules import get_module_resource
from odoo.addons.web... | 2.046875 | 2 |
parsl/dataflow/states.py | cylondata/parsl | 323 | 47093 | from enum import IntEnum
class States(IntEnum):
"""Enumerates the states a parsl task may be in.
These states occur inside the task record for a task inside
a `DataFlowKernel` and in the monitoring database.
In a single successful task execution, tasks will progress in this
sequence:
pendin... | 3.03125 | 3 |
neuralxc/tests/test_neuralxc.py | semodi/neuralxc | 24 | 47094 | """
Unit and regression test for the neuralxc package.
"""
import copy
import os
import sys
from abc import ABC, abstractmethod
import dill as pickle
import matplotlib.pyplot as plt
import numpy as np
import pytest
# Import package, test suite, and other packages as needed
import neuralxc as xc
from neuralxc.constan... | 2.125 | 2 |
dataWork/gathering/press/_1.py | eiriniavraam/digital-leadership-center | 0 | 47095 | <reponame>eiriniavraam/digital-leadership-center<gh_stars>0
#!/usr/bin/python3
"""
Docstring
------------------------------------------------------------------------------
_1.py | creting corpus of text to upload to Mongo
------------------------------------------------------------------------------
Author: <NAME>,... | 2.28125 | 2 |
stock_news_beta/stock_news_beta/apps/focus/migrations/0004_auto_20190125_1724.py | zws910/stock-news | 0 | 47096 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-01-25 09:24
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('focus', '0003_auto_20190125_1721'),
]
operations = [
migrations.AlterModelOptions(... | 1.523438 | 2 |
show_perturbations.py | HKJL10201/fast-feature-fool | 0 | 47097 | import numpy as np
from PIL import Image
nets = ["caffenet", "googlenet", "vggf", "vgg16", "vgg19"]
def load(nets):
res = []
for net in nets:
data_path = "perturbations/perturbation_%s.npy" % net
imgs = np.load(data_path, allow_pickle=True, encoding="latin1")
# print(imgs.shape)
... | 2.84375 | 3 |
data_selection/wmt/common.py | DionysisChristopoulos/google-research | 23,901 | 47098 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2.78125 | 3 |
samples/flower_classification_pytorch/data/build.py | Berumotto1/ml-platform-sdk-python | 11 | 47099 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import torch
import torch.distributed as dist
from dat... | 1.820313 | 2 |