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 |
|---|---|---|---|---|---|---|
scrapy_toolbox/database.py | IW-Big-Data-Analytics/scrapy-toolbox | 4 | 12769051 | from scrapy import signals
from sqlalchemy import create_engine
from sqlalchemy.engine.url import URL
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_utils import database_exists, create_database
from sqlalchemy.orm import object_mapper
from .mapper import... | 2.4375 | 2 |
test/unit/data_factory.py | JoachimC/magicbox_distance | 0 | 12769052 | from geopy import Point
from magicbox_distance import shapefile, distance
right_angle_start = Point(1.0, 1.0)
right_angle_middle = Point(1.1, 1.0)
right_angle_end = Point(1.1, 1.1)
right_angle_distance = distance.using_latitude_and_longitude(right_angle_start, right_angle_middle) + \
distance.... | 2.90625 | 3 |
src/data/dataset_wrapper.py | vkinakh/scatsimclr | 12 | 12769053 | from typing import Tuple
from torch.utils.data import Dataset
from .datasets import get_dataset
from .augmentor import ContrastiveAugmentor
from .base_dataset_wrapper import BaseDatasetWrapper
class UnsupervisedDatasetWrapper(BaseDatasetWrapper):
"""Dataset wrapper for unsupervised image classification"""
... | 2.796875 | 3 |
setup.py | ameli/gaussian_proc | 0 | 12769054 | <reponame>ameli/gaussian_proc
#!/usr/bin/env python
# SPDX-FileCopyrightText: Copyright 2021, <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileType: SOURCE
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the license found in the LICENSE.txt file in th... | 2.015625 | 2 |
h2o-py/tests/testdir_munging/binop/pyunit_mod.py | ahmedengu/h2o-3 | 6,098 | 12769055 | <gh_stars>1000+
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def frame_as_list():
prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/prostate/prostate.csv.zip"))
(prostate % 10).show()
(prostate[4] % 10).show()
airlines = h2o.import_file(path=pyun... | 2.125 | 2 |
models.py | Pycomet/music-bot | 0 | 12769056 | from dataclasses import dataclass
@dataclass
class User:
id: int
name: str = ""
@dataclass
class Order:
product: str
price: float
price: float
description: str
url: str
data: str
@dataclass
class Product:
name: str
price: float
description: str
url: str
| 2.78125 | 3 |
src/ralph_assets/others.py | mkurek/ralph_assets | 0 | 12769057 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.utils.encoding import smart_str
from ralph_assets.models import Asset, Licence
from ralph_assets.models_assets import MO... | 1.90625 | 2 |
examples/test_simple.py | VStoilovskyi/agent-python-pytest | 85 | 12769058 | <gh_stars>10-100
"""Simple example test."""
def test_simple():
"""Simple example test."""
assert True
| 1.328125 | 1 |
faker/providers/company.py | kaflesudip/faker | 1 | 12769059 | <reponame>kaflesudip/faker
# coding=utf-8
from __future__ import unicode_literals
from . import BaseProvider
class Provider(BaseProvider):
formats = ['{{last_name}} {{company_suffix}}', ]
company_suffixes = ['Ltd', ]
def company(self):
"""
:example 'Acme Ltd'
"""
pattern... | 2.609375 | 3 |
change_detection_pytorch/utils/lr_scheduler.py | yjt2018/change_detection.pytorch | 99 | 12769060 | <gh_stars>10-100
import warnings
from torch.optim.lr_scheduler import ReduceLROnPlateau, _LRScheduler
from torch.optim.optimizer import Optimizer
__all__ = ['GradualWarmupScheduler', 'PolyScheduler']
class GradualWarmupScheduler(_LRScheduler):
"""https://github.com/ildoonet/pytorch-gradual-warmup-lr
Gradual... | 2.25 | 2 |
paper/plot_addmul_performance.py | RobertCsordas/modules | 22 | 12769061 | #!/usr/bin/env python3
from typing import List, Dict
import lib
from lib import StatTracker
from lib.common import group, calc_stat
import collections
import matplotlib.pyplot as plt
import os
plots = collections.OrderedDict()
plots["Full"] = "analyzer/baseline/validation/"
plots["$+$"] = "analyzer/add/validation/"
p... | 2.53125 | 3 |
backend/coreapp/serializers.py | kiwi515/decomp.me | 1 | 12769062 | from rest_framework import serializers
from typing import Optional, TYPE_CHECKING
from .models import Profile, Scratch
from .github import GitHubUser
from .middleware import Request
def serialize_profile(request: Request, profile: Profile):
if profile.user is None:
return {
"is_you": profile =... | 2.171875 | 2 |
spexxy/data/__init__.py | thusser/spexxy | 4 | 12769063 | from .filter import Filter
from .fitsspectrum import FitsSpectrum
from .isochrone import Isochrone, MultiIsochrone
from .losvd import LOSVD
from .lsf import LSF, AnalyticalLSF, EmpiricalLSF
from .resultsfits import ResultsFITS
from .spectrum import Spectrum, SpectrumFits, SpectrumFitsHDU, SpectrumBinTableFITS, Spectrum... | 0.855469 | 1 |
video-streaming/video_streaming/core/constants/status.py | mojtaba-arvin/video-service | 9 | 12769064 | <filename>video-streaming/video_streaming/core/constants/status.py
__all__ = [
'PrimaryStatus',
'InputStatus',
'OutputStatus',
'StopReason'
]
class PrimaryStatus:
QUEUING_CHECKS = "QUEUING_CHECKS"
# one of checks tasks has been started
CHECKING = "CHECKING"
# when all first level ta... | 2.359375 | 2 |
src/appliance-onboarding-script/appliance_setup/pkgs/_az_cli.py | Azure/ArcOnAVS | 0 | 12769065 | <reponame>Azure/ArcOnAVS
#!/usr/bin/python
# This module is wrapper around az cli command execution
# az_cli and az_cli_with_retries are two functions which
# can be used to execute az commands.
import os, subprocess, logging
from ._utils import bytes_to_string
def az_cli (*args):
res = None
try:
cmd... | 2.296875 | 2 |
apps/users/urls.py | lorenz-bienek/drf-saas-starter | 9 | 12769066 | from rest_framework.routers import DefaultRouter
from django.conf.urls import include, url
from .views import UserViewSet
app_name = 'apps.users'
# # Here the comments and activity is added manually by including them under the detail view.
#
# urlpatterns = [
#
# url(
# regex=r'^$',
# view=UserV... | 2.34375 | 2 |
tests/test_powrap.py | deronnax/powrap | 1 | 12769067 | from pathlib import Path
import pytest
import os
from powrap import powrap
FIXTURE_DIR = Path(__file__).resolve().parent
@pytest.mark.parametrize("po_file", (FIXTURE_DIR / "bad" / "glossary.po",))
def test_fail_on_bad_wrapping(po_file, capsys):
assert powrap.check_style([po_file]) == 1
assert str(po_file) ... | 2.3125 | 2 |
src/patteRNA/ScoringManager.py | AviranLab/patteRNA | 12 | 12769068 | import exrex
import logging
import os
import multiprocessing
import numpy as np
from scipy.stats import genlogistic
from scipy.ndimage.filters import median_filter, uniform_filter1d
from functools import partial
from patteRNA.LBC import LBC
from patteRNA import rnalib, filelib, timelib, misclib, viennalib
from tqdm imp... | 1.898438 | 2 |
hardhat/recipes/freefont.py | stangelandcl/hardhat | 0 | 12769069 | import os
from .base import GnuRecipe
class FreeFontRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(FreeFontRecipe, self).__init__(*args, **kwargs)
self.sha256 = '7c85baf1bf82a1a1845d1322112bc6ca' \
'982221b484e3b3925022e25b5cae89af'
self.depends = ['fo... | 2.265625 | 2 |
python/src/model/structure.py | LaudateCorpus1/scalu | 0 | 12769070 |
import src.frontend.utility.utility as utility
import src.model.universe as universe
class rd_obj():
def __init__(self):
self.name = ''
self.declared = False
def declaration_collision(self):
pass
class rd_list(list):
def setup(self, obj_constructor):
self.obj_constructor = obj_constructor
return sel... | 2.4375 | 2 |
get_attribute.py | jalexvig/python_learn | 0 | 12769071 | <filename>get_attribute.py
# __getattr__ is not implemented by default
# __getattribute__ run for every attribute access (w/o looking at attributes on object)
# __getattr__ only run when attribute not found in normal ways
class Foo(object):
def __getattribute__(self, item):
print('Foo called __getattribut... | 3.296875 | 3 |
bitex/api/REST/response.py | ligggooo/quant2018 | 312 | 12769072 | # Import Third-Party
from requests import Response
class APIResponse(Response):
def __init__(self, req_response, formatted_json=None):
for k, v in req_response.__dict__.items():
self.__dict__[k] = v
self._formatted = formatted_json
@property
def formatted(self):
retur... | 2.484375 | 2 |
gluetool_modules_framework/infrastructure/mbs.py | testing-farm/gluetool-modules | 0 | 12769073 | # Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import collections
import urllib
import re
import six
from concurrent.futures import ThreadPoolExecutor, wait
import requests
from jq import jq
import koji
import gluetool
from gluetool import GlueError
from gluetool.action... | 1.742188 | 2 |
map_to_py.py | russhughes/hershey-scripts | 1 | 12769074 | #!/usr/bin/env python3
"""
Convert Hershey data with hmp file to create DrawBot python module file
"""
from struct import pack
import re
from parse import parse
vectors = {}
vectors_count = {}
vectors_used = {}
def hershey_load(glyph_file_name):
"""
Load Hershey glyphs
"""
global vectors, vectors_co... | 3.28125 | 3 |
Assoc/ceas.py | jianTaoLiu-SWJTU2012/taolib | 14 | 12769075 | <filename>Assoc/ceas.py
#!/usr/bin/env python
"""Module Description
Copyright (c) 2008 <NAME> <<EMAIL>>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: ... | 1.921875 | 2 |
historycontrol.py | bixind/JohnReboot | 2 | 12769076 | <reponame>bixind/JohnReboot
import threading
import time
import datetime as dt
import fileparse as fp
historyLock = threading.Lock()
day = 24 * 60 * 60
with historyLock, open('days/lastupdate.txt') as f:
last_update = int(f.readline())
def statusChange(upd):
global last_update
with historyLock:
d... | 2.6875 | 3 |
maskprocessor/__main__.py | Xvezda/python-maskprocessor | 1 | 12769077 | <filename>maskprocessor/__main__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Xvezda <<EMAIL>>
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
from __future__ import absolute_import
from __futu... | 1.4375 | 1 |
examples/print.py | tugboat1039/Form1-Hack | 71 | 12769078 | #!/usr/bin/env python
"""
This is a Python script that prints an FLP
"""
import OpenFL.Printer as P
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Print a .flp")
parser.add_argument('input', metavar='input', type=str,
help='source flp file')
args = parser.... | 2.59375 | 3 |
simplegan/__init__.py | grohith327/EasyGAN | 23 | 12769079 | <filename>simplegan/__init__.py
from simplegan import autoencoder, gan, datasets, losses, metrics
__version__ = "v0.2.9"
| 1.085938 | 1 |
blog/migrations/0004_auto_20200301_1133.py | satyamtiwari1004/incognito-beta | 0 | 12769080 | <filename>blog/migrations/0004_auto_20200301_1133.py
# Generated by Django 3.1 on 2020-03-01 06:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20090101_0253'),
]
operations = [
migrations.AlterField(
mo... | 1.421875 | 1 |
estimate_pass_test.py | FootBrawlers/Passing_Algo | 1 | 12769081 | <reponame>FootBrawlers/Passing_Algo<filename>estimate_pass_test.py
# --------- This script will estimate the best coordinate to pass the ball, if any. ----------------
# here, we are defining some constraints based on field dimensions
maximum_pass_length = 700
ellipse_width_opp_check =40 # 'b'-parameter and 'a' will... | 2.796875 | 3 |
motrackers/detectors/__init__.py | timseifer/mixed_motion_detection | 570 | 12769082 | from motrackers.detectors.tf import TF_SSDMobileNetV2
from motrackers.detectors.caffe import Caffe_SSDMobileNet
from motrackers.detectors.yolo import YOLOv3
| 1.046875 | 1 |
tests/orm/nodes/data/test_array_bands.py | azadoks/aiida-core | 180 | 12769083 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 1.929688 | 2 |
contents/models.py | hafiztsalavin/personal_web | 4 | 12769084 | from django.contrib.auth.models import User
from django.db import models
from PIL import Image
class Profile(models.Model):
contact_no = models.CharField(max_length=20)
address = models.CharField(max_length=200)
image = models.ImageField(help_text='425x425px recommmended', upload_to='profile_pics')
ti... | 2.4375 | 2 |
palindrome_check.py | gtsofa/yt | 0 | 12769085 | <reponame>gtsofa/yt
# palindrome_check.py
# recursion in strings
def isPalindrome(s):
# check if string is a palindrome
def toChars(s):
# convert string to characters
s = s.lower()
ans = ''
for c in s:
if c in 'abcdefghijklmnopqrstuvwxy':
ans = an... | 3.625 | 4 |
pep/MeanComparison2groups.py | Martacsg/Edem2021MDA | 0 | 12769086 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 19 18:29:06 2021
@author: marta
"""
reset -f
import os #sistema operativo
import pandas as pd #gestionar dataframes
import numpy as np # numeric python vectores
import matplotlib.pyplot as plt # graficos
from pandas.api.types import CategoricalDtype #Gest... | 3.421875 | 3 |
data/deu-eng/divide.py | lorylei/DARTS-et | 1 | 12769087 | <filename>data/deu-eng/divide.py
f = open('./deu.txt','r')
fwde = open('./deu.de','w')
fwen = open('./deu.en','w')
lines = [line for line in f.read().split('\n') if line]
for line in lines:
items = line.split('\t')
assert len(items)==3
fwen.write(items[0] + '\n')
fwde.write(items[1] + '\n')
fwde.clos... | 2.8125 | 3 |
talentmap_api/position/migrations/0023_positionbidstatistics_has_handshake_accepted.py | burgwyn/State-TalentMAP-API | 5 | 12769088 | <filename>talentmap_api/position/migrations/0023_positionbidstatistics_has_handshake_accepted.py
# Generated by Django 2.0.4 on 2019-03-11 18:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('position', '0022_positionbidstatistics_has_handshake_offered... | 1.664063 | 2 |
CostControl.py | yusukeyurameshi/CostControlV2 | 0 | 12769089 | #!/usr/bin/python3
##########################################################################
# Tables used:
# - OCI_USAGE - Raw data of the usage reports
# - OCI_USAGE_STATS - Summary Stats of the Usage Report for quick query if only filtered by tenant and date
# - OCI_USAGE_TAG_KEYS - Tag keys of the usage reports
# ... | 1.859375 | 2 |
friendtrend.py | srodriguez1850/friendtrend | 0 | 12769090 | <gh_stars>0
#!/usr/bin/python
import plotly
import plotly.graph_objs as go
import preprocess_data as prepdata
import argparse
import json
import os
from plotly import tools
from collections import defaultdict, Counter
from fnvhash import fnv1a_32
from enum import Enum
## ENUMS ##
class TopKFormat(Enum):
GLOBAL_K ... | 2.078125 | 2 |
SUSOD/config.py | whale-net/SUSOD | 1 | 12769091 | """
SUSOD dev config.
currently not very useful
"""
import os
APPLICATION_ROOT = '/'
SECRET_KEY = b'tobegenerated'
SESSION_COOKIE_NAME = 'login_name'
# Directory for file uploads
# currently not used
UPLOAD_FOLDER = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
'var',
'uploads',
)
... | 1.601563 | 2 |
06/06_P16.py | monikuri/2110101_Com_Prog | 0 | 12769092 | <filename>06/06_P16.py
height_map = [int(e.strip()) for e in input().strip().split(',')]
count = 0
negative = False
for i in height_map:
if i < 0:
negative = True
else:
if negative:
count += 1
negative = False
print(count) | 3.234375 | 3 |
polls/tests.py | davidefabbrico/Progetto_School | 1 | 12769093 | import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse
| 1.375 | 1 |
tests/main_test.py | NaveenKumarGorantla/cs5293sp21-project0 | 0 | 12769094 | import pytest
#from project0 import project0
from project0 import main
def test_fetchincidents():
url = "https://www.normanok.gov/sites/default/files/documents/2021-03/2021-03-03_daily_incident_summary.pdf"
data = main.fetchincidents(url)
assert type(data) == bytes
def test_extractincidents():
url = ... | 2.5 | 2 |
sensor-button/button.py | sahuyash/raspberrypi-examples | 41 | 12769095 | <filename>sensor-button/button.py
"""
read state from buttons using callback functions
"""
import RPi.GPIO as GPIO
btnPin1 = 27
btnPin2 = 22
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(btnPin1, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(btnPin2, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
def event... | 3.421875 | 3 |
options/model_options/__init__.py | chorseng/UMD | 48 | 12769096 | <gh_stars>10-100
from .context_encoder_options import ContextEncoderOption
from .image_encoder_options import ImageEncoderOption, ContextImageEncoderOption, ProductImageEncoderOption
from .mfb_fusion_options import MFBFusionOption, ContextMFBFusionOption, ContextAttentionMFBFusionOption, \
ProductMFBFusionOption, P... | 1.03125 | 1 |
users/serializers.py | nikolamatijas/DjangoAndReact | 0 | 12769097 | from rest_framework import serializers
from users.models import User, Permission, Role
class RoleRelatedField(serializers.RelatedField):
def to_representation(self, instance):
return RoleSerializer(instance).data
def to_internal_value(self, data):
return self.queryset.get(pk=data)
class U... | 2.234375 | 2 |
hphp/tools/benchy/benchy_config.py | ng0ctrinh/hhvm | 1 | 12769098 | #!/usr/bin/env python
"""Configuration loader for benchy benchmark harness.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
def _load():
"""Initializes and returns a singleton config dic... | 2.046875 | 2 |
utils.py | existme/har-to-seq | 0 | 12769099 | import json
def read_json_file(filename):
f = open(filename, 'r')
data = json.load(f)
f.close()
return data
def find_nth(haystack, needle, n):
start = haystack.find(needle)
while start >= 0 and n > 1:
start = haystack.find(needle, start + len(needle))
n -= 1
return start
... | 3.203125 | 3 |
check_diff.py | JoDaTy/pyats-check-os | 6 | 12769100 | <reponame>JoDaTy/pyats-check-os<gh_stars>1-10
import toolbox.pyats_diff as diff
import toolbox.database as db
import argparse
import sys
import json
import pprint
# Parsing the args
description = "Print the differences for a specific test and hostname."
test_help = '''Possible completions:
- route_summary > show ip r... | 2.6875 | 3 |
spotlob/tests/test_feature_filter.py | fa-me/spotlob | 1 | 12769101 | import unittest
import numpy as np
from numpy.testing import assert_array_equal,\
assert_array_almost_equal, assert_almost_equal
from .image_generation import binary_circle_border
from ..spim import Spim, SpimStage
from ..process_opencv import ContourFinderSimple, FeatureFormFilter
class FeatureFil... | 2.453125 | 2 |
cal_different.py | Feobi1999/unbiased-teacher | 0 | 12769102 | <reponame>Feobi1999/unbiased-teacher<filename>cal_different.py
import json
import torch
farea = lambda x: (x[:, 2] - x[:, 0]) * (x[:, 3] - x[:, 1])
def bbox_iou(box1, box2):
area1 = farea(box1)
area2 = farea(box2)
lt = torch.max(box1[:, None, :2], box2[:, :2]) # [N,M,2]
rb = torch.min(box1[:, ... | 1.882813 | 2 |
billboard.py | the-pudding/falsetto-site | 1 | 12769103 | string = "hi there my name is matt"
print(string.count("e"))
| 3.359375 | 3 |
src/setup_custom_envs.py | jqueguiner/ai-api-marketplace- | 0 | 12769104 | #!/usr/bin/env python3
import os
import yaml
rootDir = 'apis'
for dirName, subdirList, fileList in os.walk(rootDir):
if 'env.yaml' in fileList:
print(f"Found env.yaml in {dirName}")
with open(os.path.join(dirName, 'env.yaml'), 'r') as stream:
try:
env_yaml = yaml.s... | 2.375 | 2 |
ros/src/waypoint_updater/waypoint_updater.py | dayuwater/CarND-Capstone | 0 | 12769105 | <gh_stars>0
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from std_msgs.msg import Header
import math
# import a helper module for waypoint updater
import helper
'''
This node will publish waypoints from the car's current position to some `x` d... | 2.921875 | 3 |
script/test_regex_match_dialog.py | cpcgskill/dg_editor | 2 | 12769106 | # -*-coding:utf-8 -*-
u"""
:创建时间: 2021/12/5 1:40
:作者: 苍之幻灵
:我的主页: https://cpcgskill.com
:QQ: 2921251087
:爱发电: https://afdian.net/@Phantom_of_the_Cang
:aboutcg: https://www.aboutcg.org/teacher/54335
:bilibili: https://space.bilibili.com/351598127
"""
from __future__ import unicode_literals, print_function
import imp
i... | 1.945313 | 2 |
problems/problem-2/FibonacciSeries.py | Nimelo/project-euler | 0 | 12769107 | from itertools import takewhile
def fibonacci_series():
last, current = 0, 1
while True:
current, last = current + last, current
yield current
def even_fibonacci_series():
last, current = 0, 1
while True:
current, last = current + last, current
current, last = curre... | 3.921875 | 4 |
UnpairedNumber.py | Cynthyah/Exercises | 0 | 12769108 | <reponame>Cynthyah/Exercises<filename>UnpairedNumber.py
# Find value that occurs in odd number of elements.
# Find the number in an non-empty array that does not have pair
# Array [9,3,9,3,9,7,9] pairs
# A[0] = 9 and A[2] = 9
# A[1] = 3 and A[3] = 3
# A[4] = 9 and A[6] = 9
# A[5] = 7 no pair
# the func... | 4.09375 | 4 |
google/ads/google_ads/v2/proto/services/landing_page_view_service_pb2.py | jiulongw/google-ads-python | 1 | 12769109 | <reponame>jiulongw/google-ads-python
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v2/proto/services/landing_page_view_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import desc... | 1.5625 | 2 |
prodavnica/migrations/0007_auto_20170811_0044.py | astanic1/novi | 0 | 12769110 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-10 22:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('prodavnica', '0006_slika'),
]
operations = [
migrations.RemoveField(
... | 1.328125 | 1 |
__manifest__.py | rocketgithub/hr_expense_invoice | 0 | 12769111 | # -*- coding: utf-8 -*-
{
'name': 'Gastos unidos a facturas',
'version': '1.0',
'category': 'Accounting/Expenses',
'sequence': 6,
'summary': 'Gastos unidos a facturas',
'description': """ Cambios a gastos para unirlas a facturas """,
'website': 'http://aquih.com',
'author': '<NAME>',
... | 0.953125 | 1 |
dbt_sugar/core/clients/dbt.py | badge/dbt-sugar | 0 | 12769112 | <reponame>badge/dbt-sugar
"""Holds methods to interact with dbt API (we mostly don't for now because not stable) and objects."""
import os
from pathlib import Path
from typing import Any, Dict, Optional, Union
from pydantic import BaseModel, Field, root_validator
from dbt_sugar.core.clients.yaml_helpers import open_y... | 2.203125 | 2 |
modules/sbin/get_dataframe.py | BiRG/Omics-Dashboard | 1 | 12769113 | <reponame>BiRG/Omics-Dashboard
#!/usr/bin/env python3
import sys
from os.path import splitext, basename
from omics_dashboard_client.hdf_tools.collection_tools import get_dataframe
filename = sys.argv[1]
numeric_columns = sys.argv[2].lower() == 'true' if len(sys.argv) > 2 else True
include_labels = sys.argv[3].lower()... | 2.515625 | 3 |
assessment/views/custom404.py | kenware/Assessment | 0 | 12769114 | <reponame>kenware/Assessment
from rest_framework import viewsets
from rest_framework.response import Response
class custom404(viewsets.ModelViewSet):
def error_404(self, request):
method = request.method
return Response({
'statusCode': 404,
'error': f'The {method} requ... | 2.34375 | 2 |
datapackage_pipelines/specs/hashers/hash_calculator.py | gperonato/datapackage-pipelines | 109 | 12769115 | <filename>datapackage_pipelines/specs/hashers/hash_calculator.py
import hashlib
from ...utilities.extended_json import json
from ..parsers.base_parser import PipelineSpec
from ..errors import SpecError
from .dependency_resolver import resolve_dependencies
class HashCalculator(object):
def __init__(self):
... | 2.328125 | 2 |
notebooks/universals.py | MikeOMa/MV_Prediction | 1 | 12769116 | METHOD_ORDER = ["NGB", "Indep NGB", "skGB", "GB", "NN"]
METRIC_ORDER = ["NLL", "RMSE", "coverage", "area"] | 1.242188 | 1 |
normbench/testing/test_pyScTransform.py | normjam/benchmark | 18 | 12769117 | <gh_stars>10-100
import numpy as np
from normbench.methods import ad2seurat as a2s
from normbench.methods.data import pbmc3k
def test_pyScTransform():
adata = pbmc3k()
a2s.pyScTransform(adata)
# Test that it runs
assert 'normalized' in adata.layers
# Test functionality
assert np.isclose(adat... | 2.265625 | 2 |
main.py | justinhchae/app_courts | 4 | 12769118 | <filename>main.py
from application.application import Application
if __name__ == '__main__':
app = Application()
def run_app():
app.run_app()
run_app()
| 1.851563 | 2 |
src/gitlab_connection/utils.py | davidkuda/gitlab-api-client | 0 | 12769119 | from typing import List
def transform_vars_data_structure(vars: List[dict]):
"""Transforms the data structure of the dict.
Transforms this:
[{
'environment_scope': '*',
'key': 'DATA',
'masked': False,
'protected': True,
'value': 'Dave',
... | 3.5 | 4 |
Week 3/source.py | SoloSynth1/data-visualization | 0 | 12769120 | <gh_stars>0
# Use the following data for this assignment:
%matplotlib notebook
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import scipy.stats as stats
def get_df(seed_no, index):
np.random.seed(seed_no)
df = pd.DataFrame([np.random.normal(32000,200000,3650),
... | 2.859375 | 3 |
0000_book/wrssystem_cdtype.py | takuya-ki/wrs | 23 | 12769121 | import numpy as np
import modeling.collision_model as cm
import visualization.panda.world as wd
if __name__ == '__main__':
base = wd.World(cam_pos=np.array([.7, .05, .3]), lookat_pos=np.zeros(3))
# object
object_ref = cm.CollisionModel(initor="./objects/bunnysim.stl",
cdp... | 2.328125 | 2 |
HLTrigger/Configuration/python/HLT_75e33/eventsetup/hltESPChi2MeasurementEstimator100_cfi.py | PKUfudawei/cmssw | 1 | 12769122 | import FWCore.ParameterSet.Config as cms
hltESPChi2MeasurementEstimator100 = cms.ESProducer("Chi2MeasurementEstimatorESProducer",
ComponentName = cms.string('hltESPChi2MeasurementEstimator100'),
MaxChi2 = cms.double(40.0),
MaxDisplacement = cms.double(0.5),
MaxSagitta = cms.double(2.0),
MinPtForHit... | 1.257813 | 1 |
test/language/templates/python/StructTemplateInTemplateTest.py | dkBrazz/zserio | 86 | 12769123 | import unittest
import zserio
from testutils import getZserioApi
class StructTemplateInTemplateTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "templates.zs").struct_template_in_template
def testReadWrite(self):
structTemplateInTemplate = self.a... | 2.546875 | 3 |
imax/randaugment.py | 4rtemi5/imax | 16 | 12769124 | # Original Source:
# https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/autoaugment.py
#
# 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 ... | 1.765625 | 2 |
example_config.py | cyprienruffino/CycleGAN-TensorFlow | 2 | 12769125 | import hashlib
from applications import cyclegan_disc, cyclegan_gen_9
from configs.abstract_config import AbstractConfig
from CycleGAN import CycleGANBase
class CustomConfig(AbstractConfig):
def __init__(self, name):
super().__init__(name)
# Edit from here
# Run metadata
self.gp... | 2.390625 | 2 |
core/polyaxon/operations/tuner.py | erexer/polyaxon | 0 | 12769126 | <filename>core/polyaxon/operations/tuner.py
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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/LI... | 1.976563 | 2 |
resippy/photogrammetry/dem/dem_factory.py | BeamIO-Inc/resippy | 11 | 12769127 | from __future__ import division
from resippy.image_objects.earth_overhead.geotiff.geotiff_image_factory import GeotiffImageFactory
from resippy.photogrammetry.dem.geotiff_dem import GeotiffDem
from resippy.photogrammetry.dem.constant_elevation_dem import ConstantElevationDem
class DemFactory:
@staticmethod
d... | 2.09375 | 2 |
pyspec/mockobject.py | jyotijaya/pyspec | 1 | 12769128 | <filename>pyspec/mockobject.py
# -*- coding: ascii -*-
"""PySpec mock objects
"""
__pyspec = 1
import pyspec
import copy
from util import create_method_repr
from pyspec.embedded import config
class MockResult(object):
def __init__(self, parent_method):
self.parent = parent_method
def result(self, r... | 3.03125 | 3 |
socket_client.py | KhalilWong/AIO | 0 | 12769129 | import asyncio
import time
################################################################################
async def main():
reader, writer = await asyncio.open_connection(
'127.0.0.1', 8888
)
while not reader.at_eof():
data = await reader.readline()
print('[{}] Received: {}'.format... | 3.078125 | 3 |
tests/test_optimizers/test_inf_nan.py | Wollala/Gradient-Free-Optimizers | 1 | 12769130 | <gh_stars>1-10
import pytest
import random
import numpy as np
from ._parametrize import optimizers
def objective_function_nan(para):
rand = random.randint(0, 1)
if rand == 0:
return 1
else:
return np.nan
def objective_function_m_inf(para):
rand = random.randint(0, 1)
if rand =... | 2.109375 | 2 |
networks/mocogan.py | maua-maua-maua/nvGAN | 0 | 12769131 | <gh_stars>0
import functools
from typing import Dict, List, Tuple
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from omegaconf import DictConfig, OmegaConf
from torch import Tensor
import dnnlib
from networks.stylegan2 import Discriminator as ImageDiscriminator
from torch_utils... | 1.976563 | 2 |
Day2.2.py | m-berk/AdventOfCode2019 | 1 | 12769132 | Data_File = open("Day2_Data.txt")
Data = Data_File.read()
Data = Data.split(',')
for i in range(len(Data)):
Data[i]=int(Data[i])
Data_Backup = Data.copy()
for noun in range (100):
for verb in range(100):
Data = Data_Backup.copy()
Data[1] = noun
Data[2] = verb
Ind... | 3.25 | 3 |
ISBN.py | Jeet1243/Mathematizer | 0 | 12769133 | # https://www.facebook.com/roshan.philipines/posts/2769055946717382
# Subscribed by Roshaen
#Implementation of ISBN number
def isbn(n):
lst=[]
j=0
for i in range(len(n)):
lst.insert(j,n[i])
j+=1
i=0
sum=0
for i in range(len(lst)):
sum=sum+int(lst[i])*(10-i)
if(sum%1... | 3.65625 | 4 |
bin/sofa_record.py | sjeemb/sofa | 0 | 12769134 | #!/usr/bin/env python3
import numpy as np
import csv
import json
import sys
import argparse
import multiprocessing as mp
import glob
import os
from functools import partial
from sofa_print import *
import subprocess
from time import sleep, time
def sofa_record(command, logdir, cfg):
p_tcpdump = None
p_mpstat... | 2.046875 | 2 |
src/third_party/beaengine/tests/0fc4.py | CrackerCat/rp | 1 | 12769135 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 2.109375 | 2 |
shopping-cart-with-discounts/discounts.py | DeepNinja07x/python | 3 | 12769136 | <reponame>DeepNinja07x/python<gh_stars>1-10
from abc import (ABC, abstractmethod)
from typing import (Dict, List, Optional)
from product import Product
class Discounts():
def __init__(self, discounts: List["BaseDiscount"], available_products: Dict[str, Product]) -> None:
self.discounts = discounts
... | 3.390625 | 3 |
lib/ControlFile.py | cedadev/mistamover | 0 | 12769137 | # BSD Licence
# Copyright (c) 2012, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
from AbstractControlFile import *
class ControlFile(AbstractControlFile):
"""
Simple class to read/write ... | 2.75 | 3 |
tests/test_managers/test_build_job.py | DXist/polyaxon-cli | 0 | 12769138 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from unittest import TestCase
from polyaxon_cli.managers.build_job import BuildJobManager
from polyaxon_cli.schemas import BuildJobConfig
class TestBuildJobManager(TestCase):
def test_default_props(self):
... | 1.773438 | 2 |
src/apps/core/models/publication_model.py | zhiyuli/HydroLearn | 0 | 12769139 | <reponame>zhiyuli/HydroLearn
from django.db import models
from src.apps.core.models.module_models import Module
class Publication(models.Model):
class Meta:
app_label = 'core'
verbose_name_plural = 'Publications'
# map to a user and a module
# user = models.ForeignKey(User, null=False, bl... | 2.28125 | 2 |
pyecore/resources/xmi.py | bmjjr/pyecore | 0 | 12769140 | """
The xmi module introduces XMI resource and XMI parsing.
"""
from enum import unique, Enum
from defusedxml.lxml import _etree as etree
from .resource import Resource
from .. import ecore as Ecore
XSI = 'xsi'
XSI_URL = 'http://www.w3.org/2001/XMLSchema-instance'
XMI = 'xmi'
XMI_URL = 'http://www.omg.org/XMI'
@uniq... | 2.265625 | 2 |
tools/queue_producer.py | saucetray/st2 | 2 | 12769141 | #!/usr/bin/env python
# Copyright 2019 Extreme 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
#
# Unless required by applica... | 2.25 | 2 |
tests/linux_benchmarks/beam_integration_benchmark_test.py | robfrut135/PerfKitBenchmarker | 3 | 12769142 | # Copyright 2014 PerfKitBenchmarker 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 appli... | 1.9375 | 2 |
Config/Defaults.py | jeroanan/Gyroscope | 1 | 12769143 | def get_defaults():
return {
"acceptable_size": 100,
"acceptable_time": 3,
"get_pages": True,
"get_assets": True,
"get_images": True,
"get_scripts": True,
"get_stylesheets": True,
"give_second_chance": True,
"logfile_location": "gyroscope.log",... | 1.570313 | 2 |
django_mobile_app_distribution/admin.py | chingmeng/django-mobile-app-distribution | 38 | 12769144 | <reponame>chingmeng/django-mobile-app-distribution
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.contrib import admin, messages
from django.contrib.auth.models import User
try:
from django.contrib.sites.models import get_current_site
except ImportError:
from djang... | 1.734375 | 2 |
parse.py | starswan/www-hertschess-com | 0 | 12769145 | from utils import commaSep
HEADER_TRANS = { 'TEAM':'Team Name', 'PLAYED':'P', 'WON':'W', 'DRAWN':'D', 'LOST':'L',
'GAMES':'For','POINTS':'Ps', 'POSITION':'Position', 'DIVISION':'Division'}
def celldata(cells, division, index):
if index == 1:
return cells[index].findAll('a')[0].contents[0] + div... | 3.015625 | 3 |
Keras-test/k-mlp-softmax.py | ruanyangry/Keras_NLP_- | 1 | 12769146 | <reponame>ruanyangry/Keras_NLP_-<gh_stars>1-10
# _*_ coding:gbk _*_
'''
Author: <NAME>
Email: <EMAIL>
Reference: https://keras-cn.readthedocs.io/en/latest/getting_started/sequential_model/
'''
import keras
from keras.models import Sequential
from keras.layers import Dense,Dropout,Activation
from keras.op... | 3.359375 | 3 |
cli/src/pcluster/cli/commands/configure/command.py | maclema/aws-parallelcluster | 279 | 12769147 | # Copyright 2013-2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'LICENSE.txt' file ... | 1.9375 | 2 |
src/data/change_only_ypred.py | onurerkin/prohack | 0 | 12769148 | import pandas as pd
import numpy as np
test_submission_guardians_may_24 = pd.read_csv('data/processed/test_submission_guardians_may_24.csv')
two_sub_combined_submission_may_23 = pd.read_csv('data/processed/two_sub_combined_submission_may_23.csv')
two_sub_combined_submission_may_23_y_pred_may_24 = two_sub_combined_... | 2.46875 | 2 |
PE010.py | CaptainSora/Python-Project-Euler | 0 | 12769149 | <reponame>CaptainSora/Python-Project-Euler
from _prime_tools import sieve
def summation_of_primes(ceiling):
"""
Returns the sum of all primes below ceiling.
"""
return sum(sieve(ceiling))
def solve(vol=0):
return summation_of_primes(2 * 10**6)
| 3.53125 | 4 |
examples/joined.py | SilverOS/Silbot-Py | 4 | 12769150 | import silbot
from silbot.helper import InlineKBMarkup, inlineKBRow, inlineKBData
"""
This is an example of how to use new methods added with silbot 1.1
This is a simple bot that will check if a user is in a channel or is admin of that channel
"""
token = "<KEY>" # Put bot token here
channelid = -1001086416281 # Cha... | 2.953125 | 3 |