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 |
|---|---|---|---|---|---|---|
eval/gen_histories.py | DBCobra/CobraBench | 1 | 38800 | <reponame>DBCobra/CobraBench
#!/usr/bin/python
import subprocess
import sys
import os
from gen_config import Config
def set_default(config):
config.set_db('rocksdb')
config.confs['THREAD_NUM'] = 24
config.confs['MAX_FZ_TXN_NUM'] = 20
config.confs['LOCAL_LOG'] = True
config.confs['CLOUD_LOG'] = Fa... | 2.03125 | 2 |
src/backend/api/utils/rclone_connection.py | dtenenba/motuz | 0 | 38801 | from collections import defaultdict
import functools
import json
import logging
import re
import subprocess
import threading
import time
import os
from .abstract_connection import AbstractConnection, RcloneException
class RcloneConnection(AbstractConnection):
def __init__(self):
self._job_status = default... | 2.09375 | 2 |
src/apps/account/test_utils.py | plitzenberger/graphene-auth-examples | 71 | 38802 | import pytest
from django.core import mail
from test_fixtures.users import user
from .utils import send_activation_email, send_password_reset_email
@pytest.mark.django_db
def test_send_activtion_email(user, rf):
request = rf.request()
send_activation_email(user, request)
assert len(mail.outbox) == 1
@... | 2.03125 | 2 |
mmfashion/apis/test_fashion_recommender.py | RyanJiang0416/mmfashion | 952 | 38803 | <reponame>RyanJiang0416/mmfashion<gh_stars>100-1000
from __future__ import division
import torch
from mmcv.parallel import MMDataParallel
from ..datasets import build_dataloader
from .env import get_root_logger
def test_fashion_recommender(model,
dataset,
cf... | 2.140625 | 2 |
pyvx/build_cbackend.py | hakanardo/pyvx | 7 | 38804 | import os
import re
import sys
from cffi import FFI
from pyvx import __backend_version__
mydir = os.path.dirname(os.path.abspath(__file__))
def build(name, openvx_install, default):
pwd = os.getcwd()
os.chdir(os.path.dirname(mydir))
assert name != 'default'
hdr = os.path.join(openvx_install, 'inclu... | 2.234375 | 2 |
t2s/trackinfo.py | frenchytheasian/tracklist-to-spotify | 0 | 38805 | import requests
from bs4 import BeautifulSoup
class TrackInfo:
"""
An object containing track information and operations necessary for
scraping the info off of 1001tracklists.com
"""
def __init__(self, url):
self.url = url
self.tracklist_id = self.url.split('tracklist/')[1].split... | 3.453125 | 3 |
gbmodel/model_sqlalchemy.py | BartMassey/capstone360 | 0 | 38806 | import os
import sys
import datetime
import logging
import traceback
from extensions import db
from sqlalchemy import exc, func
sys.path.append(os.getcwd())
def handle_exception():
# Get exception information
exception_details = sys.exc_info()
# Rollback the db (so the session doesn't crash)
db.sess... | 2.828125 | 3 |
tab2comma.py | Guerillero/GeolocationFun | 1 | 38807 | <gh_stars>1-10
#Converts the geo_data tvs into a more ArcMap friendly csv
import csv
import sys
fin = open('geo_data.tsv', 'r')
fout = open('geo_data.csv', 'w')
csv.field_size_limit(sys.maxsize)
tabfile = csv.reader(fin, dialect=csv.excel_tab)
commafile = csv.writer(fout, dialect=csv.excel)
for row in tabfile:
... | 2.53125 | 3 |
srv/service/__init__.py | mantou22/SC_system | 0 | 38808 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@author:MT
@file:__init__.py.py
@time:2021/8/21 23:02
""" | 1.023438 | 1 |
Python/Introduction/write-a-function.py | lakshika1064/Hackerrank_Solutions-Python | 1 | 38809 | <gh_stars>1-10
def is_leap(year):
leap = False
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
leap = True
else:
leap = False
else:
leap = True
return leap
year = int(input())
print(is_leap(year))
'''
In the G... | 4.21875 | 4 |
systemfixtures/tests/test_users.py | alejdg/systemfixtures | 13 | 38810 | <filename>systemfixtures/tests/test_users.py<gh_stars>10-100
import pwd
from testtools import TestCase
from ..users import FakeUsers
class FakeUsersTest(TestCase):
def setUp(self):
super(FakeUsersTest, self).setUp()
self.users = self.useFixture(FakeUsers())
def test_real(self):
inf... | 2.328125 | 2 |
StatisticalModelling.py | bdolenc/Zemanta-challenge | 0 | 38811 | #The code is published under MIT license.
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn import cross_validation
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import ro... | 2.59375 | 3 |
setup.py | bkbilly/AlarmPI | 55 | 38812 | from setuptools import setup, find_packages
REQUIRES = [
'Flask>=1.1.1',
'Flask-SocketIO>=4.2.1',
'Flask-Login>=0.4.1',
'requests>=2.22.0',
'pytz>=2019.2',
'paho-mqtt>=1.4.0',
'RPi.GPIO>=0.7.0',
]
setup(
name='AlarmPI',
version='4.7',
description='Home Security System',
au... | 1.195313 | 1 |
AntiFire/model_utils.py | MikhailKitikov/AntiFire | 0 | 38813 | from keras.layers.pooling import AveragePooling2D, MaxPooling2D
from keras.applications.mobilenet_v2 import MobileNetV2
from keras.applications.nasnet import NASNetMobile
from keras.applications import ResNet50V2
from keras.layers.core import Dropout
from keras.layers.core import Flatten
from keras.layers.core import D... | 2.59375 | 3 |
test/functional/omni_graceperiod.py | fiscalobject/uniasset | 39 | 38814 | <filename>test/functional/omni_graceperiod.py
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test grace period."""
from test_framework.test_framework... | 2.125 | 2 |
PythonEdition/03_lengthOfLongestSubstring.py | cxiaolong/Algorithm-Practice | 0 | 38815 | <gh_stars>0
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
occ = set()
n = len(s)
max_length = 0
cur = 0
for i in range(n):
if i != 0:
# 左指针向右移动一格,移除一个字符
occ.remove(s[i-1])
while cur < n and s[cur] no... | 3.5 | 4 |
main.py | eternal-forces/profielwerkstuk | 1 | 38816 | import pyglet
import os
from classes.car import Car
from classes.improvedCircuit import circuit
from classes.Vector import Vector2D
### MAIN LOOP
# config = pyglet.gl.Config(sample_buffers=1, samples=4)
window = pyglet.window.Window(resizable=False, width=1920, height=1080, vsync=True)
#inner_points = [[18,3],[8,3],[... | 2.09375 | 2 |
gefen-hdsdi2dvi.py | timvideos/panacontrol | 0 | 38817 | <filename>gefen-hdsdi2dvi.py
#!/usr/bin/python
import fcntl
import struct
import sys
import termios
import time
import math
import os
class SerialPort(object):
def __init__(self, tty_name):
self.tty_name = tty_name
self.tty = None
self.old_termios = None
self.InitTTY()
def __del__(self):
if s... | 2.40625 | 2 |
misc/osutils.py | KartikaySrivadtava/dl-for-har-ea1e9babb2b178cc338dbc72db974325c193c781 | 0 | 38818 | from __future__ import absolute_import
import os
import errno
import numpy as np
def mkdir_if_missing(dir_path):
try:
os.makedirs(dir_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
def get_free_gpu():
os.system('nvidia-smi -q -d Memory |grep -A4 GPU|grep Free >... | 2.78125 | 3 |
docs/constants.py | djangothon/django-mptt-docs | 1 | 38819 | """HackerEarth docs constants"""
DOC_URL_DICT = {
# 'doc_name': 'doc_url1',
# 'doc_name': 'doc_url2',
}
| 1.742188 | 2 |
main.py | wsuzume/proj | 0 | 38820 | import os
import sys
import json
import argparse
script_content = """\
#!/bin/sh
gpython=${PYENV_ROOT}/versions/$(pyenv global)/bin/python
gproj=${PYENV_ROOT}/versions/$(pyenv global)/bin/proj
if [[ $1 =~ ^[^\-] ]] ; then
result=$(exec $gpython $gproj --echo $1)
exit_code=$?
if test $exit_code -eq 0 ; th... | 2.265625 | 2 |
tools_box/tools_box/report/helpdesk_report/helpdesk_report.py | maisonarmani/Tools_Box | 4 | 38821 | # Copyright (c) 2013, <EMAIL> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
def execute(filters=None):
#S/N Date Doc id Request Type Subject Raised By Status Assigned to
columns, data = ["Date:Datetime:200","Doc id:Link/Helpdesk Ticket:200",... | 2.125 | 2 |
relay/__init__.py | ldesgoui/relay | 0 | 38822 | # coding: utf-8
"""
Relay
~~~~~
Relay is an irc micro-framework that smells too much like a web framework
Copyright (c) 2015, ldesgoui <relay at ldesgoui dot xyz>
See LICENSE for more informations.
"""
from collections import defaultdict
import logging
import os
import socket
from . import constants
from . import ... | 2.4375 | 2 |
src/views/panels/grade.py | abelfodil/inf1900-grader | 1 | 38823 | from urwid import Edit, IntEdit, LineBox
from src.models.grade import AssignmentType, grade
from src.models.state import state
from src.views.widgets.form import Form
from src.views.widgets.radio import RadioGroup
class GradePanel(Form):
def __init__(self):
grading_directory = LineBox(Edit(("header", "G... | 2.28125 | 2 |
Python3/no53_Maximum_Subarray.py | mistwave/leetcode | 0 | 38824 | class Solution(object):
def maxSubArray1(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
this = maxsum = 0
for i in range(len(nums)):
this += nums[i]
if this > maxsum:
maxsum = this
elif this < 0:
... | 3.671875 | 4 |
software/stdMac_python/main.py | ATMakersOrg/IKeysAdapter | 0 | 38825 | # Trinket IO demo
# Welcome to CircuitPython 3.1.1 :)
import board
import adafruit_dotstar as dotstar
import time
import busio
import struct
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.mouse import Mouse
from qwertyMAC import *
overlay = webaccess
# One pixel connected internally!
dot = dotstar.DotS... | 2.546875 | 3 |
Drawing Book/code.py | swy20190/HackerRankChallenge | 0 | 38826 | <gh_stars>0
import os
def pageCount(n, p):
# Write your code here
front_flip = int(p/2)
end_flip = int(n/2)-front_flip
return min(front_flip, end_flip)
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input().strip())
p = int(input().strip())
result =... | 2.90625 | 3 |
pylearn2/sampling/replace_samples.py | CKehl/pylearn2 | 0 | 38827 | <gh_stars>0
'''
Created on Apr 16, 2015
@author: christian
'''
from optparse import OptionParser
import numpy
import os
from os import listdir
from os.path import isfile, join
import cPickle
import glob
def unpickle(file):
fo = open(file, 'rb')
dictionary = cPickle.load(fo)
fo.close()
return diction... | 2.125 | 2 |
GAN/CGAN/cgan_mnist.py | fengjiran/scholar_project | 3 | 38828 | from __future__ import division
import numpy as np
from keras.models import Model, Sequential
from keras.optimizers import SGD, Adam
from keras.layers import Input, Dense, Dropout, LeakyReLU, concatenate
from keras.layers.normalization import BatchNormalization
from keras.regularizers import l1, l1_l2
from keras... | 2.453125 | 2 |
user/migrations/0002_auto_20200816_0510.py | moewahed/trade_cycle | 0 | 38829 | <filename>user/migrations/0002_auto_20200816_0510.py
# Generated by Django 2.2 on 2020-08-16 02:10
import django.core.validators
from django.db import migrations, models
import user.model_addon
class Migration(migrations.Migration):
dependencies = [
('user', '0001_initial'),
]
operations = [
... | 1.851563 | 2 |
App/migrations/0001_initial.py | GnomGad/BackendDjangoTodoServer | 0 | 38830 | # Generated by Django 3.0.6 on 2020-07-10 22:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Person',
fields=[
... | 1.851563 | 2 |
tinybot/user.py | codymcelroy/Tinyman-Bot | 0 | 38831 | <filename>tinybot/user.py
from algosdk import mnemonic
from tinyman.v1.client import TinymanMainnetClient
import os
from dotenv import load_dotenv
#Creating Tinyman client object
class User:
def __init__(self) -> None:
pass
def load_env_key(environment_key):
load_dotenv()
env_key = ... | 2.859375 | 3 |
graphgallery/nn/models/pytorch/autoencoder/__init__.py | TobiasSchmidtDE/GraphGallery | 0 | 38832 | <filename>graphgallery/nn/models/pytorch/autoencoder/__init__.py<gh_stars>0
from .decoder import InnerProductDecoder
from .autoencoder import AutoEncoder
from .loss import BCELoss
from .gae import GAE
from .vgae import VGAE
| 1.132813 | 1 |
ad_api/api/sb/bid_recommendations.py | mkdir700/python-amazon-ad-api | 12 | 38833 | <reponame>mkdir700/python-amazon-ad-api
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
class BidRecommendations(Client):
"""
Use the Amazon Advertising API for Sponsored Brands for campaign, ad group, keyword, negative keyword, drafts, Stores, landing pages, and Brands management o... | 2.375 | 2 |
rrt.py | dixantmittal/vanilla-rrt-and-variants | 10 | 38834 | import numpy as np
import networkx as nx
from commons import *
from tqdm import tqdm
def apply_rrt(state_space, starting_state, target_space, obstacle_map, granularity=0.1, d_threshold=0.5,
n_samples=1000, find_optimal=True):
tree = nx.DiGraph()
tree.add_node(starting_state)
final_state = N... | 2.53125 | 3 |
migrations/versions/b829c4a4c128_add_sign_hash_table.py | rivendale/ethsigns | 1 | 38835 | """add-sign-hash-table
Revision ID: b829c4a4c128
Revises: cc<PASSWORD>
Create Date: 2021-05-25 16:04:18.028626
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b829c4a4c128'
down_revision = 'cc5dce03ad39'
branch_labels = None
depends_on = None
def upgrade():
... | 1.71875 | 2 |
tests/util/test_json_stream.py | MatthiasLohr/bfebench | 0 | 38836 | # This file is part of the Blockchain-based Fair Exchange Benchmark Tool
# https://gitlab.com/MatthiasLohr/bfebench
#
# Copyright 2021-2022 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | 2.046875 | 2 |
python-objects_statements_and_data_structures-practice-master/even_in_range.py | valcal/python_practice | 0 | 38837 | <reponame>valcal/python_practice
"""
EVEN IN RANGE: Use range() to print all the even numbers from 0 to 10.
"""
for number in range(11):
if number % 2 == 0:
if number == 0:
continue
print(number)
| 4.03125 | 4 |
DummyTile.py | godesab/minesweep | 0 | 38838 | # -*- coding: utf-8 -*-
class DummyTile:
def __init__(self, pos, label=None):
self.pos = pos
# Label tells adjacent mine count for this tile. Int between 0...8 or None if unknown
self.label = label
self.checked = False
self.marked = False
self.adj_mines = None
... | 3.390625 | 3 |
ameilisearch/_httprequests.py | SaidBySolo/ameilisearch | 0 | 38839 | <reponame>SaidBySolo/ameilisearch
import json
from typing import Any, Dict, List, Optional, Type, Union
from types import TracebackType
from aiohttp.client_reqrep import ClientResponse
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from aiohttp.client import ClientCo... | 2.296875 | 2 |
cuida24/backend/cuida24/services_habits.py | afonscosta/LEI_1819 | 0 | 38840 | from django.utils import timezone
from django.shortcuts import get_object_or_404
from backend.cuida24.serializers import *
logger = logging.getLogger("mylogger")
def habitsFrontToBackJSON(request_data, user):
request_data['caregiver'] = get_object_or_404(Caregiver, info=user.pk).pk
return request_data
def ... | 2.078125 | 2 |
tests/acceptance/features/component/environment.py | AlvaroVega/fiware-facts | 1 | 38841 | <reponame>AlvaroVega/fiware-facts
# -*- coding: utf-8 -*-
#
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is parpt of FI-WARE project.
#
# 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... | 1.164063 | 1 |
savu/plugins/azimuthal_integrators/pyfai_azimuthal_integrator.py | malte-storm/Savu | 1 | 38842 | <reponame>malte-storm/Savu
# Copyright 2014 Diamond Light Source Ltd.
#
# 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... | 1.875 | 2 |
Exercise/t4.py | Twenkid/Python-Various | 0 | 38843 | <filename>Exercise/t4.py
#t4.py
def kaka(a):
print(a*465546 + 2342) | 1.398438 | 1 |
config.py | paris3200/flask-inventory | 6 | 38844 | <filename>config.py
# config.jinja2
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig(object):
"""Base configuration."""
SECRET_KEY = '<KEY>'
DEBUG = False
BCRYPT_LOG_ROUNDS = 13
WTF_CSRF_ENABLED = True
DEBUG_TB_ENABLED = False
DEBUG_TB_INTERCEPT_REDIRECTS = ... | 2.125 | 2 |
ensysmod/model/ts_capacity_max.py | NOWUM/EnSysMod | 1 | 38845 | <filename>ensysmod/model/ts_capacity_max.py
from sqlalchemy import Column, PickleType
from ensysmod.database.base_class import Base
from ensysmod.database.ref_base_class import RefCRBase
class CapacityMax(RefCRBase, Base):
max_capacities = Column(PickleType, nullable=False)
| 2.3125 | 2 |
ui/AterAuiNotebook.py | yeweiasia/ater | 2 | 38846 | <filename>ui/AterAuiNotebook.py
import time
import wx.aui as aui
from SessionManager import SessionManager
class AterAuiNotebook(aui.AuiNotebook):
def __init__(self, parent):
aui.AuiNotebook.__init__(self, parent=parent)
self.parent = parent
self.default_style = aui.AUI_NB_TOP | aui.AUI_NB... | 2.484375 | 2 |
pyyeti/cla/_rptpct1.py | twmacro/pyye | 0 | 38847 | # -*- coding: utf-8 -*-
"""
Low level tool for writing percent difference reports. Typically, this
is called via: :func:`cla.DR_Results.rptpct`.
"""
from io import StringIO
from types import SimpleNamespace
import warnings
import numpy as np
import matplotlib.pyplot as plt
from pyyeti import ytools, locate, writer
from... | 2.421875 | 2 |
python/run_selective_universal.py | rwightman/pytorch-nips2017-adversarial | 17 | 38848 | import argparse
from attacks.image_save_runner import ImageSaveAttackRunner
from attacks.selective_universal import SelectiveUniversal
from dataset import Dataset
from models import create_ensemble
from models.model_configs import config_from_string
parser = argparse.ArgumentParser(description='Defence')
parser.add_a... | 2.25 | 2 |
py-fedex/pyfedex/location_service_v11.py | QwadwoNyamekye/purplship-carriers | 2 | 38849 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Fri Mar 6 15:54:36 2020 by generateDS.py version 2.35.15.
# Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) [Clang 6.0 (clang-600.0.57)]
#
# Command line options:
# ('--no-namespace-defs', '')
# ('-o', './python/location_service_v... | 1.882813 | 2 |
context_cache/context_cache.py | tervay/the-blue-alliance | 266 | 38850 | from google.appengine.ext import ndb
CACHE_DATA = {}
def get(cache_key):
full_cache_key = '{}:{}'.format(cache_key, ndb.get_context().__hash__())
return CACHE_DATA.get(full_cache_key, None)
def set(cache_key, value):
full_cache_key = '{}:{}'.format(cache_key, ndb.get_context().__hash__())
CACHE_DA... | 2.4375 | 2 |
pytma/Sentiment.py | aloidia-solutions/nlp-modelling | 1 | 38851 | <reponame>aloidia-solutions/nlp-modelling<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import nltk
from nltk.tokenize import word_tokenize
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from pytma.Utility import log
class Sentiment:
"""
Sentiment analyzer. Supervised via NaiveBa... | 3.015625 | 3 |
aiida_castep/calculations/tools.py | asamli/aiida-castep | 3 | 38852 | """
Tools for calculations
"""
import warnings
from aiida.tools import CalculationTools
from aiida.common import InputValidationError
from aiida.orm import CalcJobNode, Dict
from aiida.common.links import LinkType
from aiida.plugins import DataFactory
from aiida.engine import CalcJob, ProcessBuilder
from aiida_castep... | 2.078125 | 2 |
apps/addons/tests/test_search.py | muffinresearch/addons-server | 1 | 38853 | from nose.tools import eq_
import amo.tests
from addons.models import (Addon, attach_categories, attach_tags,
attach_translations)
from addons.search import extract
class TestExtract(amo.tests.TestCase):
fixtures = ['base/users', 'base/addon_3615']
def setUp(self):
super(T... | 2.125 | 2 |
src/beanmachine/applications/hme/interface.py | horizon-blue/beanmachine-1 | 177 | 38854 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Tuple
import pandas as pd
from .configs import InferConfig, ModelConfig
from .null_mixture_model import NullMixtureMixe... | 2.453125 | 2 |
python-examples/bulk/bulk_send_complex.py | ryan-lydz/socketlabs-python | 10 | 38855 | <reponame>ryan-lydz/socketlabs-python<filename>python-examples/bulk/bulk_send_complex.py<gh_stars>1-10
import json
import os
from socketlabs.injectionapi import SocketLabsClient
from socketlabs.injectionapi.message.__imports__ import \
Attachment, BulkMessage, BulkRecipient, CustomHeader, EmailAddress
# build th... | 2.859375 | 3 |
input_tests.py | KittyKuttleFish/Python | 0 | 38856 | <reponame>KittyKuttleFish/Python
test = input("Please enter any string for input testing:")
print("Testing String...")
import time
time.sleep(5)
if(test)
| 3.21875 | 3 |
model.py | hafezgh/music_classification | 1 | 38857 |
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import torchvision
import torch
from torchvision import models, datasets
class CRNN_Base(nn.Module):
def __init__(self, class_num, c, h, w, k, filters, poolings, dropout_rate, g... | 2.671875 | 3 |
tests/utils/test_string_utils.py | PeterSulcs/mlflow | 10,351 | 38858 | <filename>tests/utils/test_string_utils.py
import pytest
from mlflow.utils.string_utils import strip_prefix, strip_suffix, is_string_type
@pytest.mark.parametrize(
"original,prefix,expected",
[("smoketest", "smoke", "test"), ("", "test", ""), ("", "", ""), ("test", "", "test")],
)
def test_strip_prefix(origi... | 2.734375 | 3 |
api/migrations/0002_auto_20181108_2243.py | apigram/jade-api | 0 | 38859 | <filename>api/migrations/0002_auto_20181108_2243.py
# Generated by Django 2.1.3 on 2018-11-08 11:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='company'... | 1.609375 | 2 |
argueserver/plugins/arguments.py | UKPLab/argotario | 8 | 38860 | <filename>argueserver/plugins/arguments.py
import interfaces
import random
import pymongo
class Arguments(interfaces.Plugin):
"""
The plugin for the collection arguments
"""
#follows the links and resolves them
def kraken(self, arg):
"""
get all linked documents and append them t... | 3.171875 | 3 |
predictions/dota_predictor.py | LavinaVRovine/hazard | 1 | 38861 | import pandas as pd
from sqlalchemy import create_engine
from config import DATABASE_URI
from predictions.common_predictor import CommonPredictor
pd.set_option("display.width", 1000)
pd.set_option("display.max_columns", 50)
class DotaPredictor(CommonPredictor):
def __init__(self, debug: bool = False):
su... | 2.53125 | 3 |
sphinxcontrib/gitloginfo/__init__.py | TYPO3-Documentation/sphinxcontrib-gitloginfo | 0 | 38862 | <reponame>TYPO3-Documentation/sphinxcontrib-gitloginfo
"""
sphinxcontrib.gitloginfo
~~~~~~~~~~~~~~~~~~~~~~~~
Provide properties obtained from git log
:copyright: Copyright 2020 by <NAME> <<EMAIL>>
:license: MIT, see LICENSE for details.
"""
import datetime
import io
import json
import sys
from o... | 1.757813 | 2 |
train/train.py | sjtu-tcloud/Tiny-OFA | 0 | 38863 | <reponame>sjtu-tcloud/Tiny-OFA
import argparse
import torch.distributed as dist
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import test # import test.py to get mAP after each epoch
from models import *
from utils.dataset import *
from utils.utils import *
from mymodel import *
wdir ... | 1.9375 | 2 |
client.py | BrenndonCJ/GUI_Chat_MultiClient_Python | 0 | 38864 | <filename>client.py<gh_stars>0
import sys
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from frontend.tela_login import *
from frontend.tela_chat import *
class TelaXat(QMainWindow):
def __ini... | 2.40625 | 2 |
server/serv.py | pdeutsch/RobotVisionSim | 0 | 38865 | <filename>server/serv.py
import time
from networktables import NetworkTables
#NetworkTables.initialize()
#NetworkTables.startServer(persistFilename='networktables.ini', listenAddress='localhost', port=8123)
NetworkTables.startServer()
print('isServer:{}'.format(NetworkTables.isServer()))
t = NetworkTables.getTable(... | 2.84375 | 3 |
diet/urls.py | EspeIgira/Health-Diet | 0 | 38866 | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url('^$',views.diet,name = 'diet'),
url('^$',views.health_of_day,name='healthToday'),
url(r'^search/', views.search_results, name='search_results'),
url(r'... | 1.921875 | 2 |
tests/data/samplecfg.py | glebshevchukk/gradslam | 1,048 | 38867 | import os
import sys
from gradslam.config import CfgNode as CN
cfg = CN()
cfg.TRAIN = CN()
cfg.TRAIN.HYPERPARAM_1 = 0.9
| 1.226563 | 1 |
whendidit/tests/test_happen.py | RyanSkraba/whendidit | 1 | 38868 | <gh_stars>1-10
import os
import tempfile
from unittest import TestCase
import avro
import whendidit
class TestHappen(TestCase):
def test_adds_to_file(self):
with tempfile.TemporaryDirectory() as tmp_dir:
filename = os.path.join(tmp_dir, 'events.avro')
# Add one event to the file... | 2.6875 | 3 |
hackerrank/Python/Hex Color Code/test.py | ATrain951/01.python-com_Qproject | 4 | 38869 | <reponame>ATrain951/01.python-com_Qproject
import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'11',
'#BED',
'{',
' color: #FfFdF8; background-color:#aef;',
... | 2.734375 | 3 |
minos/tests/model/parameters_test.py | qorrect/sisy | 6 | 38870 | <reponame>qorrect/sisy
'''
Created on Feb 7, 2017
@author: julien
'''
import unittest
from keras.layers.core import Dense
from minos.experiment.experiment import ExperimentParameters, Experiment,\
check_experiment_parameters, InvalidParametersException
from minos.experiment.training import Training
from minos.mo... | 1.953125 | 2 |
agent/adapters/opencog/relex/__init__.py | akolonin/singnet | 0 | 38871 | <reponame>akolonin/singnet<filename>agent/adapters/opencog/relex/__init__.py
#
# adapters/opencog/relex/__init__.py - an AI adapter that integrates the relex natural language parser...
#
# Copyright (c) 2017 SingularityNET
#
# Distributed under the MIT software license, see LICENSE file.
#
import logging
from typing i... | 2.03125 | 2 |
oompa/tracking/github/GitHubNeo.py | sjtsp2008/oompa | 2 | 38872 | #
# GitHubNeo.py
#
# note: i tried using bulbs, which would be easier to
# migrate to other tinkerpop graph engines, but had
# trouble authenticating
#
#
"""
package oompa.tracking.github
experiments with working on github graphs in neo
uses py2neo
TODO: i think bulb seems to have better object modeling... | 2.203125 | 2 |
tests/dummy_cell_env.py | pktl/distributed_game_of_life | 0 | 38873 | from src.dgol_worker.cell_env import CellEnv
ce = CellEnv() | 1.179688 | 1 |
webServ/app.py | harryparkdotio/dabdabrevolution | 9 | 38874 | from flask import Flask, Response, send_from_directory
import random, time
app = Flask(__name__, static_folder='www')
@app.route('/')
def index():
return ''
@app.route('/stream')
def stream():
def event():
while True:
yield "data: " + random.choice(['a', 'b', 'c', 'd']) + "nn"
with app.app_context():
ti... | 2.59375 | 3 |
scripts/jandan_crawler.py | 920671233/SpiderItems | 0 | 38875 | <gh_stars>0
import re
import urllib.request
from urllib.error import URLError
def crawl():
html = urllib.request.urlopen('http://jandan.net/page/1').read()
html = str(html)
pattern1 = '<div id="content">.*<div class="post f" style="padding-left:210px;">'
result1 = re.compile(pattern1).findall(html)
... | 2.96875 | 3 |
SRC/Chapter_03-When-Object-Are-Alike/supplier.py | eminemence/python3_OOPs | 0 | 38876 | import contact
class Supplier(contact.Contact):
def order(self, order):
print(
"If this were a real system we would send"
"{} order to {}".format(order, self.name)
)
| 3.078125 | 3 |
gamestate/Main.py | skitter30/modbot | 2 | 38877 | <filename>gamestate/Main.py<gh_stars>1-10
from GameState import GameState, Game
from Component import Component
def main():
# Testing code
"""
game = Game('large_normal_186')
game.load_events()
game.process_events()
print(game.generate_vote_count(278))
print('\nNow in RC style!\n')
pri... | 2.703125 | 3 |
src/enviroment.py | Menoita99/Reinforcement-Learning-Based-Encoder-Decoder-Implementation- | 1 | 38878 | <gh_stars>1-10
import enum
import random
import pandas as pd
class Actions(enum.IntEnum):
Buy = 0
Sell = 1
Noop = 2
Close = 3
@staticmethod
def random():
rand = random.randint(0, 3)
if rand == 0:
return Actions.Buy
elif rand == 1:
return Actions... | 2.953125 | 3 |
setup.py | MarkusH/django-osm-field | 23 | 38879 | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name="django-osm-field",
author="<NAME>",
author_email="<EMAIL>",
description="Django OpenStreetMap Field",
license="MIT",
long_description=long_description,
long_description_content_type=... | 1.335938 | 1 |
src/tools/bin/archive_to_arkivum.py | aherbert/omero-archiving | 1 | 38880 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANT... | 1.882813 | 2 |
projects/Yolov3/convert.py | shellhue/detectron2 | 3 | 38881 | import torch.nn as nn
import numpy as np
import torch
import os
from detectron2.config import get_cfg
from detectron2.engine import DefaultTrainer, default_argument_parser, default_setup, launch
from detectron2.evaluation import COCOEvaluator, verify_results
from yolov3 import add_yolov3_config
def load_darknet_wei... | 2.21875 | 2 |
examples/al_logistic.py | kirthevasank/mps | 3 | 38882 | <gh_stars>1-10
"""
An active learning example on a 1D parametric problem.
-- <EMAIL>
To execute this example, you will need to install the Edward probabilistic
programming language (http://edwardlib.org).
See http://edwardlib.org/iclr2017 for instructions.
"""
# pylint: disable=invalid-name
# pylint: disabl... | 2.90625 | 3 |
settings/settings.py | guilhermegch/telegram-twitter-bot | 2 | 38883 | <filename>settings/settings.py<gh_stars>1-10
import os
from dotenv import load_dotenv
load_dotenv()
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
CHAT_ID = os.getenv("CHAT_ID")
API_KEY = os.getenv("API_KEY")
API_SECRET_KEY = os.getenv("API_SECRET_KEY")
ACCESS_TOKEN = os.getenv("ACCESS_TOKEN")
ACCESS_TOKEN_SECRET = os... | 1.5625 | 2 |
rsbeams/rsstats/kinematic.py | radiasoft/rsbeams | 3 | 38884 | <reponame>radiasoft/rsbeams<gh_stars>1-10
#!/usr/bin/env python
import sys
import argparse as arg
import numpy as np
from scipy.constants import e, c, m_e, physical_constants
from future.utils import iteritems
# TODO: Priority #1: Need to go back to the principle that user puts in whatever units they desire
# TODO: co... | 2.71875 | 3 |
Python Basics/Week 4/assess_ac4_1_1_8.py | sasathornt/Python-3-Programming-Specialization | 1 | 38885 | <filename>Python Basics/Week 4/assess_ac4_1_1_8.py
##Write code to switch the order of the winners list so that it is now Z to A. Assign this list to the variable z_winners.
winners = ['<NAME>', '<NAME>', '<NAME>', '<NAME>', '<NAME>', '<NAME>']
z_winners = winners
z_winners.reverse()
print(z_winners) | 4.21875 | 4 |
shreddit/app.py | llalon/Shreddit | 0 | 38886 | """This module contains script entrypoints for shreddit.
"""
import argparse
import yaml
import logging
import os
import pkg_resources
from shreddit import default_config
from shreddit.shredder import Shredder
CONFIG_FILE_PATH = "/app/config/shreddit.yml"
def generate_empty_config(path: str):
print("Writing shre... | 2.859375 | 3 |
helpers/bnp.py | wim-vdw/bank-statement-converter | 0 | 38887 | from PyPDF3 import PdfFileReader
class BNPConverter:
def __init__(self, input_file, start_number=1):
self.input_file = input_file
self.start_number = start_number
def get_text_lines(self):
pdf_data = PdfFileReader(self.input_file)
text_lines = []
for page in range(pdf_... | 3.140625 | 3 |
c15/p280_test1511.py | pkingpeng/-python- | 0 | 38888 | <filename>c15/p280_test1511.py
import time
print(time.time())
def calcProd():
product = 1
for i in range(1, 100000):
product *= i
return product
startTime = time.time()
result = calcProd()
endTime = time.time()
print('The result is %s digits long, took %s seconds to calculate.' % (len(str(resu... | 3.328125 | 3 |
blog/user.py | mahdisj/flask_project | 1 | 38889 | from flask import Blueprint
from flask import g
from flask import flash
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from werkzeug.exceptions import abort
from werkzeug.utils import secure_filename
from bson import ObjectId
from blog.auth imp... | 2.28125 | 2 |
Python-Hackerrank/Eye and Identity.py | nihalkhan2810/Data-Structures-Algorithms | 10 | 38890 | import numpy
print(str(numpy.eye(*map(int,input().split()))).replace('1',' 1').replace('0',' 0'))
| 2.609375 | 3 |
main.py | NChechulin/telegram-renderer-bot | 1 | 38891 | <reponame>NChechulin/telegram-renderer-bot
"""Main file which starts the bot and sets all of the parameters"""
from bot import Bot
if __name__ == '__main__':
bot = Bot('token.txt')
bot.start()
| 1.679688 | 2 |
tpRigToolkit/tools/controlrig/widgets/controlviewer.py | tpRigToolkit/tpRigToolkit-tools-controlrig | 0 | 38892 | <reponame>tpRigToolkit/tpRigToolkit-tools-controlrig<gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains control viewer widget for tpRigToolkit.tools.controlrig
"""
from __future__ import print_function, division, absolute_import
import math
from copy import copy
from Qt.QtCore import... | 2.0625 | 2 |
sinfo/perifericos/views.py | webdesigncuba/Sinfo | 0 | 38893 | #
# Created on Sat Dec 25 2021
#
# The MIT License (MIT)
# Copyright (c) 2021 <NAME>
#
# 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 ri... | 1.679688 | 2 |
autogluon/utils/tabular/ml/models/tab_transformer/hyperparameters/parameters.py | joshr17/autogluon | 0 | 38894 | from ....constants import BINARY, MULTICLASS, REGRESSION
def get_fixed_params():
""" Parameters that currently cannot be searched during HPO
TODO: HPO NOT CURRENTLY IMPLEMENTED FOR TABTRANSFORMER
Will need to figure out what (in future PR) is "fixed" and what is searchable. """
fixed_params = {'batch_s... | 2.0625 | 2 |
Accounts/migrations/0014_remove_timetable_class_time.py | Anand911/E-LEARNING-SCLMAXO- | 1 | 38895 | <filename>Accounts/migrations/0014_remove_timetable_class_time.py
# Generated by Django 3.1.3 on 2020-12-18 12:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Accounts', '0013_timetable'),
]
operations = [
migrations.RemoveField(
... | 1.515625 | 2 |
app/crawlzero/apps.py | rputh055/crawlzerotest | 0 | 38896 | from django.apps import AppConfig
class crawlzeroConfig(AppConfig):
name = 'crawlzero'
| 1.0625 | 1 |
python/code_challenges/stacks_and_queues/stacks_and_queues.py | kylehoac/data-structures-and-algorithms | 0 | 38897 | <reponame>kylehoac/data-structures-and-algorithms
class Node:
def __init__(self, value, next_=None):
self.value = value
self.next = next_
class Stack:
def __init__(self, top=None):
self.top = top
def push(self, value):
self.top = Node(value, self.top)
def pop(self):
if self.top:
ret... | 3.984375 | 4 |
fastflix/encoders/copy/settings_panel.py | AwesomeGitHubRepos/FastFlix | 1 | 38898 | <reponame>AwesomeGitHubRepos/FastFlix<gh_stars>1-10
# -*- coding: utf-8 -*-
import logging
from qtpy import QtWidgets
from fastflix.encoders.common.setting_panel import SettingPanel
from fastflix.language import t
from fastflix.models.encode import CopySettings
from fastflix.models.fastflix_app import FastFlixApp
lo... | 1.914063 | 2 |
thermo_images/teste.py | brochinejr/thermo_images | 0 | 38899 | import matplotlib.pyplot as plt
import numpy as np
import cv2
from skimage.data import astronaut
from skimage.color import rgb2gray
from skimage.filters import sobel
from skimage.segmentation import felzenszwalb, slic, quickshift, watershed
from skimage.segmentation import mark_boundaries
from skimage.util import img_... | 2.703125 | 3 |