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 |
|---|---|---|---|---|---|---|
doc/source/stats_callbacks.py | mhaseeb123/TECA | 34 | 12790251 | from teca import *
import numpy as np
import sys
def get_request_callback(rank, var_names):
def request(port, md_in, req_in):
sys.stderr.write('descriptive_stats::request MPI %d\n'%(rank))
req = teca_metadata(req_in)
req['arrays'] = var_names
return [req]
return request
def get... | 2.1875 | 2 |
tests/strain_inputs.py | greschd/aiida_strain | 0 | 12790252 | <reponame>greschd/aiida_strain<gh_stars>0
# -*- coding: utf-8 -*-
# © 2017-2019, ETH Zurich, Institut für Theoretische Physik
# Author: <NAME> <<EMAIL>>
"""
Test fixtures providing input for the strain workchains.
"""
# pylint: disable=unused-argument,redefined-outer-name,missing-docstring
import pytest
__all__ = [... | 1.84375 | 2 |
twitter_feels/apps/map/models.py | michaelbrooks/twitter-feels | 1 | 12790253 | from django.core.exceptions import ObjectDoesNotExist
from django.db import models, connection, transaction, IntegrityError, DatabaseError
from django.utils import timezone
import random
from south.db.generic import DatabaseOperations
from twitter_stream.fields import PositiveBigAutoField, PositiveBigAutoForeignKey
f... | 2.03125 | 2 |
gimp-plugins/PD-Denoising-pytorch/utils.py | sunlin7/GIMP-ML | 1,077 | 12790254 | <reponame>sunlin7/GIMP-ML
import math
import torch
import torch.nn as nn
import numpy as np
# from skimage.measure.simple_metrics import compare_psnr
from torch.autograd import Variable
import cv2
import scipy.ndimage
import scipy.io as sio
# import matplotlib as mpl
# mpl.use('Agg')
# import matplotlib.pyplot as plt
... | 2.125 | 2 |
accounts/forms.py | bugulin/gymgeek-web | 0 | 12790255 | <filename>accounts/forms.py
from django import forms
from core import material_design
class AboutForm(forms.Form):
about = forms.CharField(widget=material_design.Textarea, max_length=500, required=False)
| 1.859375 | 2 |
module10-packages/deepcloudlabs/hr.py | deepcloudlabs/dcl160-2021-jul-05 | 0 | 12790256 | <filename>module10-packages/deepcloudlabs/hr.py
class Employee:
def __init__(self, fullname, email, salary):
self.fullname = fullname
self.email = email
self.salary = salary
def __str__(self):
return f"employee (full name: {self.fullname})"
| 2.625 | 3 |
iutest/core/iconutils.py | mgland/iutest | 10 | 12790257 | # Copyright 2019-2020 by <NAME>, MGLAND animation studio. All rights reserved.
# This file is part of IUTest, and is released under the "MIT License Agreement".
# Please see the LICENSE file that should have been included as part of this package.
import os
from iutest.core import pathutils
from iutest.qt import iconFr... | 1.765625 | 2 |
pmovie/scanp4.py | noobermin/lspreader | 0 | 12790258 | #!/usr/bin/env python
'''
Search a p4 for good indices. This imports the file specified by
the modulepath option, reads a function called "f" from it,
and filters the frames using it. Outputs a numpy array of
good trajectories.
Usage:
./search.py [options] <input> <hashd> <output>
Options:
--help -h ... | 2.90625 | 3 |
cradmin_legacy/viewhelpers/listfilter/base/abstractfilter.py | appressoas/cradmin_legacy | 0 | 12790259 | <reponame>appressoas/cradmin_legacy<filename>cradmin_legacy/viewhelpers/listfilter/base/abstractfilter.py
from __future__ import unicode_literals
import json
from xml.sax.saxutils import quoteattr
from django.utils.translation import pgettext
from cradmin_legacy.viewhelpers.listfilter.base.abstractfilterlistchild impor... | 2.1875 | 2 |
hon/json/json_serializable.py | swquinn/hon | 0 | 12790260 | <reponame>swquinn/hon<filename>hon/json/json_serializable.py
"""
hon.json.json_serializable
~~~~~
"""
class JsonSerializable():
def to_json(self):
raise NotImplementedError()
| 1.984375 | 2 |
sentience/core/utils/errors.py | jtdutta1/Sentience | 0 | 12790261 | <gh_stars>0
class Error(Exception):
def __init__(self):
self.message = None
def __repr__(self) -> str:
return self.message
def __str__(self) -> str:
return self.message
class DimensionalityMismatchError(Error):
def __init__(self, reduce_expand, *args) -> None:
... | 2.65625 | 3 |
python/pic_format.py | YeungShaoFeng/libxib | 0 | 12790262 | <reponame>YeungShaoFeng/libxib
def pic_format(file_head: bin):
"""
Determine the format of a picture. \n
:param file_head: The [:8] of the pic's file_head.
:return: Pic's format if matched, "unknown" if none matched .
"""
res = "unknown"
if b'\xff\xd8\xff' in file_head:
res = 'jpg'
... | 3.203125 | 3 |
common/models.py | stefangeorg/town-car | 0 | 12790263 | <filename>common/models.py
from django.contrib.gis.db import models
class Address(models.Model):
address1 = models.CharField(max_length=255)
address2 = models.CharField(max_length=255)
city = models.CharField(max_length=255)
zip = models.CharField(max_length=20, blank=True, null=True)
state = mode... | 2.140625 | 2 |
TalentHunter/jobMatchingApi/urls.py | Hnachik/JobMatchingPfeProjectBack | 0 | 12790264 | <gh_stars>0
from django.urls import include, path
from .views import recruiter, jobseeker
urlpatterns = [
path('jobseeker/', include(([
path('', jobseeker.JobSeekerView.as_view()),
path('resume/', jobseeker.ResumeDetailView.as_view()),
path('resume/<int:id>/', jobseeker.ResumeUpdateView.a... | 1.96875 | 2 |
vscod/extensions_downloader.py | DivoK/vscod | 4 | 12790265 | import asyncio
import dataclasses
import json
import re
import typing
from pathlib import Path
import aiohttp
from loguru import logger
from .utils import download_url, get_request, get_original_filename
# Format string linking to the download of a vscode extension .vsix file.
MARKETPLACE_DOWNLOAD_LINK = '''
htt... | 2.609375 | 3 |
tests/test_code_block.py | ralphbean/markdown-to-confluence | 9 | 12790266 | from textwrap import dedent
def test_code_block(script):
"""
Test code block.
"""
script.set_content(
dedent(
"""
```python
m = {}
m["x"] = 1
```
"""
)
)
assert (
'<ac:structured-mac... | 2.53125 | 3 |
wikiitem/views_show.py | shagun30/djambala-2 | 0 | 12790267 | <reponame>shagun30/djambala-2
# -*- coding: utf-8 -*-
"""
/dms/wikiitem/views_show.py
.. zeigt den Inhalt einer Wiki-Seite an
Django content Management System
<NAME>
<EMAIL>
Die Programme des dms-Systems koennen frei genutzt und den spezifischen
Beduerfnissen entsprechend angepasst werden.
0.01 17.03.2008... | 1.929688 | 2 |
igmp/igmp2/RouterState.py | pedrofran12/igmp | 3 | 12790268 | from threading import Timer
import logging
from igmp.packet.PacketIGMPHeader import PacketIGMPHeader
from igmp.packet.ReceivedPacket import ReceivedPacket
from igmp.rwlock.RWLock import RWLockWrite
from igmp.utils import TYPE_CHECKING
from . import igmp_globals
from .GroupState import GroupState
from .querier.Querier... | 2.296875 | 2 |
model/get_raid.py | H3C/hdm-redfish-script | 4 | 12790269 | ###
# Copyright 2021 New H3C Technologies 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/licenses/LICENSE-2.0
#
# Unless required by applicab... | 1.6875 | 2 |
yaml_query/tests/test.py | majidaldo/yaml2table | 1 | 12790270 | <filename>yaml_query/tests/test.py
select_test = \
"""
select * from yaml
"""
def test('test.yaml','from ):
return
| 1.664063 | 2 |
seq2seq/corpus.py | shinoyuki222/torch-light | 310 | 12790271 | import torch
import argparse
import logging
from utils import corpora2idx, normalizeString
from const import *
class Dictionary(object):
def __init__(self):
self.word2idx = {
WORD[BOS]: BOS,
WORD[EOS]: EOS,
WORD[PAD]: PAD,
WORD[UNK]: UNK
}
s... | 2.59375 | 3 |
app.py | lit26/streamlit-image-label | 16 | 12790272 | import streamlit as st
import os
from streamlit_img_label import st_img_label
from streamlit_img_label.manage import ImageManager, ImageDirManager
def run(img_dir, labels):
st.set_option("deprecation.showfileUploaderEncoding", False)
idm = ImageDirManager(img_dir)
if "files" not in st.session_state:
... | 2.578125 | 3 |
m3c/__init__.py | rkingan/m3c | 1 | 12790273 | r"""
Library routines for minimally 3-connected graph generation.
This program requires cython.
"""
import pyximport
pyximport.install(language_level=3)
| 1.75 | 2 |
main.py | felamaslen/neural-net | 0 | 12790274 | <filename>main.py
#!/usr/bin/python3
from environment import Environment
env = Environment()
| 1.742188 | 2 |
python/gpusim_search.py | Mariewelt/gpusimilarity | 61 | 12790275 | from PyQt5 import QtCore, QtNetwork
import random
from gpusim_utils import smiles_to_fingerprint_bin
def parse_args():
import argparse
parser = argparse.ArgumentParser(description="Sample GPUSim Server - "
"run an HTTP server that loads fingerprint data onto GPU and " #noqa
"responds ... | 2.796875 | 3 |
models/credentials.py | govle-192-21-2/govle | 0 | 12790276 | <gh_stars>0
from abc import ABC
from dataclasses import dataclass, field
from typing import List
@dataclass
class LearningEnvCredentials(ABC):
pass
@dataclass
class GoogleCredentials(LearningEnvCredentials):
# Associated user ID
user_id: str = ''
# Associated e-mail address
email: str = ''
... | 2.65625 | 3 |
aoc/cli/commands/new.py | juanrgon/advent-of-code | 3 | 12790277 | import click
import pendulum
import subprocess
import os
from pathlib import Path
from aoc.script import Script
import aoc.paths
import pendulum
@click.command()
@click.option("-y", "--year", type=str)
@click.option("-d", "--day", type=str)
def new(year: str, day: str):
"""Create new script for AOC"""
if not... | 2.890625 | 3 |
src/semnav/learning/behavior_net/behavior_rnn.py | kchen92/graphnav | 17 | 12790278 | <filename>src/semnav/learning/behavior_net/behavior_rnn.py
import torch
import torch.nn as nn
import torch.nn.functional as F
class BehaviorRNN(nn.Module):
def __init__(self, rnn_type, hidden_size, num_layers):
super(BehaviorRNN, self).__init__()
self.is_recurrent = True
self.hidden_size ... | 2.734375 | 3 |
third_party/upb/docs/render.py | echo80313/grpc | 515 | 12790279 | <reponame>echo80313/grpc<gh_stars>100-1000
#!/usr/bin/env python3
import subprocess
import sys
import shutil
import os
if len(sys.argv) < 2:
print("Must pass a filename argument")
sys.exit(1)
in_filename = sys.argv[1]
out_filename = in_filename.replace(".in.md", ".md")
out_dir = in_filename.replace(".in.md",... | 2.453125 | 2 |
ch2/echoclient.py | cybaek/twisted-network-programming-essentials-2nd-edition-python3 | 0 | 12790280 | <reponame>cybaek/twisted-network-programming-essentials-2nd-edition-python3
from twisted.internet import reactor, protocol
class EchoClient(protocol.Protocol):
def connectionMade(self):
self.transport.write(u'Hello, world!'.encode('utf-8'))
def dataReceived(self, data):
print("Server said: ",... | 3.15625 | 3 |
login.py | lij321/test | 0 | 12790281 | <gh_stars>0
a = 2
print(a)
b = "hello"
print(b)
c = 123123
print(c)
d = c
print(d)
def fun()
print("*"*5)
fun()
| 2.9375 | 3 |
setup.py | imposeren/pynames | 0 | 12790282 | # coding: utf-8
import setuptools
setuptools.setup(
name = 'Pynames',
version = '0.1.0',
author = '<NAME>',
author_email = '<EMAIL>',
packages = setuptools.find_packages(),
url = 'https://github.com/Tiendil/pynames',
license = 'LICENSE',
description = "characters' name generation librar... | 1.242188 | 1 |
setup.py | DahlitzFlorian/python-color-changer | 3 | 12790283 | from setuptools import setup
setup(
name='color-changer',
version='1.0.5',
packages=['colorchanger', ],
license='MIT',
description='Reads in an image and swap specified colors ',
long_description=open('README.rst').read(),
author='<NAME>',
author_email='<EMAIL>',
url='https://github... | 1.507813 | 2 |
setup.py | sgielen/trac-plugin-softduedate | 0 | 12790284 | from setuptools import setup, find_packages
setup(
name='TracSoftDueDate', version='1.0',
packages=find_packages(exclude=['*.tests*']),
entry_points = {
'trac.plugins': [
'softduedate = softduedate',
],
},
)
| 1.226563 | 1 |
AktuelFinder/operations/PdfTask.py | maysu1914/AktuelFinder | 1 | 12790285 | import os
from urllib.parse import urlparse
import requests
from PyPDF2 import PdfFileReader
def download_pdf(url):
parse = urlparse(url)
base_url = parse.scheme + '://' + parse.netloc
try:
redirect = requests.get(url, allow_redirects=False)
except requests.exceptions.ConnectionError as e:
... | 3.46875 | 3 |
cmpds.py | jlinoff/cmpds | 0 | 12790286 | #!/usr/bin/env python
r'''
Compare two datasets to determine whether there is a significant
difference between them for a specific confidence level using the
t-test methodology for unpaired observations.
Please note that this is not, strictly, a t-test because it switches
over to the standard normal distribution (SND)... | 2.75 | 3 |
test/test_extension.py | sekikawattt/mkdocs-linkpatcher-plugin | 0 | 12790287 | <filename>test/test_extension.py
# coding: utf-8
from __future__ import unicode_literals
import re
import unittest
import markdown
from markdown.util import etree
from mkdocs import config, nav
import linkpatcher.plugin as plugin
from linkpatcher.extension import (LinkPatcherTreeProcessor,
... | 2.28125 | 2 |
Extra Exercises/hello.py | luizpavanello/python_udacity | 0 | 12790288 | # This program says hello and asks for my name
print('Hello, world!')
print('What is your name? ') # ask for their name
myName = input()
print(f'It is good to meet you, {myName}!')
print(f'The length of your name is: {len(myName)}')
print('What is your age?') #ask for their age
myAge = input()
print('You will be ' +... | 4.0625 | 4 |
User/tests/test_selenium.py | LukaszHoszowski/Django_ProEstate | 1 | 12790289 | <reponame>LukaszHoszowski/Django_ProEstate<filename>User/tests/test_selenium.py
import os
import time
import pytest
@pytest.mark.usefixtures('driver_init')
class TestUrlChrome:
def test_open_url(self, live_server):
self.driver.get(f'{live_server.url}/admin/')
assert 'Zaloguj się | Administracja... | 2.1875 | 2 |
src/freetype/src/tools/chktrcmp.py | fenollp/wex | 39 | 12790290 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: <NAME>, 2009, 2013
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = ["src"]
TRACE_DEF_FILES = ["include/freetype/internal/ftt... | 2.234375 | 2 |
pysm/semantic_modeling/assembling/autolabel/maxf1.py | binh-vu/semantic-modeling | 3 | 12790291 | <reponame>binh-vu/semantic-modeling<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
from typing import Dict, Tuple, List, Union, Optional, Set
from data_structure import Graph, GraphLink
from experiments.evaluation_metrics import DataNodeMode
from semantic_modeling.assembling.autolabel.align_graph import alig... | 2.265625 | 2 |
tools/data_loader.py | ZhengjieFANG/SalienGAN | 0 | 12790292 | import os
import torch
import utils
import torchvision.transforms as T
from torch.utils import data
from PIL import Image
#定义自己的数据集合
class MyDataSet(data.Dataset):
def __init__(self,root,transform):
# 所有图片的绝对路径
imgs=os.listdir(root)
self.imgs=[os.path.join(root,k) for k in imgs]
sel... | 2.890625 | 3 |
tests/types/test_nullable.py | rfloriano/preggy | 10 | 12790293 | # -*- coding: utf-8 -*-
# preggy assertions
# https://github.com/heynemann/preggy
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2013 <NAME> <EMAIL>
from preggy import expect
#-----------------------------------------------------------------------------
def test_... | 2.484375 | 2 |
nodeClass.py | EdwardG5/tempCrossword | 0 | 12790294 | <reponame>EdwardG5/tempCrossword<filename>nodeClass.py<gh_stars>0
class Node:
def __init__(self, parent, letter, word):
self._parent = parent # Pointer to parent
self._letter = letter # Current letter
self.word = word # Bool (Yes or no)
# Pointers to other child nodes
self._pointers = [None for x in... | 3.28125 | 3 |
tests/test_utils_dataset_info_is_valid.py | jic-dtool/dtool_lookup_server | 4 | 12790295 | """Test dtool_lookup_server.utils.dataset_info_is_valid helper function."""
# Minimum data required to register a dataset.
INFO = {
"uuid": "af6727bf-29c7-43dd-b42f-a5d7ede28337",
"type": "dataset",
"uri": "file:///tmp/a_dataset",
"name": "my-dataset",
"readme": {"description": "test dataset"},
... | 2.296875 | 2 |
site_project/movement/admin.py | clockworkk/Personal-Stat-Tracker | 0 | 12790296 | from django.contrib import admin
from .models import Activity, Fitbit
class ActivityAdmin(admin.ModelAdmin):
fieldsets = [
('Date Information', {'fields': ['entry_date']}),
('Fitbit Data', {'fields': ['steps', 'distance'], 'classes' : ['collapse']}),
]
list_display = ('entry_date' , 'steps', 'distance')
class... | 1.75 | 2 |
imdb_rating/dependencies/__init__.py | PeregHer/imdb-rating-predictions | 0 | 12790297 | from .models import Movie
from .spiders import IMDBSpider
__all__ = ["Movie", "IMDBSpider"]
| 1.15625 | 1 |
predict.py | KnightZhang625/TF_ESTIMATOR_STANDARD_PARADIGM | 1 | 12790298 | <gh_stars>1-10
# coding:utf-8
import numpy as np
import tensorflow as tf
from tensorflow.contrib import predictor
from pathlib import Path
from config import config as _cg
def predict():
# find the pb file
subdirs = [x for x in Path(_cg.infer_pb_path).iterdir()
if x.is_dir() and 'temp' not in str(x... | 2.4375 | 2 |
solutions/two_sum.py | lishengfeng/leetcode | 0 | 12790299 | # Given an array of integers, return indices of the two numbers such that
# they add up to a specific target.
#
# You may assume that each input would have exactly one solution, and you
# may not use the same element twice.
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: Li... | 3.71875 | 4 |
External/astrometry.net/astrometry/python/pyfits/NA_pyfits.py | simonct/CoreAstro | 3 | 12790300 | <filename>External/astrometry.net/astrometry/python/pyfits/NA_pyfits.py<gh_stars>1-10
#!/usr/bin/env python
# $Id: NA_pyfits.py 329 2007-07-06 13:11:54Z jtaylor2 $
"""
A module for reading and writing FITS files and manipulating their contents.
A module for reading and writing Flexible Image Transport System
(FITS) ... | 1.984375 | 2 |
tools/real_world_impact/nsfw_urls.py | zealoussnow/chromium | 14,668 | 12790301 | # Copyright 2014 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.
"""NSFW urls in the Alexa top 2000 sites."""
nsfw_urls = set([
"http://xhamster.com/",
"http://xvideos.com/",
"http://livejasmin.com/",
"http://pornh... | 1.148438 | 1 |
setup.py | EhwaZoom/bpgen | 0 | 12790302 | <reponame>EhwaZoom/bpgen
import setuptools
setuptools.setup(
name = 'bpgen',
version = '0.1.0',
description = 'Boilerplate generator.',
url = 'https://github.com/EhwaZoom/bpgen',
author = 'EhwaZoom',
author_email = '<EMAIL>',
maintainer ... | 1.132813 | 1 |
HW3/HW3_1.py | kolyasalubov/Lv-677.PythonCore | 0 | 12790303 | zen_of_P = """Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality... | 3.59375 | 4 |
webdriver_recorder/plugin.py | UWIT-IAM/webdriver-recorder | 6 | 12790304 | import logging
import os
import sys
import tempfile
from contextlib import contextmanager
from typing import Callable, Dict, List, Optional, Type, Union
import pytest
from pydantic import BaseSettings, validator
from selenium import webdriver
from .browser import BrowserError, BrowserRecorder, Chrome, Remote
from .mo... | 2.21875 | 2 |
___Language___/Python/Iter/Zip and Unzip & range.py | JUD210/Study-Note | 0 | 12790305 | <gh_stars>0
a = [1, 2, 3]
b = [4, 5]
r = ((x, y) for x in a for y in b)
print(r)
# <generator object <genexpr> at 0x00000182580A0B88>
print(*r)
# (1, 4) (1, 5) (2, 4) (2, 5) (3, 4) (3, 5)
r = [(x, y) for x in a for y in b]
print(r)
# [(1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5)]
print(*r)
# (1, 4) (1, 5) (2, 4) (... | 2.796875 | 3 |
saintBioutils/utilities/file_io/get_paths.py | HobnobMancer/saintBioutils | 1 | 12790306 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) University of St Andrews 2020-2021
# (c) University of Strathclyde 2020-2021
# (c) James Hutton Institute 2020-2021
#
# Author:
# <NAME>
#
# Contact
# <EMAIL>
#
# <NAME>,
# Biomolecular Sciences Building,
# University of St Andrews,
# <NAME>,
# St And... | 1.601563 | 2 |
training/Metrics.py | sdwalker62/Log-Diagnostics-Archive | 3 | 12790307 | import tensorflow as tf
loss_object = tf.keras.losses.SparseCategoricalCrossentropy(
from_logits=True)
def loss_function(real, pred):
mask = tf.math.logical_not(tf.math.equal(real, 0))
loss_ = loss_object(real, pred)
mask = tf.cast(mask, dtype=loss_.dtype)
loss_ *= mask
return tf.reduce_sum(loss_)... | 2.53125 | 3 |
pynq_chainer/overlays/__init__.py | tkat0/pynq-chainer | 6 | 12790308 | <filename>pynq_chainer/overlays/__init__.py<gh_stars>1-10
from .mmult import Mmult
from .bin_mmult import BinMmult
| 1.179688 | 1 |
host/models.py | Sindhuja-SRL/back-end | 0 | 12790309 | <reponame>Sindhuja-SRL/back-end
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Event(models.Model):
host = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
name = models.CharField(max_length=200)
status = models.CharField(max_length=... | 2.46875 | 2 |
GPU/python/CUDA_numba.py | maxtcurie/Parallel_programming | 0 | 12790310 | import numpy as np
from numba import cuda, float32
import time
@cuda.jit
def matmul(A, B, C):
"""Perform square matrix multiplication of C = A * B
"""
i, j = cuda.grid(2)
if i < C.shape[0] and j < C.shape[1]:
tmp = 0.
for k in range(A.shape[1]):
tmp += A[i, k] * B[k, j]
... | 3.484375 | 3 |
pleiades_script.py | jagfu/Qanalysis | 0 | 12790311 | <reponame>jagfu/Qanalysis
#!/usr/bin/python3
import requests
import random
import time
import calendar
import os
import argparse
import datetime
# Console arguments
parser = argparse.ArgumentParser(
description="Estimate number of cars at given rectangles (latitude-longitude) on given timeframes"
)
parser.add_arg... | 2.90625 | 3 |
send_eadmin.py | huxiba/nagios-plugins | 0 | 12790312 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import urllib.parse
import sys
from datetime import datetime
url = 'http://zzzzzz/api/upload.php'
def sendmessage(message):
print(message)
params = urllib.parse.urlencode(message)
params = params.encode("ascii")
req = urllib.reques... | 3 | 3 |
python/강길웅1.py | gilwoong-kang/education.cloudsecurity | 0 | 12790313 | <reponame>gilwoong-kang/education.cloudsecurity<gh_stars>0
import numpy as np
import re
result = []
month = [0,0,0,0,0,0,0,0,0,0,0,0]
with open('./output.txt','w') as output:
with open('./input.txt','r') as file:
data = file.readline()
for data in file:
output.write('{}'.format(data.st... | 2.921875 | 3 |
recodoc2/apps/codeutil/parser.py | bartdag/recodoc2 | 9 | 12790314 | <filename>recodoc2/apps/codeutil/parser.py
from __future__ import unicode_literals
def create_match(parent, children=None):
if children is None:
children = tuple()
return (parent, tuple(children))
def is_valid_match(match, matches, filtered):
'''Returns true if the match is new, bigger than an e... | 2.765625 | 3 |
swagger_server/controllers/default_controller.py | Surya2709/FlaskSwaggerDemo | 0 | 12790315 | <reponame>Surya2709/FlaskSwaggerDemo<filename>swagger_server/controllers/default_controller.py
import connexion
import six
from swagger_server.models.alert import Alert # noqa: E501
from swagger_server.models.alert_array import AlertArray # noqa: E501
from swagger_server.models.updatealert import Updatealert # noqa... | 2.390625 | 2 |
neurogaze/analyze/grouping.py | chrizzzlybear/neurogaze_research | 0 | 12790316 | import numpy as np
def time_between_values(df, cols):
gap_df = df[cols].dropna(how='any')
return gap_df.index.to_series().diff(-1).dt.total_seconds().abs()
def distance_to_monitor(df):
dist = np.sqrt(
df.left_gaze_origin_in_user_coordinate_system_x ** 2
+ df.left_gaze_origin_in_user_coor... | 3.03125 | 3 |
src/skmultiflow/core/base_object.py | lckr/scikit-multiflow | 0 | 12790317 | from abc import ABCMeta, abstractmethod
class BaseObject(metaclass=ABCMeta):
""" BaseObject
The most basic object, from which target_values in scikit-multiflow
derive from. It guarantees that all target_values have at least the
two basic functions described in this base class.
"""
@... | 3.6875 | 4 |
SoftLabelCCRF/run.py | liujch1998/SoftLabelCCRF | 17 | 12790318 | <reponame>liujch1998/SoftLabelCCRF
import os, sys
import argparse
import logging
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
sys.path.insert(0, os.path.dirname(__file__))
from model import Model
from utils.data import load_tokens
from utils.vision import iou, clip_... | 1.984375 | 2 |
cli.py | MurmurWheel/Raft | 2 | 12790319 | <reponame>MurmurWheel/Raft<filename>cli.py
#!/usr/bin/python3
# coding:utf-8
# 命令行工具
import argparse
import socket
import json
import sys
# 发送请求
def send_request(request: str) -> str:
# 创建套接字
client = socket.socket(
socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP)
# 连接
client.connect(... | 2.796875 | 3 |
1.py | Time2003/lr7 | 0 | 12790320 | <reponame>Time2003/lr7
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Ввести список А из 10 элементов, найти разность положительных элементов кратных 11, их
# количество и вывести результаты на экран.
if __name__ == '__main__':
lst = [0] * 10
count = 0
dif = 0
b = 0
for i in range(10):
print("Введ... | 3.453125 | 3 |
mindsdb/api/mysql/mysql_proxy/datahub/datanodes/integration_datanode.py | yarenty/mindsdb | 0 | 12790321 | import pandas as pd
from mindsdb.api.mysql.mysql_proxy.datahub.datanodes.datanode import DataNode
class IntegrationDataNode(DataNode):
type = 'integration'
def __init__(self, integration_name, data_store):
self.integration_name = integration_name
self.data_store = data_store
def get_typ... | 2.703125 | 3 |
pswalker/callbacks.py | ZLLentz/pswalker | 0 | 12790322 | <filename>pswalker/callbacks.py
"""
Specialized Callbacks for Skywalker
"""
############
# Standard #
############
import logging
import simplejson as sjson
from pathlib import Path
###############
# Third Party #
###############
import lmfit
import pandas as pd
import numpy as np
from lmfit.models import LinearModel... | 2.515625 | 3 |
ppln/filterCallNoCall.py | asalomatov/nextgen-pipeline | 4 | 12790323 | '''
'''
import sys
from sets import Set
sys.path.insert(0, '/nethome/asalomatov/projects/ppln')
import logProc
if len(sys.argv) == 1:
print 'Usage:'
print sys.argv[0], 'input.bed', 'output.bed', 'logdir', 'filter1', 'filter2', 'filter3'
N = 4
inf, outf, outdir = sys.argv[1:N]
fltrs = sys.argv[N:]
print fltrs... | 2 | 2 |
tacker_horizon/openstack_dashboard/dashboards/nfv/vnffgmanager/tables.py | grechny/tacker-horizon | 0 | 12790324 | # 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, software
# distributed under t... | 1.710938 | 2 |
we_guitar/urls.py | guoshijiang/we_guitar | 2 | 12790325 | <reponame>guoshijiang/we_guitar
#encoding=utf-8
from django.contrib import admin
from django.urls import path, re_path, include
from django.conf import settings
from django.conf.urls.static import static
from django.views.static import serve
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('... | 1.484375 | 1 |
Desafios/desafio074.py | VanessaCML/python | 0 | 12790326 | <filename>Desafios/desafio074.py<gh_stars>0
from random import randint
n = randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10)
print(f'Os números sorteados foram: ', end='')
for num in n:
print(num, end=' ')
print(f'\nO menor número é {min(n)} e o maior é {max(n)}.')
'''from random impo... | 3.84375 | 4 |
kite-python/kite_common/kite/codeexamples/context.py | kiteco/kiteco-public | 17 | 12790327 | <reponame>kiteco/kiteco-public
import __builtin__
import types
import ast
from contextlib import contextmanager
from pprint import pprint
from utils import node_to_code
LITERAL_NODES = {
ast.Num: "number",
ast.Str: "str",
ast.List: "list",
ast.Tuple: "tuple",
ast.Set: "set",
ast.Dict: "dict",... | 2.5625 | 3 |
test/typeclasses/test_functor.py | victoradan/pythonZeta | 0 | 12790328 | <reponame>victoradan/pythonZeta<filename>test/typeclasses/test_functor.py<gh_stars>0
from toolz import identity, compose, curry
from hypothesis import given
import hypothesis.strategies as st
from pyzeta.typeclasses.functor import fmap
## TODO: use hypothesis
def test_functor_identity():
assert_functor_identity... | 2.671875 | 3 |
app/study/filterVolumeProfileDailySetup.py | kyoungd/material-stock-finder-app | 0 | 12790329 | <gh_stars>0
import requests
import json
import logging
from scipy import stats, signal
import numpy as np
import pandas as pd
from util import StockAnalysis, AllStocks
from alpaca import AlpacaHistorical, AlpacaSnapshots
class FilterVolumeProfileDailySetup:
def __init__(self):
self.sa = StockAnalysis()
... | 2.265625 | 2 |
datastructure/graph/undirected_graph_node.py | NLe1/Pyrithms | 1 | 12790330 | from typing import Dict, List
class UndirectedGraphNode:
"""
Definition of GraphNode
For the weighted undirected graph:
A <-> B (cost 4)
A <-> C (cost 1)
B <-> C (cost 7)
B <-> D (cost 2)
We will have
[GraphNode {
val = 'A'
edges = {
'B': 4
'C': 1
}... | 3.9375 | 4 |
ppo/Buffer.py | leonjovanovic/drl-ml-agents-3dball | 0 | 12790331 | import torch
import Config
class Buffer:
# Since the enviroment we use has multiple agents that work in parallel and PPO requires to store whole episodes in
# buffer so the advantage can be calculated, each agent will have separate episode buffer in which will store each
# step of only its episode.... | 2.40625 | 2 |
acme/setup.py | stewnorriss/letsencrypt | 1 | 12790332 | <reponame>stewnorriss/letsencrypt
import sys
from setuptools import setup
from setuptools import find_packages
install_requires = [
'argparse',
# load_pem_private/public_key (>=0.6)
# rsa_recover_prime_factors (>=0.8)
'cryptography>=0.8',
'mock<1.1.0', # py26
'pyrfc3339',
'ndg-httpsclien... | 1.890625 | 2 |
tests/conftest.py | avallbona/periskop-python | 0 | 12790333 | <gh_stars>0
import pytest
from periskop_client.collector import ExceptionCollector
from periskop_client.exporter import ExceptionExporter
from periskop_client.models import HTTPContext
@pytest.fixture
def collector():
return ExceptionCollector()
@pytest.fixture
def exporter(collector):
return ExceptionExpo... | 1.976563 | 2 |
test_script.py | ROBACON/mobspy | 0 | 12790334 | <reponame>ROBACON/mobspy<filename>test_script.py
# This script tests the model creation and compilation
# It also test the calculation capabilities
# It uses some simple model and assertions
import pytest
from mobspy import *
import sys
# TODO Plot has random order for species names
# Compare results with expected ... | 2.484375 | 2 |
mkauthlist/__init__.py | alexji/mkauthlist | 3 | 12790335 | <filename>mkauthlist/__init__.py<gh_stars>1-10
#!/usr/bin/env python
"""
Nothing to see here.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| 1.445313 | 1 |
src/grid_plot.py | heitor57/ant-colony-tsp | 0 | 12790336 | import os
from concurrent.futures import ProcessPoolExecutor
import itertools
import yaml
import sys
import copy
import numpy as np
import pandas as pd
from lib.constants import *
from lib.utils import *
TOP_N = 15
loader = yaml.SafeLoader
loader.add_implicit_resolver(
u'tag:yaml.org,2002:float',
re.compile(u... | 1.945313 | 2 |
python/keepsake/version.py | jsemric/keepsake | 810 | 12790337 | # This file is auto-generated by the root Makefile. Do not edit manually.
version = "0.4.2"
| 1 | 1 |
pedrec/models/validation/validation_results.py | noboevbo/PedRec | 1 | 12790338 | <gh_stars>1-10
from dataclasses import dataclass
from pedrec.models.validation.env_position_validation_results import EnvPositionValidationResults
from pedrec.models.validation.orientation_validation_results import OrientationValidationResults
from pedrec.models.validation.pose_2d_validation_conf_results import Pose2D... | 2.140625 | 2 |
main.py | 2017Kirill2017/Python_Audio_Synth | 0 | 12790339 | <reponame>2017Kirill2017/Python_Audio_Synth<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed May 9 2018
@author: Glu(<NAME>
"""
import os
from random import randint
from pygame import mixer
import time
from gtts import gTTS
from langdetect import detect_langs
from langdetect import DetectorFactory
DetectorFactor... | 2.75 | 3 |
register/util/signals/__init__.py | kws/building-register | 0 | 12790340 | from .slack import *
| 1.085938 | 1 |
exams/validators.py | ayhanfuat/scheduler | 0 | 12790341 | <gh_stars>0
from django.core.exceptions import ValidationError
def validate_noexam(exam_pk):
from .models import Exam, NoExam
exam = Exam.objects.get(pk=exam_pk)
qs = NoExam.objects.filter(course=exam.offering.course, period=exam.period)
if qs.count() > 0:
raise ValidationError(
f... | 2.546875 | 3 |
tests/pydevtest/configuration.py | cyverse/irods | 0 | 12790342 | <filename>tests/pydevtest/configuration.py
import socket
import os
RUN_IN_TOPOLOGY = False
TOPOLOGY_FROM_RESOURCE_SERVER = False
HOSTNAME_1 = HOSTNAME_2 = HOSTNAME_3 = socket.gethostname()
USE_SSL = False
ICAT_HOSTNAME = socket.gethostname()
PREEXISTING_ADMIN_PASSWORD = '<PASSWORD>'
# TODO: allow for arbitrary numbe... | 1.984375 | 2 |
python/csvToJson.py | Hopingocean/Demo | 0 | 12790343 | <filename>python/csvToJson.py
import csv
import json
import codecs
import pandas as pd
with codecs.open('E:/Demo/python/enum.csv', 'r') as csvfile:
jsonfile = open('E:/Demo/python/enum.json','w', encoding='utf-8')
key = pd.read_csv('E:/Demo/python/enum.csv', encoding='gbk')
fieldnames1 = key.columns
keys = tup... | 3.1875 | 3 |
ChatApp/server.py | xckomorebi/ChatApp | 0 | 12790344 | <reponame>xckomorebi/ChatApp<gh_stars>0
import threading
from socket import *
from ChatApp.models import Message, User
from ChatApp.msg import Msg, MsgType
from ChatApp.settings import DEBUG, TIMEOUT
from ChatApp.utils import get_timestamp
def send(msg: Msg, receiver):
global send_all_need_update
sock = sock... | 2.515625 | 3 |
kernel_pm_acc.py | owensgroup/ml_perf_model | 0 | 12790345 | <gh_stars>0
# BSD 3-Clause License
#
# Copyright (c) 2021, The Regents of the University of California, Davis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code ... | 1.484375 | 1 |
Meta-learning_all.py | nobodymx/resilient_swarm_communications_with_meta_graph_convolutional_networks | 15 | 12790346 | from Main_algorithm_GCN.CR_MGC import CR_MGC
from Configurations import *
import matplotlib.pyplot as plt
from copy import deepcopy
from torch.optim import Adam
import Utils
# the range of the number of remained UAVs
meta_type = [i for i in range(2, 201)]
print("Meta Learning Starts...")
print("----------------------... | 2.296875 | 2 |
wielder/util/data_conf.py | hamshif/Wielder | 0 | 12790347 | #!/usr/bin/env python
__author__ = '<NAME>'
import os
import argparse
import yaml
from collections import namedtuple
import logging
from wielder.util.arguer import LogLevel, convert_log_level
from wielder.util.log_util import setup_logging
class Conf:
def __init__(self):
self.template_ignore_dirs = [... | 2.015625 | 2 |
beartype_test/a00_unit/a00_util/cache/test_utilcachecall.py | posita/beartype | 1,056 | 12790348 | <gh_stars>1000+
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
**Beartype callable caching utility unit tests.**
This submodule unit tests the public API of the private
:mod:`be... | 1.898438 | 2 |
tools/kernelCollection.py | pelperscience/arctic-connectivity | 0 | 12790349 | """Kernels for advecting particles in Parcels"""
from parcels import (JITParticle, Variable)
import numpy as np
class unbeachableBoundedParticle(JITParticle):
# Beaching dynamics from https://github.com/OceanParcels/Parcelsv2.0PaperNorthSeaScripts
# beached : 0 sea, 1 beached, 2 after non-beach... | 2.71875 | 3 |
ghia/web.py | tumapav/ghia | 0 | 12790350 | import click
import configparser
import hmac
import os
from flask import Flask
from flask import request
from flask import render_template
from .ghia_patterns import GhiaPatterns
from .ghia_requests import GhiaRequests
from .ghia_issue import Issue
BAD_REQUEST = 400
ALLOWED_ACTIONS = ["opened", "edited", "transferred"... | 2.46875 | 2 |