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 |
|---|---|---|---|---|---|---|
apps/portalbase/system/system__alerts/methodclass/system_alerts.py | Jumpscale/jumpscale_portal8 | 0 | 18400 | <reponame>Jumpscale/jumpscale_portal8
from JumpScale import j
class system_alerts(j.tools.code.classGetBase()):
"""
Alerts handler
"""
def __init__(self):
self._te = {}
self.actorname = "alertshandler"
self.appname = "system"
self.alertmodel = j.data.models.system.A... | 2.25 | 2 |
docs/pyqbdi.py | pbrunet/QBDI | 1 | 18401 | <reponame>pbrunet/QBDI
# This file is only used to generate documentation
# VM class
class vm():
def getGPRState():
"""Obtain the current general purpose register state.
:returns: GPRState (an object containing the GPR state).
"""
pass
def getFPRState():
"""Obtain... | 2.671875 | 3 |
krkbipscraper/settings.py | pawmar/krkbipscraper | 0 | 18402 | <reponame>pawmar/krkbipscraper
# -*- coding: utf-8 -*-
"""Scrapy settings."""
BOT_NAME = 'krkbipscraper'
SPIDER_MODULES = ['krkbipscraper.spiders']
NEWSPIDER_MODULE = 'krkbipscraper.spiders'
ITEM_PIPELINES = ['krkbipscraper.pipelines.JsonWriterPipeline']
| 1.148438 | 1 |
sap hana/connections and query execution with python/script.py | Phelipe-Sempreboni/databases | 1 | 18403 | # Importação da biblioteca.
# Certifique-se de ter a biblioteca instalada.
import pyhdb
# Essa função traz/chama outro arquivo que contém a senha, visando não deixar exposta na aplicação.
# Caso não queira utilizar esse método e inserir diretamente a senha na conexão, exclua esse bloco e insira a senha diretamente no... | 2.84375 | 3 |
tests/mvae/distributions/test_von_mises_fisher.py | macio232/mvae | 53 | 18404 | # Copyright 2019 <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 1.734375 | 2 |
cello/download_resources.py | Ann-Holmes/CellO | 42 | 18405 | <reponame>Ann-Holmes/CellO<gh_stars>10-100
"""
Download CellO's resources files. These files include CellO's pre-trained
models, gene ID-to-symbol mappings, and training sets for training CellO's
models on new gene sets.
Authors: <NAME> <<EMAIL>>
"""
import subprocess
from os.path import join
from shutil import which... | 2.078125 | 2 |
prob_020.py | tansly/euler | 1 | 18406 | def sum_digit(n):
total = 0
while n != 0:
total += n % 10
n /= 10
return total
def factorial(n):
if n <= 0:
return 1
return n * factorial(n - 1)
| 3.96875 | 4 |
mmtrack/models/mot/trackers/base_tracker.py | sht47/mmtracking | 12 | 18407 | from abc import ABCMeta, abstractmethod
import torch
import torch.nn.functional as F
from addict import Dict
from mmtrack.models import TRACKERS
@TRACKERS.register_module()
class BaseTracker(metaclass=ABCMeta):
"""Base tracker model.
Args:
momentums (dict[str:float], optional): Momentums to update ... | 2.4375 | 2 |
test/conftest.py | pauldg/ro-crate-py | 0 | 18408 | # Copyright 2019-2022 The University of Manchester, UK
# Copyright 2020-2022 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2022 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
# Copyright 2022 École Polytechni... | 1.710938 | 2 |
tests/unit/test_marathon.py | seomoz/roger-mesos-tools | 0 | 18409 | <reponame>seomoz/roger-mesos-tools
#!/usr/bin/python
from __future__ import print_function
import unittest
import json
import os
import sys
import requests
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(os.path.realpath(__file__)), os.pardir, "cli")))
from cli.marathon import Marathon
from cli.ap... | 2.484375 | 2 |
1/0/10821/10821.py | chr0m3/boj-codes | 3 | 18410 | <reponame>chr0m3/boj-codes<filename>1/0/10821/10821.py
numbers = list(map(int, input().split(',')))
print(len(numbers))
| 2.625 | 3 |
Chapter13/server.py | Joustie/Mastering-GitLab-12 | 40 | 18411 | <filename>Chapter13/server.py
from flask import Flask, request
import json
app = Flask(__name__)
def runsomething():
print "This is triggered"
@app.route('/',methods=['POST'])
def trigger():
data = json.loads(request.data)
print "New commit by: {}".format(data['commits'][0]['author']['name'])
print "New... | 2.765625 | 3 |
tests/test_nlp4e.py | EDTAKE/IA | 0 | 18412 | <gh_stars>0
import pytest
import nlp
from nlp4e import Rules, Lexicon, Grammar, ProbRules, ProbLexicon, ProbGrammar, E0
from nlp4e import Chart, CYK_parse, subspan, astar_search_parsing, beam_search_parsing
# Clumsy imports because we want to access certain nlp.py globals explicitly, because
# they are accessed ... | 2.359375 | 2 |
integration_test/ESI/cosim/loopback.py | Patosga/circt | 0 | 18413 | #!/usr/bin/python3
import binascii
import random
import cosim
class LoopbackTester(cosim.CosimBase):
"""Provides methods to test the loopback simulations."""
def test_list(self):
ifaces = self.cosim.list().wait().ifaces
assert len(ifaces) > 0
def test_open_close(self):
ifaces = self.cosim.list().... | 2.515625 | 3 |
pcdsdevices/targets.py | christina-pino/pcdsdevices | 3 | 18414 | <reponame>christina-pino/pcdsdevices
"""
Module for common target stage stack configurations.
"""
import logging
import numpy as np
from datetime import datetime
import os
from ophyd.device import Device
import json
import jsonschema
import yaml
from itertools import chain
from pcdsdevices.epics_motor import _GetMoto... | 2.578125 | 3 |
release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/netcmd/time.py | zaion520/ATtomato | 2 | 18415 | <reponame>zaion520/ATtomato<filename>release/src-rt-6.x.4708/router/samba3/source4/scripting/python/samba/netcmd/time.py
#!/usr/bin/env python
#
# time
#
# Copyright <NAME> 2010 <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | 2.546875 | 3 |
tests/job/test_redis.py | ulule/bokchoy | 0 | 18416 | <reponame>ulule/bokchoy<gh_stars>0
import unittest
import redis
import socket
import pytest
from bokchoy.conductors.dummy import DummyConductor
from bokchoy.results.redis import RedisResult
from bokchoy.serializers.json import JSONSerializer
from exam import fixture
from .base import JobTests
def redis_is_availabl... | 2.0625 | 2 |
venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py | realxwx/leetcode-solve | 0 | 18417 | # Copyright (c) 2020
# Author: xiaoweixiang
"""Contains purely network-related utilities.
"""
| 0.878906 | 1 |
server/global_config.py | CLG0125/elemesdk | 1 | 18418 | <gh_stars>1-10
class Global:
sand_box = True
app_key = None
# your secret
secret = None
callback_url = None
server_url = None
log = None
def __init__(self, config):
Global.sand_box = config.get_env()
Global.app_key = config.get_app_key()
Global.secret = conf... | 2.0625 | 2 |
Constants.py | micv-dev/DeepKubeGPUCluster | 2 | 18419 | DEFAULT_KUBE_VERSION=1.14
KUBE_VERSION="kubeVersion"
USER_ID="userId"
DEFAULT_USER_ID=1
CLUSTER_NAME="clusterName"
CLUSTER_MASTER_IP="masterHostIP"
CLUSTER_WORKER_IP_LIST="workerIPList"
FRAMEWORK_TYPE= "frameworkType"
FRAMEWORK_VERSION="frameworkVersion"
FRAMEWORK_RESOURCES="frameworkResources"
FRAMEWORK_VOLUME_SIZE= ... | 1.3125 | 1 |
mpcontribs-portal/mpcontribs/portal/urls.py | fraricci/MPContribs | 0 | 18420 | <reponame>fraricci/MPContribs
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.views.generic.base import RedirectView
from mpcontribs.portal import views
app_name = "mpcontribs_portal"
urlpatterns = [
url(r"^$", views.index, name="index"),
url(r"^healthcheck/?$", views.healthcheck, name="he... | 1.789063 | 2 |
src/mp_api/dielectric/client.py | jmmshn/api | 0 | 18421 | from typing import List, Optional, Tuple
from collections import defaultdict
from mp_api.core.client import BaseRester, MPRestError
import warnings
class DielectricRester(BaseRester):
suffix = "dielectric"
def get_dielectric_from_material_id(self, material_id: str):
"""
Get dielectric data... | 2.640625 | 3 |
docs/example/advanced/view.py | Kozea/Pynuts | 1 | 18422 | from wtforms import TextField, IntegerField, PasswordField
from wtforms.ext.sqlalchemy.fields import (
QuerySelectField, QuerySelectMultipleField)
from wtforms.validators import Required
from pynuts.view import BaseForm
import database
from application import nuts
class EmployeeView(nuts.ModelView):
model = ... | 2.734375 | 3 |
scripts/extract_hit_upstreams.py | waglecn/helD_search | 0 | 18423 | <gh_stars>0
#!/usr/bin/env python3
import sys
from Bio import SeqIO
import os
genome = sys.argv[1]
in_aa = f'hits/{genome}.hits'
in_up = f'fa/{genome}.upstream'
hits = SeqIO.to_dict(SeqIO.parse(in_aa, 'fasta'))
raes = SeqIO.to_dict(SeqIO.parse(in_up, 'fasta'))
for k in hits.keys():
i = k.split('|')[1]
print(raes... | 2.578125 | 3 |
homeassistant/components/airtouch4/climate.py | MrDelik/core | 4 | 18424 | """AirTouch 4 component to control of AirTouch 4 Climate Devices."""
from __future__ import annotations
import logging
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_DIFFUSE,
FAN_FOCUS,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM... | 1.835938 | 2 |
giosgappsdk/giosg_api.py | mentholi/giosgapp-python-sdk | 0 | 18425 | <reponame>mentholi/giosgapp-python-sdk
import json
import requests
class GiosgApiMixin(object):
URL_USERS = '/api/v3/customer/personnel'
URL_CHATS = '/api/v3/chat/chatsessions'
def build_request_url(self, base, page_size=25, page=1):
domain = self.data.get('sub')
return '%s://%s%s?page_si... | 2.28125 | 2 |
Pixelfonts/Delete duplicate components.py | NaN-xyz/Glyphs-Scripts | 1 | 18426 | <gh_stars>1-10
#MenuTitle: Delete Duplicate Components
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Looks for duplicate components (same component, same x/y values) and keeps only one of them.
"""
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def getA... | 2.5 | 2 |
src/structures/Errors.py | Xiddoc/ComPy | 0 | 18427 | """
Error classes, when needed for exceptions.
"""
from _ast import AST
from dataclasses import dataclass, field
from typing import Optional, Union
from src.compiler.Util import Util
@dataclass(frozen=True)
class ObjectAlreadyDefinedError(NameError):
"""
For our compilation scheme, objects can only be define... | 3.890625 | 4 |
github/recorders/github/github_user_info_recorder.py | zvtvz/play-github | 2 | 18428 | # -*- coding: utf-8 -*-
import argparse
from github.accounts.github_account import GithubAccount
from github.domain.github import GithubUser
from github.recorders.github.common import get_result
from zvdata.api import get_entities
from zvdata.domain import get_db_session
from zvdata.recorder import TimeSeriesDataRecor... | 1.953125 | 2 |
pyEDAA/OutputFilter/__init__.py | edaa-org/pyEDAA.OutputFilter | 1 | 18429 |
from pyTooling.Decorators import export
__version__ = "0.1.0"
@export
class Filter:
pass
| 1.421875 | 1 |
tut/app.py | Tyler9937/titanic-test | 0 | 18430 | # Importing needed libraries
import uuid
from decouple import config
from dotenv import load_dotenv
from flask import Flask, render_template, request, jsonify
from sklearn.externals import joblib
import traceback
import pandas as pd
import numpy as np
from flask_sqlalchemy import SQLAlchemy
# Saving DB var
DB = SQLAlc... | 2.515625 | 3 |
trainer.py | thedesertm/leapmotion_training_svm | 0 | 18431 | import pandas as pd
import os
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.model_selection import train_test_split
import pickle
BASE_PATH = os.path.join(os.getcwd() , "dataset")
df = None
i = 0
for file_na... | 2.671875 | 3 |
1 - Data Analysis/2_Analysis - Data Exploration.py | dkim319/NFL_Predictive_Model_v2 | 1 | 18432 | <filename>1 - Data Analysis/2_Analysis - Data Exploration.py
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 14 20:21:23 2017
@author: DKIM
"""
import pandas as pd
import numpy as np
# required libraries loaded
import pandas as pd
import numpy as np
import matplotlib
matplotlib.style.use('ggplot')
import matplotlib.... | 3.625 | 4 |
tests/functional/testplan/test_plan_timeout.py | dobragab/testplan | 0 | 18433 | <reponame>dobragab/testplan
#!/usr/bin/env python
"""Testplan that is expected to time out."""
import sys
import threading
import testplan
from testplan.testing import multitest
@multitest.testsuite
class TimeoutSuite(object):
@multitest.testcase
def blocks(self, env, result):
result.log('Blocking..... | 2.515625 | 3 |
Codefights/arcade/intro/level-2/6.Make-Array-Consecutive-2/Python/solution1.py | RevansChen/online-judge | 7 | 18434 | # Python3
def makeArrayConsecutive2(statues):
return (max(statues) - min(statues) + 1) - len(statues)
| 2.609375 | 3 |
tests/classification_test.py | mjirik/lisa | 22 | 18435 | <filename>tests/classification_test.py
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
# import sys
import os.path
path_to_script = os.path.dirname(os.path.abspath(__file__))
# sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/"))
# sys.path.append(os.path.join(path_t... | 2.453125 | 2 |
application.py | milindvb/python-docs-hello-world | 0 | 18436 | from flask import Flask
# import pyodbc
app = Flask(__name__)
@app.route("/")
def hello():
# Some other example server values are
# server = 'localhost\sqlexpress' # for a named instance
# server = 'myserver,port' # to specify an alternate port
# server = 'tcp:mytest.centralus.cloudapp.azure.com... | 3.109375 | 3 |
basefiles/sweeps/SMTBFsweep.py | hpec-2021-ccu-lanl/simulator | 0 | 18437 | from sweeps.sweepFunctions import *
import numpy as np
def SMTBFSweep(SMTBFSweepInput,ourInput):
myRange = SMTBFSweepInput["range"] if dictHasKey(SMTBFSweepInput,"range") else False
myStickyRange=SMTBFSweepInput["sticky-range"] if dictHasKey(SMTBFSweepInput,"sticky-range") else False
sticky=False if type(... | 2.75 | 3 |
tests/functional_pyecore/regressions/test_issue_34_resolving_pyecore.py | aranega/textX | 4 | 18438 | from __future__ import unicode_literals
import pytest # noqa
import sys
pytestmark = pytest.mark.skipif(sys.version_info[0] < 3,
reason="pyecore is not Python 2 compatible") # noqa
pyecore = pytest.importorskip("pyecore") # noqa
import textx
from textx.metamodel import metamodel_from_... | 2.109375 | 2 |
pylbd/s3_object.py | MacHu-GWU/pylbd-project | 0 | 18439 | # -*- coding: utf-8 -*-
import boto3
from botocore.exceptions import ClientError
import attr
from attrs_mate import AttrsClass
import weakref
@attr.s
class S3Object(AttrsClass):
aws_profile = attr.ib()
bucket = attr.ib() # type: str
key = attr.ib() # type: str
_s3_client_cache = weakref.WeakValueDic... | 2.3125 | 2 |
android_toast/toast.py | ShareASmile/car-locator | 21 | 18440 |
from android.runnable import run_on_ui_thread
from jnius import autoclass, cast
mActivity = autoclass("org.kivy.android.PythonActivity").mActivity
Toast = autoclass("android.widget.Toast")
CharSequence = autoclass("java.lang.CharSequence")
String = autoclass("java.lang.String")
@run_on_ui_thread
def android_toast(t... | 2.8125 | 3 |
ktsp.py | lum4chi/mylearn | 0 | 18441 | #!/usr/bin/env python3
# coding: utf-8
# author: <NAME> <<EMAIL>>
import pandas as pd
import numpy as np
from itertools import islice
from sklearn.utils.validation import check_X_y
class KTopScoringPair:
""" K-Top Scoring Pair classifier.
This classifier evaluate maximum-likelihood estimation for P(X_i <... | 3.296875 | 3 |
picmodels/models/care_advisors/daily_metrics_models/services/read.py | bbcawodu/careadvisors-backend | 0 | 18442 | <reponame>bbcawodu/careadvisors-backend
import datetime
import picmodels.models
from picmodels.models.utils import filter_db_queryset_by_id
from picmodels.models.care_advisors.navigator_models.services.read import filter_navigator_objs_by_f_and_l_name
from picmodels.models.care_advisors.navigator_models.services.read ... | 2.1875 | 2 |
utils.py | YaelMoshe/CSV-Compressor | 0 | 18443 | <reponame>YaelMoshe/CSV-Compressor<gh_stars>0
class CompressorUtils(object):
@staticmethod
def encode(_cell, _list):
if not _cell:
data = "-"
elif _cell not in _list:
data = str(len(_list))
_list.append(_cell)
else:
data = str(_l... | 3 | 3 |
beakerx/beakerx/commands.py | acq/beakerx | 0 | 18444 | <filename>beakerx/beakerx/commands.py
# Copyright 2018 TWO SIGMA OPEN SOURCE, 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
#
# Unl... | 1.96875 | 2 |
attnganw/runner.py | cptanalatriste/AttnGAN | 0 | 18445 | <reponame>cptanalatriste/AttnGAN<gh_stars>0
from datetime import datetime
from typing import List
import dateutil
from datasets import TextDataset
from miscc.config import cfg_from_file, cfg
from torchvision.transforms import transforms
from attnganw.train import GanTrainerWrapper, BirdGenerationFromCaption
def get... | 2.140625 | 2 |
Gds/src/fprime_gds/common/data_types/sys_data.py | m-aleem/fprime | 1 | 18446 | '''
@brief Base class for system data classes.
This class defines the interface for cata classes which are intended to hold
a specific data item (packet, channel, event). This data item includes the time
of the data as well as data such as channel value or argument value.
@date Created July 2, 2018
@author <NAME> (<E... | 2.9375 | 3 |
txdav/carddav/datastore/query/test/test_filter.py | eventable/CalendarServer | 1 | 18447 | ##
# Copyright (c) 2011-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 1.859375 | 2 |
train/erfnet_pspnet_hier33.py | elnino9ykl/Sequential-Hierarchical-ERF-PSPNet | 0 | 18448 | <gh_stars>0
# ERFNet full model definition for Pytorch
# Sept 2017
# <NAME>
#######################
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
class DownsamplerBlock (nn.Module):
def __init__(self, ninput, noutput):
super().__init__()
self.conv... | 2.671875 | 3 |
wsgi.py | nam4dev/evedom_demo | 0 | 18449 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI script
Setup Application, Authentication, ...
"""
import os
from eve import Eve
from evedom import loader
# from your_app.authentication.token import TokenBasedAuth
__author__ = "nam4dev"
__created__ = '08/11/2017'
ROOT_PATH = os.path.dirname(
os.pa... | 2.03125 | 2 |
workflow/migrations/0027_tolausercountryroles_tolauserprogramroles.py | mercycorps/TolaWorkflow | 0 | 18450 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-01-18 17:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('workflow', '0026_auto_20190116_1357'),
]
operation... | 1.71875 | 2 |
set-2/challenge-11.py | natehouk/cryptopals-crypto-challenges-solutions | 0 | 18451 | import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import random
from util.util import pad, detect_aes_ecb, generate_key, ammend_plaintext, encrypt_random
# Chosen plaintext
plaintext = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# Generate data and encrypt plaintext
key = g... | 3.09375 | 3 |
lib/python3.6/site-packages/example/authorize_driver.py | venkyyPoojari/Smart-Mirror | 187 | 18452 | # Copyright (c) 2017 Uber Technologies, Inc.
#
# 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, copy, modify, merge, publ... | 1.84375 | 2 |
orangeplus/OPTICS_w.py | panatronic-git/orange-plus | 0 | 18453 | # -*- coding: utf-8 -*-
""" A data clustering widget for the Orange3.
This is a data clustering widget for Orange3, that implements the OPTICS algorithm.
OPTICS stands for "Ordering Points To Identify the Clustering Structure".
This is a very useful algorithm for clustering data when the dataset is unlabel... | 2.875 | 3 |
message_prototypes/base_message.py | agratoth/py-message-prototypes | 1 | 18454 | import json
from message_prototypes.exceptions import MissingModelException
class BaseMessage:
_serializable_fields = []
def pack(self, unpacking_info=True):
result = {
'_model': self.__class__.__name__,
} if unpacking_info else {}
def serialize_node(node=None):
... | 2.40625 | 2 |
Tests/Methods/Geometry/test_is_inside.py | Eomys/pyleecan | 95 | 18455 | <filename>Tests/Methods/Geometry/test_is_inside.py
# -*- coding: utf-8 -*
import pytest
from pyleecan.Classes.Circle import Circle
from pyleecan.Classes.Segment import Segment
from pyleecan.Classes.SurfLine import SurfLine
# Configuring the test of is_inside
inside_test = list()
# Test 1 : checking if a po... | 3.203125 | 3 |
examples/polling_tweets_example.py | Cheetah97/nitter_scraper | 21 | 18456 | <gh_stars>10-100
import time
from nitter_scraper import NitterScraper
last_tweet_id = None
with NitterScraper(port=8008) as nitter:
while True:
for tweet in nitter.get_tweets("dgnsrekt", pages=1, break_on_tweet_id=last_tweet_id):
if tweet.is_pinned is True:
continue
... | 2.578125 | 3 |
esse/mainapp/migrations/0003_auto_20210225_0350.py | alexeevivan/bookstore | 0 | 18457 | <reponame>alexeevivan/bookstore
# Generated by Django 3.1.6 on 2021-02-25 00:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_typ... | 1.835938 | 2 |
mypo/sampler/__init__.py | sonesuke/my-portfolio | 2 | 18458 | <filename>mypo/sampler/__init__.py
# flake8: noqa
from .sampler import Sampler
| 1.171875 | 1 |
tools/com/test/test_alpha.py | AnthonyEdvalson/Machina | 0 | 18459 | <filename>tools/com/test/test_alpha.py
from tools.com.alpha import Flow, Path
def test_flow():
p = Path("TEST", "layer", ["TASK", "SUB"])
f = Flow(content="abc123", path=p, format="text", a=1, b=7, c="aaaa")
s = str(p).encode() + b"""
text
a: 1
b: 7
c: aaaa
abc123"""
assert f.to_byte... | 2.34375 | 2 |
compile.py | DrSuiunbek/pbc | 0 | 18460 | <reponame>DrSuiunbek/pbc
import argparse
import os
import subprocess
from subprocess import call
def compile_separate():
cmd = "docker run -v " + contractsdir + ":/data ethereum/solc:stable --bin --abi --overwrite -o /data /data/" + filename
print(cmd)
call(cmd, shell=True)
def comile_combined():
cmd... | 2.8125 | 3 |
app/machine_learning/utils.py | jonzxz/project-piscator | 0 | 18461 | <gh_stars>0
import re
import joblib
from sklearn.ensemble import RandomForestClassifier
from typing import List, Tuple
# Cleans up a messed up HTML / tabbed raw content into space delimited content
def clean_up_raw_body(raw_text: str) -> str:
return ' '.join([line.strip() for line in raw_text.strip().splitlines() ... | 2.75 | 3 |
sendgrid_email.py | ssiddhantsharma/open-source-library-data-collector | 0 | 18462 | <reponame>ssiddhantsharma/open-source-library-data-collector
import os
import sendgrid
from sendgrid.helpers.mail import Content, Email, Mail
from bs4 import BeautifulSoup
class SendGrid(object):
"""Send an email through SendGrid"""
def __init__(self):
# Check if we are not in heroku
sendgrid_... | 2.859375 | 3 |
ckilpailija.py | bittikettu/JTimer | 0 | 18463 | <reponame>bittikettu/JTimer<gh_stars>0
import json
class kilpailija:
def __init__(self,etunimi,sukunimi,puhelinnumero,seura,kilpasarja,bibnumber):
self.etunimi = etunimi
self.sukunimi = sukunimi
self.puhelinnumero = puhelinnumero
self.seura = seura
self.kilpasarja = ki... | 2.640625 | 3 |
hessen/frankfurt.py | risklayer/corona-landkreis-crawler | 12 | 18464 | #!/usr/bin/python3
## Tommy
from botbase import *
_frankfurt_st = re.compile(r"Stand:\s*(\d\d?\. *\w+ 20\d\d, \d\d?(?::\d\d)?) Uhr")
def frankfurt(sheets):
import locale
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
soup = get_soup("https://frankfurt.de/service-und-rathaus/verwaltung/aemter-und-instituti... | 2.953125 | 3 |
lib/utils/timeout.py | kustodian/aerospike-admin | 0 | 18465 | # Copyright 2013-2018 Aerospike, 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
#
# Unless required by applicable law or agreed to in writ... | 2.078125 | 2 |
src/myapp/admin.py | anmquangw/viu-upload-file | 0 | 18466 | """from django.contrib import admin
from .models import DemoModel
admin.site.register(DemoModel)"""
| 1.398438 | 1 |
straightlanespipeline.py | semeniuta/CarND-AdvancedLaneLines | 0 | 18467 | import lanelines
from compgraph import CompGraph, CompGraphRunner
import numpy as np
import cv2
func_dict = {
'grayscale': lanelines.grayscale,
'get_image_shape': lambda im : im.shape,
'canny': lanelines.canny,
'define_lanes_region': lanelines.define_lanes_region,
'apply_region_mask': lanelines.ap... | 2.1875 | 2 |
PA1/ArrayListTests/main_create_tests.py | tordisuna/SC-T-201-GSKI | 0 | 18468 | <reponame>tordisuna/SC-T-201-GSKI<gh_stars>0
import random
from random import Random
def write_test_line(f, r, c, clear, o = 0):
f.write("\n")
if(o == 0):
if clear == 0:
o = r.randint(1, 8)
elif clear == 1:
o = 9
else:
o = r.randint(1, 9)
if o =... | 2.953125 | 3 |
stock deep learning/7-2.LSTM(stock).py | nosy0411/Deep-learning-project | 0 | 18469 | # LSTM(GRU) 예시 : KODEX200 주가 (2010 ~ 현재)를 예측해 본다.
# KODEX200의 종가와, 10일, 40일 이동평균을 이용하여 향후 10일 동안의 종가를 예측해 본다.
# 과거 20일 (step = 20) 종가, 이동평균 패턴을 학습하여 예측한다.
# 일일 주가에 대해 예측이 가능할까 ??
#
# 2018.11.22, 아마추어퀀트 (조성현)
# --------------------------------------------------------------------------
import tensorflow as tf
import nump... | 2.96875 | 3 |
media.py | wduncanfraser/movie_trailer_website | 0 | 18470 | """media.py: Module for movie_trailer_website, contains Movie class"""
import webbrowser
import urllib
import json
class Movie(object):
"""This class provides a way to store movie related information.
constructor takes movie title, imdb_id and a url for a youtube trailer as input.
All other values are po... | 3.390625 | 3 |
src/moredataframes/mdf_core.py | GlorifiedStatistics/MoreDataframes | 0 | 18471 | """
A collection of useful functions for manipulating/encoding pandas dataframes for data science.
"""
| 1.796875 | 2 |
superslomo/model.py | myungsub/meta-interpolation | 74 | 18472 | import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from model_utils import *
class down(nn.Module):
"""
A class for creating neural network blocks containing layers:
Average P... | 3.25 | 3 |
adaptfx/discrete_programs/updater_discrete.py | rmnldwg/Adaptive-fractionation | 1 | 18473 | # -*- coding: utf-8 -*-
"""
In this file are all the needed functions to calculate an adaptive fractionation treatment plan. The value_eval and the result_calc function are the only ones that should be used
This file requires all sparing factors to be known, therefore, it isnt suited to do active treatment planning ... | 3.25 | 3 |
ltc/base/admin.py | v0devil/jltom | 4 | 18474 | <gh_stars>1-10
from django.contrib import admin
# Register your models here.
from ltc.base.models import Project, Test, Configuration
# Register your models here.
admin.site.register(Project)
admin.site.register(Test)
admin.site.register(Configuration)
| 1.304688 | 1 |
examples/utils/interaction.py | epuzanov/pivy | 29 | 18475 | import sys
from PySide2.QtWidgets import QApplication
from PySide2.QtGui import QColor
from pivy import quarter, coin, graphics, utils
class ConnectionMarker(graphics.Marker):
def __init__(self, points):
super(ConnectionMarker, self).__init__(points, True)
class ConnectionPolygon(graphics.Polygon):
s... | 2.5625 | 3 |
utils/data_process.py | cltl/a-proof-zonmw | 2 | 18476 | """
Functions used in pre-processing of data for the machine learning pipelines.
"""
import pandas as pd
from pandas.api.types import is_scalar
from pathlib import Path
from sklearn.model_selection import GroupShuffleSplit
def concat_annotated(datadir):
"""
Concatenate all "annotated_df_*_parsed*.pkl" files... | 2.84375 | 3 |
venv/Lib/site-packages/numpy/typing/tests/data/fail/lib_utils.py | ajayiagbebaku/NFL-Model | 11 | 18477 | import numpy as np
np.deprecate(1) # E: No overload variant
np.deprecate_with_doc(1) # E: incompatible type
np.byte_bounds(1) # E: incompatible type
np.who(1) # E: incompatible type
np.lookfor(None) # E: incompatible type
np.safe_eval(None) # E: incompatible type
| 1.875 | 2 |
VoiceAssistant/Project_Basic_struct/speakListen.py | TheRealMilesLee/Python | 1 | 18478 | <filename>VoiceAssistant/Project_Basic_struct/speakListen.py
import time
from colorama import Fore, Back, Style
import speech_recognition as sr
import os
import pyttsx3
import datetime
from rich.progress import Progress
python = pyttsx3.init("sapi5") # name of the engine is set as Python
voices = python.get... | 3.453125 | 3 |
api/krenak_api/apps/activities/migrations/0008_auto_20210506_2357.py | bacuarabrasil/krenak | 0 | 18479 | # Generated by Django 3.1.7 on 2021-05-06 23:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mentorships', '0001_initial'),
('activities', '0007_activity_enrollment'),
]
operations = [
migrati... | 1.546875 | 2 |
Data_pre/encoding_feature.py | KaifangXu/API | 0 | 18480 | import numpy as np
import pandas as pd
from scipy import signal,stats
from flask import Flask,request,jsonify
import json
import re
import os
import data_utils as utils
import sklearn.preprocessing as pre
configpath=os.path.join(os.path.dirname(__file__),'config.txt')
try:
config = utils.py_configs... | 2.453125 | 2 |
src/utils.py | mmin0/SigDFP | 0 | 18481 |
import torch
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.legend_handler import HandlerTuple
from matplotlib.ticker import FormatStrFormatter
#from tqdm import tqdm
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.rc('xtick', labelsize=... | 2.328125 | 2 |
lambdata_doinalangille/__init__.py | doinalangille/lambdata_doinalangille | 0 | 18482 | """
lambdata - a collection of Data Science helper functions
"""
import pandas as pd
import sklearn | 1.679688 | 2 |
jsConsole/__init__.py | Animenosekai/jsConsole | 0 | 18483 | """
pyJsConsole wrapper.
© <NAME> - 2020
"""
from .internal.javascript import classes as JSClass
console = JSClass._Console()
document = JSClass._Document()
history = JSClass._History()
Math = JSClass._Math()
navigator = JSClass._Navigator()
screen = JSClass._Screen()
window = JSClass._Window()
browser = JSClass.Bro... | 2.109375 | 2 |
grr/client/client_actions/file_finder_test.py | panhania/grr | 0 | 18484 | #!/usr/bin/env python
"""Tests the client file finder action."""
import collections
import glob
import hashlib
import os
import platform
import shutil
import subprocess
import unittest
import mock
import psutil
import unittest
from grr.client import comms
from grr.client.client_actions import file_finder as client_f... | 2.078125 | 2 |
lesson13/sunzhaohui/reboot/deploy/models.py | herrywen-nanj/51reboot | 0 | 18485 | <gh_stars>0
from django.db import models
# Create your models here.
from django.db import models
from users.models import UserProfile
class Deploy(models.Model):
STATUS = (
(0, '申请'),
(1, '审核'),
(2, '上线'),
(3, '已取消'),
(4, '已上线'),
(5,'失败')
)
name = models... | 2.140625 | 2 |
config.py | zombodotcom/twitchUserData | 1 | 18486 | Client_ID = "<Your Client ID>"
Authorization = "Bearer <Insert Bearer token Here>" | 1.09375 | 1 |
echo_client.py | gauravssnl/Python3-Network-Programming | 4 | 18487 | import socket
host = 'localhost'
# we need to define encode function for converting string to bytes string
# this will be use for sending/receiving data via socket
encode = lambda text: text.encode()
# we need to define deocde function for converting bytes string to string
# this will convert bytes string sent/reci... | 4.125 | 4 |
my_collection/paxos/proposer.py | khanh-nguyen-code/my-collection | 0 | 18488 | from typing import Optional
from my_collection.paxos.common import NodeId, Router, ProposalId, Value, PrepareRequest, is_majority, PrepareResponse, \
Proposal, ProposeRequest, ProposeResponse, CODE_OK
class Proposer:
node_id: NodeId
acceptor_id_list: list[NodeId]
router: Router
current_proposal_i... | 2.546875 | 3 |
.leetcode/749.contain-virus.py | KuiyuanFu/PythonLeetCode | 0 | 18489 | <filename>.leetcode/749.contain-virus.py
# @lc app=leetcode id=749 lang=python3
#
# [749] Contain Virus
#
# https://leetcode.com/problems/contain-virus/description/
#
# algorithms
# Hard (49.14%)
# Likes: 190
# Dislikes: 349
# Total Accepted: 7.5K
# Total Submissions: 15.2K
# Testcase Example: '[[0,1,0,0,0,0,0,1... | 3.0625 | 3 |
src/robotcontrol.py | social-robotics-lab/dog_sample | 0 | 18490 | <reponame>social-robotics-lab/dog_sample
import json
import os.path
import socket
import subprocess
from pydub import AudioSegment
from typing import Dict, List
class RCClient(object):
"""
RobotControllerを操作するためのクラス
"""
def __init__(self, host:str, speech_port=22222, pose_port=22223, read_port=22224):... | 2.734375 | 3 |
exercises/shortest-path/ShortestPath.py | maxwellmattryan/cs-313e | 1 | 18491 | import math
class Point (object):
# constructor
def __init__ (self, x = 0, y = 0):
self.x = x
self.y = y
# get the distance to another Point object
def dist (self, other):
return math.hypot (self.x - other.x, self.y - other.y)
# string representation of a Point
def __str__ (self):
return ... | 3.890625 | 4 |
Data Analysis/csv remove other label.py | byew/python-do-differernt-csv | 0 | 18492 | import pandas as pd
exa = pd.read_csv('en_dup.csv')
exa.loc[exa['label'] =='F', 'label']= 0
exa.loc[exa['label'] =='T', 'label']= 1
exa.loc[exa['label'] =='U', 'label']= 2
#不读取label2, 只读取0,1标签
exa0 = exa.loc[exa["label"] == 0]
exa1 = exa.loc[exa["label"] == 1]
exa = [exa0, exa1]
exa = pd.concat(exa)
exa.to_csv('... | 2.640625 | 3 |
pySPACE/resources/dataset_defs/stream.py | pyspace/pyspace | 32 | 18493 | <filename>pySPACE/resources/dataset_defs/stream.py
""" Reader objects and main class for continuous data (time series)
Depending on the storage format, the fitting reader is loaded and takes care
of reading the files.
.. todo:: unify with analyzer collection!
eeg source and analyzer sink node should work toge... | 2.765625 | 3 |
tests/base/test_endpoints_authentication.py | rapydo/http-api | 8 | 18494 | from restapi.connectors import Connector
from restapi.env import Env
from restapi.services.authentication import BaseAuthentication, Role
from restapi.tests import API_URI, BaseTests, FlaskClient
from restapi.utilities.logs import log
class TestApp(BaseTests):
def test_no_auth(self, client: FlaskClient) -> None:
... | 2.421875 | 2 |
katsdpscripts/rts_session.py | ska-sa/katsdpscripts | 0 | 18495 | <reponame>ska-sa/katsdpscripts
###############################################################################
# SKA South Africa (http://ska.ac.za/) #
# Author: <EMAIL> #
# Copyright @ 2013 SKA SA. All rights reserved. ... | 2.125 | 2 |
projects/webptspy/apps/account/admin.py | codelieche/testing | 2 | 18496 | # -*- coding:utf-8 -*-
from django.contrib import admin
from .models import UserProfile
# Register your models here.
class UserProfileModelAdmin(admin.ModelAdmin):
"""
用户管理Model
"""
list_display = ('id', 'username', 'nike_name', 'mobile',
'email', 'is_active')
list_filter = ('... | 1.890625 | 2 |
axicli.py | notpeter/AxiDraw_API | 0 | 18497 | '''
axicli.py - Command line interface (CLI) for AxiDraw.
For quick help:
python axicli.py --help
Full user guide:
https://axidraw.com/doc/cli_api/
This script is a stand-alone version of AxiDraw Control, accepting
various options and providing a facility for setting default values.
'''
from axicli.a... | 1.664063 | 2 |
qualification_round_2017/C.py | asukakenji/codejam2018 | 0 | 18498 | # code jam: Qualification Round 2017: Problem C. Bathroom Stalls
def read_int():
return int(raw_input())
def read_int_n():
return map(int, raw_input().split())
def get_y_z(n, k):
if k == 1:
if n & 1 == 0:
# Even Number
return n >> 1, (n >> 1) - 1
else:
... | 3.28125 | 3 |
tests/integration/modules/test_vmc_vm_stats.py | kdsalvy/salt-ext-modules-vmware-1 | 10 | 18499 | """
Integration Tests for vmc_vm_stats execution module
"""
import pytest
@pytest.fixture
def vm_id(salt_call_cli, vmc_vcenter_connect):
ret = salt_call_cli.run("vmc_sddc.get_vms", **vmc_vcenter_connect)
vm_obj = ret.json[0]
return vm_obj["vm"]
def test_get_cpu_stats_for_vm_smoke_test(salt_call_cli,... | 2.234375 | 2 |