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 |
|---|---|---|---|---|---|---|
checkov/terraform/checks/resource/digitalocean/DropletSSHKeys.py | pmalkki/checkov | 1 | 12769351 | from checkov.common.models.enums import CheckCategories
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
from typing import Any
from checkov.common.models.consts import ANY_VALUE
class DropletSSHKeys(BaseResourceValueCheck):
def __init__(self):
name = "Ensure... | 2.203125 | 2 |
code/segment_cells.py | a9w/Fat2_polarizes_WAVE | 0 | 12769352 | <reponame>a9w/Fat2_polarizes_WAVE
"""
For all base images in a directory, segment the cells from a 2D image or image
stack. Batch segmentation does not allow hand-adjustment of tissue segmentation
parameters by image, which is necessary for some images.
Input is a directory with .tif files to be segmented, either a si... | 2.734375 | 3 |
sudan-art/django-backend/sudan_art/migrations/0004_alter_artwork_tags.py | osintalex/sudan-art | 1 | 12769353 | # Generated by Django 4.0 on 2022-04-16 00:55
import sudan_art.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("sudan_art", "0003_alter_artwork_tags"),
]
operations = [
migrations.AlterField(
model_name="artwork",
... | 1.484375 | 1 |
examples/s3client.py | JohnVinyard/annotate-api | 1 | 12769354 | <gh_stars>1-10
import boto3
from botocore.exceptions import ClientError
from botocore.config import Config
from botocore import UNSIGNED
class ObjectStorageClient(object):
def __init__(self, endpoint, region, access_key, secret, bucket):
self.bucket = bucket
self.secret = secret
self.acces... | 1.992188 | 2 |
spatial_correlation.py | Binxu-Stack/Statistics | 0 | 12769355 | <reponame>Binxu-Stack/Statistics
#!/usr/bin/env ovitos
import numpy as np
from ovito.io import import_file
from ovito.data import CutoffNeighborFinder
filename = "min.cfg"
max_r = 5.0
nbins = 10
dr = max_r/float(nbins)
node = import_file(filename)
data = node.source
finder = CutoffNeighborFinder(max_r, data)
atomic_m... | 2.125 | 2 |
src/integral_timber_joints/rhino/debug_movements.py | gramaziokohler/integral_timber_joints | 3 | 12769356 | import Rhino # type: ignore
import rhinoscriptsyntax as rs
import scriptcontext
import re
from integral_timber_joints.rhino.load import get_process, get_process_artist, process_is_none
from integral_timber_joints.geometry import JointHalfLap
from integral_timber_joints.rhino.assembly_artist import AssemblyNurbsArtist
... | 1.65625 | 2 |
rubberband/handlers/fe/file.py | ambros-gleixner/rubberband | 4 | 12769357 | """Contains FileView."""
from tornado.web import HTTPError
from rubberband.models import TestSet, Result
from rubberband.constants import EXPORT_DATA_FORMATS, EXPORT_FILE_TYPES
from .base import BaseHandler
class FileView(BaseHandler):
"""Request handler handling the view or download of log files or log file con... | 2.71875 | 3 |
src/adventofcode2020/solutions/day11.py | RoelAdriaans/adventofcode2020 | 2 | 12769358 | from abc import abstractmethod
from collections import defaultdict, deque
from typing import Deque, Dict
from adventofcode2020.utils.abstract import FileReaderSolution
class Day11:
count_seats: int
@abstractmethod
def count_next_to_it(self, grid, row, col) -> int:
"""Count the number of seats ne... | 3.765625 | 4 |
src/spaczz/customattrs.py | JonasHablitzel/spaczz | 153 | 12769359 | <gh_stars>100-1000
"""Custom spaCy attributes for spaczz."""
from __future__ import annotations
from typing import Iterable, Optional, Set, Tuple, Type
import warnings
from spacy.tokens import Doc, Span, Token
from .exceptions import AttrOverwriteWarning, SpaczzSpanDeprecation
class SpaczzAttrs:
"""Adds spaczz... | 2.3125 | 2 |
src/pybel/resources/definitions/definitions.py | tehw0lf/pybel | 0 | 12769360 | # -*- coding: utf-8 -*-
import logging
import os
import requests.exceptions
import six
from configparser import ConfigParser
from ..exc import EmptyResourceError, InvalidResourceError, MissingResourceError
from ..utils import download, is_url
__all__ = [
'parse_bel_resource',
'get_lines',
'get_bel_resour... | 2.5 | 2 |
usersapp/migrations/0002_auto_20200309_1308.py | AlpsRunner/money_tranfer_page | 0 | 12769361 | # Generated by Django 2.2.3 on 2020-03-09 08:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('usersapp', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='customuser',
options={'ordering': [... | 1.671875 | 2 |
dataset_creation/find_answer.py | AseelAlshorafa/SOQAL | 109 | 12769362 | <filename>dataset_creation/find_answer.py
import sys
import os
from scipy import spatial
import numpy as np
def editDistance(str1, str2, m, n):
# edit distance recursive implementation, m = len(str1) and n = len(str2)
dp = [[0 for x in range(n + 1)] for x in range(m + 1)]
for i in range(m + 1):
for... | 3.03125 | 3 |
scripts/djvuPageLabels.py | Noitaenola/ScanManual | 2 | 12769363 | <gh_stars>1-10
"""
Generate page labels for the djvu and insert them.
"""
import os
SCAN = "../djv/SCAN_INS_OCR_BOOK.djvu"
SCAN_PAG = "../djv/SCAN_INS_OCR_BOOK_PAG.djvu"
djvuPageLabels = "djvuPageLabels.dsed"
# Delete old files (if they exist).
if os.path.isfile(SCAN_PAG):
os.remove(SCAN_PAG)
if os.path.isfile(d... | 3.015625 | 3 |
scripts/print.py | DavideMammarella/USI-MSDE-Thesis-Code | 4 | 12769364 | <reponame>DavideMammarella/USI-MSDE-Thesis-Code<gh_stars>1-10
# Copyright 2021 Testing Automated @ Università della Svizzera italiana (USI)
# All rights reserved.
# This file is part of the project SelfOracle, a misbehaviour predictor for autonomous vehicles,
# developed within the ERC project PRECRIME
# and is release... | 1.84375 | 2 |
mesa.py | jadexter/astr3400 | 0 | 12769365 |
import numpy as np
import os
from astropy.io import ascii
class mesa:
def init(self):
###### parameters ####################
self.path = '/Users/Jason/code/mesa_progenitors/' # file path
# self.type = 'solar' # file type
self.name = 'profileXX.data' ... | 2.890625 | 3 |
data_preparation/get_density_map_gaussian.py | ZhengPeng7/Multi_column_CNN_in_Keras_for_crowd_counting | 5 | 12769366 | import cv2
import math
import numpy as np
def get_density_map_gaussian(im, points):
im_density = np.zeros_like(im, dtype=np.float64)
h, w = im_density.shape
if points is None:
return im_density
if points.shape[0] == 1:
x1 = max(0, min(w-1, round(points[0, 0])))
y1 = max(0, min... | 2.578125 | 3 |
src/analisador_sintatico/Node.py | matheusfbonfim/BahTche-Language-Compiler | 1 | 12769367 | class Node:
def __init__(self, name=None, terminal=False):
self._name = name
self._children = []
self._level = None
self._terminal = terminal
# ====================
# GETTERS E SETTERS
@property
def name(self):
return self._name
@name.setter
def name... | 3.3125 | 3 |
page_objects/temperature_main_page.py | NikhilPrakashrao/evaluationtask | 0 | 12769368 | """
This class models the main Temperature page.
"""
from .Base_Page import Base_Page
from .temperature_object import Temperature_Object
from utils.Wrapit import Wrapit
class Temperature_Main_Page(Base_Page,Temperature_Object):
"Page Object for the temperature main page"
def start(self):
"Use... | 3.09375 | 3 |
helper_scripts/components/headers_helper.py | fengjixuchui/difuze | 347 | 12769369 | def get_all_includes(comp_args, dst_includes):
i = 0
while i < len(comp_args):
curr_arg = comp_args[i].strip()
if curr_arg == "-isystem":
curr_arg1 = "-I" + comp_args[i+1].strip()
if curr_arg1 not in dst_includes:
dst_includes.append(curr_arg1)
if ... | 2.765625 | 3 |
tests/test_clean_string.py | jceresearch/pydit | 0 | 12769370 | """ test of base functions"""
import os
import sys
# pylint: disable=import-error disable=wrong-import-position
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from pydit import setup_logging, clean_string
# import numpy as np
# from datetime import datetime, date, timedelta
# from panda... | 2.53125 | 3 |
KilluaRobot/utils/adminperms.py | apisuserbot/Killua-Robot | 3 | 12769371 | <reponame>apisuserbot/Killua-Robot<filename>KilluaRobot/utils/adminperms.py
import asyncio
from pyrogram import filters
from pyrogram.types import ChatPermissions, Message
from KilluaRobot import pbot as app
async def member_permissions(chat_id: int, user_id: int):
perms = []
member = await app.get_chat_membe... | 2.078125 | 2 |
gamestonk_terminal/stocks/comparison_analysis/ca_controller.py | Aerex/GamestonkTerminal | 3 | 12769372 | <gh_stars>1-10
"""Comparison Analysis Controller Module"""
__docformat__ = "numpy"
# pylint:disable=too-many-lines
import argparse
import difflib
import random
from typing import List
from datetime import datetime, timedelta
import yfinance as yf
from colorama import Style
from matplotlib import pyplot as plt
from pro... | 2.015625 | 2 |
blog/admin.py | thanhngk/blog | 0 | 12769373 | from django.contrib import admin
from django.utils.html import mark_safe, format_html
from . import models
class CategoryAdmin(admin.ModelAdmin):
fields = ('image_tag', 'title', 'description', 'image',)
readonly_fields = ('image_tag',)
class PostAdmin(admin.ModelAdmin):
fields = ('title', 'content', 'a... | 2.25 | 2 |
icarus/models/cache/systems.py | Chrisys93/IcarusRepoSEND | 4 | 12769374 | # -*- coding: utf-8 -*-
"""Simple networks of caches modeled as single caches."""
import random
import numpy as np
from icarus.util import inheritdoc
from icarus.tools import DiscreteDist
from icarus.registry import register_cache_policy, CACHE_POLICY
from .policies import Cache
__all__ = [
'PathCache',
'Tr... | 2.953125 | 3 |
app/service/train_mleng/runner.py | kislerdm/conversion_rate_service | 1 | 12769375 | <reponame>kislerdm/conversion_rate_service
import os
import time
import yaml
import argparse
from typing import Tuple
import pandas as pd
import numpy as np
from google.cloud import storage
from service_pkg.logger import getLogger
from service_pkg.file_io import load_data
import importlib
from pathlib import Path
np.... | 2.5 | 2 |
narrowing_ai_research/transformers/process_paper_data.py | nestauk/narrowing_ai_research | 4 | 12769376 | import pandas as pd
import pickle
from narrowing_ai_research.utils.list_utils import flatten_list
import narrowing_ai_research
import datetime
import logging
import os
import json
project_dir = narrowing_ai_research.project_dir
def make_ai_ids():
"""Function to extract AI Ids from the categories and expanded pap... | 2.921875 | 3 |
kerastools/models/horde_models.py | gyfastas/ICCV2019-Horde | 84 | 12769377 | #!/usr/bin/env python
# coding: utf-8
from tensorflow.keras.models import Model
from tensorflow.keras.layers import GlobalAveragePooling2D, Conv2D, Dense, Concatenate, Flatten, Input
from .abe_models import ABE
from ..layers import L2Normalisation
from ..layers.horde_layers import CKOP, PKOB
from .extractors import ge... | 2.28125 | 2 |
EventHandler/repo/push.py | AdityaTelange/bitbucket-telegram-bot-webhook | 2 | 12769378 | <reponame>AdityaTelange/bitbucket-telegram-bot-webhook<gh_stars>1-10
def push(data_json):
# A user pushes 1 or more commits to a repository.
repository = data_json['repository']
# repository_scm = repository['scm']
repository_name = repository['name']
repository_link = repository['links']['html']['h... | 2.5625 | 3 |
django_dicom/models/managers/messages.py | ZviBaratz/django-dicom | 8 | 12769379 | <gh_stars>1-10
"""
Messages for the :mod:`~django_dicom.models.managers` module.
"""
DATA_ELEMENT_CREATION_FAILURE = (
"Failed to create DataElement instance for:\n{data_element}\n{exception}"
)
HEADER_CREATION_FAILURE = "Failed to read header information!\n{exception}"
IMPORT_ERROR = (
"Failed to import {path}... | 2.015625 | 2 |
.sublime/Packages/CTags/ranking/parse.py | teedoo/dotfiles | 1 | 12769380 | <reponame>teedoo/dotfiles<filename>.sublime/Packages/CTags/ranking/parse.py
import re
from helpers.common import *
#import spdb
# spdb.start()
class Parser:
"""
Parses tag references and tag definitions. Used for ranking
"""
@staticmethod
def extract_member_exp(line_to_symbol, source):
"""... | 2.1875 | 2 |
mysite/urls.py | AmanRiat1/uOttaHack | 0 | 12769381 | <filename>mysite/urls.py
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r'^$', views.basic, name='output'),
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
| 1.71875 | 2 |
lib/local.py | sakyra01/CatPaw_OSINT | 0 | 12769382 | <gh_stars>0
import sys
import time
import collections
import requests
nu = "\033[0m"
re = "\033[1;31m"
gr = "\033[0;32m"
cy = "\033[0;36m"
wh = "\033[0;37m"
ye = "\033[0;34m"
su = f"\033[1;31m[\033[1;36m+\033[1;31m]{nu}"
fa = f"\033[1;31m[\033[1;31m!\033[1;31m]{nu}"
er = f"\033[1;31m[\033[1;34m?\033[1;31m]{nu}"
def... | 2.390625 | 2 |
angio2020/generate_poly_masks.py | dhaulagiri0/Mask_RCNN | 0 | 12769383 | <filename>angio2020/generate_poly_masks.py<gh_stars>0
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from pathlib import Path
import cv2
import numpy as np
import imageio
import os, json
from shutil import copyfile
def getPolyImage(points_dict, shape=(512, 512)):
points = []
... | 2.28125 | 2 |
push_db_to_stage.py | vanpattenmedia/vpmframe-module-scripts | 0 | 12769384 | #!/usr/bin/env python
#
#
# Push the current database to stage
#
# This script pushes the content in the site database for the current
# stage to another stage, for example, development -> staging.
#
# It automatically handles the rewriting of key WordPress options siteurl,
# home and upload_path, as well as rewriting... | 2.203125 | 2 |
scripts/un/energy/process_test.py | padma-g/data | 0 | 12769385 | # Copyright 2021 Google LLC
#
# 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 in writing, ... | 2.296875 | 2 |
Visitor_behaviour_sequence.py | daiweiLin/unity_simulator | 0 | 12769386 | <reponame>daiweiLin/unity_simulator<gh_stars>0
"""
This is the class of visitor which are attracted to a sequence of actions
Attract sequence: Low-High, High-Low
"""
import numpy as np
from collections import deque
from itertools import groupby
class Visitor_behaviour_sequence:
def __init__(self, num_visitors, ... | 2.96875 | 3 |
src/ui/ui_cfg_flexspinand.py | paotien833/NXP-MCUBootUtility | 0 | 12769387 | #! /usr/bin/env python
import wx
import sys
import os
import uivar
import uidef
sys.path.append(os.path.abspath(".."))
from win import bootDeviceWin_FlexspiNand
class secBootUiFlexspiNand(bootDeviceWin_FlexspiNand.bootDeviceWin_FlexspiNand):
def __init__(self, parent):
bootDeviceWin_FlexspiNand.... | 2.140625 | 2 |
src/ml_tooling/storage/base.py | thomasfrederikhoeck/ml_tooling | 7 | 12769388 | <filename>src/ml_tooling/storage/base.py
import pathlib
from abc import ABCMeta, abstractmethod
from typing import List
from ml_tooling.utils import Pathlike, Estimator
class Storage(metaclass=ABCMeta):
"""
Base class for Storage classes
"""
@abstractmethod
def load(self, file_path: Pathlike) -> ... | 2.984375 | 3 |
637_average_of_levels_in_binary_tree.py | Sanster/LeetCode | 2 | 12769389 | from utils import TreeNode
class Solution:
def averageOfLevels(self, root: TreeNode):
"""
BFS 广度优先搜索
"""
out = []
level = [root] if root else []
while len(level) != 0:
queue = []
# 把一层的所有 node 和 leaf 加到 queue 里
# 如果是最后一层,则 queue 为... | 3.46875 | 3 |
public_21CMvFAST_MC/Programs/CosmoHammer_21CMMC/sampler/MpiCosmoHammerSampler.py | NNSSA/21cmvFAST | 5 | 12769390 | from .CosmoHammerSampler import CosmoHammerSampler
from collections import namedtuple
from cosmoHammer.util.SampleFileUtil import SampleFileUtil
from mpi4py import MPI
import emcee
import itertools
class MpiCosmoHammerSampler(CosmoHammerSampler):
"""
A sampler implementation extending the regular sampler in o... | 2.265625 | 2 |
objects/multigraph.py | cklb/jsongraph.py | 10 | 12769391 | from .graph import Graph
import json
import unittest
class Multigraph:
GRAPHS = 'graphs'
TYPE = 'type'
LABEL = 'label'
METADATA = 'metadata'
def __init__(self, graphs=[], type=None, label=None, metadata=None):
"""Constructor of the Multigraph class.
Arguments:
... | 3.328125 | 3 |
utils.py | hyperionfalling/final_assignment | 1 | 12769392 | """
-*- coding:utf-8 -*-
@Time :2019/11/27 下午4:54
@Author :wts
@File :utils.py
@Version:1.0
"""
import torch
import torch.utils.data.sampler as Sampler
import torch.nn as nn
import torch.nn.functional as F
class Mish(nn.Module):
def __init__(self):
super().__init__()
#print("Mish activation loa... | 2.5625 | 3 |
test_mindfuck.py | pradeepchhetri/mindfuck | 1 | 12769393 | #!/usr/bin/env python
import os
import pytest
import mindfuck
def load_from_file(brainfuck_code):
cwd = os.path.dirname(__file__)
fpath = os.path.join(cwd, 'data/%s' % brainfuck_code)
with open(fpath, 'r') as f:
return f.read()
def test_hello_world(capfd):
code = load_from_file("helloworld.bf... | 2.5625 | 3 |
conbench/tests/api/test_auth.py | jonkeane/conbench | 48 | 12769394 | <reponame>jonkeane/conbench<filename>conbench/tests/api/test_auth.py
import copy
from ...tests.api import _asserts
class TestLoginPost(_asserts.PostEnforcer):
url = "/api/login/"
required_fields = ["email", "password"]
valid_payload = {"email": "<EMAIL>", "password": "<PASSWORD>"}
def test_unauthent... | 2.59375 | 3 |
tests/test_zonecontrolhumidistat.py | marcelosalles/pyidf | 19 | 12769395 | <filename>tests/test_zonecontrolhumidistat.py
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.zone_hvac_controls_and_thermostats import ZoneControlHumidistat
log = logging.getLogger(__name__)
class TestZoneControlHumidistat(u... | 2.671875 | 3 |
exploration-scripts/error_distribution.py | alecokas/BiLatticeRNN-data-processing | 5 | 12769396 | <gh_stars>1-10
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import re
from scipy import stats
import sys
def read_pickle(file_name):
""" Load the pickle file
"""
with (open(file_name, "rb")) as openfile:
return pickle.load(openfile)
def difference_err... | 2.65625 | 3 |
thenewboston_node/business_logic/tests/test_blockchain_base/test_validate_root_account_file.py | nishp77/thenewboston-node | 30 | 12769397 | import pytest
from thenewboston_node.business_logic.exceptions import ValidationError
from thenewboston_node.business_logic.tests.baker_factories import (
make_account_state, make_blockchain_state, make_genesis_blockchain_state
)
from thenewboston_node.business_logic.tests.mocks.utils import patch_blockchain_state... | 2.25 | 2 |
octopus_deploy_swagger_client/models/package_notes_result.py | cvent/octopus-deploy-api-client | 0 | 12769398 | <gh_stars>0
# coding: utf-8
"""
Octopus Server API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
Generated by: https://github.com... | 1.875 | 2 |
bin/disco_vpc_ui.py | Angakkuq/asiaq-aws | 0 | 12769399 | <reponame>Angakkuq/asiaq-aws
#!/usr/bin/env python
"""
Command line tool for creating and destroying VPC's
"""
from __future__ import print_function
import logging
import argparse
import sys
from disco_aws_automation import DiscoVPC
from disco_aws_automation.disco_aws_util import run_gracefully
from disco_aws_automat... | 2.59375 | 3 |
src/litmos/api.py | alexeiser/python-litmos-api | 0 | 12769400 | <filename>src/litmos/api.py
import html
import json
import time
import requests
class API(object):
ROOT_URL = 'https://api.litmos.com/v1.svc'
PAGINATION_OFFSET = 200
api_key = None
app_name = None
@classmethod
def _base_url(cls, resource, **kwargs):
return cls.ROOT_URL + "/" + \
... | 2.640625 | 3 |
NSGA2/individual_selector.py | hirokuramoto/Optimizer | 0 | 12769401 | # 混雑度トーナメント選択により新たな探索母集団Qt+1を生成
import numpy as np
import random
import copy
class Tournament(object):
"""混雑度トーナメント選択
"""
def __init__(self, archive_set):
self._archive_set = copy.deepcopy(archive_set)
def tournament(self):
# アーカイブ母集団の個体数分の探索母集団を生成
size = int(self._archive_set... | 3.34375 | 3 |
backend/api/services/authorServices.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | 1 | 12769402 | from ..models.author import Author
from ..models.node import Node
from ..serializers import AuthorSerializer
from rest_framework import status
from rest_framework.response import Response
from django.conf import settings
from django.forms import URLField
from django.core.exceptions import ValidationError
from django.c... | 2.484375 | 2 |
Diena_6_lists/uzd3_g1.py | edzya/Python_RTU_08_20 | 8 | 12769403 | <filename>Diena_6_lists/uzd3_g1.py
# Māras
text = input("ievadi teikumu")
texta = []
words = text.split()
textb = [w[::-1] for w in words]
# for item in words:
# texta.append(item[::-1])
# textb = " ".join(texta) # so we do not have " " after last item
print(" ".join(textb))
| 3.578125 | 4 |
movimento/migrations/0001_initial.py | pontual/sistema-v1 | 1 | 12769404 | # Generated by Django 2.0.1 on 2018-01-30 23:36
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('registros', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 1.851563 | 2 |
facenet.py | KomissarYarrik/face_recognition | 0 | 12769405 | <filename>facenet.py
# coding: utf-8
import tensorflow as tf
import keras
from keras import applications
import os
from keras.models import load_model,model_from_json
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import inline
import cv2
import dlib
from sklearn.svm import SVC
from sklearn.prepr... | 2.59375 | 3 |
spin/prophecy.py | cloudRoutine/curveship | 1 | 12769406 | spin = {
'time': 'before'}
| 1.34375 | 1 |
postreise/analyze/generation/tests/test_emissions.py | lanesmith/PostREISE | 0 | 12769407 | import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_array_almost_equal
from powersimdata.tests.mock_grid import MockGrid
from powersimdata.tests.mock_scenario import MockScenario
from postreise.analyze.generation.emissions import (
generate_emissions_stats,
summarize_emissions... | 2.15625 | 2 |
modules/msa/msa/contrib/uniqauth/static.py | haoyutan/MSA-Framework | 2 | 12769408 | EMPTY_MD5 = "d41d8cd98f00b204e9800998ecf8427e"
| 0.972656 | 1 |
physicoModule/physico_style.py | sseungyong/physico_project | 0 | 12769409 | <gh_stars>0
import openpyxl
from openpyxl.styles import PatternFill
from openpyxl.styles import Border, Side
from openpyxl.styles import Alignment, Font
boldFont = Font(bold=True)
centetAlignment = Alignment(horizontal='center', vertical='center')
normal_box = Border(
left=Side(border_style='thin', color='FF0000... | 2.5625 | 3 |
setup.py | antiproblemist/django-accountk | 15 | 12769410 | <gh_stars>10-100
from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()
setup(name='django-accountkit',
version='0.2.3',
description='Facebook accountkit support for Dja... | 1.328125 | 1 |
socket_rlbot_test/hive.py | ViliamVadocz/Hivemind | 2 | 12769411 | import socket
from messages import send_packet, receive_packet, INPUT_MESSAGE
ID = 0
NUM_BOTS = 4
# Notice: multiplicity == 4, telling RLBot I want to control bots.
# Controlled IDs are [id, id + 1, id + 2, id + 3].
# There must be enough cars in the match config file to support this.
HIVE_READY_MESSAGE = {
"typ... | 2.8125 | 3 |
Max/Max_0011_20200131.py | Morek999/OMSCS_Taiwan_Leetcode | 1 | 12769412 | <filename>Max/Max_0011_20200131.py
"""
11. Container With Most Water
https://leetcode.com/problems/container-with-most-water/
Time complexity: O()
Space complexity: O()
Solution:
"""
from typing import List
class Solution:
def maxArea(self, height: List[int]) -> int:
res = l = 0
r = ... | 3.953125 | 4 |
account/migrations/0010_auto_20200929_1634.py | cuiliang0302/myblog | 5 | 12769413 | <filename>account/migrations/0010_auto_20200929_1634.py<gh_stars>1-10
# Generated by Django 3.1.1 on 2020-09-29 16:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0009_auto_20200929_1109'),
]
operations = [
migrations.Alte... | 1.421875 | 1 |
services/ingest-file/ingestors/support/convert.py | bakrale/aleph | 0 | 12769414 | import math
import logging
import requests
from itertools import count
from requests import RequestException, HTTPError
from servicelayer.util import backoff
from followthemoney.helpers import entity_filename
from ingestors.settings import CONVERT_URL, CONVERT_TIMEOUT
from ingestors.support.cache import CacheSupport
f... | 2.234375 | 2 |
src/mrsimulator/methods/tests/test_MQVAS.py | pjgrandinetti/mrsimulator | 14 | 12769415 | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from mrsimulator.method.query import TransitionQuery
from mrsimulator.methods import FiveQ_VAS
from mrsimulator.methods import SevenQ_VAS
from mrsimulator.methods import ThreeQ_VAS
__author__ = "<NAME>"
__email__ = "<EMAIL>"
methods = [ThreeQ_VAS, FiveQ_VAS, Se... | 1.929688 | 2 |
distsys/actions/status.py | austinlostinboston/distsys | 0 | 12769416 | <reponame>austinlostinboston/distsys
#!/usr/bin/python
## Import builtins
import sys
from multiprocessing import Pool
## Import distsys
from distsys.services import services
from distsys.statistics import online
def client_status(client):
if online(client):
print "Client: " + str(client) + "\t" + "\033... | 2.75 | 3 |
ucf_sub_embedded_ros/ucf_sub/src/sub_sensors/src/InternalEnvironment.py | RoboticsClubatUCF/RoboSub | 0 | 12769417 | #!/usr/bin/env python3
import HIH6130
import rospy
from sensor_msgs.msg import Temperature, RelativeHumidity
def publish():
tempPub = rospy.Publisher('InternalTemperature', Temperature, queue_size=1)
humidPub = rospy.Publisher('InternalHumidity', RelativeHumidity, queue_size=1)
rospy.init_node('InternalEnvironment'... | 2.4375 | 2 |
src/transformers/models/herbert/__init__.py | timpal0l/transformers | 2 | 12769418 | <reponame>timpal0l/transformers<gh_stars>1-10
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
from ...file_utils import is_tokenizers_available
from .tokenization_herbert import HerbertTokenizer
... | 1.3125 | 1 |
src/main.py | Saztroz/Top-100-Movies | 0 | 12769419 | <filename>src/main.py
from bs4 import BeautifulSoup
import requests
import spotipy
from spotipy.oauth2 import SpotifyOAuth
#scraping data
date = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD: ")
URL = f"https://www.billboard.com/charts/hot-100/{date}"
response = requests.get(URL)
... | 3.671875 | 4 |
fuel_agent/fuel_agent/tests/test_utils.py | Zipfer/fuel-web | 0 | 12769420 | <gh_stars>0
# Copyright 2011 <NAME>
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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/licen... | 2.078125 | 2 |
src/python/analysis.py | yigitozgumus/AAPP_Project | 0 | 12769421 | <filename>src/python/analysis.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import argparse
from os import listdir
from os.path import isfile, join
# visualization library
import seaborn as sns
sns.set( color_codes=True)
sns.set_context(rc={"font.family":'sans',"font.size":24,"axes.titlesiz... | 2.84375 | 3 |
script_data_transformation/LifeCycle.py | mbeviere/mbeviere.github.io | 0 | 12769422 | <reponame>mbeviere/mbeviere.github.io<filename>script_data_transformation/LifeCycle.py
class LifeCycle:
def __init__(self, id, label, composed_of):
self.id = id
self.label = label
self.composed_of = composed_of
| 1.632813 | 2 |
sdk/python/pulumi_alicloud/ros/get_stacks.py | pulumi/pulumi-alicloud | 42 | 12769423 | <gh_stars>10-100
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overlo... | 1.8125 | 2 |
analysis/utils/mouse_player.py | chrelli/3DDD_social_mouse_tracker | 1 | 12769424 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# from IPython import get_ipython
import time, os, sys, shutil
# from utils.fitting_utils import *
# for math and plotting
import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # <--- This is... | 2.828125 | 3 |
bayesapi/resources/anomalies.py | vishalbelsare/bayesrest | 3 | 12769425 | import falcon
import history
from bayesapi.resources import BaseResource
from bayesapi.validation import validate
class AnomaliesResource(BaseResource):
def on_post(self, req, resp):
req_vars = validate(self.api_def, 'post', req)
target_column = req_vars['target-column']
context_columns ... | 2.203125 | 2 |
kmc_paper_data/make_inputs/make_inputs_105.py | j-m-dean/Overscreening_and_Underscreening | 1 | 12769426 | import json
import numpy as np
import os
home = os.getcwd() + "/"
with open(home + "averaged_distributions/105_charges_distributions_errors.json") as file:
data = json.load(file)
x = list(np.array(range(4, 38)) * 2.5e-10)
permittivities = [1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 50, 75, 100, 2, 65, 85]
os.chdir(home... | 2.515625 | 3 |
edk2toolext/capsule/signtool_signer.py | joschock/edk2-pytool-extensions | 32 | 12769427 | # @file signtool_signer.py
# This module contains the abstracted signing interface for Windows Signtool.
# This interface abstraction takes in the signature_options and signer_options
# dictionaries that are used by capsule_tool and capsule_helper.
#
# Will attempt to locate a valid installation of Windows Signtool usi... | 1.984375 | 2 |
tests/argo_workflow_tools/dsl/test_workflow_template.py | DiagnosticRobotics/argo-workflow-tools | 15 | 12769428 | import argo_workflow_tools.models.io.argoproj.workflow.v1alpha1 as argo
from argo_workflow_tools import dsl, WorkflowTemplate
@dsl.Task(image="python:3.10")
def say_hello(name: str):
return f"hello {name}"
@dsl.DAG()
def command_hello(name):
return say_hello(name)
def test_workflow_template():
workflo... | 2.3125 | 2 |
fedhf/api/logger/logger.py | beiyuouo/fedhf | 2 | 12769429 | <reponame>beiyuouo/fedhf
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : fedhf\api\logger\logger.py
# @Time : 2022-05-03 15:58:38
# @Author : <NAME>
# @Email : <EMAIL>
# @License : Apache License 2.0
import os
import logging
import sys
import wandb
import time
from .base_logger import BaseL... | 2.484375 | 2 |
configloader.py | metecyu/shadowsocksr | 0 | 12769430 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import importloader
g_config = None
def load_config():
global g_config
g_config = importloader.loads(['userapiconfig', 'apiconfig'])
def get_config():
return g_config
load_config()
| 2.015625 | 2 |
basic/Day3/Day11.py | ductnn/Python-tu | 1 | 12769431 | <reponame>ductnn/Python-tu
a = []
maximum = 0
for _ in range(6):
tmp = [int(x) for x in str(input()).split(" ")]
a.append(tmp)
for i in range(6):
for j in range(6):
if (j + 2 < 6) and (i + 2 < 6):
result = a[i][j] + a[i][j+1] + a[i][j+2] + a[i+1][j+1] + a[i+2][j] + a[i+2][j+1] + a[i+2][j+2]
if(result > max... | 2.84375 | 3 |
zahlwort2num/command_line.py | spatialbitz/zahlwort2num | 5 | 12769432 | from _ctypes import ArgumentError
import zahlwort2num as w2n
import sys
def main():
if(sys.argv[1]):
print(w2n.convert(sys.argv[1]))
else:
raise ArgumentError('No parameter given!') | 2.875 | 3 |
Vanilla/src/assistant.py | allepicondor/SnakePython | 0 | 12769433 | <reponame>allepicondor/SnakePython<gh_stars>0
def NumpyInList(array,l1):
for i in l1:
if i[0] == array[0] and i[1] == array[1]:
return True
return False
| 2.890625 | 3 |
src/the_tale/the_tale/accounts/exceptions.py | devapromix/the-tale | 1 | 12769434 |
import smart_imports
smart_imports.all()
class AccountError(utils_exceptions.TheTaleError):
MSG = 'account error'
class UnkwnownAchievementTypeError(AccountError):
MSG = 'unknown achievement type: %(achievement_type)r'
class EmailAndPasswordError(AccountError):
MSG = 'email & password must be specif... | 2.40625 | 2 |
environments/Gazebo/controller/__init__.py | zal/simenvbenchmark | 9 | 12769435 | from .robot_env import RobotEnv_gazebo
from .nnn_env import nnnEnv_gazebo
| 1.054688 | 1 |
Extracting Faces/main.py | rudrabarad/OpenCV-Basics | 1 | 12769436 | from PIL import Image # importing packages
import face_recognition
image = face_recognition.load_image_file('group.jpg') # reading group photo
face_locations = face_recognition.face_locations(image)
for face_location in face_locations:
top, right, bottom, left = face_location
face_image = image[top:b... | 3.21875 | 3 |
goods/migrations/0007_alter_pharmproduct_unique_together.py | dcopm999/pharmcrm2-goods | 0 | 12769437 | # Generated by Django 3.2.7 on 2021-10-12 09:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('goods', '0006_auto_20211012_0812'),
]
operations = [
migrations.AlterUniqueTogether(
name='pharmproduct',
unique_together={(... | 1.585938 | 2 |
src/coder.py | CedMaire/pdc-project | 1 | 12769438 | <reponame>CedMaire/pdc-project
import unireedsolomon as ReedSalomon
import lib as Lib
import mpmath as BigNumbers
import numpy as np
class Coder:
# Constuctor, initializes the parameters.
def __init__(self):
self.RSCoder = ReedSalomon.rs.RSCoder(
Lib.CODE_WORD_LENGTH, Lib.MESSAGE_LENGTH)
... | 2.859375 | 3 |
tpfd/compat.py | erinxocon/tpfd | 106 | 12769439 | import sys
"""
This module handles import compatibility issues between Python 2 and
Python 3.
"""
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
if is_py2:
builtin_str = str
bytes = str
str = unicode
basestring = basestring
... | 2.8125 | 3 |
viberbot/api/user_profile.py | wowkin2/viber-bot-python | 0 | 12769440 | from future.utils import python_2_unicode_compatible
class UserProfile(object):
def __init__(self, name=None, avatar=None, user_id=None, country=None, language=None, api_version=None):
self._name = name
self._avatar = avatar
self._id = user_id
self._country = country
self._... | 2.59375 | 3 |
src/sadie/airr/igblast/igblast.py | jwillis0720/pybody | 0 | 12769441 | """Low level module for IgBLAST api calls
You probably only want to interact with this module through airr as the database files are extremely tricky to get right
"""
from __future__ import annotations
import glob
import logging
import os
import subprocess
import tempfile
import warnings
import semantic_version
from ... | 2.171875 | 2 |
py/sonetos.py | ceciliakuhnvanin/meusoneto.github.io | 1 | 12769442 | <gh_stars>1-10
import random
def estrofe1():
return verso()+ "<br>" + verso() + "<br>" + verso() + "<br>" + verso() + "<br> <br>"
return """
Amo-te tanto, meu amor... nao canto
O humano coracao com mais verdade...
Amo-te como amigo e como amante
Numa sempre diversa realidade
"""
def estrofe2():
return ver... | 3.140625 | 3 |
core/admin.py | monitorme/monitorme | 1 | 12769443 | from django.contrib import admin
from core.models import User, TrackerGroup, TrackerGroupInstance, Question, Answer, Response, TrackerGroupInstance
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = (
'username',
'name',
'email',
'slug',
)
@admin.register(T... | 2.046875 | 2 |
Classes/Androxus.py | devRMA/Androxus | 8 | 12769444 | <reponame>devRMA/Androxus
# -*- coding: utf-8 -*-
# Androxus bot
# Androxus.py
__author__ = 'Rafael'
import re
from datetime import datetime
from itertools import cycle
from json import loads
from os import listdir
from string import ascii_letters
from sys import version
from traceback import format_exc
import disco... | 1.976563 | 2 |
utility/Team.py | KilometersFan/SciOlyScheduler | 1 | 12769445 | from Coach import Coach
class Team:
def __init__(self, number, name):
self.number = number
self.coaches = []
self.name = name
def add_coach(self, coach):
if isinstance(coach, Coach):
self.coaches.append(coach)
else:
print("Invalid argument passed.... | 3.8125 | 4 |
ker/api/ssh.py | csvwolf/ker.py | 5 | 12769446 | """
ssh module
"""
from ker.utils import request
from .list import API_LIST
class SSH:
"""
ssh api
"""
def __init__(self, email, token):
self.email = email
self.token = token
def list(self):
"""
list ssh keys
"""
return request(API_LIST.SSH_LIST.val... | 2.703125 | 3 |
ampligraph/latent_features/__init__.py | wayne9qiu/AmpliGraph | 0 | 12769447 | # Copyright 2019-2020 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
r"""This module includes neural graph embedding models and support functions.
... | 1.671875 | 2 |
exptools/viewing/__init__.py | Shiduo-zh/pybulletSim | 9 | 12769448 | ''' possible complement of viewing an experiment results
'''
__author__ = 'dementrock' | 1.015625 | 1 |
code/utils.py | yi-ding-cs/TSception | 9 | 12769449 | <filename>code/utils.py
import os
import time
import pprint
from networks import TSception
from eeg_dataset import *
from torch.utils.data import DataLoader
from sklearn.metrics import confusion_matrix, accuracy_score, f1_score
def set_gpu(x):
torch.set_num_threads(1)
os.environ["CUDA_DEVICE_ORDER"... | 2.296875 | 2 |
test/jinja_script.py | SecSamDev/cancamusa | 3 | 12769450 | from jinja2 import Template
import sys
import os
import argparse
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
from ad_struct import ADStructure
with open(os.path.join(os.path.dirname(__file__), '../lib/scripter/templates/fill-ad.ps1.jinja'),'r') as fill_ad:
template = Template(fill_ad.read(... | 1.929688 | 2 |