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 |
|---|---|---|---|---|---|---|
backend/api/migrations/0005_education.py | EmileSchneider/cityrepo | 0 | 33300 | <gh_stars>0
# Generated by Django 3.0.5 on 2020-12-11 14:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20201211_1411'),
]
operations = [
migrations.CreateModel(
name='Education',
fields=[
... | 1.78125 | 2 |
data/example_dataset/carla/image_file_index/make_image_file_index.py | lukschwalb/bisenetv2-tensorflow | 0 | 33301 | <reponame>lukschwalb/bisenetv2-tensorflow
import os
import os.path as ops
import glob
import random
import tqdm
SOURCE_IMAGE_DIR = '/home/luk/datasets/carla/04-10-town02-ss/gt_images'
SOURCE_LABEL_DIR = '/home/luk/datasets/carla/04-10-town02-ss/gt_annotation'
DST_IMAGE_INDEX_FILE_OUTPUT_DIR = '.'
unique_ids = []
fo... | 2.34375 | 2 |
Chicago Data Clean/categories_chicago.py | minxstm/Bootcamp_Project_1 | 0 | 33302 | <reponame>minxstm/Bootcamp_Project_1<gh_stars>0
import pandas as pd
chicago_df=pd.read_csv("Chicago_Crime_2015-2017.csv")
#print(chicago_df.head())
chicago_vc = chicago_df["Primary Type"].value_counts()
pd.DataFrame(chicago_vc).to_csv("crime_types_chicago_1.csv")
| 2.953125 | 3 |
Day 3/part1.py | jonomango/advent-of-code-2020 | 0 | 33303 | trees = []
with open("input.txt", "r") as f:
for line in f.readlines():
trees.append(line[:-1])
# curr pos
x, y = 0, 0
count = 0
while True:
x += 3
y += 1
if y >= len(trees):
break
if trees[y][x % len(trees[y])] == '#':
count += 1
print(count) | 3.328125 | 3 |
happenings/tests.py | doismellburning/tango-happenings | 0 | 33304 | from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from .models import Event
UserModel = get_user_model()
class TestHappeningsGeneralViews(TestCase):
fixtures = ['events.json', 'users.json']
def setUp(self):
self.event = Even... | 2.453125 | 2 |
bopflow/models/yolonet.py | parejadan/bopflow | 0 | 33305 | <reponame>parejadan/bopflow<gh_stars>0
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Input
from tensorflow.keras.losses import binary_crossentropy, sparse_categorical_crossentropy
from bopflow.models.darknet import darknet_conv_upsampling, darknet_con... | 1.945313 | 2 |
vespa/simulation/auto_gui/experiment_list.py | vespa-mrs/vespa | 0 | 33306 | # -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.9.3 on Wed Sep 11 13:50:00 2019
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: MyDialog.__init__
kwds["style"] = kw... | 2.15625 | 2 |
S4/S4 Library/simulation/familiars/familiar_handlers.py | NeonOcean/Environment | 1 | 33307 | <filename>S4/S4 Library/simulation/familiars/familiar_handlers.py
from gsi_handlers.sim_handlers import _get_sim_info_by_id
from sims4.gsi.dispatcher import GsiHandler
from sims4.gsi.schema import GsiGridSchema
familiar_schema = GsiGridSchema(label='Familiars', sim_specific=True)
familiar_schema.add_field('familiar_nam... | 2.03125 | 2 |
for python/data/mramesh/pframe.py | aerolalit/Auto-Testing-Python-Programs | 4 | 33308 | #35011
#a3_p10.py
#<NAME>
#<EMAIL>
n = int(input("Enter the width"))
w = int(input("Enter the length"))
c = input("Enter a character")
space=" "
def print_frame(n, w):
for i in range(n):
if i == 0 or i == n-1:
print(w*c)
else:
print(c + space*(w-2) + c)
pr... | 3.796875 | 4 |
detectors/hamlog.py | time-track-tool/time-track-tool | 0 | 33309 | # Copyright (C) 2012 Dr. <NAME> Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: <EMAIL>
# All rights reserved
# ****************************************************************************
# This library is free software; you can redistribute it and/or
# modify it under ... | 1.53125 | 2 |
grgrlib/core.py | gboehl/grgrlib | 0 | 33310 | #!/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import numpy.linalg as nl
import scipy.linalg as sl
import scipy.stats as ss
import time
aca = np.ascontiguousarray
def nul(n):
return np.zeros((n, n))
def iuc(x, y):
"""
Checks if pair of generalized EVs x,y is inside the unit circle. Here for ... | 2.5625 | 3 |
django-app/main/views.py | honchardev/crypto-sentiment-app | 9 | 33311 | <gh_stars>1-10
import json
import time
from datetime import datetime
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import UserCreationForm
from django.c... | 1.921875 | 2 |
bluesky_browser/viewer/figures.py | EliotGann/bluesky-browser | 0 | 33312 | import collections
import logging
from event_model import DocumentRouter, RunRouter
import numpy
from matplotlib.backends.backend_qt5agg import (
FigureCanvasQTAgg as FigureCanvas,
NavigationToolbar2QT as NavigationToolbar)
import matplotlib
from qtpy.QtWidgets import ( # noqa
QLabel,
QWidget,
QVB... | 2.046875 | 2 |
gpytorch/priors/__init__.py | bdecost/gpytorch | 0 | 33313 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .gamma_prior import GammaPrior
from .multivariate_normal_prior import MultivariateNormalPrior
from .normal_prior import NormalPrior
from .smoothed_box_prior import S... | 1.070313 | 1 |
fuelweb_ui_test/tests/preconditions.py | Miroslav-Anashkin/fuel-main | 0 | 33314 | <gh_stars>0
import time
from pageobjects.environments import Environments, Wizard, DeployChangesPopup
from pageobjects.header import TaskResultAlert
from pageobjects.nodes import Nodes, RolesPanel
from settings import OPENSTACK_CENTOS, OPENSTACK_RELEASE_CENTOS
from tests.base import BaseTestCase
class Environment:
... | 1.953125 | 2 |
web_client_external_partner_feedback.py | UKPLab/emnlp2019-NeuralWeb | 3 | 33315 | import base64
import datetime
import http.client
import json
import sys
from pyblake2 import blake2b
from flask import Flask, request
from flask import render_template
from util.config import host_config
app = Flask(__name__)
AUTH_SIZE = 16
API_KEY = '<KEY>' # use the provided one
SECRET_KEY = '2a4309a8a2c54e539e... | 2.546875 | 3 |
globus_contents_manager/scripts/spawn_tokens.py | NickolausDS/globus-contents-manager | 0 | 33316 | import os
import json
from fair_research_login import NativeClient
CLIENT_ID = 'e54de045-d346-42ef-9fbc-5d466f4a00c6'
APP_NAME = 'My App'
SCOPES = 'openid email profile urn:globus:auth:scope:transfer.api.globus.org:all urn:globus:auth:scope:search.api.globus.org:all'
CONFIG_FILE = 'tokens-data.json'
tokens = None
# ... | 2.34375 | 2 |
new_listings_scraper.py | hokkiefrank/gateio-crypto-trading-bot-binance-announcements-new-coins | 0 | 33317 | <filename>new_listings_scraper.py<gh_stars>0
import requests
import os.path, json
import time
from store_order import *
from load_config import *
def get_last_coin():
"""
Scrapes new listings page for and returns new Symbol when appropriate
"""
latest_announcement = requests.get("https://www.binance.... | 2.984375 | 3 |
setup.py | poliquin/pyfixwidth | 6 | 33318 | <reponame>poliquin/pyfixwidth
# -*- coding: utf8 -*-
from distutils.core import setup
setup(
name='pyfixwidth',
packages=['fixwidth'],
version='0.1.1',
description="Read fixed width data files",
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/poliquin/pyfixwidth',
keyw... | 2.0625 | 2 |
examples/oucru/oucru-full/test_invert_dicts.py | bahp/datablend | 0 | 33319 | # Libraries
import ast
import collections
import pandas as pd
# -----------------
# Methods
# -----------------
def invert(d):
if isinstance(d, dict):
return {v: k for k, v in d.items()}
return d
def str2eval(x):
if pd.isnull(x):
return None
return ast.literal_eval(x)
def sortkeys(... | 2.84375 | 3 |
twitter_likes.py | reinhartP/twitter-likes-media-downloader | 1 | 33320 | import argparse
import twitter
import os
import json
from likes import Likes
import sys
import time
class Downloader:
def __init__(self):
self._current_path = os.path.dirname(os.path.realpath(__file__))
def downloadLikes(self, api, screen_name, force_redownload):
liked_tweets = Likes(
... | 2.96875 | 3 |
test.py | lusing/algo | 0 | 33321 | <reponame>lusing/algo
import gym
import numpy as np
env = gym.make('FrozenLake-v0')
#env = env.unwrapped
print(env.observation_space)
print(env.action_space)
def play_policy(env, policy, render=True):
total_reward = 0
observation = env.reset()
while True:
if render:
env.render()
... | 2.4375 | 2 |
tests/test_pyspy.py | gjoseph92/scheduler-profiling | 0 | 33322 | <filename>tests/test_pyspy.py
import json
import pathlib
import platform
import dask
import distributed
import pytest
import scheduler_profilers
pytest_plugins = ["docker_compose"]
def core_test(client: distributed.Client, tmp_path: pathlib.Path) -> None:
df = dask.datasets.timeseries().persist()
schedule... | 1.828125 | 2 |
setup.py | starofrainnight/ncstyler | 0 | 33323 | <reponame>starofrainnight/ncstyler<filename>setup.py
#!/usr/bin/env python
from pydgutils_bootstrap import use_pydgutils
use_pydgutils()
import pydgutils
from setuptools import setup, find_packages
try:
from pip.req import parse_requirements
except:
from pip._internal.req import parse_requirements
... | 1.953125 | 2 |
code/model.py | philippmarcus/CarND-Behavioral-Cloning-P3 | 0 | 33324 | <gh_stars>0
import csv
import cv2
import numpy as np
import copy
from sklearn.utils import shuffle
"""
Data generator and augmentation methods. The generator called
get_flipped_copies and get_color_inverted_copies, if augmentation mode
is activated.
The usage of color inverted copies is done to make the algorithm als... | 3.109375 | 3 |
abc/abc243/d/main.py | tonko2/AtCoder | 2 | 33325 | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N, X = na()
S = ns()
up = 0
tmp_S = ""
for c in S[::-1]:
if c =... | 2.328125 | 2 |
test/fcos/test_map.py | aclex/detection-experiments | 5 | 33326 | <reponame>aclex/detection-experiments
import pytest
import math
import torch
from detector.fcos.map import Mapper
from test.fcos.level_map_fixtures import (
image_size,
strides,
sample,
targets,
expected_level_map_sizes,
expected_joint_map_8x8
)
@pytest.fixture
def expected_level_thresholds(expected_level_m... | 1.929688 | 2 |
setup.py | BoaVaga/boavaga_server | 0 | 33327 | import sqlalchemy
from sqlalchemy.ext.compiler import compiles
import sys
from src.container import create_container
from src.models.base import Base
from src.models import *
@compiles(sqlalchemy.LargeBinary, 'mysql')
def compile_binary_mysql(element, compiler, **kw):
if isinstance(element.length, int) and eleme... | 2.3125 | 2 |
cli/src/pcluster/cli/middleware.py | enrico-usai/cfncluster | 415 | 33328 | # Copyright 2021 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 acc... | 2.0625 | 2 |
src/pyrin/audit/api.py | wilsonGmn/pyrin | 0 | 33329 | <filename>src/pyrin/audit/api.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
audit api module.
"""
import pyrin.audit.services as audit_services
from pyrin.api.router.decorators import api
audit_config = audit_services.get_audit_configurations()
audit_config.update(no_cache=True)
is_enabled = audit_config.pop('enabled',... | 1.914063 | 2 |
python/stage_2/2839.py | smartx-jshan/Coding_Practice | 0 | 33330 | a = int(input())
sum = 0
while True:
if ( a == 0):
print (int(sum))
break
if ( a <= 2):
print (-1)
break
if (a%5 != 0):
a = a - 3
sum = sum + 1
else:
sum = sum + int(a/5)
a = 0
| 3.578125 | 4 |
tests/test_losses/test_mesh_losses.py | nightfuryyy/mmpose | 1,775 | 33331 | # Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from numpy.testing import assert_almost_equal
from mmpose.models import build_loss
from mmpose.models.utils.geometry import batch_rodrigues
def test_mesh_loss():
"""test mesh loss."""
loss_cfg = dict(
type='MeshLoss',
... | 1.84375 | 2 |
seqs/IntegerHeap.py | vincentdavis/special-sequences | 1 | 33332 | """IntegerHeap.py
Priority queues of integer keys based on van Emde Boas trees.
Only the keys are stored; caller is responsible for keeping
track of any data associated with the keys in a separate dictionary.
We use a version of vEB trees in which all accesses to subtrees
are performed indirectly through a hash table... | 3.265625 | 3 |
core/client/client.py | spiritotaku/fedlearn-algo | 1 | 33333 | <gh_stars>1-10
# Copyright 2021 Fedlearn authors.
# 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 agr... | 2.328125 | 2 |
L1Trigger/GlobalTriggerAnalyzer/test/L1GtPackUnpackAnalyzer_cfg.py | SWuchterl/cmssw | 6 | 33334 | <filename>L1Trigger/GlobalTriggerAnalyzer/test/L1GtPackUnpackAnalyzer_cfg.py
from __future__ import print_function
#
# cfg file to pack (DigiToRaw) a GT DAQ record, unpack (RawToDigi) it back
# and compare the two set of digis
#
# V <NAME> 2009-04-06
import FWCore.ParameterSet.Config as cms
# process
process = cms.Pr... | 1.8125 | 2 |
ranges/RangeDict.py | wikti/ranges | 0 | 33335 | from operator import is_
from ._helper import _UnhashableFriendlyDict, _LinkedList, _is_iterable_non_string, Rangelike
from .Range import Range
from .RangeSet import RangeSet
from typing import Iterable, Union, Any, TypeVar, List, Tuple, Dict, Tuple
T = TypeVar('T', bound=Any)
V = TypeVar('V', bound=Any)
class Range... | 3.046875 | 3 |
cases/urls.py | testyourcodenow/core | 1 | 33336 | from django.urls import path
from cases.api.get_visuals_data import UpdateVisualsData
from cases.api.kenyan_cases import KenyanCaseList
from cases.api.visuals import VisualList
urlpatterns = [
path('kenyan/all', KenyanCaseList.as_view(), name='Historical data'),
path('history/', VisualList.as_view(), name='Hi... | 1.585938 | 2 |
tests/test_cloudfront_distribution.py | aexeagmbh/cfn-lint-rules | 1 | 33337 | from typing import List
import pytest
from cfn_lint_ax.rules import (
CloudfrontDistributionComment,
CloudfrontDistributionLogging,
)
from tests.utils import BAD_TEMPLATE_FIXTURES_PATH, ExpectedError, assert_all_matches
@pytest.mark.parametrize(
"filename,expected_errors",
[
(
"c... | 2.28125 | 2 |
holdit/records.py | caltechlibrary/holdit | 2 | 33338 | '''
records.py: base record class for holding data
Authors
-------
<NAME> <<EMAIL>> -- Caltech Library
Copyright
---------
Copyright (c) 2018 by the California Institute of Technology. This code is
open-source software released under a 3-clause BSD license. Please see the
file "LICENSE" for more information.
'''
... | 2.515625 | 3 |
pyroSAR/gamma/srtm.py | ibaris/pyroSAR | 1 | 33339 | #!/usr/bin/env python
##############################################################
# preparation of srtm data for use in gamma
# module of software pyroSAR
# <NAME> 2014-18
##############################################################
"""
The following tasks are performed by executing this script:
-reading of a par... | 2.46875 | 2 |
youtrack/test_create_issue.py | JiSoft/python_test_api | 0 | 33340 | import unittest
from my_test_api import TestAPI
class TestCreateIssue(TestAPI):
def test_create_issue(self):
params = {
'project': 'API',
'summary': 'test issue by robots',
'description': 'You are mine ! ',
}
response = self.put('/issue/', params)
... | 3.171875 | 3 |
test/test_add_contact_to_group.py | havrylyshyn/python_training | 0 | 33341 | from model.contact import Contact
from model.group import Group
import random
def test_add_contact_to_group(app, db):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="contact", lastname="forGroup", address="UA, Kyiv, KPI", homephone="0123456789", email="<EMAIL>"))
if len(db.ge... | 2.734375 | 3 |
deadtrees/network/extra/resunetplusplus/__init__.py | cwerner/deadtrees | 1 | 33342 | from .model import ResUnetPlusPlus
| 1.109375 | 1 |
datacamp/case_collections/study_crimes.py | anilgeorge04/learn-ds | 0 | 33343 | import csv
from collections import Counter
from collections import defaultdict
from datetime import datetime
# Make dictionary with district as key
# Create the CSV file: csvfile
csvfile = open('crime_sampler.csv', 'r')
# Create a dictionary that defaults to a list: crimes_by_district
crimes_by_district = defaultdic... | 3.875 | 4 |
python/nsc/nsc_instcal_combine_breakup_idstr.py | dnidever/noaosourcecatalog | 4 | 33344 | #!/usr/bin/env python
# Break up idstr file into separate measid/objectid lists per exposure on /data0
import os
import sys
import numpy as np
import time
from dlnpyutils import utils as dln, db
from astropy.io import fits
import sqlite3
import socket
from argparse import ArgumentParser
def breakup_idstr(dbfile):
... | 2.546875 | 3 |
Chapter10/fabfile_operations.py | frankethp/Hands-On-Enterprise-Automation-with-Python | 51 | 33345 | #!/usr/bin/python
__author__ = "<NAME>"
__EMAIL__ = "<EMAIL>"
from fabric.api import *
env.hosts = [
'10.10.10.140', # ubuntu machine
'10.10.10.193', # CentOS machine
]
env.user = "root"
env.password = "<PASSWORD>"
def run_ops():
output = run("hostname")
def get_ops():
try:
get("/var/lo... | 1.992188 | 2 |
WebApp/application.py | Ezetowers/AppEngine_EventsManagement | 0 | 33346 | <reponame>Ezetowers/AppEngine_EventsManagement
import os
from Model.Model import *
from Handlers.AddGuest import AddGuest
from Handlers.QueryGuest import QueryGuest
from Handlers.EventsCreation import EventsCreation
from Handlers.EventRemoval import EventRemoval
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2... | 2.0625 | 2 |
leap/leap_test.py | shozi91/xpython | 0 | 33347 | <filename>leap/leap_test.py
import unittest
from year import is_leap_year
class YearTest(unittest.TestCase):
def test_leap_year(self):
self.assertTrue(is_leap_year(1996))
def test_non_leap_year(self):
self.assertFalse(is_leap_year(1997))
def test_non_leap_even_year(self):
self.a... | 3.453125 | 3 |
Examples/batch_data_reduction.py | keflavich/TurbuStat | 0 | 33348 | <reponame>keflavich/TurbuStat
# Licensed under an MIT open source license - see LICENSE
'''
Runs data_reduc on all data cubes in the file.
Creates a folder for each data cube and its products
Run from folder containing data cubes
'''
from turbustat.data_reduction import *
from astropy.io.fits import getdata
import... | 2.515625 | 3 |
tests/test_dataset_tensor_backend.py | evendrow/deepsnap | 0 | 33349 | <reponame>evendrow/deepsnap<gh_stars>0
import copy
import random
import torch
import unittest
from torch_geometric.datasets import TUDataset, Planetoid
from copy import deepcopy
from deepsnap.graph import Graph
from deepsnap.hetero_graph import HeteroGraph
from deepsnap.dataset import GraphDataset, Generator, EnsembleG... | 2.28125 | 2 |
kube-socialNetwork/scripts/init_social_graph.py | Romero027/DeathStarBench | 0 | 33350 | import aiohttp
import asyncio
import os
import string
import random
import argparse
async def upload_follow(session, addr, user_0, user_1):
payload = {'user_name': 'username_' + user_0,
'followee_name': 'username_' + user_1}
async with session.post(addr + '/wrk2-api/user/follow', data=payload) as res... | 2.703125 | 3 |
src/reader/test_cases/test_wiki_article.py | LukeMurphey/textcritical_net | 6 | 33351 | <filename>src/reader/test_cases/test_wiki_article.py<gh_stars>1-10
from . import TestReader
from reader.models import WikiArticle
class TestWikiArticle(TestReader):
def test_get_wiki_article(self):
wiki = WikiArticle(search="M. Antonius Imperator Ad Se Ipsum", article="Meditations")
wiki.save(... | 2.9375 | 3 |
tests/test_predictions.py | platiagro/projects | 6 | 33352 | # -*- coding: utf-8 -*-
import unittest
import unittest.mock as mock
import requests
import json
from io import BytesIO
from fastapi.testclient import TestClient
from projects.api.main import app
from projects.database import session_scope
import tests.util as util
app.dependency_overrides[session_scope] = util.ove... | 2.703125 | 3 |
examples/add_module.py | satyavls/simple_mock | 1 | 33353 | <gh_stars>1-10
def add_num(x, y):
return x + y
def sub_num(x, y):
return x - y
class MathFunctions(object):
pass
| 2.375 | 2 |
terraform/stacks/threat-intelligence/lambdas/python/cloud-sniper-threat-intelligence/cloud_sniper_threat_intelligence.py | houey/cloud-sniper | 160 | 33354 | <gh_stars>100-1000
import boto3
import json
import datetime
import logging
import os
import ipaddress
import requests
log = logging.getLogger()
log.setLevel(logging.INFO)
QUEUE_URL = os.environ['SQS_QUEUE_CLOUD_SNIPER']
DYNAMO_TABLE = os.environ['DYNAMO_TABLE_CLOUD_SNIPER']
WEBHOOK_URL = os.environ['WEBHOOK_URL_CLOUD... | 1.976563 | 2 |
tests/apitests/python/test_tag_immutability.py | tedgxt/harbor | 1 | 33355 | from __future__ import absolute_import
import unittest
import sys
from testutils import ADMIN_CLIENT
from testutils import harbor_server
from library.project import Project
from library.user import User
from library.repository import Repository
from library.repository import push_image_to_project
from li... | 2.359375 | 2 |
src/hackmds/tasks.py | chairco/dj-Hackmd-notifer | 4 | 33356 | <reponame>chairco/dj-Hackmd-notifer
import requests
import logging
import os
import diffhtml
from django.conf import settings
from django.shortcuts import render
from django.core.mail import EmailMessage
from django.template import loader
from django.contrib.auth.models import User
from django_q.tasks import async_ch... | 1.992188 | 2 |
camunda/utils/log_utils.py | finexioinc/camunda-external-task-client-python3 | 0 | 33357 | <reponame>finexioinc/camunda-external-task-client-python3
import logging
from frozendict import frozendict
def log_with_context(message, context=frozendict({}), log_level='info', **kwargs):
log_function = __get_log_function(log_level)
log_context_prefix = __get_log_context_prefix(context)
if log_context... | 2.171875 | 2 |
Python/Basic Data Types/Lists.py | justchilll/HackerRank | 1 | 33358 | <gh_stars>1-10
if __name__ == '__main__':
N = int(input())
main_list=[]
for iterate in range(N):
entered_string=input().split()
if entered_string[0] == 'insert':
main_list.insert(int(entered_string[1]),int(entered_string[2]))
elif entered_string[0] == 'print':
... | 3.796875 | 4 |
wildlifecompliance/migrations/0055_auto_20180704_0848.py | preranaandure/wildlifecompliance | 1 | 33359 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-07-04 00:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wildlifecompliance', '0054_assessment_licence_activity_type'),
]
ope... | 1.609375 | 2 |
day2/day2.py | tlee911/aoc2021 | 0 | 33360 | with open('input.txt', 'r') as file:
input = file.readlines()
input = [ step.split() for step in input ]
input = [ {step[0]: int(step[1])} for step in input ]
def part1():
x = 0
y = 0
for step in input:
x += step.get('forward', 0)
y += step.get('down', 0)
y -= step.get('up', 0)... | 3.53125 | 4 |
user_metrics/metrics/edit_count.py | wikimedia/user_metrics | 1 | 33361 |
__author__ = "<NAME>"
__date__ = "July 27th, 2012"
__license__ = "GPL (version 2 or later)"
from os import getpid
from collections import namedtuple
import user_metric as um
from user_metrics.metrics import query_mod
from user_metrics.metrics.users import UMP_MAP
from user_metrics.utils import multiprocessing_wrapper... | 2.1875 | 2 |
sdk/python/pulumi_aws_native/panorama/get_application_instance.py | pulumi/pulumi-aws-native | 29 | 33362 | <reponame>pulumi/pulumi-aws-native
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, over... | 1.5 | 2 |
year_3/comppi_1/managers/views.py | honchardev/KPI | 0 | 33363 | <gh_stars>0
import json
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
... | 2.0625 | 2 |
tests/union-env.py | fangyuchen86/mini-pysonar | 22 | 33364 | def f(x):
if x:
x = 1
else:
x = 'zero'
y = x
return y
f(1)
| 3.265625 | 3 |
mechroutines/es/runner/scan.py | keceli/mechdriver | 0 | 33365 | <reponame>keceli/mechdriver<filename>mechroutines/es/runner/scan.py
""" Library to perform sequences of electronic structure calculations
along a molecular coordinate and save the resulting information to
SCAN or CSAN layers of the save filesystem.
"""
import numpy
import automol
import autofile
import elstru... | 2.21875 | 2 |
book-copier.py | BoKnowsCoding/hbd-organizer | 0 | 33366 | """
Designed to be used in conjunction with xtream1101/humblebundle-downloader.
Takes the download directory of that script, then copies all file types of
each non-comic book to a chosen directory.
Each folder in the target directory will be one book, containing the
different file formats available for the boo... | 3.125 | 3 |
nemo/collections/tts/torch/helpers.py | 23jura23/NeMo | 0 | 33367 | <reponame>23jura23/NeMo
# Copyright (c) 2021, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | 2.078125 | 2 |
Project Pattern/pattern_26.py | AMARTYA2020/nppy | 4 | 33368 | class Pattern_Twenty_Six:
'''Pattern twenty_six
***
* *
*
* ***
* *
* *
***
'''
def __init__(self, strings='*'):
if not isinstance(strings, str):
strings = str(strings)
for i in range(7):
if i i... | 3.59375 | 4 |
SVD.py | divi9626/RANSAC | 0 | 33369 | <reponame>divi9626/RANSAC<filename>SVD.py
import numpy as np
A = np.asarray([[-5, -5, -1, 0, 0, 0, 500, 500, 100],
[0, 0, 0, -5, -5, -1, 500, 500, 100],
[-150, -5, -1, 0, 0, 0, 30000, 1000, 200],
[0, 0, 0, -150, -5, -1, 12000, 400, 80... | 2.5625 | 3 |
apps/university/api/serializers.py | ilyukevich/university-schedule | 0 | 33370 | from rest_framework import serializers
from ..models import Faculties, Departaments, StudyGroups, Auditories, Disciplines
class FacultiesSerializers(serializers.ModelSerializer):
"""Faculties API"""
class Meta:
fields = '__all__'
model = Faculties
class DepartamentsSerializers(serializers.M... | 2.4375 | 2 |
app/views/info/info_routes.py | tjdaley/publicdataws | 0 | 33371 | """
info_routes.py - Handle the routes for basic information pages.
This module provides the views for the following routes:
/about
/privacy
/terms_and_conditions
Copyright (c) 2019 by <NAME>. All Rights Reserved.
"""
from flask import Blueprint, render_template
info_routes = Blueprint("info_routes", __name__, tem... | 2.84375 | 3 |
guppe/atividades/secao_7/ex030.py | WesleyLucas97/cursos_python | 0 | 33372 | <gh_stars>0
"""
Faça um programa que leia dois vetores de 10 elementos. Crie um vetor que seja a intersecçao entre os 2 vetores
anteriores, ou seja, que contém apenas os números que estao em ambos os vetores. Nao deve conter números repetidos.
"""
from random import randint
vetor1 = []
vetor2 = []
inter = []
for x in ... | 3.671875 | 4 |
tests/internal/instance_type/test_instance_type_h_auto.py | frolovv/aws.ec2.compare | 0 | 33373 | <gh_stars>0
# Testing module instance_type.h
import pytest
import ec2_compare.internal.instance_type.h
def test_get_internal_data_instance_type_h_get_instances_list():
assert len(ec2_compare.internal.instance_type.h.get_instances_list()) > 0
def test_get_internal_data_instance_type_h_get():
assert len(ec2_compare... | 2.125 | 2 |
gridSearch.py | piotrbla/pyExamples | 0 | 33374 | #!/bin/python3
import sys
# t = int(input().strip())
# for a0 in range(t):
# G = [
# "7283455864",
# "6731158619",
# "8988242643",
# "3830589324",
# "2229505813",
# "5633845374",
# "6473530293",
# "7053106601",
# "0834282956",
# "4607924137"
# ]
# P = ["9505", "3845", "3530"]
G... | 3.078125 | 3 |
rollbar_udp_agent/util.py | lrascao/rollbar-udp-agent | 1 | 33375 | import os
import logging
import tempfile
log = logging.getLogger(__name__)
class PidFile(object):
""" A small helper class for pidfiles. """
PID_DIR = '/var/run/rollbard'
def __init__(self, program, pid_dir=None):
self.pid_file = "%s.pid" % program
self.pid_dir = pid_dir or self.get_defa... | 3.03125 | 3 |
server/migrations/0019_auto_20151124_1806.py | gregneagle/sal | 2 | 33376 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0018_auto_20151124_1654'),
]
operations = [
migrations.CreateModel(
name='UpdateHistoryItem',
... | 1.78125 | 2 |
libc/kernel/tools/update_all.py | Keneral/abionic | 0 | 33377 | <reponame>Keneral/abionic<gh_stars>0
#!/usr/bin/env python
#
import sys, cpp, kernel, glob, os, re, getopt, clean_header, subprocess
from defaults import *
from utils import *
def usage():
print """\
usage: %(progname)s [kernel-original-path] [kernel-modified-path]
this program is used to update all the aut... | 2.1875 | 2 |
binding/python/ddls/feeder/batch.py | huzelin/ddls | 3 | 33378 | """ batch iterator"""
from __future__ import absolute_import
import ctypes
from ddls.base import check_call, LIB, c_str, c_array
from ddls.hpps.tensor import Tensor
class Batch(object):
""" The BatchIterator
"""
def __init__(self, handle):
""" The batch from iterator
"""
self.hand... | 2.421875 | 2 |
pymoo/util/ref_dirs/energy_layer.py | jarreguit/pymoo | 762 | 33379 | import autograd.numpy as anp
import numpy as np
from autograd import value_and_grad
from pymoo.factory import normalize
from pymoo.util.ref_dirs.energy import squared_dist
from pymoo.util.ref_dirs.optimizer import Adam
from pymoo.util.reference_direction import ReferenceDirectionFactory, scale_reference_directions
c... | 2.09375 | 2 |
convert_pfm_json.py | biolib/deepclip | 7 | 33380 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("-seqs",
required=True,
type=str,
default=None,
help="File contain... | 2.515625 | 3 |
xmpt/apps.py | anzrz/djangoapp | 1 | 33381 | from django.apps import AppConfig
class XmptConfig(AppConfig):
name = 'xmpt'
| 1.015625 | 1 |
prc/fatigue.py | moulin1024/WIRELES2 | 3 | 33382 | import numpy as np
import math
import fatpack
import matplotlib.pyplot as plt
import pandas as pd
#Create a function that reutrns the Goodman correction:
def Goodman_method_correction(M_a,M_m,M_max):
M_u = 1.5*M_max
M_ar = M_a/(1-M_m/M_u)
return M_ar
def Equivalent_bending_moment(M_ar,Neq,m):
P = M_ar... | 2.390625 | 2 |
executor/process.py | xolox/python-executor | 82 | 33383 | # Programmer friendly subprocess wrapper.
#
# Author: <NAME> <<EMAIL>>
# Last Change: March 2, 2020
# URL: https://executor.readthedocs.io
"""
Portable process control functionality for the `executor` package.
The :mod:`executor.process` module defines the :class:`ControllableProcess`
abstract base class which enable... | 2.3125 | 2 |
lambda/qldb/import_transport_product.py | UBC-CIC/VaccineDistribution | 0 | 33384 | from logging import basicConfig, getLogger, INFO
from connect_to_ledger import create_qldb_driver
from amazon.ion.simpleion import dumps, loads
logger = getLogger(__name__)
basicConfig(level=INFO)
from constants import Constants
from register_person import get_scentityid_from_personid,get_scentity_contact
from sampled... | 1.867188 | 2 |
rewx/components.py | akrk1986/re-wx | 0 | 33385 | """
All components and wrappers currently
supported by rewx.
"""
import wx
import wx.adv
import wx.lib.scrolledpanel
import wx.media
ActivityIndicator = wx.ActivityIndicator
Button = wx.Button
BitmapButton = wx.BitmapButton
CalendarCtrl = wx.adv.CalendarCtrl
CheckBox = wx.CheckBox
# CollapsiblePane = wx.CollapsiblePa... | 2.34375 | 2 |
test/blank_named_regtest.py | shraddha-pandhe/iscpy | 0 | 33386 | #!/usr/bin/python
# Copyright (c) 2009, Purdue University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list ... | 1.609375 | 2 |
oo/carro.py | RafaelLJC/pythonbirds | 0 | 33387 | <reponame>RafaelLJC/pythonbirds
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 21 16:41:09 2020
@author: rafae
Exercício
Você deve criar uma classe carro que vai possuir dois atributos
compostos por outras duas classes:
1) motor;
2) Direção.
O motor terá a responsabilidade de controlar a velocidade.
Ele oferece o... | 4.125 | 4 |
src/models/items/constants.py | MDRCS/deals-catcher | 0 | 33388 | <reponame>MDRCS/deals-catcher
Collection = "items"
| 0.945313 | 1 |
before.py | PatrickLTI/Refactor-Code-Smell | 0 | 33389 | <reponame>PatrickLTI/Refactor-Code-Smell
"""
Very advanced Employee management system.
"""
from dataclasses import dataclass
from typing import List
FIXED_VACATION_DAYS_PAYOUT = 5 # The fixed nr of vacation days that can be paid out.
@dataclass
class Employee:
"""Basic representation of an employee at the comp... | 3.640625 | 4 |
python/decorator/function_transform_with_decorator.py | zeroam/TIL | 0 | 33390 | <filename>python/decorator/function_transform_with_decorator.py<gh_stars>0
def debug_transformer(func):
def wrapper():
print(f'Function `{func.__name__}` called')
func()
print(f'Function `{func.__name__}` finished')
return wrapper
@debug_transformer
def walkout():
print('Bye Felic... | 2.5625 | 3 |
logging_context/helpers.py | vuonglv1612/logging-context | 0 | 33391 | import functools
import logging
from typing import Callable
from logging_context.context.base import BaseContext
from .context import get_logging_context
def context_logging_factory(record_factory: Callable, context: BaseContext) -> Callable:
@functools.wraps(record_factory)
def wrapper(*args, **kwargs):
... | 2.4375 | 2 |
script/proxycheck/check.py | kenshinx/rps | 6 | 33392 | <gh_stars>1-10
#!/usr/bin/env python
import re
import sys
import time
import logging
import asyncore
import optparse
from datetime import datetime
import schedule
from pymongo import MongoReplicaSetClient, MongoClient
from async_s5 import AsyncSocks5Client
from async_http import AsyncHTTPClient
from async_http_tunn... | 2.0625 | 2 |
Notebook/KL Divergence Loop.py | yxie367/Mushrooms | 0 | 33393 | # %% [Algorithm 1c Loop]
# # MUSHROOMS
# %% [markdown]
# ## Binary Classification
# %% [markdown]
# ### Imports
# %%
import os
import pandas as pd
import numpy as np
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
# %% [markdown]
# ### Load Data
dataset = pd.read_csv(r"C:\User... | 2.90625 | 3 |
galaxydb/__init__.py | alantelles/galaxydb | 2 | 33394 | <gh_stars>1-10
from galaxydb.column import Column
from galaxydb.scheme import Scheme
from galaxydb.logic import Logic
from galaxydb.table import Table
from galaxydb.constants import *
from galaxydb.statics import *
| 1.125 | 1 |
attic/library/kepler.py | vdods/heisenberg | 3 | 33395 | <filename>attic/library/kepler.py
# NOTE: This changes a/b to produce a floating point approximation of that
# ratio, not the integer quotient. For integer quotient, use a//b instead.
from __future__ import division
import fourier_parameterization
import numpy as np
import multiindex
import symbolic
import sympy
impo... | 2.75 | 3 |
flaskr/tripods/tripod.py | ardtieboy/campy | 0 | 33396 | <reponame>ardtieboy/campy<filename>flaskr/tripods/tripod.py
import pantilthat
class Tripod(object):
def __init__(self):
self.horizontal = 0
self.vertical = 0
self.step_size = 5
pantilthat.pan(0)
pantilthat.tilt(0)
def left(self):
if (-80 < self.horizontal):
... | 3.1875 | 3 |
mercury_engine_data_structures/pkg_editor.py | duncathan/mercury-engine-data-structures | 0 | 33397 | import collections
import contextlib
import os.path
import typing
from contextlib import ExitStack
from pathlib import Path
from typing import BinaryIO, Dict, Optional, Generator, Iterator, Set
from mercury_engine_data_structures import formats, dread_data
from mercury_engine_data_structures.formats.base_resource impo... | 2.3125 | 2 |
code/textProcessing.py | corollari/BaaCL | 1 | 33398 | <gh_stars>1-10
def preprocess(text):
text=text.replace('\n', '\n\r')
return text
def getLetter():
return open("./input/letter.txt", "r").read()
| 2.59375 | 3 |
lrthubcore/users/api/views.py | xrojan/lrthub-core | 0 | 33399 | <gh_stars>0
# Created by <NAME> on 09/07/2018
# @email <EMAIL>
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status, generics
... | 2.171875 | 2 |