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 |
|---|---|---|---|---|---|---|
securetea/common.py | adeyosemanputra/SecureTea-Project | 0 | 12765551 | # -*- coding: utf-8 -*-
u"""Common module for SecureTea.
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: <NAME> <<EMAIL>> , Jan 30 2019
Version: 1.1
Module: SecureTea
"""
import time
def getdatetime():
"""Date and time.
Returns:
... | 2.59375 | 3 |
scripts/SCZ_RNAseq/syn4590909/prepare_individual_gene_clusters.py | omarmaddouri/GCNCC_cross_validated | 1 | 12765552 | <gh_stars>1-10
import sys
from os.path import dirname, abspath
sys.path.append(dirname(dirname(abspath(__file__))))
from collections import OrderedDict
import csv
path="../../data/SCZ_RNAseq/output/syn4590909/"
dataset="PPI"
dict = OrderedDict()
for i in range(19576):
dict["Center_{}".format(i)] = i
with open("{}{... | 2.28125 | 2 |
tools/latlon_reader.py | bjlittle/mint | 0 | 12765553 | import netCDF4
import numpy
import vtk
from reader_base import ReaderBase
class LatLonReader(ReaderBase):
def __init__(self, filename, padding=0):
"""
Constructor
@param filename UM netCDF file
@param padding number of extra cells to add on the high end of longitudes
@note... | 2.75 | 3 |
selectinf/learning/Rutils.py | TianXie1999/selective-inference | 51 | 12765554 | import os, glob, tempfile, warnings
import numpy as np
from traitlets import (HasTraits,
Integer,
Unicode,
Float,
Integer,
Instance,
Dict,
Bool,
... | 2.25 | 2 |
kidsdata/ftsdata.py | abeelen/kidsdata | 0 | 12765555 | import numpy as np
import warnings
from copy import deepcopy
from scipy.signal import fftconvolve, medfilt
import astropy.units as u
import astropy.constants as cst
from astropy.io import fits, registry
from astropy.wcs import WCS
from astropy.nddata import NDDataArray, StdDevUncertainty, InverseVariance
from astropy... | 2.203125 | 2 |
mattermost_handler/__init__.py | aymericderbois/py-mattermost-webhooks-log-handler | 0 | 12765556 | # coding=utf-8
name = "mattermost_handler"
import logging
import requests
logger = logging.getLogger(__name__)
class MattermostIncomeWebhookHandler(logging.Handler):
def __init__(self, url):
super(MattermostIncomeWebhookHandler, self).__init__()
self.url = url
if self.url is None:
... | 2.421875 | 2 |
1629 Slowest Key.py | AtharvRedij/leetcode-solutions | 0 | 12765557 | '''
URL: https://leetcode.com/problems/slowest-key/
Difficulty: Easy
Description: Slowest Key
A newly designed keypad was tested, where a tester pressed a sequence of n keys, one at a time.
You are given a string keysPressed of length n, where keysPressed[i] was the ith key pressed in the testing sequence, and a so... | 3.546875 | 4 |
dynamic_unet/utils.py | dthiagarajan/dynamic_unet | 1 | 12765558 | # AUTOGENERATED! DO NOT EDIT! File to edit: 02_utils.ipynb (unless otherwise specified).
__all__ = ['load_camvid_dataset', 'display_segmentation', 'display_segmentation_from_file', 'CamvidDataset']
# Cell
import matplotlib.pyplot as plt
import os
import torch
import torchvision.transforms.functional as tf
from PIL i... | 2.5 | 2 |
krysztalki/workDir/tests/test matrices/test_matrices_like_3_xxx.py | woblob/Crystal_Symmetry | 0 | 12765559 | import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_3_xxx:
def test_matrix_3_xxx(self):
expected = Point([ z, x, y, 1])
calculated = Point.calculate(mne.... | 2.578125 | 3 |
q2_convex_hull/tests/test_classifier.py | dpear/convex-hull | 1 | 12765560 | <reponame>dpear/convex-hull<gh_stars>1-10
from unittest import TestCase, main
class ClassifierTests(TestCase):
def test_run_random_forests(self):
# take pandas series describing binary labels for samples
# take a feature table
# construct a classifier
# return measures indicating t... | 2.734375 | 3 |
primeira_lista/ex002.py | PedroSantana2/exercicios-em-python | 1 | 12765561 | '''
Faça um Programa que peça um número e então mostre a mensagem: O número informado foi [número].
'''
numero = input('Digite um número: ')
print('O número informado foi: {}'.format(numero))
| 4.125 | 4 |
mqtt_gateways/utils/app_properties.py | ppt000/mqtt_gateways | 0 | 12765562 | '''
docstring
'''
from collections import namedtuple
import logging
import os.path
import sys
_THIS = sys.modules[__name__]
AppProperties = namedtuple('AppProperties', ('name', 'path', 'root_logger', 'init', 'get_path', 'get_logger'))
def __dummy(*args, **kwargs):
pass
def __get_logger(fullmodulename):
'''... | 3.046875 | 3 |
datasette/database.py | heussd/datasette | 0 | 12765563 | <filename>datasette/database.py
from pathlib import Path
from .utils import (
QueryInterrupted,
detect_fts,
detect_primary_keys,
detect_spatialite,
get_all_foreign_keys,
get_outbound_foreign_keys,
sqlite3,
table_columns,
)
from .inspect import inspect_hash
class Database:
def __in... | 2.390625 | 2 |
trusat/satid.py | TruSat/trusat-orb | 40 | 12765564 | #!/usr/bin/env python
from __future__ import print_function
from __future__ import division # Eliminate need for decimals on whole values
import sys
# As of 28 July 2019, python3.6 is the default "python3" in apt-get install python3
if sys.version_info[0] != 3 or sys.version_info[1] < 6:
print("This ... | 2.046875 | 2 |
tests/compute_diversity.py | ariel415el/GPDM | 18 | 12765565 | <filename>tests/compute_diversity.py
import os
from collections import defaultdict
import cv2
import numpy as np
def read_image_as_grayscale(path):
ref = cv2.imread(path)
return cv2.cvtColor(ref, cv2.COLOR_BGR2GRAY)
def compute_images_diversity(ref_dir, image_dirs):
"""To quantify the diversity of the ... | 3.046875 | 3 |
hard-gists/5720029/snippet.py | jjhenkel/dockerizeme | 21 | 12765566 | import arcpy
import os
def create_path(path):
if not os.path.exists(path):
print "Creating directory {}".format(path)
os.makedirs(path)
# default application data dir; e.g. c:\Users\scw\AppData\Roaming
app_data_path = os.getenv('APPDATA')
# get current ArcGIS version
arc_version = arcpy.GetInsta... | 2.703125 | 3 |
rover_ml/behavior_cloning/src/behavior_cloning/train_model.py | shawshany/diy_driverless_car_ROS | 1 | 12765567 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#https://github.com/juano2310/CarND-Behavioral-Cloning-P3-Juan/blob/master/model.py
#https://github.com/udacity/self-driving-car/blob/master/steering-models/community-models/rambo/train.py
import os
import csv
import cv2
import numpy as np
import matplotlib.pyplot as plt
i... | 2.5 | 2 |
git_repos/bin/app/uix/canvasbasics/quicar.py | saidino84/kivymd_projects_2021_10_16 | 1 | 12765568 | from kivy.uix.widget import Widget
from kivy.graphics.instructions import Canvas
from kivy.graphics.vertex_instructions import Line,Ellipse ,Ellipse,Rectangle
from kivy.graphics.context_instructions import Color
from kivy.metrics import dp
# from kivy.clock import Clock
from kivy.properties import Clock
from kivymd.... | 2.75 | 3 |
timesheet_utils/auth.py | MirkoPs/timesheet-utils | 0 | 12765569 | from timesheet_utils.service_comunication import request
from werkzeug.exceptions import Unauthorized, Forbidden
import os
def get_logged_user():
users_service_url_port = os.path.expandvars(
os.environ.get('USERS_SERVICE_URL_PORT')
)
data = request(
'{}{}/me/'.format(
users_serv... | 2.421875 | 2 |
footkit/__init__.py | KhaitovR/footkit | 1 | 12765570 | <gh_stars>1-10
from .Parser import Parser
from .Preprocess import Preprocess
from .models import Validation
from .Odds import OddsParser
from .Calculation import Calculation
from .ImageDraw import PlotPredict
# from .Insta import InstaBot
from .FeatureSelector import FeatureSelector
# InstaBot,
__all__ = [Parser, Prep... | 1.242188 | 1 |
pyorbit/classes/model_container_multinest.py | lucaborsato/PyORBIT | 12 | 12765571 | from pyorbit.classes.common import *
from pyorbit.classes.model_container_abstract import ModelContainer
class ModelContainerMultiNest(ModelContainer):
def __init__(self):
super(self.__class__, self).__init__()
self.include_priors = False
self.nested_sampling_parameters = {'nlive_mult': ... | 2.125 | 2 |
torchrecipes/vision/image_classification/tests/test_train_app.py | nateanl/recipes-1 | 0 | 12765572 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#!/usr/bin/env python3
# pyre-strict
import os
from copy import deepcopy
from typing import List, Optional
import torch
from torch ... | 1.78125 | 2 |
minemeld/ft/azure.py | mikejrizzo/minemeld-core | 0 | 12765573 | # Copyright 2015-2016 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 1.867188 | 2 |
tests/apps/packages/test_xmlrpc.py | tranarthur/localshop | 162 | 12765574 | import xmlrpc.client as xmlrpclib
import pytest
from tests.factories import ReleaseFactory
@pytest.fixture(params=['/RPC2', '/pypi'])
def rpc_endpoint(request):
return request.param
@pytest.mark.django_db
def test_search_package_name(client, admin_user, live_server, repository,
rp... | 2.078125 | 2 |
python/python-algorithm-intervew/18-binary-search/68-two-sum-ii-input-arrayt-is-sorted-2.py | bum12ark/algorithm | 1 | 12765575 | <filename>python/python-algorithm-intervew/18-binary-search/68-two-sum-ii-input-arrayt-is-sorted-2.py
"""
* 두수의 합 II
정렬된 배열을 받아 덧셈하여 타겟을 만들 수 있는 배열의 두 숫자 인덱스를 리턴하라.
주의 : 이 문제에서 배열은 0이 아닌 1부터 시작하는 것으로 한다.
Input: numbers = [2, 7, 11, 15], target = 9
Output: [1, 2]
"""
from typing import List
class Solution:
# 현재 값을... | 3.8125 | 4 |
mlir_linalg/dsl/tc_model.py | stellaraccident/linalgpy-hacking | 3 | 12765576 | <reponame>stellaraccident/linalgpy-hacking
"""Model classes representing a tensor-comprehension."""
from typing import Callable, Dict, List, Optional, Sequence, Set, Tuple, Union
from mlir import ir as _ir
from .affine import *
from .scalar_expr import *
from .types import *
from .yaml_helper import *
# Type aliase... | 2.078125 | 2 |
tripleoclient/v1/undercloud_deploy.py | mail2nsrajesh/python-tripleoclient | 0 | 12765577 | # Copyright 2016 Red Hat, 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 ... | 1.617188 | 2 |
midistegano.py | nonameable/steganography-with-midi | 2 | 12765578 | <gh_stars>1-10
from fileIO import FileIO
from hiding import Hider
from unraveling import Unraveler
import sys
from os import path
intention=sys.argv[1]
midi_file_name=sys.argv[2]
name = None
if intention=="-hide":
message_file_name = sys.argv[3]
if path.isfile(midi_file_name):
if path.isfile(message... | 3.265625 | 3 |
contest/urls.py | archimedeans/integration-bee | 0 | 12765579 | <filename>contest/urls.py
"""contest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home... | 2.71875 | 3 |
examples/pftest.py | MasterSpecter/ekmmeters | 9 | 12765580 | """ Simple example read getting 2 fields
(c) 2016 EKM Metering.
"""
from ekmmeters import *
my_port_name = "/dev/ttyO4"
my_meter_address = "000300001463"
ekm_set_log(ekm_no_log)
port = SerialPort(my_port_name)
if (port.initPort() == True):
my_meter = V4Meter(my_meter_address)
my_meter.attachPort(port)
else:... | 2.78125 | 3 |
mojo/devtools/common/devtoolslib/shell.py | zbowling/mojo | 1 | 12765581 | <reponame>zbowling/mojo<filename>mojo/devtools/common/devtoolslib/shell.py
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Shell(object):
"""Represents an abstract Mojo shell."""
def serve_loca... | 2.25 | 2 |
network.py | IBM/oct-glaucoma-global-visual-field | 0 | 12765582 | <reponame>IBM/oct-glaucoma-global-visual-field<filename>network.py
"""
Network architecture with loss function and optimizer
"""
from keras import backend as K
from keras.optimizers import SGD, Adam, RMSprop, Nadam
from keras.layers.normalization import BatchNormalization
from keras.models import Input, Model
from kera... | 2.296875 | 2 |
dmbrl/config/reacher.py | nikkik11/handful-of-trials | 358 | 12765583 | <reponame>nikkik11/handful-of-trials<gh_stars>100-1000
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import tensorflow as tf
from dotmap import DotMap
import gym
from dmbrl.misc.DotmapUtils import get_required_argument
from dmbrl.modeli... | 1.929688 | 2 |
tests/ut/test_core.py | tubone24/fileName2SerialNumber | 4 | 12765584 | <reponame>tubone24/fileName2SerialNumber
import os
import re
import logging
from unittest.mock import call
from unittest.mock import patch
import pytest
from ebook_homebrew.core import Common
from ebook_homebrew.exceptions import InvalidExtensionTypeError, \
InvalidPathTypeError, InvalidDigitsFormatError, ChangeF... | 2.34375 | 2 |
epm/modeling/ml_modeling.py | EPM-LearningAnalytics/EPM_Project | 2 | 12765585 | #!/usr/bin/env python
# coding: utf-8
"""
This module subsets the certain number of important features
and detects student behavior and grouping students
"""
# Load libraries
import pandas as pd
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.neighbors import KNeighborsClassifier
from skl... | 3.40625 | 3 |
sym2num/model.py | cea-ufmg/sym2num | 1 | 12765586 | """Symbolic model code generation.
Improvement ideas
-----------------
* Add compiled code to linecache so that tracebacks can be produced, like done
in the `IPython.core.compilerop` module.
"""
import abc
import collections
import collections.abc
import contextlib
import functools
import inspect
import itertools... | 2.34375 | 2 |
leetcode/path-sum-iii/path-sum-iii.py | EliahKagan/practice | 0 | 12765587 | <gh_stars>0
# LeetCode #437 - Path Sum III
# https://leetcode.com/problems/path-sum-iii/
# Prefix-sum hashing solution. Runs in linear time.
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.... | 3.40625 | 3 |
memcards/tests/test_models.py | machine23/memmage | 0 | 12765588 | <reponame>machine23/memmage
# from ..models import Tag, Question, Answer
import pytest
from mixer.backend.django import mixer
pytestmark = pytest.mark.django_db
class TestTag:
def test_model(self):
obj = mixer.blend('memcards.Tag')
assert obj.pk == 1
def test_str(self):
tag = mixer.b... | 2.4375 | 2 |
refinery/units/crypto/keyderive/__init__.py | larsborn/refinery | 0 | 12765589 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Implements key derivation routines. These are mostly meant to be used as
modifiers for multibin expressions that can be passed as key arguments to
modules in `refinery.units.crypto.cipher`.
"""
from ... import arg, Unit
from ....lib.argformats import number
try:
f... | 2.578125 | 3 |
utils/search_tours_data.py | aakanksha1/selenium-python-framework | 47 | 12765590 | class SearchToursData:
def __init__(self, destination, tour_type, start_year, start_month, start_day, adults_num):
self.destination = destination
self.tour_type = tour_type
self.start_year = start_year
self.start_month = start_month
self.start_day = start_day
self.ad... | 2.59375 | 3 |
pset6/dna/dna.py | Oobl84/CS50-2020 | 0 | 12765591 | from sys import argv, exit
import csv
import re
if len(argv) != 3:
print("Usage: dna.py data.csv sequence.txt")
exit(1)
elif re.match(".*\.csv$", argv[1]) is None or re.match(".*\.txt$", argv[2]) is None:
print("Usage: dna.py data.csv sequence.txt")
exit(2)
else:
# opening csvfile
with open(ar... | 3.375 | 3 |
bob/db/swan/config_protocol_grandtest0_voice_bio.py | bioidiap/bob.db.swan | 0 | 12765592 | database.protocol = 'grandtest0-voice-bio'
| 0.960938 | 1 |
kttool/actions/version.py | heiseish/kt | 6 | 12765593 | <gh_stars>1-10
from kttool.version import version
from kttool.base import Action
from kttool.logger import color_cyan, log
class Version(Action):
def _act(self) -> None:
log(f'Current version: {color_cyan(version)}')
| 1.929688 | 2 |
coderdojochi/migrations/0019_auto_20180815_1658.py | rgroves/weallcode-website | 15 | 12765594 | <gh_stars>10-100
# Generated by Django 2.0.6 on 2018-08-15 21:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coderdojochi', '0018_auto_20180606_0838'),
]
operations = [
migrations.AddField(
model_name='guardian',
... | 1.765625 | 2 |
solutions/1450-number-of-students-doing-homework-at-a-given-time.py | lk-hang/leetcode | 0 | 12765595 | """
Given two integer arrays startTime and endTime and given an integer queryTime.
The ith student started doing their homework at the time startTime[i] and finished it at time endTime[i].
Return the number of students doing their homework at time queryTime. More formally, return the number of students where queryTim... | 3.734375 | 4 |
Cron_Philip/Assignments/great_number_game/g_n_g.py | webguru001/Python-Django-Web | 5 | 12765596 | from flask import Flask, render_template, request, redirect, session
import random
app = Flask(__name__)
app.secret_key = 'ThisIsSecret'
@app.route('/')
def index():
if 'number' not in session:
session['format'] = 'hide'
session['number'] = random.randrange(0, 101)
print session['number']... | 2.78125 | 3 |
stereo/preprocess/qc.py | nilsmechtel/stereopy | 61 | 12765597 | #!/usr/bin/env python3
# coding: utf-8
"""
@author: <NAME> <EMAIL>
@last modified by: <NAME>
@file:qc.py
@time:2021/03/26
"""
from scipy.sparse import issparse
import numpy as np
def cal_qc(data):
"""
calculate three qc index including the number of genes expressed in the count matrix, the total counts per c... | 2.59375 | 3 |
e2e/aws/s3/__main__.py | bincyber/pitfall | 33 | 12765598 | <gh_stars>10-100
from datetime import datetime
import pulumi_aws as aws
import pulumi
cfg = pulumi.Config()
bucket_name = cfg.require("s3-bucket-name")
creation_date = datetime.utcnow().strftime('%Y/%m/%d')
tags = {
'Environment': cfg.require('environment'),
'BillingProject': cfg.require('billing-project')... | 2.140625 | 2 |
djangocms_baseplugins/baseplugin/templatetags/baseplugin_tags.py | benzkji/djangocms-baseplugins | 2 | 12765599 | from django import template
from ..utils import sanitize_richtext
register = template.Library()
@register.filter
def baseplugin_pluginid(plugin_object):
return 'data-plugin-id="%s"' % plugin_object.pk
@register.filter
def baseplugin_sanitize_richtext(text):
return sanitize_richtext(text)
| 1.765625 | 2 |
bulk/send.py | Crazyokd/pt.csust_crawler | 4 | 12765600 | <reponame>Crazyokd/pt.csust_crawler
import csv
import os
from settings import SENDER_EMAIL, EMAIL_PASSWORD, DISPLAY_NAME
from smtplib import SMTP
import markdown
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
import tim... | 2.5 | 2 |
code/Datasets.py | asdqwe12011/Medical-Datasets-Classification | 0 | 12765601 | import pandas as pd
import numpy as np
def load_cancer():
# data, target, feature_names
result_dict = {'features': np.array(["Clump Thickness",
"Uniformity of Cell Size",
"Uniformity of Cell Shape",
... | 2.953125 | 3 |
networks/drox/_solution/solver.py | afnom/what-the-ctf-2020 | 0 | 12765602 | import pyshark
cap = pyshark.FileCapture('drox.pcapng')
key = b'xord'
for packet in cap:
try:
data = bytes([int(x, 16) for x in packet.tcp.payload.split(":")])
r = range(max(len(key), len(data)))
print(''.join([chr((key[i%len(key)]) ^ (data[i])) for i in r]))
except Exception as e:
print(e)
| 2.21875 | 2 |
test/test_problem1.py | jimleroux/interview_problems | 0 | 12765603 | import pytest
from enphaseAI.problem1 import find_lines_from_points, find_lines_intersection
def test_find_lines_from_points() -> None:
p0 = 0., "string_input"
p1 = 1., 2.5
# Test for string input
args = [p0, p1]
pytest.raises(AssertionError, find_lines_from_points, *args)
# Test... | 2.8125 | 3 |
attic/ngfrontman/wp_frontman/models.py | ludoo/wpkit | 0 | 12765604 | import os
import sys
import re
import datetime
import warnings
from urlparse import urlsplit, urlunsplit, SplitResult
from hashlib import md5
from threading import local
from types import ModuleType
from functools import partial
from copy import deepcopy
from warnings import warn
from django.conf import settings
from... | 1.875 | 2 |
src/datalayer/tests/test_allelefilter.py | Dabble-of-DevOps-Bio/ella | 0 | 12765605 | """
Integration/unit test for the AlleleFilter module.
Since it consists mostly of database queries, it's tested on a live database.
"""
import pytest
from datalayer import AlleleFilter
from vardb.datamodel import sample, jsonschema
FILTER_CONFIG_NUM = 0
def insert_filter_config(session, filter_config):
global ... | 2.59375 | 3 |
first_non_repeating_letter.py | rmayherr/python | 0 | 12765606 | def first_non_repeating_letter(string):
lowercase_string = string.lower()
result = []
for i in lowercase_string:
if (lowercase_string.count(i) == 1):
result.append(i)
if (len(result) == 0):
return ""
else:
if (string.find(result[0]) == -1 ):
return re... | 3.984375 | 4 |
quoridor/selfmatch.py | nakanoi/QuoridorAlphaZero | 0 | 12765607 | <filename>quoridor/selfmatch.py<gh_stars>0
import numpy as np
import os
import time
import subprocess
from networks import Network
from montecarlo import MCTS
from copy import deepcopy
from board import Board
from logs import Log
import config
class SelfMatch:
'''
Attribute
----------
log : Log
... | 2.359375 | 2 |
data/migrations/0098_auto_20200728_1208.py | SIXMON/peps | 5 | 12765608 | # Generated by Django 3.0.7 on 2020-07-28 12:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data', '0097_auto_20200724_1157'),
]
operations = [
migrations.RenameModel(
old_name='Culture',
new_name='SimulatorCulture',... | 1.648438 | 2 |
easy_rec/python/model/easy_rec_model.py | swaitw/EasyRec | 61 | 12765609 | # -*- encoding: utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
import logging
import re
from abc import abstractmethod
import six
import tensorflow as tf
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops.variables import PartitionedVariable
from easy_rec.python.compat impor... | 2.03125 | 2 |
dev/a_covidcases.py | exaxorg/pycon20-nyc-taxi-covid-movie | 2 | 12765610 | <reponame>exaxorg/pycon20-nyc-taxi-covid-movie
datasets = ('source',)
def synthesis(job):
d = {}
agg = 0
for dt, x in datasets.source.iterate('roundrobin', ('DATE_OF_INTEREST', 'CASE_COUNT')):
agg += x
d[dt] = agg
return d
| 2.296875 | 2 |
pyreach/mock/color_camera_mock.py | google-research/pyreach | 13 | 12765611 | # 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.359375 | 2 |
tests/tools/test_aux_methods_sanity_checks.py | nipy/nilabels | 15 | 12765612 | <filename>tests/tools/test_aux_methods_sanity_checks.py
from os.path import join as jph
from numpy.testing import assert_raises
from nilabels.definitions import root_dir
from nilabels.tools.aux_methods.sanity_checks import check_pfi_io, check_path_validity, is_valid_permutation
from tests.tools.decorators_tools impor... | 2.25 | 2 |
fhir/resources/DSTU2/elementdefinition.py | mmabey/fhir.resources | 0 | 12765613 | <reponame>mmabey/fhir.resources
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2019-05-14.
# 2019, SMART Health IT.
from . import (address, annotation, attachment, codeableconcept, coding,
contactpoint, e... | 2.25 | 2 |
pycs/spells/beacon_of_hope.py | dwagon/pycs | 0 | 12765614 | <filename>pycs/spells/beacon_of_hope.py
"""https://www.dndbeyond.com/spells/beacon-of-hope"""
from pycs.constant import SpellType
from pycs.spell import SpellAction
##############################################################################
#########################################################################... | 2.53125 | 3 |
pyvisdk/mo/host_system.py | Infinidat/pyvisdk | 0 | 12765615 |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.mo.managed_entity import ManagedEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class HostSystem(ManagedEn... | 2.015625 | 2 |
HomeComponents/AutoCheckBox.py | kristian5336/osr2mp4-app | 1 | 12765616 | <reponame>kristian5336/osr2mp4-app
import os
from PyQt5 import QtCore
from PyQt5.QtWidgets import QCheckBox
from abspath import abspath
from helper.helper import changesize
class AutoCheckBox(QCheckBox):
def __init__(self, parent):
super().__init__(parent)
self.main_window = parent
self.img_uncheck = os.pa... | 2.46875 | 2 |
model/Consulta.py | RRFreitas/Projeto_APS | 0 | 12765617 | from util.Color import *
class Consulta():
def __init__(self, preco, data, paciente_id, medico_id, realizada, paga, id=None):
self.id=id
self.preco=preco
self.data=data
self.paciente_id=paciente_id
self.medico_id=medico_id
self.realizada=realizada
... | 2.796875 | 3 |
services/storage/src/simcore_service_storage/utils.py | KZzizzle/osparc-simcore | 0 | 12765618 | <reponame>KZzizzle/osparc-simcore
import logging
import tenacity
from aiohttp import ClientSession
from yarl import URL
logger = logging.getLogger(__name__)
RETRY_WAIT_SECS = 2
RETRY_COUNT = 20
CONNECT_TIMEOUT_SECS = 30
@tenacity.retry(
wait=tenacity.wait_fixed(RETRY_WAIT_SECS),
stop=tenacity.stop_after_a... | 2.890625 | 3 |
ZergParser.py | loginn/sc2-build-classifier | 0 | 12765619 | <filename>ZergParser.py
# This file contains parsing functions for Zerg build orders
from RaceParser import RaceParser
class ZergParser(RaceParser):
def __init__(self, player, max_tuples=50):
super().__init__(player, max_tuples)
self.name = "zerg parser"
| 2.328125 | 2 |
script_generator.py | openharmony-gitee-mirror/update_packaging_tools | 0 | 12765620 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | 2.109375 | 2 |
tests/integration/test_requirements.py | Darsstar/pipenv | 0 | 12765621 | import pytest
@pytest.mark.requirements
def test_requirements_generates_requirements_from_lockfile(PipenvInstance):
with PipenvInstance(chdir=True) as p:
packages = ('requests', '2.14.0')
dev_packages = ('flask', '0.12.2')
with open(p.pipfile_path, 'w') as f:
contents = f"""
... | 2.34375 | 2 |
electoral/urls.py | RyanFleck/Django-React-Heroku-Test | 0 | 12765622 | """electoral URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 2.421875 | 2 |
PythonAppDevSamples/OrcsV1/orcsV0_0_1.py | HamzaHindRyanSofia/wargameRepo | 0 | 12765623 | '''
Created on 16 ago 2017
@author: Hamza
'''
class MyClass(object):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
| 2.828125 | 3 |
designate/storage/impl_sqlalchemy/migrate_repo/versions/040_fix_record_data.py | infobloxopen/designate | 0 | 12765624 | <filename>designate/storage/impl_sqlalchemy/migrate_repo/versions/040_fix_record_data.py
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may ... | 1.835938 | 2 |
pyCardiac/signal/processing/filtration/fourier_filter.py | humanphysiologylab/pyCardiac | 0 | 12765625 | import numpy as np
from scipy.fftpack import rfft, irfft, rfftfreq
from ....routines import rescale
def fourier_filter(data: np.ndarray, fs: float,
lp_freq: float = None, hp_freq: float = None, bs_freqs: list = [],
trans_width: float = 1, band_width: float = 1) -> np.ndarray:
... | 2.734375 | 3 |
PSICT_extras/WorkerScriptManager.py | JeanOlivier/Labber-PSICT | 2 | 12765626 | import os
import sys
import re
import shutil
import importlib.util
import numpy as np
from datetime import datetime
import time
import pathlib
import logging
import PSICT_UIF._include36._LogLevels as LogLevels
## Worker script breakpoints - DO NOT MODIFY
OPTIONS_DICT_BREAKPOINT = '## OPTIONS DICT BREAKPOINT'
SCRIPT_C... | 1.71875 | 2 |
2021-summer-research.py | KhoiLe01/2021-summer-research | 0 | 12765627 | import random
import math
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import colorsys
import copy
def visualization(machines, jobs, algo):
# Declaring a figure "gnt"
fig, gnt = plt.subplots()
# Setting labels for x-axis and y-axis
gnt.set_xlabel('Processing Time')
gnt.set_yla... | 2.796875 | 3 |
Code/Common/kitti_tfrecords_creator.py | Turgibot/NeuralNets | 0 | 12765628 | <filename>Code/Common/kitti_tfrecords_creator.py
# Copyright 2018 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 2.078125 | 2 |
BackEnd/src/app/domain/collections/stocks/stocksQueries.py | JeremieBeaudoin/LavalUniversityStockExchange | 0 | 12765629 | <reponame>JeremieBeaudoin/LavalUniversityStockExchange<filename>BackEnd/src/app/domain/collections/stocks/stocksQueries.py
from src.app.database.utility.StockUtility import splitTickerAggregate
def getAllStockTickersAndSuffixes():
return """SELECT ticker, suffix
FROM stocks;"""
def getAllS... | 2.546875 | 3 |
prev_ob_models/KaplanLansner2014/plotting_and_analysis/plot_gauss.py | fameshpatel/olfactorybulb | 5 | 12765630 |
import numpy as np
import matplotlib.mlab as mlab
import pylab
p = [1.631787e+02, 6.670855e+00, 1.977871e+00, \
1.909487e+01, 1.110809e+01, 3.353855e+00, \
4.188897e+00, 4.088460e+01, 4.966478e-01]
def trimodal_gauss(x, p):
w1 = p[0]
mu1 = p[1]
sigma1 = p[2]
w2 = p[3]
mu2 = p[4]
si... | 2.375 | 2 |
plugins/snortlabslist/komand_snortlabslist/actions/lookup/schema.py | lukaszlaszuk/insightconnect-plugins | 46 | 12765631 | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "IP Check"
class Input:
ADDRESS = "address"
class Output:
ADDRESS = "address"
FOUND = "found"
STATUS = "status"
URL = "url"
class LookupInput(komand.Input):
schema = json.loads(""... | 2.375 | 2 |
envs/meta/__init__.py | twni2016/pomdp-baselines | 40 | 12765632 | from gym.envs.registration import register
## off-policy variBAD benchmark
register(
"PointRobot-v0",
entry_point="envs.meta.toy_navigation.point_robot:PointEnv",
kwargs={"max_episode_steps": 60, "n_tasks": 2},
)
register(
"PointRobotSparse-v0",
entry_point="envs.meta.toy_navigation.point_robot:S... | 1.671875 | 2 |
prev_ob_models/exclude/GilraBhalla2015/generators/generate_firerates_sinusoids.py | fameshpatel/olfactorybulb | 0 | 12765633 | <reponame>fameshpatel/olfactorybulb
import sys, pickle
from pylab import *
import numpy
sys.path.extend(["..","../networks","../simulations"])
from networkConstants import *
from stimuliConstants import *
#### Generate sinusoids of different frequencies and amplitudes
#### to feed to gloms individually to obtain fre... | 2.53125 | 3 |
test_pomo.py | liuxk99/sjPomotodo | 0 | 12765634 | <reponame>liuxk99/sjPomotodo<gh_stars>0
# coding=utf-8
import re
from unittest import TestCase
from pomo import Pomo
json = u'{' \
u' "uuid": "26a37b6f-6e69-4a2e-ae79-e9c264a4a653",' \
u' "created_at": "2020-03-30T12:25:26.800Z",' \
u' "updated_at": "2020-03-30T12:25:26.800Z",' \
... | 2.671875 | 3 |
api.py | johnnymck/historical-api | 0 | 12765635 | #!/usr/bin/evn python
import sqlite3
from flask import Flask, jsonify, g
app = Flask(__name__)
DATABASE = 'union-bridge'
def query_db(query, args=(), one=False):
cur=g.db.execute(query, args)
rv = [dict((cur.description[idx][0], value)
for idx, value in enumerate(row)) for row in cur.fetchall()]
... | 2.859375 | 3 |
lino/core/requests.py | khchine5/lino | 1 | 12765636 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
See introduction in :doc:`/dev/ar`.
"""
from builtins import str
import six
import logging
logger = logging.getLogger(__name__)
from copy import copy
from xml.sax.saxutils import escape
# from... | 1.804688 | 2 |
tests/test_a0179largestnumber.py | nirofang/pyleet | 3 | 12765637 | <reponame>nirofang/pyleet<gh_stars>1-10
from solutions.a0179largestnumber import Solution
solution = Solution()
def test_largestNumber1():
nums = [10, 2]
expect = "210"
actual = solution.largestNumber(nums)
assert actual == expect
def test_largestNumber2():
nums = [3, 30, 34, 5, 9]
expect = "9534330"
... | 2.59375 | 3 |
Project_Euler/Problem 14 script.py | JasPass/Projects | 0 | 12765638 | <reponame>JasPass/Projects
# Project Euler: Problem 14
#
#
# Which starting number, under one million, produces the longest chain?
import time
# Sets starting time of program
startTime = time.time()
# Function to run the sequence until 1 is reached
def sequence(n, sequence_length=1):
# Checks if (n) is even
... | 3.609375 | 4 |
punkweb_boards/context_processors.py | shakedown-street/punkweb-boards | 1 | 12765639 | from punkweb_boards.conf import settings as BOARD_SETTINGS
from punkweb_boards.models import Report
def settings(request):
return {
"BOARD_SETTINGS": {
"BOARD_NAME": BOARD_SETTINGS.BOARD_NAME,
"BOARD_THEME": BOARD_SETTINGS.BOARD_THEME,
"SHOUTBOX_ENABLED": BOARD_SETTINGS... | 2.03125 | 2 |
AlgorithmQuestionAnswering/StanfordSpacyNLP.py | zointblackbriar/QuestionAnswering | 1 | 12765640 | <gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
from __future__ import print_function
# try:
# unicode_ = unicode #Python2
# except NameError:
# unicode_ = str #Python3
#This py file will use Stanford Core NLP Server
from collections import defaultdict
import nlt... | 2.3125 | 2 |
nodes/pulsar-houdini/open_file.py | Soulayrol/Pulsar | 16 | 12765641 | import os
import hou
def main(arguments):
file = arguments["file"].replace(os.sep, '/')
if(arguments["force"] == 0):
hou.hipFile.load(file, suppress_save_prompt=True)
else:
hou.hipFile.save(file_name=None)
hou.hipFile.load(file, suppress_save_prompt=False)
# workspace_path = f... | 2.25 | 2 |
driloader/__main__.py | lucasmello/Driloader | 4 | 12765642 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# pylint: disable=too-few-public-methods
"""Driloader Command Line Interface
Using Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html
"""
import argparse
import sys
from driloader.brows... | 2.515625 | 3 |
services/backend/src/database/config.py | CarooSilvestri/fastapi-vue | 35 | 12765643 | <reponame>CarooSilvestri/fastapi-vue
import os
TORTOISE_ORM = {
"connections": {"default": os.environ.get("DATABASE_URL")},
"apps": {
"models": {
"models": [
"src.database.models", "aerich.models"
],
"default_connection": "default"
}
}
}
| 1.4375 | 1 |
4-2/race.py | mttaggart/everlive-python-intro | 0 | 12765644 | from car import Car
class Race:
def __init__(self, racers, distance):
pass
def tick(self):
pass
def run(self):
pass
| 2.3125 | 2 |
metrics_exporter.py | nfvsap/latency-tests | 0 | 12765645 | # -*- coding: utf-8 -*-
import flask
import os
import sys
import ast
import json
import argparse
app = flask.Flask(__name__)
filename = ''
@app.route('/latency_metrics')
def get_latency_percentiles():
""" Retrieves the last saved latency hdr histogram percentiles
and the average latency
Args:
... | 2.890625 | 3 |
GPyOpt/testing/util_tests/test_general_utils.py | RaulAstudillo/bocf | 9 | 12765646 | import numpy as np
import unittest
from numpy.testing import assert_array_less
from GPyOpt.core.errors import InvalidConfigError
from GPyOpt.core.task.space import Design_space
from GPyOpt.experiment_design import initial_design
class TestInitialDesign(unittest.TestCase):
def setUp(self):
self.space = [
... | 2.609375 | 3 |
src/pipeline/stock-news-pipeline.py | HalmonLui/msft-azure-hacks-2019 | 5 | 12765647 | <filename>src/pipeline/stock-news-pipeline.py
import datetime
import json
from airflow import DAG
from airflow import models
from airflow.operators.python_operator import PythonOperator
from airflow.operators.bash_operator import BashOperator
from airflow.contrib.hooks.mongo_hook import MongoHook
DEFAULT_ARGS = {
... | 1.960938 | 2 |
yamlsql/render.py | yejianye/yamlsql | 0 | 12765648 | <filename>yamlsql/render.py
import sqlparse
from funcy import omit, merge
from ruamel.yaml.comments import CommentedMap
from .parser import YAMLParser
def sql_format(sql):
sql = sql.strip()
if not sql.endswith(';'):
sql = sql + ';'
return sqlparse.format(sql.strip(), reindent=True, keyword_case='... | 2.484375 | 2 |
coding_intereview/1450. Number of Students Doing Homework at a Given Time.py | Jahidul007/Python-Bootcamp | 2 | 12765649 | <filename>coding_intereview/1450. Number of Students Doing Homework at a Given Time.py
class Solution:
def busyStudent(self, startTime: List[int], endTime: List[int], queryTime: int) -> int:
working = 0
for i, stu in enumerate(startTime):
if stu <= queryTime and endTime[i] >= queryTime:
... | 3.4375 | 3 |
setup.py | gustavla/vzlog | 3 | 12765650 | <reponame>gustavla/vzlog
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from setuptools import setup
import os
if os.getenv('READTHEDOCS'):
with open('requirements_docs.txt') as f:
required = f.read().splitlines()
compile_ext = False
else:
import numpy as np... | 1.601563 | 2 |