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 |
|---|---|---|---|---|---|---|
edafos/soil/__init__.py | nickmachairas/edafos | 0 | 12781551 | <filename>edafos/soil/__init__.py
from .physics import *
from .profile import SoilProfile | 1.179688 | 1 |
Packages/Patterns_Package/setup.py | saribalarakeshreddy/Python-3.9.0 | 0 | 12781552 | <reponame>saribalarakeshreddy/Python-3.9.0
from setuptools import setup,find_packages
classifiers = [
'Development Status :: ',
'Intended Audience :: Education',
'Operating System :: windows 10',
'License :: MIT License',
'Programming Language :: Python :: 3.9.0'
]
setup(
name='Patter... | 1.171875 | 1 |
backend/auth/__init__.py | golani04/bug-tracker | 0 | 12781553 | from fastapi import APIRouter
from backend.auth.login import router
auth_routers = APIRouter()
auth_routers.include_router(router, tags=["Auth"])
| 1.789063 | 2 |
office-plugin/windows-office/program/wizards/common/Properties.py | jerrykcode/kkFileView | 6,660 | 12781554 | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... | 2.5 | 2 |
fedml_core/trainer/model_trainer.py | arj119/FedML | 0 | 12781555 | <filename>fedml_core/trainer/model_trainer.py
from abc import ABC, abstractmethod
import torch
import torch.nn as nn
class ModelTrainer(ABC):
"""Abstract base class for federated learning trainer.
1. The goal of this abstract class is to be compatible to
any deep learning frameworks such as PyTorch... | 3.03125 | 3 |
geartracker/admin.py | pigmonkey/django-geartracker | 1 | 12781556 | from django.contrib import admin
from geartracker.models import *
class ItemAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("make", "model", "size")}
list_display = ('__unicode__', 'type', 'metric_weight', 'acquired')
list_filter = ('archived', 'category', 'type', 'make')
search_fields = ('ma... | 2.015625 | 2 |
viterbi/viterbi.py | cornell-brg/xloops-bmarks | 3 | 12781557 | <filename>viterbi/viterbi.py
#! /usr/bin/python2.6
# Convolutional Encoder and Hard-Decision Viterbi Decoder
# Code and example inspired by the tutorial at
# http://home.netcom.com/~chip.f/viterbi/algrthms.html
import itertools
K = 3
RATE = 1.0/2
POLY = [7, 5]
#******************************************************... | 3.109375 | 3 |
delphi_epidata/request.py | lee14257/delphi-epidata-py | 0 | 12781558 | from datetime import date
from typing import Final, Generator, Sequence, cast, Iterable, Mapping, Optional, Union, List
from json import loads
from requests import Response, Session
from tenacity import retry, stop_after_attempt
from pandas import DataFrame
from ._model import (
EpiRangeLike,
AEpiDataCall,
... | 2.65625 | 3 |
python-package/lets_plot/plot/sampling.py | OLarionova-HORIS/lets-plot | 0 | 12781559 | <reponame>OLarionova-HORIS/lets-plot
#
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
from .core import FeatureSpec
__all__ = ['sampling_random',
'sampling_random_stratified',
'sampling_pick',
'sa... | 2.015625 | 2 |
models/user.py | wimp-project/backend | 0 | 12781560 | from dataclasses import dataclass
from typing import List
from sqlalchemy.orm import relationship
from app import db
from models import Feedback
@dataclass
class User(db.Model):
__tablename__ = 'user'
user_id: int = db.Column(db.Integer, primary_key=True)
name: str = db.Column(db.String(), nullable=Fa... | 2.90625 | 3 |
boa3/neo3/contracts/nef.py | hal0x2328/neo3-boa | 25 | 12781561 | <reponame>hal0x2328/neo3-boa<filename>boa3/neo3/contracts/nef.py
from __future__ import annotations
import hashlib
from typing import Tuple
from boa3.neo3.core import Size as s, serialization, types, utils
class Version(serialization.ISerializable):
"""
Represents the version number of an assembly
"""
... | 2.390625 | 2 |
scplint/scp.py | richardzimmermann/scplint | 2 | 12781562 | import json
import os
from logging import getLogger
from pathlib import Path
from scplint.statement import Statement
logger = getLogger()
class SCP:
def __init__(self, scp: dict, filename: str = 'my_scp',
size_max: int = 5120, minimize: bool = False):
logger.debug('initialize scp')
... | 2.6875 | 3 |
comdirect_api/comdirect_client.py | maxpautsch/comdirect-api-simple | 1 | 12781563 | import requests
import pickle
from comdirect_api.auth.auth_service import AuthService
from comdirect_api.service.account_service import AccountService
from comdirect_api.service.depot_service import DepotService
from comdirect_api.service.document_service import DocumentService
from comdirect_api.service.report_servic... | 2.171875 | 2 |
indicnlp/transliterate/unicode_transliterate.py | shubham303/indic_nlp_library | 432 | 12781564 | <reponame>shubham303/indic_nlp_library
#
# Copyright (c) 2013-present, <NAME>
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
#Program for text written in one Indic script to another based on Unicode mapping... | 2.375 | 2 |
utilities.py | RyanLinXiang/flower-classifier | 0 | 12781565 | <reponame>RyanLinXiang/flower-classifier
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PROGRAMMER: <NAME>
# DATE CREATED: 4th Feb 2020
# REVISED DATE: 05th Feb 2020
# PURPOSE: This file included all the helper functions necessary to save and load the model, as well as process the i... | 2.859375 | 3 |
openneurodata/analyse_ophys.py | seankmartin/NeuralOpenData | 0 | 12781566 | <gh_stars>0
def summarise_single_session(allen_dataset):
## Summary in print
print(
f"-----------Working on image plane {allen_dataset.ophys_experiment_id}"
f"session {allen_dataset.ophys_session_id}------------"
)
print(f"\tThis experiment has metadata {allen_dataset.metadata}")
ce... | 2.65625 | 3 |
teamscale_precommit_client/client_configuration_utils.py | cqse/teamscale-cli | 5 | 12781567 | <gh_stars>1-10
from teamscale_client.teamscale_client_config import TeamscaleClientConfig
def get_teamscale_client_configuration(config_file):
"""Gets a Teamscale client configuration from the provided config file or a config file in the user's home dir
or both combined. This allows users to separate their cr... | 2.40625 | 2 |
class.py | NageshJ2014/TestRepor | 0 | 12781568 | lottery_player = {"name" : "Rolf", "numbers" : (20,40,30,85)}
#print(lottery_player)
class Lottery_player:
def __init__(self,name="Rolf",numbers=(20,40,30,85)):
self.name = name
self.numbers = numbers
def total(self):
return sum(self.numbers)
Player = Lottery_player("Nagesh",(12,24,36,... | 3.375 | 3 |
SVD-example/mnist_training.py | tum-pbs/racecar | 4 | 12781569 | import tensorflow as tf
import numpy as np
import os
import time
import argparse
import imageio
parser = argparse.ArgumentParser()
parser.add_argument("--training", type=int, default=1, help="training or testing")
parser.add_argument("--testdir", type=str, default=None, help="specify log file dir")
parser.add_argument... | 2.390625 | 2 |
anonramblings/ramblings/migrations/0010_post_comment_count.py | emre/anonramblings | 2 | 12781570 | <reponame>emre/anonramblings
# Generated by Django 3.0.6 on 2020-05-17 12:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ramblings', '0009_post_reply_to'),
]
operations = [
migrations.AddField(
model_name='post',
... | 1.5 | 2 |
examples/golf_putting/model_simple.py | mcguenther/ipme | 22 | 12781571 | import pandas as pd
import io
import pymc3 as pm
import arviz as az
from arviz_json import get_dag, arviz_to_json
#Binomial Logistic Regression Model
#Reference: https://docs.pymc.io/notebooks/putting_workflow.html#Logit-model
#data
golf_data = """distance tries successes
2 1443 1346
3 694 577
4 455 337
5 353 208
6 27... | 2.9375 | 3 |
testdatageneration.py | odeliss/wapetex | 0 | 12781572 | from datagenerationpipeline import dataGenerationPipeline
imageDirectory = "\\\\192.168.1.37\\Multimedia\\datasets\\test\\watches_categories\\1"
fileType=".jpg"
pipeline=dataGenerationPipeline(imageDirectory, fileType)
print("[INFO]: There should be 200 images in directory 1")
pipeline.rotate()
#assert there are 10... | 3.0625 | 3 |
backend/uclapi/dashboard/management/commands/clear_dashboard_data.py | nayanadasgupta/uclapi | 0 | 12781573 | from django.core.management.base import BaseCommand
from dashboard.models import User, App, APICall, Webhook, WebhookTriggerHistory
class Command(BaseCommand):
help = 'Cleans Dashboard of everything'
def handle(self, *args, **options):
string = input("THIS WILL WIPE THESE MODELS ARE YOU S... | 2.078125 | 2 |
imcsdk/mometa/memory/MemoryPersistentMemoryDimms.py | ecoen66/imcsdk | 31 | 12781574 | """This module contains the general information for MemoryPersistentMemoryDimms ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class MemoryPersistentMemoryDimmsConsts:
SOCKET_ID_1 = "1"
SOCKET_ID_2 = "2"
SOCKET_ID_... | 1.78125 | 2 |
tensorflow/python/tools/module_util.py | KosingZhu/tensorflow | 190,993 | 12781575 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1.960938 | 2 |
main_num_learners.py | crm416/online_boosting | 56 | 12781576 | <reponame>crm416/online_boosting<filename>main_num_learners.py
import argparse
from random import seed
from yaml import dump
from utils.experiment import testNumLearners
from utils.utils import *
if __name__ == "__main__":
seed(0)
parser = argparse.ArgumentParser(
description='Test error for a combina... | 2.421875 | 2 |
python/packages/nisar/workflows/rdr2geo_runconfig.py | isce3-testing/isce3-circleci-poc | 0 | 12781577 | <gh_stars>0
import journal
from nisar.workflows.runconfig import RunConfig
class Rdr2geoRunConfig(RunConfig):
def __init__(self, args):
# all insar submodules share a commmon `insar` schema
super().__init__(args, 'insar')
if self.args.run_config_path is not None:
self.load_ge... | 2.015625 | 2 |
eelbrain/_wxgui/history.py | christianbrodbeck/Eelbrain | 32 | 12781578 | '''History for wx GUIs'''
# Author: <NAME> <<EMAIL>>
from logging import getLogger
import os
from typing import Optional, Tuple
import wx
from .help import show_help_txt
from .frame import EelbrainFrame
from .utils import Icon
from . import ID
TEST_MODE = False
class CallBackManager:
def __init__(self, keys)... | 2.4375 | 2 |
stevesie/remote_resource.py | Stevesie/stevesie-py | 1 | 12781579 | import os
import re
import json
from typing import Sequence, GenericMeta
from datetime import datetime, date
import dateutil.parser
import inflection
from stevesie import resources
from stevesie.utils import api
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
class RemoteResource(object):
_is_hydrated = False
... | 2.328125 | 2 |
farms2face/payments/apps.py | dev1farms2face/f2f | 0 | 12781580 | <filename>farms2face/payments/apps.py
from __future__ import unicode_literals
from django.apps import AppConfig
class PaymentsConfig(AppConfig):
name = 'payments'
def ready(self):
import payments.signals # noqa
| 1.273438 | 1 |
evaluation_data_purify.py | gucheol/deep-text-recognition-benchmark | 0 | 12781581 | import os
import glob
import shutil
from PIL import Image
# for file_path in glob.glob('./data/evaluation/card_evaluation/*.png'):
# file_name = os.path.basename(file_path)
# if file_name.find(',') >= 0 or file_name.find('@') >=0 or file_name.find('*') > 0 or file_name.find(':') > 0 \
# or file_nam... | 2.703125 | 3 |
clean_aws/compare_format.py | SamuelDiai/Dash-Website | 0 | 12781582 | import time
import pandas as pd
from dash_website.utils.aws_loader import load_excel, load_parquet, load_feather
if __name__ == "__main__":
time_excel = 0
for idx_load_excel in range(10):
start_excel = time.time()
load_excel("xwas/univariate_results/linear_correlations.xlsx")
time_exce... | 2.46875 | 2 |
back/to_do/models.py | valuko/ChiefOnboarding | 0 | 12781583 | from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import JSONField
from django.db import models
from organization.models import BaseTemplate
from misc.models import Content
class ToDo(BaseTemplate):
content = models.ManyToManyField(Content)
due_on_day = models.IntegerField(de... | 2.03125 | 2 |
WebSpider/proxy.py | bianQ/similarweb | 0 | 12781584 | <gh_stars>0
"""
Author : Alan
Date : 2021/7/24 9:39
Email : <EMAIL>
"""
import requests
from retry import retry
from settings import GET_IP_URL, WHITE_URL, USER, PWD
def get_my_ip():
try:
# resp = requests.get('http://myip.top', timeout=2)
resp = requests.get('http://ipinfo.io', timeout=... | 2.65625 | 3 |
countries/auth.py | sinaesmaili216/blog | 0 | 12781585 | import functools
from flask import Blueprint
from flask import flash
from flask import g
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from flask import url_for
from werkzeug.security import check_password_hash
from werkzeug.security import generate_pa... | 2.328125 | 2 |
daily_coding_problem/934.py | mhetrerajat/ds-challenge | 0 | 12781586 | def naive(string: str) -> str:
map = {}
for char in string:
count = map.get(char, 0)
if count >= 1:
return char
else:
map[char] = 1
return None
def get_recurring_char(string: str) -> str:
"""assuming string only contains lowercase letters"""
checker ... | 3.703125 | 4 |
tests/format-keys/examples/test.py | looking-for-a-job/format-keys.py | 0 | 12781587 | <filename>tests/format-keys/examples/test.py
#!/usr/bin/env python
import format_keys
string = "https://api.travis-ci.org/{fullname}.svg?branch={branch}"
keys = format_keys.keys(string)
print(keys)
| 1.828125 | 2 |
flyingcracker/weather/urls.py | grahamu/flyingcracker | 0 | 12781588 | from django.urls import re_path
from . import views
app_name = 'weather'
urlpatterns = [
re_path(r'^$', views.weather, name='root'),
re_path(r'^current/$', views.current, name='current'),
re_path(r'^unitchange/$', views.unit_change, name='unit-change'),
re_path(r'^generate/$', views.generate,... | 1.804688 | 2 |
cmus_scrobbler/cli.py | JosephVSN/cmus-scrobbler | 0 | 12781589 | #!/usr/bin/python
"""Console script for cmus_scrobbler."""
import cmus_scrobbler
import argparse
import sys
def main():
"""Console script for cmus_scrobbler."""
parser = argparse.ArgumentParser()
parser.add_argument('status', nargs='*')
parser.add_argument('-c', '--config', nargs=2, help="Called with t... | 2.484375 | 2 |
salmon/commands.py | elwoodpd/smoked-salmon | 42 | 12781590 | <reponame>elwoodpd/smoked-salmon
import asyncio
import importlib
import os
import html
from urllib import parse
import click
import pyperclip
import salmon.checks
import salmon.converter
import salmon.database
import salmon.play
import salmon.search
import salmon.sources
import salmon.tagger
import salmon.uploader
im... | 2.015625 | 2 |
19-CS-Data-Structures/01_queue/queue.py | shalevy1/data-science-journal | 71 | 12781591 | <gh_stars>10-100
class Queue:
def __init__(self):
self.size = 0
# what data structure should we
# use to store queue elements?
self.storage = LinkedList()
def enqueue(self, item):
self.storage.add_to_tail(item)
self.size += 1
def dequeue(self):
item ... | 4.0625 | 4 |
tests/qos/conftest.py | dmytroxshevchuk/sonic-mgmt | 132 | 12781592 | <gh_stars>100-1000
from .args.qos_sai_args import add_qos_sai_args
from .args.buffer_args import add_dynamic_buffer_calculation_args
# QoS pytest arguments
def pytest_addoption(parser):
'''
Adds option to QoS pytest
Args:
parser: pytest parser object
Returns:
None
... | 1.757813 | 2 |
tool_read_file_to_db/read_file_to_db.py | xuerenlv/PaperWork | 1 | 12781593 | <reponame>xuerenlv/PaperWork<filename>tool_read_file_to_db/read_file_to_db.py
# -*- coding: utf-8 -*-
'''
Created on Oct 16, 2015
@author: nlp
'''
import os
from store_model import Single_weibo_store
import sys
import traceback
reload(sys)
sys.setdefaultencoding('utf8')
if __name__ == '__main__':
filel... | 2.234375 | 2 |
models/toy_models.py | MichaelArbel/GeneralizedEBM | 40 | 12781594 | <filename>models/toy_models.py
from torch import nn
import numpy as np
import torch.nn.functional as F
import torch
from torch.nn.utils import spectral_norm as sn_official
spectral_norm = sn_official
import samplers
import os
class Generator(nn.Module):
def __init__(self, dim=3, device ='cuda'):
super(Gene... | 2.203125 | 2 |
direct_posterior_comparison.py | cunningham-lab/cyclic-gps | 0 | 12781595 | <reponame>cunningham-lab/cyclic-gps
import numpy as np
import torch
from torch.nn import Parameter
from cyclic_gps.models import LEGFamily
import matplotlib.pyplot as plt
DTYPE = torch.double
RANK = 5
PATH_TO_NPY = "../numpy_arrays/"
with open(PATH_TO_NPY + "sample3_ts.npy", "rb") as f:
sample3_ts = np.load(f)
wi... | 2.40625 | 2 |
0350_Intersection_of_Two_Arrays_II.py | 21PIRLO21/LeetCode2020 | 0 | 12781596 | from collections import Counter
# sort
class Solution_1:
def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]:
nums1.sort()
nums2.sort()
res = []
len1 = len(nums1)
len2 = len(nums2)
idx1 = 0
idx2 = 0
whi... | 3.359375 | 3 |
tests/test_validate_quantile_csv_file.py | Serena-Wang/zoltpy | 0 | 12781597 | import json
from unittest import TestCase
from unittest.mock import patch
from zoltpy.covid19 import validate_config_dict, validate_quantile_csv_file
class CdcIOTestCase(TestCase):
"""
"""
def test_validate_quantile_csv_file_calls_validate_config_dict(self):
validation_config = {'target_groups'... | 2.546875 | 3 |
fsm/states/gui.py | nczeak/switchgrass_cv_application | 0 | 12781598 | <gh_stars>0
class WelcomeState:
"""
The welcome state for the application.
""" | 1.195313 | 1 |
tests/test_cell.py | kafonek/gridthings | 2 | 12781599 | import pytest
from gridthings import Cell
# Cells represent individual data points in a grid
# They implement a variety of mathematical dunder methods
# so that they can be compared, sorted, and manipulated
def test_cell_when_equal():
c1 = Cell(y=0, x=0, value="foo")
c2 = Cell(y=0, x=1, value="foo")
# u... | 3.5 | 4 |
conf/twitterbot_config.py | xabrickx/chirping-snoos | 0 | 12781600 | import os
import logging
#[PATHS]
# Paths will be based on the location of this file which is ./conf by default. Adjust accordingly!
FILEPATH = os.path.abspath(os.path.dirname(__file__))
ENV_PATH = FILEPATH + "/env"
#[LOGGING]
LOG_PATH = FILEPATH + "/../logs/"
LOG_FILE = "twitterbot.log"
LOG_LEVEL = logging.DEBUG
... | 2.421875 | 2 |
special_cases.py | GBTAmmoniaSurvey/LineFitting | 0 | 12781601 | #=======================================================================================================================
# an example file on how to build special test/training cubes using nh3_testcube.py
#================================================================================================================... | 2.03125 | 2 |
tests/test_bed_adapter_consumer_kafka_timer.py | ba-tno/python-test-bed-adapter | 1 | 12781602 | <reponame>ba-tno/python-test-bed-adapter
import unittest
import sys
import threading
import time
import logging
import json
sys.path.append("..")
import datetime
from test_bed_adapter.options.test_bed_options import TestBedOptions
from test_bed_adapter import TestBedAdapter
logging.basicConfig(level=logging.INFO)
clas... | 2.375 | 2 |
scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_daemon_server.py | timgates42/trex-core | 956 | 12781603 | #!/usr/bin/python
import outer_packages
import daemon
from trex_server import do_main_program, trex_parser
import CCustomLogger
import logging
import time
import sys
import os, errno
import grp
import signal
from daemon import runner
from extended_daemon_runner import ExtendedDaemonRunner
import lockfile
import errno... | 2.03125 | 2 |
arangodb/tests/test_arangodb.py | OuesFa/integrations-core | 0 | 12781604 | # (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import logging
import os
import mock
import pytest
from requests import HTTPError
from datadog_checks.arangodb import ArangodbCheck
from datadog_checks.dev.http import MockResponse
from datadog_checks.de... | 1.96875 | 2 |
test/db_test/operate_remote_dbs/context_prepare.py | AnonymousAuthor2013/KnowAlpha | 2 | 12781605 | from programmingalpha.DataSet.DBLoader import MongoStackExchange
import programmingalpha
from programmingalpha.Utility.TextPreprocessing import PreprocessPostContent
import json
import logging
import argparse
import tqdm
import multiprocessing
logging.basicConfig(format = '%(asctime)s - %(levelname)s - %(name... | 2.21875 | 2 |
Code/UI/splash_ui.py | jphdotam/Cophy | 0 | 12781606 | from Code.UI.splash_layout import Ui_MainWindow
from Code.UI.label import LabelUI
#from ui.export_ui import ExportUI
#from ui.questionnaire_ui import QuestionnaireUI
from PyQt5 import QtCore
import sys, traceback
if QtCore.QT_VERSION >= 0x50501:
def excepthook(type_, value, traceback_):
traceback.print_exc... | 2.25 | 2 |
nodebox/gui/mac/AskString.py | nodebox/nodebox-pyobjc | 47 | 12781607 | <gh_stars>10-100
__all__ = ["AskString"]
import objc
from Foundation import *
from AppKit import *
# class defined in AskString.xib
class AskStringWindowController(NSWindowController):
questionLabel = objc.IBOutlet()
textField = objc.IBOutlet()
def __new__(cls, question, resultCallback, default="", paren... | 2.140625 | 2 |
REPORT.py | AlexXG0152/HR_report_fill | 0 | 12781608 | <reponame>AlexXG0152/HR_report_fill
import pandas as pd
import os
import time
from mailmerge import MailMerge
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
from docx import Document
from docx.shared import Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH
'''
The idea... | 2.8125 | 3 |
wallsup.py | tonikarppi/wallsup | 0 | 12781609 | <reponame>tonikarppi/wallsup<gh_stars>0
#!/usr/bin/env python3
"""
This is a simple script for the Gnome desktop environment that randomly picks an image
file from a directory tree and sets it as the wallpaper.
"""
import os
import random
import subprocess as sp
from getpass import getuser
from os.path import join
fr... | 2.96875 | 3 |
streaming-mqtt/python-tests/tests.py | JacopoCastello/bahir | 337 | 12781610 | <gh_stars>100-1000
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licens... | 1.921875 | 2 |
Minion/Collectors/Linux_CPU.py | onderogluserdar/boardInstrumentFramework | 16 | 12781611 | <gh_stars>10-100
##############################################################################
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | 2.1875 | 2 |
heyyz/core.py | CarlHey/heyyz | 0 | 12781612 | <gh_stars>0
import heyy
from .dbf_utils import (
dbf2objs,
try_dbf2objs,
str2objs,
read_fields,
compare_fields,
split_multiline,
)
pt = heyy.pt
dbf2objs = dbf2objs
try_dbf2objs = try_dbf2objs
str2objs = str2objs
read_fields = read_fields
compare_fields = compare_fields
split_multiline = split_m... | 1.289063 | 1 |
desktop/core/ext-py/cx_Oracle-6.4.1/samples/tutorial/query_one.py | yetsun/hue | 5,079 | 12781613 | #------------------------------------------------------------------------------
# query_one.py (Section 3.2)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Copyright 2017, 2018, Oracle and/or its affiliat... | 2.390625 | 2 |
bach/tests/unit/bach/test_series.py | objectiv/objectiv-analytics | 23 | 12781614 | """
Copyright 2021 Objectiv B.V.
"""
from typing import List
import pytest
from bach import get_series_type_from_dtype
from bach.expression import Expression
from bach.partitioning import GroupBy
from tests.unit.bach.util import get_fake_df, FakeEngine
def test_equals(dialect):
def get_df(index_names: List[str]... | 2.546875 | 3 |
mpikat/meerkat/apsuse/apsuse_config.py | ewanbarr/mpikat | 2 | 12781615 | """
Copyright (c) 2018 <NAME> <<EMAIL>>
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, publish, distribut... | 1.476563 | 1 |
interpolation.py | DahlitzFlorian/how-to-work-with-config-files-in-python-article-snippets | 0 | 12781616 | <reponame>DahlitzFlorian/how-to-work-with-config-files-in-python-article-snippets<filename>interpolation.py<gh_stars>0
# interpolation.py
from configparser import ConfigParser
from configparser import ExtendedInterpolation
config = ConfigParser(interpolation=ExtendedInterpolation())
config.read("interpolation_config.i... | 2.40625 | 2 |
koronawirus_backend/elastic.py | merito/dokadzwirusem_backend | 0 | 12781617 | <reponame>merito/dokadzwirusem_backend
from datetime import datetime
from elasticsearch import Elasticsearch as ES
class NotDefined:
pass
class Point:
def __init__(self, name, operator, address, opening_hours, lat, lon, point_type, phone, prepare_instruction,
owned_by, waiting_time, doc_id=... | 2.484375 | 2 |
src/experiments/train_common.py | prakashchhipa/Depth-Contrast-Self-Supervised-Method | 0 | 12781618 | <filename>src/experiments/train_common.py
from distutils.log import error
import errno
import numpy as np
import json
import argparse
import time
from tqdm import tqdm
import cv2
import logging
import sys, os
import torch
import torchvision
import torch.nn as nn
from torch import optim
from torch.utils.data import Dat... | 1.960938 | 2 |
therma.py | tomacorp/thermapythia | 3 | 12781619 | #!/Users/toma/python278i/bin/python
# -*- coding: utf-8 -*-
#
import MainWindow
import os
import platform
import sys
from PyQt4.QtGui import (QApplication, QIcon)
__version__ = "1.0.0"
def main():
app = QApplication(sys.argv)
app.setOrganizationName("tomacorp")
app.setOrganizationDomain("tomacorp.com") ... | 2.375 | 2 |
python/scripts/waterfall_viewer/pyPeekTCP_1pol.py | eschnett/kotekan | 19 | 12781620 | <filename>python/scripts/waterfall_viewer/pyPeekTCP_1pol.py
# === Start Python 2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # noqa pylint: disable=W0401, W... | 1.6875 | 2 |
brands/tests/test_views.py | netvigator/auctions | 0 | 12781621 | <filename>brands/tests/test_views.py
# import inspect
import logging
from django.urls import reverse
from psycopg2.errors import UniqueViolation
from core.tests.base import BaseUserWebTestCase
from core.utils import getExceptionMessageFromResponse
from ..models import Brand
from ..v... | 2.359375 | 2 |
LeetCode/Trees and Graphs/117. Populating Next Right Pointers in Each Node II/solution.py | Ceruleanacg/Crack-Interview | 17 | 12781622 | <reponame>Ceruleanacg/Crack-Interview
class TreeLinkNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
self.next = None
class Solution:
# @param root, a tree link node
# @return nothing
def connect(self, root):
if not root:
... | 3.484375 | 3 |
001 - Delete-Clusters.py | georgeeks/mslearn-dp100 | 0 | 12781623 | <reponame>georgeeks/mslearn-dp100<gh_stars>0
# tutorial/99-Delete-clusters.py
from azureml.core import Workspace
from azureml.core.compute import ComputeTarget, AmlCompute
from azureml.core.compute_target import ComputeTargetException
import os
#path = os.path.join(os.getcwd(), 'DP100\.azureml')
ws = Workspace.from_c... | 2.515625 | 3 |
wfpr_modules/github.com/icgc-argo-workflows/data-processing-utility-tools/payload-gen-rna-alignment@0.1.3/main.py | icgc-argo-workflows/rna-seq-alignment | 0 | 12781624 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2021, Ontario Institute for Cancer Research
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the L... | 2.03125 | 2 |
tinier_tim/rebin_psf.py | jiwoncpark/tinier-tim | 0 | 12781625 | # -*- coding: utf-8 -*-
"""Rebinning the PSF
This script rebins the given PSF and stores the rebinned PSFs in the specified directory.
"""
import os
import argparse
import rebinning_utils
def parse_args():
"""Parse command-line arguments
"""
parser = argparse.ArgumentParser()
parser.add_argument('ps... | 3.21875 | 3 |
gen_syscalls.py | HexRabbit/syscall-table | 3 | 12781626 | <filename>gen_syscalls.py
import re, json, ctags
from ctags import CTags, TagEntry
prefix = './linux/'
# file generated by ctags --fields=afmikKlnsStz --c-kinds=+pc -R
tags = CTags(prefix+'tags')
entry = TagEntry()
syscall_tbl = open(prefix+'arch/x86/entry/syscalls/syscall_64.tbl', 'r')
syscall_out = open('www/sysca... | 2.6875 | 3 |
Python2.7-UnpackAndUploadToCOS/index.py | tencentyun/scf-demo-repo | 46 | 12781627 | # -*- coding: utf-8 -*-
#####----------------------------------------------------------------#####
##### #####
##### 使用教程/readme: #####
##### https://cloud.tencent.com/document/product/583/47076 ###... | 1.976563 | 2 |
pyiron/base/job/wrappercmd.py | SanderBorgmans/pyiron | 0 | 12781628 | import sys
import getopt
from pyiron.base.job.wrapper import job_wrapper_function
def command_line(argv):
"""
Parse the command line arguments.
Args:
argv: Command line arguments
"""
debug = False
project_path = None
job_id = None
try:
opts, args = getopt.getopt(argv,... | 2.34375 | 2 |
tabcmd/parsers/edit_site_parser.py | WillAyd/tabcmd | 0 | 12781629 | <gh_stars>0
from .global_options import *
class EditSiteParser:
"""
Parser for the command editsite
"""
@staticmethod
def edit_site_parser(manager, command):
"""Method to parse edit site arguments passed by the user"""
edit_site_parser = manager.include(command)
edit_site_... | 2.84375 | 3 |
worker/crawler.py | gcvalderrama/Palantir | 0 | 12781630 | """
This script extract news information from the local web
"""
import glob
import os
import os.path
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverW... | 3.328125 | 3 |
python/tabuada.py | sswellington/bootcamp | 1 | 12781631 | <reponame>sswellington/bootcamp
#!/bin/python3
valor=6
for n in range(1,11,1):
print(str(valor) + " x " + str(n) + " = " + str((valor*n)))
| 3.609375 | 4 |
pilea/cli.py | hfjn/pilea | 0 | 12781632 | <reponame>hfjn/pilea
from pathlib import Path
import time
import click
from click import ClickException, Context, pass_context
from livereload import Server
from pilea.build_controller import BuildController
from pilea.state import State, pass_state
from shutil import copytree
import os
EXECUTION_PATH = Path(os.getc... | 2.796875 | 3 |
p_050_059/problem58.py | ericgreveson/projecteuler | 0 | 12781633 | <reponame>ericgreveson/projecteuler
from factor_tools import is_prime
def main():
"""
Entry point
"""
num_prime = 3
num_on_diagonals = 1 + 4
size = 3
while num_prime / num_on_diagonals > 0.1:
size += 2
bottom_right = size * size
other_diags = [bottom_right - i * (siz... | 3.421875 | 3 |
hsms/meta/make_sized_bytes.py | Quexington/hsms | 2 | 12781634 | from typing import Any, BinaryIO
from .bin_methods import bin_methods
from .hexbytes import hexbytes
def make_sized_bytes(size):
"""
Create a streamable type that subclasses "hexbytes" but requires instances
to be a certain, fixed size.
"""
name = "bytes%d" % size
def __new__(self, v):
... | 3.109375 | 3 |
niwidgets/__init__.py | lrq3000/niwidgets | 0 | 12781635 | <gh_stars>0
"""
Widgets to visualise neuroimaging data.
For volume images, try import NiftiWidget.
For surface images, try SurfaceWidget.
"""
# import example data
from .exampledata import exampleatlas, examplezmap, examplet1 # noqa
# import widget classes.
from .niwidget_volume import NiftiWidget # noqa
from .niwid... | 1.539063 | 2 |
server/setupdb.py | xhuang98/Dtect | 1 | 12781636 | from flask_sqlalchemy import SQLAlchemy
from api import app, db
from data.models import Authentication, UserLogin
from data.parser import authlogs
from predictions import update_predictions
# create tables
with app.app_context():
db.create_all()
with app.app_context():
entry = UserLogin(
username="adm... | 2.40625 | 2 |
running_modes/reinforcement_learning/core_reinforcement_learning.py | lilleswing/Reinvent-1 | 183 | 12781637 | <gh_stars>100-1000
import time
import numpy as np
import torch
from reinvent_chemistry.utils import get_indices_of_unique_smiles
from reinvent_models.lib_invent.enums.generative_model_regime import GenerativeModelRegimeEnum
from reinvent_models.model_factory.configurations.model_configuration import ModelConfiguration... | 1.796875 | 2 |
lbuild/api.py | fb39ca4/lbuild | 0 | 12781638 | <filename>lbuild/api.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, <NAME>
# All Rights Reserved.
#
# The file is part of the lbuild project and is released under the
# 2-clause BSD license. See the file `LICENSE.txt` for the full license
# governing this code.
import os
import lbuild.envir... | 1.929688 | 2 |
src/scheduler.py | positoro/radioRecorder | 0 | 12781639 | import pandas as pd
import json
import datetime
import subprocess
import localModule
#----
def atting_program(row):
ffmpeg_command_line = 'ffmpeg \
-loglevel error \
-fflags +discardcorrupt \
-i {0} \
-acodec copy \
-movflags faststart \
-vn \
-bsf:a aac_adtstoasc \
-t {1} \
-m... | 2.4375 | 2 |
vpklib.py | victorvde/dota2_nohats | 20 | 12781640 | <filename>vpklib.py
from binary import Struct, Magic, Format, BaseArray, String, Blob, FakeWriteStream
from itertools import count
class VPK(Struct):
def fields(self):
self.F("magic", Magic(b"\x34\x12\xaa\x55"))
self.F("version", Format("I"))
assert self["version"].data == 1
self.F(... | 2.5 | 2 |
pixelssl/task_template/__init__.py | charlesCXK/PixelSSL | 223 | 12781641 | from . import func as func_template
from . import data as data_template
from . import model as model_template
from . import criterion as criterion_template
from . import proxy as proxy_template
__all__ = [
'func_template',
'data_template',
'model_template',
'criterion_template',
'proxy_template',
] | 1.28125 | 1 |
PythonFiles/SUWSS/TDMS/tdmsReader.py | VijayS02/Random-Programming-Items | 0 | 12781642 | <gh_stars>0
"""
import numpy as np
from nptdms import TdmsFile
from nptdms import tdms
filenameS = "24July2018_Intact_1.tdms"
tdms_file = TdmsFile(filenameS)
root_object = tdms_file.object()
for name, value in root_object.properties.items():
print("{0}: {1}".format(name, value))
print(root_object.prope... | 2.265625 | 2 |
CSGLTrader.py | TerrenceHung/CSGLTrader | 0 | 12781643 | <gh_stars>0
import pickle
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support ... | 2.84375 | 3 |
revscoring/revscoring/languages/tests/test_tamil.py | yafeunteun/wikipedia-spam-classifier | 2 | 12781644 | <filename>revscoring/revscoring/languages/tests/test_tamil.py<gh_stars>1-10
import pickle
from nose.tools import eq_
from .. import tamil
from .util import compare_extraction
BAD = [
"பூல்",
"பூலு",
"கூதி",
"தேவுடியாள்",
"தேவடியாள்",
"ஓத்த",
"ஓத்தா",
"சுன்னி",
"சுண்ணி",
"ஓல்",... | 2.203125 | 2 |
test/graph_test.py | luisalves05/dsa-python | 1 | 12781645 | import sys
sys.path.append('..')
import unittest
from graphs.Graph import Graph
class TestGraph(unittest.TestCase):
def setUp(self):
self.G = Graph(5)
self.G.add_edge(1, 2)
self.G.add_edge(1, 3)
self.G.add_edge(1, 4)
self.G.add_edge(2, 4)
self.G.add_edge(... | 3.109375 | 3 |
wherefore/KafkaMessageTracker.py | ess-dmsc/wherefore | 0 | 12781646 | from threading import Thread
from typing import Union, Dict, Optional, Tuple
from datetime import datetime, timedelta, timezone
from enum import Enum, auto
from kafka import KafkaConsumer, TopicPartition
from queue import Queue, Empty, Full
from wherefore.DataSource import DataSource
from wherefore.Message import Messa... | 2.40625 | 2 |
tests/test_mgxs_openmc/test_mgxs_openmc.py | lsder/OpenMOC | 97 | 12781647 | #!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.pardir)
sys.path.insert(0, os.path.join(os.pardir, 'openmoc'))
from testing_harness import MultiSimTestHarness
import openmoc
try:
import openmc.openmoc_compatible
import openmc.mgxs
except:
print("OpenMC could not be imported, it's require... | 1.71875 | 2 |
python/class/foo.py | trammell/test | 0 | 12781648 | #!/usr/bin/env python2.4
"""
"""
class Foo(object):
bar = {}
bar['x'] = "apple"
bar['y'] = "banana"
def __call__(self):
print self.bar['x']
f = Foo()
f()
| 3.6875 | 4 |
django/localConflict/breaking_news/views.py | martinez-zea/localconflict | 1 | 12781649 | <gh_stars>1-10
from breaking_news.models import *
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
def index(request):
n_image = new.objects.filter(image__startswith='img_up').order_by('-whe... | 2.125 | 2 |
cashweb/server/main/__init__.py | jbool24/CashWEB | 0 | 12781650 | # ./server/main/__init__.py
| 1.015625 | 1 |