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 |
|---|---|---|---|---|---|---|
tests/importer/votingparser_test.py | raphiz/bsAbstimmungen | 0 | 12783051 | #!/usr/bin/env python
# coding=utf-8
import json
import pytest
from bsAbstimmungen.importer.votingimporter import VotingParser
from bsAbstimmungen.exceptions import AlreadyImportedException
from ..utils import mockdb
def test_raise_exception_when_alread_parsed(mockdb):
parser = VotingParser(mockdb)
parser.par... | 2.265625 | 2 |
desktop/core/ext-py/urllib3-1.25.8/test/appengine/test_urlfetch.py | yetsun/hue | 5,079 | 12783052 | <reponame>yetsun/hue
"""These tests ensure that when running in App Engine standard with the
App Engine sandbox enabled that urllib3 appropriately uses the App
Engine-patched version of httplib to make requests."""
import httplib
import StringIO
from mock import patch
import pytest
from ..test_no_ssl import TestWith... | 2.109375 | 2 |
bin/demo_disease2gene.py | cariaso/metapub | 28 | 12783053 | from __future__ import absolute_import, print_function, unicode_literals
import sys
from tabulate import tabulate
from metapub import MedGenFetcher
try:
term = sys.argv[1]
except IndexError:
print('Supply a disease/syndrome/condition name in quotation marks as the argument to this script.')
sys.exit()
#... | 2.28125 | 2 |
tests/ut/test_edge_volumes.py | CTERA-Networks/ctera-python-sdk | 5 | 12783054 | from unittest import mock
from cterasdk import exception
from cterasdk.common import Object
from cterasdk.edge.enum import VolumeStatus
from cterasdk.edge import volumes
from tests.ut import base_edge
class TestEdgeVolumes(base_edge.BaseEdgeTest):
_drive_1 = 'SATA-1'
_drive_2 = 'SATA-2'
_drive_size = 81... | 2.21875 | 2 |
simple_model/utils.py | felipegr/simple-model | 76 | 12783055 | <reponame>felipegr/simple-model
import inspect
import re
import typing
NOT_WORD = re.compile(r'\W')
SNAKE_CASE = re.compile('([a-z0-9])([A-Z])')
SNAKE_CASE_AUX = re.compile('(.)([A-Z][a-z]+)')
_PRIVATE_ATTR_RE = re.compile(r'_[\w\d]+__[\w\d]')
def capitalize_first(string: str) -> str:
return string[0].upper() + ... | 2.796875 | 3 |
githeart/settings.py | andressadotpy/template-projeto-selecao | 0 | 12783056 | from pathlib import Path
import os
import django_heroku
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '<KEY>'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
I... | 1.9375 | 2 |
_05_FUNCTIONS_ADVANCED_LAB/_05_min_max_sum.py | Andrey-V-Georgiev/PythonAdvanced | 1 | 12783057 | def print_min_max_sum(*args):
num_list = list(args[0])
min_num = min(num_list)
max_num = max(num_list)
sum_num = sum(num_list)
print(f'The minimum number is {min_num}')
print(f'The maximum number is {max_num}')
print(f'The sum number is: {sum_num}')
input_string = input()
input_numbers = m... | 3.90625 | 4 |
test/test_acd.py | LCAV/PyLocus | 13 | 12783058 | #!/usr/bin/env python
# module TEST_ACD
import unittest
import numpy as np
from .test_common import BaseCommon
from pylocus.point_set import PointSet
from pylocus.algorithms import reconstruct_acd
from pylocus.simulation import create_noisy_edm
class TestACD(BaseCommon.TestAlgorithms):
def setUp(self):
B... | 2.59375 | 3 |
components/studio/monitor/urls.py | ScilifelabDataCentre/stackn | 0 | 12783059 | <filename>components/studio/monitor/urls.py
from django.urls import path
from . import views
app_name = 'monitor'
urlpatterns = [
path('', views.overview, name='overview'),
path('<resource_type>/cpuchart', views.cpuchart, name='cpuchart'),
path('lab/delete/<uid>', views.delete_lab, name='delete_lab'),
... | 1.546875 | 2 |
test/test_cli.py | bninja/rump | 6 | 12783060 | <filename>test/test_cli.py
import json
import threading
import mock
import pytest
import requests
import time
from rump import dumps, cli, Settings
@pytest.fixture
def config_path(request):
return request.config.fixtures_path.join('settings', 'main.conf')
@pytest.fixture
def requests_path(request):
return... | 2.15625 | 2 |
mmtbx/regression/tst_sequence_validation.py | jbeilstenedmands/cctbx_project | 0 | 12783061 | <filename>mmtbx/regression/tst_sequence_validation.py<gh_stars>0
from __future__ import division
from libtbx import easy_mp
from libtbx import easy_pickle
from libtbx.utils import Sorry, null_out
import os
def exercise () :
import libtbx.utils
if (libtbx.utils.detect_multiprocessing_problem() is not None) :
p... | 1.96875 | 2 |
solutions/PE700.py | KerimovEmil/ProjectEuler | 1 | 12783062 | """
PROBLEM
<NAME> was born on 15 April 1707.
Consider the sequence 1504170715041707n mod 4503599627370517.
An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins.
For example, the first term is 1504170715041707 which is the first Eulercoin. The second... | 3.53125 | 4 |
tests/test_generate_trashs.py | PTank/trashtalk | 0 | 12783063 | <reponame>PTank/trashtalk<gh_stars>0
from pathlib import Path
from trashtalk import generate_trashs
from tests.init_test import generate_trash
import pwd
def test_add_profil_info(tmpdir):
test_file = tmpdir.join('.trashtalk')
s = "MEDIA_PATH=/testmediapath\nTRASH_PATH=/testtrashpath , bob"
test_file.write... | 2.234375 | 2 |
2018/bamboofox/baby-lea/hack.py | ss8651twtw/CTF | 12 | 12783064 | #!/usr/bin/env python
from pwn import *
import base64
r = remote('bamboofox.cs.nctu.edu.tw', 58789)
token = 'user=<PASSWORD>00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0... | 2.171875 | 2 |
aggregator/admin.py | EndlessTrax/spondy-news | 1 | 12783065 | <filename>aggregator/admin.py<gh_stars>1-10
from django.contrib import admin
from .models import Entry
def publish_selected(modeladmin, request, queryset):
queryset.update(is_published=True)
publish_selected.short_description = "Publish the selected posts"
@admin.register(Entry)
class EntryAdmin(admin.ModelA... | 1.945313 | 2 |
z2/part3/updated_part2_batch/jm/parser_errors_2/912800483.py | kozakusek/ipp-2020-testy | 1 | 12783066 | <reponame>kozakusek/ipp-2020-testy<gh_stars>1-10
from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 912800483
"""
"""
random actions, total chaos
... | 2.015625 | 2 |
CorbanDallas1982/Home_work_3/Ex-3.py | kolyasalubov/Lv-639.pythonCore | 0 | 12783067 | var_1=int(input('Enter first variable:'))
var_2=int(input('Enter second variable:'))
print(f"First variable {var_1}, second variable {var_2}")
var_1,var_2=var_2,var_1
print(f"After change: The first variable is {var_1} and the second variable is {var_2}") | 4.03125 | 4 |
app_questions/models.py | Audiotuete/backend_kassel_api | 0 | 12783068 | <reponame>Audiotuete/backend_kassel_api
from django.apps import apps as django_apps
from django.db import models
from django.contrib.postgres.fields import ArrayField
# from django.db.transaction import atomic
from ordered_model.models import OrderedModel
class Question(OrderedModel):
poll = models.ForeignKey('app_... | 2.421875 | 2 |
tests/q01.py | sophiarora/CS61A-Hog | 0 | 12783069 | test = {
'names': [
'q01',
'1',
'q1'
],
'points': 1,
'suites': [
[
{
'locked': True,
'test': """
>>> roll_dice(2, make_test_dice(4, 6, 1))
0d67364f3a6639e82e67af0673b4cc6e
# locked
""",
'type': 'doctest'
},
{
'lock... | 2.15625 | 2 |
hparams.py | twiet/LM-LSTM-CRF | 0 | 12783070 | <reponame>twiet/LM-LSTM-CRF
class hparams:
checkpoint_dir = "./checkpoint/"
load_check_point = False
rand_embedding = False
gpu = 0
batch_size = 10
unk = "unk"
char_hidden = 300
word_hidden = 300
drop_out = 0.55
epoch = 200
start_epoch = 0
caseless = True
char_dim = 3... | 1.40625 | 1 |
getlivechatemailstotxt.py | 54853315/livechatinc_chats_export | 2 | 12783071 | #! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'konakona'
__VERSION__ = "v1.0"
import os,sys,os.path,pycurl,cStringIO,json
python_version = sys.version_info[0]
if(python_version !=2):
print("本系统依赖于python2.7,您的系统不兼容, goodbye!")
exit()
start_date = raw_input("1.请输入开始日期(YYYY-MM-DD):")
end_date = raw_i... | 2.890625 | 3 |
deepNeuralNetwork.py | fy-meng/lunarlander-saliency | 0 | 12783072 | <reponame>fy-meng/lunarlander-saliency<gh_stars>0
"""
File name: deepNeuralNetwork.py
Deep Neural Network Class implementation with Keras and Tensorflow [1].
Author: <NAME>
enail: <EMAIL>
License: MIT
Date last modified: 03.12.2019
References:
[1] https://keras.io
Python Version: 3.6
"""
# Keras modules
fr... | 3.09375 | 3 |
codes/models/archs/arch_gcpnet.py | GuoShi28/GCP-Net | 24 | 12783073 | ''' network architecture for backbone '''
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import models.archs.arch_util as arch_util
import numpy as np
import math
import pdb
from torch.nn.modules.utils import _pair
from models.archs.dcn.deform_conv impor... | 2.546875 | 3 |
crims2s/training/infer.py | crim-ca/crims2s | 7 | 12783074 | import hydra
import logging
import os
import torch
import tqdm
import xarray as xr
from ..dataset import S2SDataset, TransformedDataset
from ..transform import ExampleToPytorch, CompositeTransform
from ..util import ECMWF_FORECASTS, collate_with_xarray
from .lightning import S2STercilesModule
from .util import find_ch... | 2.28125 | 2 |
cli/files.py | bcarld/vision-tools | 0 | 12783075 | <reponame>bcarld/vision-tools
#!/usr/bin/env python
# IBM_PROLOG_BEGIN_TAG
#
# Copyright 2019,2020 IBM International Business Machines Corp.
#
# 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... | 1.625 | 2 |
main.py | liatrio/bitbucket-elasticsearch-connector | 0 | 12783076 | <filename>main.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from index import index_repos
import logging
import os
import time
import requests
import json
import getpass
import sys, signal
import atexit
try:
from argparse import ArgumentParser
except ImportError:
logging.error("argparse is required to run... | 2.640625 | 3 |
pymailer/__init__.py | complexsum/pymailer | 1 | 12783077 | from .__about__ import __version__
from .utils.message import build_message
from .core.email_service import EmailService
| 0.921875 | 1 |
genesys/genesys/simulation/sysarray_models.py | VeriGOOD-ML/public | 6 | 12783078 | # This file contains the functions for the data access and cycle count models for the Layers executed on the Systolic Array
import logging
import math
import numpy as np
from data_objects import HardwareObject, SAResult_Inflayer, SIMDResult_Inflayer
from layer_object import LayerObject
def conv_access_model(Hardware... | 2.515625 | 3 |
RecoEcal/EgammaClusterProducers/python/egammaRechitFilter_cfi.py | ckamtsikis/cmssw | 852 | 12783079 | <filename>RecoEcal/EgammaClusterProducers/python/egammaRechitFilter_cfi.py
import FWCore.ParameterSet.Config as cms
#
# module for filtering of rechits. user provides noise threshold in GeV units
# Author: <NAME>, University of Rome & INFN
#
rechitFilter = cms.EDProducer("RecHitFilter",
noiseEnergyThreshold = cm... | 1.515625 | 2 |
freedom/reco/i3freedom.py | JanWeldert/freeDOM | 0 | 12783080 | <filename>freedom/reco/i3freedom.py
"""Provides I3Module(s) for FreeDOM reco"""
from freedom.reco.crs_reco import (
timed_fit,
zero_track_fit,
DEFAULT_SEARCH_LIMITS,
DEFAULT_INIT_RANGE,
)
from freedom.reco import transforms
from freedom.utils import i3frame_dataloader
from freedom.llh_service.llh_clien... | 1.9375 | 2 |
tools/launch_tensorboard.py | isn-dev/imagenet18 | 716 | 12783081 | <filename>tools/launch_tensorboard.py
#!/usr/bin/env python
# Usage:
# ./launch_tensorboard.py
#
# This will launch r5.large machine on AWS with tensoboard, and print URL
# in the console
import ncluster
ncluster.use_aws()
task = ncluster.make_task('tensorboard',
instance_type='r5.large',
... | 2.21875 | 2 |
labs/mapit.py | chris-skud/madison-transit-api | 0 | 12783082 | <reponame>chris-skud/madison-transit-api<filename>labs/mapit.py
import os
import wsgiref.handlers
import logging
from operator import itemgetter
from google.appengine.api import memcache
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.db import GeoPt
from google.ap... | 2.046875 | 2 |
spiel/footer.py | JoshKarpel/spiel | 3 | 12783083 | from dataclasses import dataclass
from pendulum import now
from rich.console import ConsoleRenderable
from rich.style import Style
from rich.table import Column, Table
from rich.text import Text
from spiel.modes import Mode
from spiel.rps import RPSCounter
from spiel.state import State
from spiel.utils import drop_no... | 2.265625 | 2 |
tests/MacPortsRequirementTest.py | yzgyyang/dependency_management | 4 | 12783084 | <filename>tests/MacPortsRequirementTest.py
import unittest
import unittest.mock
import sarge
from dependency_management.requirements.MacPortsRequirement import (
MacPortsRequirement)
class MacPortsRequirementTestCase(unittest.TestCase):
def test__str__(self):
self.assertEqual(str(MacPortsRequiremen... | 2.84375 | 3 |
setup.py | alliander-opensource/report_Tprognoses_quality | 1 | 12783085 | <reponame>alliander-opensource/report_Tprognoses_quality
import setuptools
import os
from setuptools import setup
pkg_dir = os.path.dirname(os.path.realpath(__file__))
# package description
with open(os.path.join(pkg_dir, "README.md")) as f:
long_description = f.read()
with open(os.path.join(pkg_dir, "requirement... | 1.8125 | 2 |
alembic/versions/3e59d406d707_update_waze_api_fields.py | shaysw/anyway | 69 | 12783086 | <reponame>shaysw/anyway
"""update waze api fields
Revision ID: 3e59d406d707
Revises: <PASSWORD>
Create Date: 2020-10-19 16:28:02.553501
"""
# revision identifiers, used by Alembic.
revision = '3e59d406d707'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy ... | 1.578125 | 2 |
core-python/Core_Python/multithreading/RLockDemo.py | theumang100/tutorials-1 | 9 | 12783087 | <gh_stars>1-10
import threading
''' This program can't give an output because by using lock we can acquire lock
then we have to release lock otherwise no other thread can able to acquire lock'''
'''lock = threading.Lock()
i = 0
lock.acquire()
i += 1
lock.acquire()
i +=2
lock.release()
print(i)'''
''' We can solve... | 3.671875 | 4 |
smartystreets_python_sdk/response.py | jasonrfarkas/smartystreets-python-sdk | 19 | 12783088 | class Response:
def __init__(self, payload, status_code, error=None):
self.payload = payload
self.status_code = status_code
self.error = error
| 2.359375 | 2 |
xastropy/spec/continuum.py | nhmc/xastropy | 0 | 12783089 | <reponame>nhmc/xastropy<gh_stars>0
"""
#;+
#; NAME:
#; continuum
#; Version 1.0
#;
#; PURPOSE:
#; Module for continuum code
#; 20-Aug-2015 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_l... | 1.960938 | 2 |
0x04-python-more_data_structures/6-print_sorted_dictionary.py | malu17/alx-higher_level_programming | 0 | 12783090 | #!/usr/bin/python3
def print_sorted_dictionary(a_dictionary):
for i, j in sorted(a_dictionary.items()):
print("{}: {}".format(i, j))
| 4.0625 | 4 |
crawlerflow/contrib/extensions/timeseries.py | EXTREMOPHILARUM/crawlerflow | 15 | 12783091 | <filename>crawlerflow/contrib/extensions/timeseries.py
from scrapy.extensions.logstats import LogStats
from datetime import datetime
import os
import yaml
class CrawlerFlowTimeSeriesStats(LogStats):
def log(self, spider):
item_scraped_count = self.stats.get_value('item_scraped_count', 0)
requests... | 2.859375 | 3 |
mathematics/probability/bday-gift.py | PingHuskar/hackerrank | 41 | 12783092 | # Mathematics > Probability > B'day Gift
# Whats the price Isaac has to pay for HackerPhone
#
# https://www.hackerrank.com/challenges/bday-gift/problem
# https://www.hackerrank.com/contests/nov13/challenges/bday-gift
#
# chaque boule a une probabilité 0.5 d'être ramassée
n = int(input())
e = sum(int(input()) for _ in... | 3.25 | 3 |
projects/mmdet3d_plugin/models/utils/dgcnn_attn.py | XiangTodayEatsWhat/detr3d | 237 | 12783093 | <reponame>XiangTodayEatsWhat/detr3d<filename>projects/mmdet3d_plugin/models/utils/dgcnn_attn.py
import math
import torch
import torch.nn as nn
from mmcv.cnn.bricks.registry import ATTENTION
from mmcv.runner.base_module import BaseModule
@ATTENTION.register_module()
class DGCNNAttn(BaseModule):
"""A warpper for D... | 2.21875 | 2 |
main.py | INTJT/conway | 0 | 12783094 | if __name__ == "__main__":
from core.editor import Editor
from widgets.editor_window import EditorWindow
from PyQt5 import QtWidgets
editor = Editor()
application = QtWidgets.QApplication([])
window = EditorWindow()
window.show()
application.exec()
| 1.929688 | 2 |
load/benchmark_database.py | cirrostratus1/benchmark-database | 0 | 12783095 | <reponame>cirrostratus1/benchmark-database<gh_stars>0
# Copyright (c) 2019 fortiss GmbH
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
import pandas as pd
import logging
import shutil
logging.getLogger().setLevel(logging.INFO)
import pickle
import zipfile
from mod... | 2 | 2 |
meiduo_mell/meiduo_mell/apps/oauth/models.py | fader-zm/kong | 0 | 12783096 | from django.db import models
from meiduo_mell.utils.models import BaseModel
from users.models import User
# Create your models here.
class OauthQQUser(BaseModel):
"""
QQ登录用户数据
"""
# ForeignKey: 设置外键
# on_delete: 指明主表删除数据时,对于外键引用表数据如何处理
# CASCADE 级联,删除主表数据时连通一起删除外键表中数据
user = models.Forei... | 2.359375 | 2 |
0015 Painting Houses.py | ansabgillani/binarysearchcomproblems | 1 | 12783097 | <gh_stars>1-10
class Solution:
def solve(self, matrix):
if not matrix or not matrix[0]: return 0
min1,min2 = 0,0
min_i = -1
for row in matrix:
new_min1,new_min2 = inf,inf
new_min_i = -1
for i,cost in enumerate(row):
new_cost = cost + (min2... | 3.03125 | 3 |
icv/data/labelme.py | dmxj/icv | 5 | 12783098 | # -*- coding: UTF-8 -*-
from .dataset import IcvDataSet
from ..utils import is_seq, is_dir
from ..image import imwrite
from ..data.core.bbox import BBox
from ..data.core.polys import Polygon
from ..data.core.sample import Sample, Anno
from ..data.core.meta import AnnoMeta,SampleMeta
from ..vis.color import VIS_COLOR
im... | 2.140625 | 2 |
debug/plot_learning_curves.py | DavidSabbagh/meeg_power_regression | 1 | 12783099 | import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import config as cfg
sns.set_style('darkgrid')
sns.set_context('notebook')
sns.despine(trim=True)
plt.close('all')
fig, ax = plt.subplots(1, 1, figsize=(8, 6))
scores = np.load(op.join(cfg.path_outputs,
'a... | 2.234375 | 2 |
bottleneck_transformer_pytorch/mish_activ.py | mydre/MultiLayerGRU | 0 | 12783100 | import pdb
import torch
from torch import nn
import torch.nn.functional as F
class Mish(nn.Module):
def __init__(self):
super().__init__()
print('Mish activation loaded....')
def forward(self, x):
x = x * (torch.tanh(F.softplus(x)))
return x | 2.734375 | 3 |
api/api.py | deborae/faq-chatbot | 0 | 12783101 | <gh_stars>0
from flask import Flask
from atlassian import Confluence
import os
CONFLUENCE_URL = os.getenv('CONFLUENCE_URL')
USER_EMAIL = os.getenv('USER_EMAIL')
USER_TOKEN = os.getenv('USER_TOKEN')
import re
import random
import string
import json
import nltk
from langdetect import detect
from sklearn.feature_extracti... | 3.078125 | 3 |
models/backbones.py | smallflyingpig/seeking-the-shape-of-sound | 12 | 12783102 | <reponame>smallflyingpig/seeking-the-shape-of-sound
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import os.path as osp
from models.base_model import BaseModel
from models.nn.ir_se_model import IR_50
from models.nn.res_se_34l_model import ResNetSE34
from models.nn.module import N... | 2.171875 | 2 |
starthinker_ui/website/management/commands/log.py | dvandra/starthinker | 1 | 12783103 | ###########################################################################
#
# Copyright 2019 Google 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
#
# https://www.apache.org... | 2.046875 | 2 |
src/main/resources/tf_graphs/lenet_tf.py | farizrahman4u/dl4j-test-resources | 0 | 12783104 | """ Convolutional Neural Network.
Build and train a convolutional neural network with TensorFlow.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
This example is using TensorFlow layers API, see 'convolutional_network_raw'
example for a raw implementation with variab... | 4.375 | 4 |
usermanager/users/urls.py | yasminhillis/user-manager | 1 | 12783105 | from rest_framework import routers
from .api import UserViewSet
router = routers.DefaultRouter()
router.register('users', UserViewSet, 'users')
urlpatterns = router.urls | 1.617188 | 2 |
blocklenium/main.py | jpunkt/blocklenium | 0 | 12783106 | <gh_stars>0
import logging
import sys
import click
from blocklenium import settings
from blocklenium.blocklenium import Blocklenium
logger = logging.getLogger('blocklenium.main')
if __name__ == '__main__':
print('Please use the click entry-point.')
pass
@click.command()
@click.option('--plc_id', default=... | 2.6875 | 3 |
aggregator/static_importer.py | olivmaurel/termsearch | 0 | 12783107 | <gh_stars>0
import csv
import os
import logging
import sys
import django
LOCAL_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(os.path.abspath(os.path.dirname('../')))
sys.path.append(os.path.abspath(os.path.dirname('.')))
django.setup()
from aggregator.models import Language
# Get an instance of... | 2.3125 | 2 |
config/__init__.py | kunal-sanghvi/flask-app | 0 | 12783108 | from .settings import *
from .constants import * | 1.179688 | 1 |
tests/data/token_indexers/elmo_indexer_test.py | unendin/allennlp | 1 | 12783109 | # pylint: disable=no-self-use
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data import Token, Vocabulary
from allennlp.data.token_indexers import ELMoTokenCharactersIndexer
class TestELMoTokenCharactersIndexer(AllenNlpTestCase):
def test_bos_to_char_ids(self):
indexer = ELMoTokenChar... | 2.1875 | 2 |
membership/management/commands/csvtestdata.py | guaq/sikteeri | 0 | 12783110 | # encoding: UTF-8
"""
Generates test data for CSV import.
"""
from __future__ import print_function
from __future__ import with_statement
# http://www.python.org/dev/peps/pep-3101/ # unicode.format()
# http://www.python.org/dev/peps/pep-3105/ # print function
import codecs
from uuid import uuid4
from datetime import... | 2.078125 | 2 |
dupdeletergui.py | ocdocdocd/DupDeleter | 0 | 12783111 | from gi.repository import Gtk, GdkPixbuf, GLib, Pango
import dhash
import os
import collections
import threading
import Queue
class mainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="DupDeleter")
self.set_border_width(10)
self.grid = Gtk.Grid()
self.grid... | 2.453125 | 2 |
tests/util/sqlalchemy_util_test.py | candango/firenado | 13 | 12783112 | <reponame>candango/firenado<filename>tests/util/sqlalchemy_util_test.py
#!/usr/bin/env python
#
# Copyright 2015-2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.... | 2.46875 | 2 |
application/handlers/api/apikmldownloader.py | opengovt/openroads-geostore | 1 | 12783113 | import json
from application.handlers.base import BaseHandler
class APIKMLDownloader(BaseHandler):
def get(self):
if self.request.get('project_code'):
project_code = self.request.get('project_code')
self.response.headers['Content-Type'] = 'application/json'
self.response... | 2.40625 | 2 |
compare.py | MichaelRiabzev/directoriesCompare | 0 | 12783114 | <filename>compare.py
import hashlib
import os
import datetime
import sys
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def compareTables(A,B):
onlyInA = []
o... | 2.609375 | 3 |
GameOfThrones/__init__.py | dhillonr/db | 0 | 12783115 | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017 CNRS
# 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 ... | 1.515625 | 2 |
envelope/constants.py | affan2/django-envelope | 0 | 12783116 | <reponame>affan2/django-envelope
from django.utils.translation import ugettext_lazy as _
STATE_TYPES = (
(-1, _('Deleted')),
(1, _('Replied')),
(2, _('Pending')),
)
COMPANY_CONTACT_CHOICES = (
("", u''),
("First choice", _('First choice')),
("Second choice", _('Second choice')),
("Third c... | 1.84375 | 2 |
spellchecker/Spellcheck.py | sa91/Ideas | 0 | 12783117 | <gh_stars>0
from Preprocess import pre_process
from Getembedding import embed
from Predictor import predictor
"""
Input of this file can be changed to stream word or anything that can be used to check spelling
For now:
It takes a word, preprocess it
get embedding of the word
send it to... | 3.578125 | 4 |
tests/bioc/test_json_encoder.py | datummd/bioc | 10 | 12783118 | <filename>tests/bioc/test_json_encoder.py
import io
import tempfile
from pathlib import Path
import pytest
from bioc import BioCFileType
from bioc.biocjson.encoder import toJSON
import bioc
from bioc.biocjson import BioCJsonIterWriter
from tests.utils import assert_everything
file = Path(__file__).pare... | 2.28125 | 2 |
toolkit/autodiff/scalar/FloatScalar.py | joseph-ai/aitoolkit | 0 | 12783119 | import toolkit.autodiff.math.scalar as am
import toolkit.autodiff.math as m
from ..math import IdentityOp
from ..CalcFlow import CalcFlow
class FloatScalar(CalcFlow):
def __init__(self, value):
super().__init__(value)
def _calc_unary(self, func):
calc_val = FloatScalar(func.calculate())
... | 2.9375 | 3 |
scraping.py | NaulaN/EDT | 0 | 12783120 | from selenium import webdriver
from selenium.webdriver.common.by import By
from datetime import datetime
class Scraping(object):
driver = webdriver.Chrome()
hours: str
edt = {}
def __init__(self, username, password):
# Ouvre la page dans Chrome
self.driver.delete_all_cookies()
... | 3.484375 | 3 |
qsar/tests.py | kingrichard2005/qsarweb-public | 0 | 12783121 | from django.test import TestCase
# Create your tests here.
class IndexViewsTestCase(TestCase):
def test_index(self):
resp = self.client.get('/qsar/')
self.assertEqual(resp.status_code, 200) | 2.109375 | 2 |
dev/park_python/camera/capture.py | remij1/Park_Detection | 0 | 12783122 | <filename>dev/park_python/camera/capture.py
##################################################################
# MESURE DU TAUX D'OCCUPATION DE PARKINGS A L'AIDE #
# DE CAMERAS VIDEOS #
# -------------------------------------------------------------- #
# ... | 2.375 | 2 |
docker-jans-configurator/scripts/bootstrap.py | duttarnab/jans | 0 | 12783123 | <gh_stars>0
import json
import logging.config
import os
import random
import socket
import time
from functools import partial
from uuid import uuid4
import click
from jans.pycloudlib import get_manager
from jans.pycloudlib import wait_for
from jans.pycloudlib.utils import get_random_chars
from jans.pycloudlib.utils i... | 1.820313 | 2 |
src/util/config/view.py | Mathtin/mc-discord-bot | 0 | 12783124 | <reponame>Mathtin/mc-discord-bot
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021-present Daniel [Mathtin] Shiko <<EMAIL>>
Project: Minecraft Discord Bot
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (... | 2.3125 | 2 |
Lib/test/test_async.py | pyparallel/pyparallel | 652 | 12783125 | import os
import sys
import atexit
import unittest
import tempfile
import async
import _async
import socket
from socket import (
AF_INET,
SOCK_STREAM,
)
def tcpsock():
return socket.socket(AF_INET, SOCK_STREAM)
CHARGEN = [
r""" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg""",... | 2.484375 | 2 |
relezoo/cli/cli.py | Ohtar10/rele-zoo | 0 | 12783126 | <gh_stars>0
import logging
import click
from relezoo.__version__ import __version__
from relezoo.algorithms import reinforce
from relezoo.utils.console import start_python_console
def docstring_parameter(*sub):
"""Decorate the main click command to format the docstring."""
def dec(obj):
obj.__doc__ ... | 2.140625 | 2 |
decode/struct_SHELL_LINK_HEADER.py | SkyLined/headsup | 1 | 12783127 | # Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 1.796875 | 2 |
python/Exercicios/ex094.py | Robert-Marchinhaki/primeiros-passos-Python | 0 | 12783128 | <filename>python/Exercicios/ex094.py
grupo_pessoas = []
pessoas = {}
med_idade_grupo = 0
mulheres = []
p_acima_media = []
while True:
nome = str(input('Nome: '))
idade = int(input('Idade: '))
sexo = str(input('Sexo [F/M/O]: ')).upper().strip()
while sexo not in 'FMO':
print('Erro! Use somente [... | 3.5625 | 4 |
calendar_service.py | jantheprogrammer/event-email-service | 0 | 12783129 | <reponame>jantheprogrammer/event-email-service
from datetime import datetime
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOP... | 2.90625 | 3 |
rompy/__init__.py | pbranson/rompy | 1 | 12783130 | <reponame>pbranson/rompy
#-----------------------------------------------------------------------------
# Copyright (c) 2020 - 2021, CSIRO
#
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#-----------------------------------------------------------------------------... | 1.5625 | 2 |
functions/id_check.py | joao-lanzarini/sales-analytics-python | 0 | 12783131 | <gh_stars>0
import csv
def check(file='inventory', action=''):
while True:
line = 0
check = False
i = input(f'Product ID to {action} [0 to exit]: ')
if i != '0':
with open (f'./{file}.csv') as file:
reader = csv.reader(file)
lines = list(... | 3.203125 | 3 |
nicos/devices/datasinks/text.py | jkrueger1/nicos | 0 | 12783132 | <gh_stars>0
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it un... | 1.898438 | 2 |
tests/core/config/models/bdk_server_config_test.py | symphony-elias/symphony-bdk-python | 17 | 12783133 | <reponame>symphony-elias/symphony-bdk-python<filename>tests/core/config/models/bdk_server_config_test.py<gh_stars>10-100
from symphony.bdk.core.config.model.bdk_server_config import BdkServerConfig, BdkProxyConfig
def test_get_base_path():
config = BdkServerConfig(scheme="https", host="dev.symphony.com", port=123... | 1.96875 | 2 |
maintenance/tests_old/test_ale_consistency.py | sfpd/rlreloaded | 0 | 12783134 | import alepy
import numpy as np
import os.path as osp
from control3 import CTRL_ROOT
# import cv2
world = alepy.AtariWorld(osp.join(CTRL_ROOT,"domain_data/atari_roms/space_invaders.bin"))
for j in xrange(5):
x0 = world.GetInitialState(np.random.randint(0,50))
u0 = np.array([0],'uint8')
y,r,o,d = world.St... | 2.375 | 2 |
src/models/XGboost/Model_Training_XGboost-MLflow.py | shunbolt/BDA-Project-Tran-Torrado-EFREI | 0 | 12783135 | import pandas as pd
import argparse
import mlflow
from sklearn.utils import resample
from sklearn.model_selection import train_test_split
import xgboost as xgb
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from urllib.parse import urlparse
if __name__ == "__main__":
df_t... | 3.078125 | 3 |
examples/02_advanced_examples/plot_custom_arguments.py | jhosoume/pymfe | 86 | 12783136 | """
Customizing measures arguments
==============================
In this example we will show you how to custorize the measures.
"""
# Load a dataset
from sklearn.datasets import load_iris
from pymfe.mfe import MFE
data = load_iris()
y = data.target
X = data.data
#################################################... | 3.125 | 3 |
pingsweep.py | strohmy86/Scripts | 1 | 12783137 | #!/usr/bin/env python3
# MIT License
# Copyright (c) 2020 <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 rights
# to use, copy... | 1.992188 | 2 |
Zip_Codes/Zipcodebase/unit_tests.py | Jay4C/API | 1 | 12783138 | import unittest
import requests
endpoint = "https://app.zipcodebase.com/api/v1"
apikey = ""
# https://app.zipcodebase.com/documentation
class UnitTestsZipcodebaseWithTorNetwork(unittest.TestCase):
def test_Authentification_Remaining_Credits(self):
print("test_Authentification_Remaining_Credits")
... | 3.03125 | 3 |
cameraServer.py | thedropbears/vision-2019 | 0 | 12783139 | #!/usr/bin/env python3
import json
import sys
import numpy as np
import cv2
import math
import time
from collections import namedtuple
from cscore import CameraServer
from networktables import NetworkTables
# Magic Numbers
lowerGreen = (50, 120, 130) # Our Robot's Camera
higherGreen = (100, 220, 220)
minContourArea ... | 2.3125 | 2 |
kite-python/kite_common/kite/ioutils/stream.py | kiteco/kiteco-public | 17 | 12783140 | <reponame>kiteco/kiteco-public
import json
def loadjson(f, bufsize=1000000, **kwargs):
"""
Load a sequence of json objects from a stream
"""
decoder = json.JSONDecoder(**kwargs)
last_error = None
cur = ""
while True:
buf = f.read(bufsize)
if buf:
cur += buf.decode()
cur = cur.lstrip() # in rare cases... | 2.921875 | 3 |
vheLC/determinePrior/determinePrior.py | orelgueta/blazar-variability-study | 1 | 12783141 | #!/usr/bin/python
import os.path
import os
import glob
import subprocess
import numpy as np
import numpy.lib.recfunctions as rfn
from astropy.io import fits
from astropy.stats import bayesian_blocks
import argparse
from collections import defaultdict
def checkDatFile(datFileName):
if not os.path.isfile(datFileNa... | 2.0625 | 2 |
app/src/yolov3/models/layers/upsample_layer.py | customr/detection_demo | 58 | 12783142 | import tensorflow as tf
def upsample_layer(name, inputs):
"""
Takes the outputs of the previous convolutional layer and upsamples them by a factor of two
using the 'nearest neighbor' method.
Parameters
----------
name : string
The name of the tensor to be used in TensorBoard.
input... | 3.65625 | 4 |
oldqa/qa/src/core_tests/Core_Tests.py | KDahlgren/pyLDFI | 6 | 12783143 | #!/usr/bin/env python
'''
Core_Tests.py
Defines unit tests for core.
'''
#############
# IMPORTS #
#############
# standard python packages
import inspect, os, sqlite3, sys, unittest
from StringIO import StringIO
# ------------------------------------------------------ #
# import sibling packages HERE!!!
sys.pat... | 2.203125 | 2 |
Coursera/Google_IT_Automation_with_Python/01_Crash_Course_on_Python/Week_3/wk3_mod1_ex3.py | ssolomon2020/Self_Study_Python_Training | 0 | 12783144 | <gh_stars>0
# Specialization: Google IT Automation with Python
# Course 01: Crash Course with Python
# Week 3 Module Part 1 Exercise 03
# Student: <NAME>
# Learning Platform: Coursera.org
# The following code causes an infinite loop. Can you figure out what’s missing and how to fix it?
# def print_range(start... | 4.1875 | 4 |
setup.py | diamond-org/puppet-diamond | 0 | 12783145 | <reponame>diamond-org/puppet-diamond<gh_stars>0
# -*- coding: utf-8 -*-
# Puppet-Diamond (c) <NAME>
import os
import re
import codecs
from setuptools import setup
from setuptools import find_packages
def read(*rnames):
return codecs.open(os.path.join(os.path.dirname(__file__), *rnames), 'r', 'utf-8').read()
de... | 1.890625 | 2 |
pipedrive/abstract.py | bindlock/pipedrivepy | 0 | 12783146 | from .chain import Chain
class AbstractClient:
ENDPOINT = 'https://{domain}.pipedrive.com/api/{version}/{path}'
def __init__(self, domain: str, token: str, version: str = 'v1'):
self.domain = domain
self.token = token
self.version = version
def __getattr__(self, name: str) -> Ch... | 2.765625 | 3 |
yt-pi.py | R2Boyo25/yt-pi | 6 | 12783147 | from flask import Flask, abort, render_template, redirect, url_for, request, session, send_from_directory, flash, jsonify
from markupsafe import escape
import random, os, database, json, requests
from werkzeug.utils import secure_filename
# create the application object
app = Flask(__name__)
app.config['DataFolder'] ... | 2.125 | 2 |
src/apps/backup/management/commands/run_backup.py | tuxis/BuckuPy | 0 | 12783148 | <filename>src/apps/backup/management/commands/run_backup.py<gh_stars>0
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
from apps.backup.functions import backup_process
bk_obj = backup_process()
bk_obj.run_backup()
| 1.617188 | 2 |
individual.py | gabrielbiasi/evolutionary-rubiks-cube | 1 | 12783149 | # -*- coding: utf-8 -*-
"""
Universidade Federal de Minas Gerais
Departamento de Ciência da Computação
Programa de Pós-Graduação em Ciência da Computação
Computação Natural
Trabalho Prático 1
Feito por <NAME>, 2016672212.
"""
#--------------------------------------------------------------#
#------------------------ ... | 2.078125 | 2 |
Interview-Preparation/Amazon/treesgraphs-flood-fill.py | shoaibur/SWE | 1 | 12783150 | <filename>Interview-Preparation/Amazon/treesgraphs-flood-fill.py<gh_stars>1-10
class Solution:
def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]:
if not image: return image
nrow = len(image)
ncol = len(image[0])
... | 3.390625 | 3 |